提交记录修改scripts/test-windows-install.ps1+5 −1看文件
| @@ -109,11 +109,15 @@ Assert-PersonalData | ||
| 109 | 109 | $uninstall = Start-Process -FilePath (Join-Path $target 'Uninstall.exe') -ArgumentList @('/S') -PassThru |
| 110 | 110 | if (-not $uninstall.WaitForExit(120000) -or $uninstall.ExitCode -ne 0) { throw 'Uninstall failed.' } |
| 111 | 111 | # NSIS may relaunch its uninstaller from TEMP so that it can delete the original. |
| 112 | 新增:# The launcher can disappear before the worker clears registration and shortcuts. | |
| 112 | 113 | $deadline = [DateTime]::UtcNow.AddSeconds(120) |
| 113 | 删除:while ((Test-Path -LiteralPath (Join-Path $target 'Uninstall.exe')) -and [DateTime]::UtcNow -lt $deadline) { Start-Sleep -Milliseconds 200 } | |
| 114 | 新增:while (((Test-Path -LiteralPath $target) -or (Test-Path $savedKey) -or | |
| 115 | 新增: (Test-Path -LiteralPath $desktopShortcut) -or (Test-Path -LiteralPath $startMenuDirectory)) -and | |
| 116 | 新增: [DateTime]::UtcNow -lt $deadline) { Start-Sleep -Milliseconds 200 } | |
| 114 | 117 | if (Test-Path -LiteralPath (Join-Path $target 'Cage.exe')) { throw 'Uninstall left Cage.exe behind.' } |
| 115 | 118 | if (Test-Path -LiteralPath (Join-Path $target 'Uninstall.exe')) { throw 'Uninstall left its launcher behind.' } |
| 116 | 119 | if (Test-Path -LiteralPath $target) { throw 'Uninstall left packaged files or directories that would block installation into the same folder.' } |
| 120 | 新增:if (Test-Path $savedKey) { throw 'Uninstall left the Cage registration behind.' } | |
| 117 | 121 | Assert-PersonalData |
| 118 | 122 | Assert-Shortcuts $false $false |
| 119 | 123 | Write-Host 'Install, WebView2 workbench, reinstall, uninstall and user-data preservation passed. VM startup was not tested.' |

