fix(installer): avoid duplicate pause prompts

This commit is contained in:
amd64fox
2026-06-16 19:38:51 +03:00
parent 0725e3465f
commit fca14a99ba
5 changed files with 26 additions and 21 deletions
+19 -14
View File
@@ -27,6 +27,9 @@ param
[Alias('cp')]
[string]$CustomPatchesPath,
[Parameter(HelpMessage = 'Skip pause before exit')]
[switch]$no_pause,
[Parameter(HelpMessage = "Use github.io mirror instead of raw.githubusercontent.")]
[Alias("m")]
[switch]$mirror,
@@ -364,15 +367,17 @@ function Stop-Script {
Write-Host $Message
switch ($Host.Name) {
"Windows PowerShell ISE Host" {
pause
break
}
default {
Write-Host ($lang).PressAnyKey
[void][System.Console]::ReadKey($true)
break
if (-not $no_pause) {
switch ($Host.Name) {
"Windows PowerShell ISE Host" {
pause
break
}
default {
Write-Host ($lang).PressAnyKey
[void][System.Console]::ReadKey($true)
break
}
}
}
Exit
@@ -412,7 +417,7 @@ function CallLang($clg) {
}
catch {
Write-Host "Error loading $clg language"
Pause
if (-not $no_pause) { Pause }
Exit
}
}
@@ -3139,7 +3144,7 @@ if ($test_spa) {
else {
$binary_exe_bak = [System.IO.Path]::GetFileName($exe_bak)
Write-Warning ("Backup copy {0} not found. Please reinstall Spotify and run SpotX again" -f $binary_exe_bak)
Pause
if (-not $no_pause) { Pause }
Exit
}
@@ -3150,7 +3155,7 @@ if ($test_spa) {
else {
$binary_chrome_elf_bak = [System.IO.Path]::GetFileName($chrome_elf_bak)
Write-Warning ("Backup copy {0} not found. Please reinstall Spotify and run SpotX again" -f $binary_chrome_elf_bak)
Pause
if (-not $no_pause) { Pause }
Exit
}
@@ -3158,7 +3163,7 @@ if ($test_spa) {
}
else {
Write-Host ($lang).NoRestore`n
Pause
if (-not $no_pause) { Pause }
Exit
}
@@ -3404,7 +3409,7 @@ if ($regex1 -and $regex2 -and $regex3 -and $regex4 -and $regex5) {
if (-not (Test-Path -LiteralPath $spotify_binary_bak)) {
$name_binary = [System.IO.Path]::GetFileName($spotify_binary_bak)
Write-Warning ("Backup copy {0} not found. Please reinstall Spotify and run SpotX again" -f $name_binary)
Pause
if (-not $no_pause) { Pause }
Exit
}