diff --git a/Install_New_theme.bat b/Install_New_theme.bat index dd48d3c..82baf98 100644 --- a/Install_New_theme.bat +++ b/Install_New_theme.bat @@ -1,7 +1,7 @@ @echo off :: Line for changing spotx parameters, each parameter should be separated by a space -set param=-new_theme +set param=-new_theme -no_pause set url='https://raw.githubusercontent.com/SpotX-Official/SpotX/refs/heads/main/run.ps1' set url2='https://spotx-official.github.io/SpotX/run.ps1' @@ -11,4 +11,4 @@ set tls=[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]: -Command %tls% $p='%param%'; """ & { $(try { iwr -useb %url% } catch { $p+= ' -m'; iwr -useb %url2% })} $p """" | iex pause -exit /b \ No newline at end of file +exit /b diff --git a/Install_Old_theme.bat b/Install_Old_theme.bat index 16b2665..b59f69b 100644 --- a/Install_Old_theme.bat +++ b/Install_Old_theme.bat @@ -1,7 +1,7 @@ @echo off :: Line for changing spotx parameters, each parameter should be separated by a space -set param=-v 1.2.13.661.ga588f749 -confirm_spoti_recomended_over -block_update_on +set param=-v 1.2.13.661.ga588f749 -confirm_spoti_recomended_over -block_update_on -no_pause set url='https://raw.githubusercontent.com/SpotX-Official/SpotX/refs/heads/main/run.ps1' set url2='https://spotx-official.github.io/SpotX/run.ps1' diff --git a/run.ps1 b/run.ps1 index 3b0ad74..034de2a 100644 --- a/run.ps1 +++ b/run.ps1 @@ -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 } diff --git a/scripts/Install_Auto.bat b/scripts/Install_Auto.bat index aae2903..99efde7 100644 --- a/scripts/Install_Auto.bat +++ b/scripts/Install_Auto.bat @@ -1,7 +1,7 @@ @echo off :: Line for changing spotx parameters, each parameter should be separated by a space -set param=-confirm_uninstall_ms_spoti -confirm_spoti_recomended_over -podcasts_off -block_update_on -start_spoti -new_theme -adsections_off -lyrics_stat spotify +set param=-confirm_uninstall_ms_spoti -confirm_spoti_recomended_over -podcasts_off -block_update_on -start_spoti -new_theme -adsections_off -lyrics_stat spotify -no_pause set url='https://raw.githubusercontent.com/SpotX-Official/SpotX/refs/heads/main/run.ps1' set url2='https://spotx-official.github.io/SpotX/run.ps1' @@ -11,4 +11,4 @@ set tls=[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]: -Command %tls% $p='%param%'; """ & { $(try { iwr -useb %url% } catch { $p+= ' -m'; iwr -useb %url2% })} $p """" | iex pause -exit /b \ No newline at end of file +exit /b diff --git a/scripts/Install_Prem.bat b/scripts/Install_Prem.bat index 742811e..1d1b31b 100644 --- a/scripts/Install_Prem.bat +++ b/scripts/Install_Prem.bat @@ -1,7 +1,7 @@ @echo off :: Line for changing spotx parameters, each parameter should be separated by a space -set param=-premium -new_theme +set param=-premium -new_theme -no_pause set url='https://raw.githubusercontent.com/SpotX-Official/SpotX/refs/heads/main/run.ps1' set url2='https://spotx-official.github.io/SpotX/run.ps1' @@ -11,4 +11,4 @@ set tls=[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]: -Command %tls% $p='%param%'; """ & { $(try { iwr -useb %url% } catch { $p+= ' -m'; iwr -useb %url2% })} $p """" | iex pause -exit /b \ No newline at end of file +exit /b