-
Notifications
You must be signed in to change notification settings - Fork 26
/
Spotify.yml
25 lines (25 loc) · 964 Bytes
/
Spotify.yml
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
version: nightly
description: Spotify. Music streaming service.
homepage: https://www.spotify.com/
license: Freeware
pre_download: if (is_admin) { throw 'Spotify needs to be installed from non-admin console for some reason.' }
url: https://download.spotify.com/SpotifyFullSetup.exe
installer:
script: |
Invoke-ExternalCommand "$dir\$fname" -ArgumentList '/Silent' | Out-Null
#### Kill opened Spotify
$done = $false
do {
if (Get-Process 'Spotify' -ErrorAction SilentlyContinue) {
Stop-Process -Name 'Spotify'
$done = $true
}
Start-Sleep -Seconds 5
} until ($done)
uninstaller:
script: |
#### Terminate all process, which could interfere with Uninstallation process.
Get-Process -Name '*Spotify*' | Stop-Process -Force
#### Wait for terminating all process.
Start-Sleep -Seconds 4
Start-Process "$env:APPDATA\Spotify\Spotify.exe" -ArgumentList '/Uninstall', '/Silent' -Wait