The Windows App Certification Kit is an easy to use tool to check whether an application has potential compatibility issues when running on Windows 10. The tool can be executed in GUI mode and in command line mode. I wrote a PowerShell script that runs the Windows App Certification Kit in a more or less automated way.
I say more or less, because the application installation process of the application itself might still prompt for input. Also the final report generation of the App Cert Tool itself requires manual interaction that i was unable to suppress. , Nevertheless I hope you find the script useful and saves you a bit of time when testing applications.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
function Start-AppCert { [CmdletBinding()] Param ( # The path to the Application instalaltion file (MSI / EXE) [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true, Position=0)] [string]$SetupPath, # The installation commandline option: Example /quiet [Parameter(Mandatory=$false, ValueFromPipelineByPropertyName=$true, Position=1)] [string]$SetupCmdLine ) Begin { # Reports Path $mydocuments = [environment]::getfolderpath("mydocuments") $AppCertReportDirectory = "$mydocuments\AppCertReports" # App Certification Toolkit Executable $AppCertTool = "C:\Program Files (x86)\Windows Kits\10\App Certification Kit\appcert.exe" $AppCertToolPath = Split-Path -Path $AppCertTool Set-Location $AppCertToolPath # Check if App Certification Toolkit is installed If ((Test-Path -Path $AppCertTool) -eq $false) { Write-Error "Microsoft Appliction Certification Toolkit is not installed on this computer" Throw } # Check Reports Path, create folder if it does not exist If ((Test-Path -Path $AppCertReportDirectory) -eq $false ) { New-Item -Path $AppCertReportDirectory -ItemType Directory } #Appcert settings $AppType = "Desktop" $WaitTimeOut = "900" $AppUsage = "permachine" # Report Filename $ReportOutPath = "$AppCertReportDirectory\" + (($SetupPath -split "\\")[-1] + ".xml") # Check if application report already exists, if so, delete it If ((Test-Path -Path $ReportOutPath) -eq $true ) { Write-Verbose "$ReportOutPath already exists, deleting file" Remove-Item -Path $ReportOutPath } # Build the command line to run appcert If ([string]::IsNullOrEmpty($SetupCmdLine)) { $AppCertCmdStr = ".\appcert.exe test -apptype " + $apptype + " -setuppath " + "'$setuppath'" + " -waittimeout " + $waittimeout + " -appusage " + $AppUsage +" -reportoutputpath " + "'$ReportOutPath'" } Else { $AppCertCmdStr = ".\appcert.exe test -apptype " + $apptype + " -setuppath " + "'$setuppath'" + " -setupcommandline " + "'$SetupCmdLine'" + " -waittimeout " + $waittimeout + " -appusage " + $AppUsage +" -reportoutputpath " + "'$ReportOutPath'" } $AppCertCmd = $AppCertCmdStr -replace "'",'"' #Build the command line to run the final report $FinalReportCmdStr = ".\appcert.exe finalizereport -reportfilepath " + "'$ReportOutPath'" $FinalReportCmd = $FinalReportCmdStr -replace "'",'"' } Process { # Run appcert Write-Verbose "Executing $AppCertCmd" invoke-expression -command "$AppCertCmd" -OutVariable $runcert # Generate the final report Write-Verbose "Executing $FinalReportCmd" Invoke-Expression -Command "$FinalReportCmd" -OutVariable $runfinalreport } End { $report = Get-Content -Path $ReportOutPath $reportdata = [xml]$report $AppInfo = $reportdata.REPORT.APPLICATIONS.Installed_Programs.Program Write-verbose "$($AppInfo)" $AllTests = $reportdata.REPORT.REQUIREMENTS.REQUIREMENT.TEST $certdata = @() ForEach ($test in $AllTests) { $object = New-Object -TypeName PSObject $object | Add-Member -MemberType NoteProperty -Name Name -Value $test.name $object | Add-Member -MemberType NoteProperty -Name Result -Value $test.Result.'#cdata-section' $object | Add-Member -MemberType NoteProperty -Name Description -Value $test.Description $object | Add-Member -MemberType NoteProperty -Name Index -Value $test.Index $certdata += $object } $certdata } } |
Before you run the script, you must install the Windows App Certification Kit which you can download from here:https://developer.microsoft.com/en-us/windows/develop/app-certification-kit
The script creates a folder AppCertReports within the MyDocuments folder and stores the report results in there. If you want to look at the reports on a computer that does not have the Windows App Certification Kit installed, copy the following files to that computer.
“C:\ProgramData\Windows App Certification Kit\wslk_strings.xml”
“C:\ProgramData\Windows App Certification Kit\results.xsl”
“C:\ProgramData\Windows App Certification Kit\wp-results.xsl”
Additional Information
- Certification requirements for Windows Desktop Apps: https://msdn.microsoft.com/en-us/library/mt674655(v=vs.85).aspx
- Windows 10 App Compat Strategy: https://blogs.msdn.microsoft.com/cjacks/2016/09/12/windows-10-app-compat-strategy/