提交记录修改scripts/test-windows-installation-files.ps1+7 −4看文件
| @@ -118,12 +118,15 @@ function Test-InstallerTransaction { | ||
| 118 | 118 | if (Test-Path $key) { |
| 119 | 119 | if ((Get-ItemProperty $key).InstallLocation -ne $target) { throw 'NSIS fixture registration changed owner; retained for inspection.' } |
| 120 | 120 | Run-Fixture (Join-Path $target 'Uninstall.exe') @('/S') |
| 121 | 删除: $deadline = [DateTime]::UtcNow.AddSeconds(20) | |
| 122 | 删除: while ((Test-Path -LiteralPath $target) -and [DateTime]::UtcNow -lt $deadline) { Start-Sleep -Milliseconds 100 } | |
| 121 | 新增: # NSIS can return from its bootstrapper while the TEMP worker is | |
| 122 | 新增: # still running. Its helper removes the target before NSIS clears | |
| 123 | 新增: # registration and shortcuts, so target disappearance is not done. | |
| 124 | 新增: $deadline = [DateTime]::UtcNow.AddSeconds(120) | |
| 125 | 新增: while (((Test-Path -LiteralPath $target) -or (Test-Path $key) -or (Test-Path -LiteralPath $desktop) -or (Test-Path -LiteralPath $menu)) -and [DateTime]::UtcNow -lt $deadline) { Start-Sleep -Milliseconds 100 } | |
| 123 | 126 | } |
| 124 | 127 | } |
| 125 | 删除: Check (!(Test-Path $key) -and !(Test-Path -LiteralPath $desktop) -and !(Test-Path -LiteralPath $menu)) 'NSIS fixture left registry or shortcut changes.' | |
| 126 | 删除: Check (!(Test-Path -LiteralPath $target)) 'NSIS fixture did not uninstall its owned files.' | |
| 128 | 新增: $remaining = @{target = (Test-Path -LiteralPath $target); registration = (Test-Path $key); desktopShortcut = (Test-Path -LiteralPath $desktop); startMenu = (Test-Path -LiteralPath $menu)} | |
| 129 | 新增: Check (!($remaining.Values -contains $true)) ('NSIS fixture did not finish uninstalling owned artifacts: ' + ($remaining | ConvertTo-Json -Compress)) | |
| 127 | 130 | Write-Output 'PASS: production NSIS silently installed/uninstalled its text-only fixture through PowerShell 5.1 transactions; no application or VM was started.' |
| 128 | 131 | } |
| 129 | 132 | try { |

