update installer

This commit is contained in:
Nose
2026-07-10 21:44:26 -07:00
parent 70c236d83c
commit bc5d6b31c4
3 changed files with 51 additions and 31 deletions
+18 -1
View File
@@ -28,7 +28,8 @@ param(
[string]$PlaywrightBrowsers = "chromium",
[switch]$FixUrllib3,
[switch]$RemovePth,
[switch]$Quiet
[switch]$Quiet,
[switch]$NoPause
)
$ErrorActionPreference = "Stop"
@@ -71,6 +72,7 @@ if ($CreateDesktopShortcut -or $CreateStartMenuShortcut -or $FixUrllib3 -or $Rem
}
try {
$exitCode = 1
$pythonCommand = $null
if ($Python) {
$pythonCommand = $Python
@@ -90,10 +92,25 @@ try {
& $pythonCommand $bootstrapPath @pythonArgs
}
$exitCode = $LASTEXITCODE
if (-not $Quiet) {
if ($exitCode -eq 0) {
Write-Host "Installation finished successfully." -ForegroundColor Green
} else {
Write-Host "Installation exited with code $exitCode." -ForegroundColor Red
}
}
} finally {
if ($temporaryBootstrap -and (Test-Path $bootstrapPath)) {
Remove-Item -LiteralPath $bootstrapPath -Force -ErrorAction SilentlyContinue
}
}
if (-not $NoPause -and -not $Quiet -and [Environment]::UserInteractive) {
try {
[void](Read-Host "Press Enter to close installer")
} catch {
# Ignore host/input edge cases and continue to exit.
}
}
exit $exitCode