update installer
This commit is contained in:
+18
-1
@@ -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
|
||||
Reference in New Issue
Block a user