mirror of
https://github.com/SpotX-Official/SpotX.git
synced 2026-06-14 03:16:33 +10:00
disable Spotify autostart
- a new parameter -DisableStartup has been added, which disables the auto-start of Spotify on Windows boot #632
This commit is contained in:
@@ -45,6 +45,9 @@ param
|
||||
|
||||
[Parameter(HelpMessage = 'Installation without ad blocking for premium accounts.')]
|
||||
[switch]$premium,
|
||||
|
||||
[Parameter(HelpMessage = 'Disable Spotify autostart on Windows boot.')]
|
||||
[switch]$DisableStartup,
|
||||
|
||||
[Parameter(HelpMessage = 'Automatic launch of Spotify after installation is complete.')]
|
||||
[switch]$start_spoti,
|
||||
@@ -1824,6 +1827,15 @@ if ([version]$offline -ge [version]"1.1.87.612" -and [version]$offline -le [vers
|
||||
Get -Url (Get-Link -e "/res/login.spa") -OutputPath $login_spa
|
||||
}
|
||||
|
||||
if ($DisableStartup) {
|
||||
$keyPath = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Run"
|
||||
$keyName = "Spotify"
|
||||
|
||||
if (Get-ItemProperty -Path $keyPath -Name $keyName -ErrorAction SilentlyContinue) {
|
||||
Remove-ItemProperty -Path $keyPath -Name $keyName -Force
|
||||
}
|
||||
}
|
||||
|
||||
# Start Spotify
|
||||
if ($start_spoti) { Start-Process -WorkingDirectory $spotifyDirectory -FilePath $spotifyExecutable }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user