-
Notifications
You must be signed in to change notification settings - Fork 1
/
SpotifyInstallUSER.ps1
41 lines (36 loc) · 3.03 KB
/
SpotifyInstallUSER.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Write-Output "Manually installing Spotify..."
## Extrat program files into well program files..
Write-Output "Unpacking Spotify files."
## You Need to download the full offline installer first!
##http://download.spotify.com/SpotifyFullSetup.exe
Start-Process -Wait -FilePath '.\SpotifyFullSetup.exe' -ArgumentList "/extract C:\Users\$([Environment]::UserName)\AppData\Roaming\Spotify\"
## Add desktop shortcut
Write-Output "Creating Spotify Desktop Shortcut."
$SourceFilePath = "C:\Users\$([Environment]::UserName)\AppData\Roaming\Spotify\Spotify.exe"
$ShortcutPath = "C:\Users\$([Environment]::UserName)\Desktop\Spotify.lnk"
$WScriptObj = New-Object -ComObject ("WScript.Shell")
$shortcut = $WscriptObj.CreateShortcut($ShortcutPath)
$shortcut.TargetPath = $SourceFilePath
$shortcut.Save()
## Add start menu shortcut
Write-Output "Creating Spotify Start Menu Shortcut."
$SourceFilePath = "C:\Users\$([Environment]::UserName)\AppData\Roaming\Spotify\Spotify.exe"
$ShortcutPath = "C:\Users\$([Environment]::UserName)\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Spotify.lnk"
$WScriptObj = New-Object -ComObject ("WScript.Shell")
$shortcut = $WscriptObj.CreateShortcut($ShortcutPath)
$shortcut.TargetPath = $SourceFilePath
$shortcut.Save()
## Add Spotify to Programs and Features
Write-Output "Adding Spotify to Programs and Features list."
[void](New-Item -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall' -Name 'Spotify')
Set-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\Spotify' -Name 'DisplayIcon' -Value "C:\Users\$([Environment]::UserName)\AppData\Roaming\Spotify\Spotify.exe,0" -Type String
Set-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\Spotify' -Name 'DisplayName' -Value 'Spotify' -Type String
Set-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\Spotify' -Name 'DisplayVersion' -Value '1.1.73.517' -Type String
Set-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\Spotify' -Name 'EstimatedSize' -Value '195000' -Type Dword
Set-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\Spotify' -Name 'InstallLocation' -Value 'C:\Program Files\Spotify' -Type ExpandString
Set-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\Spotify' -Name 'NoModify' -Value '1' -Type Dword
Set-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\Spotify' -Name 'NoRepair' -Value '1' -Type Dword
Set-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\Spotify' -Name 'Publisher' -Value 'Spotify AB' -Type String
Set-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\Spotify' -Name 'UninstallString' -Value "C:\Users\$([Environment]::UserName)\AppData\Roaming\Spotify\Spotify.exe /uninstall" -Type ExpandString
Set-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\Spotify' -Name 'URLInfoAbout' -Value 'https://www.spotify.com' -Type String
Write-Output "Done."