Skip to content

Commit 2646584

Browse files
authored
[skip ci] Merge pull request #107 from rednek46/master
[skip ci] Added optional - Remove upgrade button.
2 parents 2fd081a + deb25a4 commit 2646584

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

BlockTheSpot.bat

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Author: @rednek46
2222

2323
$SpotifyDirectory = "$env:APPDATA\Spotify"
2424
$SpotifyExecutable = "$SpotifyDirectory\Spotify.exe"
25+
$SpotifyApps = "$SpotifyDirectory\Apps"
2526

2627
Write-Host 'Stopping Spotify...'`n
2728
Stop-Process -Name Spotify
@@ -71,8 +72,21 @@ try {
7172
Write-Output $_
7273
Sleep
7374
}
75+
try {
76+
$webClient.DownloadFile(
77+
# Remote file URL
78+
'https://github.com/mrpond/BlockTheSpot/files/5767943/zlink.zip',
79+
# Local file path
80+
"$PWD\zlink.zip"
81+
)
82+
} catch {
83+
Write-Output $_
84+
Sleep
85+
}
7486
Expand-Archive -Force -LiteralPath "$PWD\chrome_elf.zip" -DestinationPath $PWD
7587
Remove-Item -LiteralPath "$PWD\chrome_elf.zip"
88+
Expand-Archive -Force -LiteralPath "$PWD\zlink.zip" -DestinationPath $PWD
89+
Remove-Item -LiteralPath "$PWD\zlink.zip"
7690

7791
$spotifyInstalled = (Test-Path -LiteralPath $SpotifyExecutable)
7892
if (-not $spotifyInstalled) {
@@ -110,8 +124,18 @@ if (!(test-path $SpotifyDirectory/chrome_elf.dll.bak)){
110124

111125
Write-Host 'Patching Spotify...'
112126
$patchFiles = "$PWD\chrome_elf.dll", "$PWD\config.ini"
127+
$remup = "$PWD\zlink.spa"
113128
Copy-Item -LiteralPath $patchFiles -Destination "$SpotifyDirectory"
114129

130+
$ch = Read-Host -Prompt "Optional - Remove Upgrade Button. (Y/N) "
131+
if ($ch -eq 'y'){
132+
move $SpotifyApps\zlink.spa $SpotifyApps\zlink.spa.bak >$null 2>&1
133+
Copy-Item -LiteralPath $remup -Destination "$SpotifyApps"
134+
} else{
135+
Write-Host @'
136+
Won't remove Upgrade Button.
137+
'@`n
138+
}
115139
$tempDirectory = $PWD
116140
Pop-Location
117141

uninstall.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@ echo Author: @rednek46
44
echo *****************
55
echo Removing Patch
66
del /s /q "%APPDATA%\Spotify\chrome_elf.dll" > NUL 2>&1
7+
del /s /q "%APPDATA%\Spotify\Apps\zlink.spa" > NUL 2>&1
78
move "%APPDATA%\Spotify\chrome_elf.dll.bak" "%APPDATA%\Spotify\chrome_elf.dll" > NUL 2>&1
9+
move "%APPDATA%\Spotify\Apps\zlink.spa.bak" "%APPDATA%\Spotify\Apps\zlink.spa" > NUL 2>&1
810
pause

0 commit comments

Comments
 (0)