diff --git a/BlockTheSpot.bat b/BlockTheSpot.bat index d23b215..8992533 100644 --- a/BlockTheSpot.bat +++ b/BlockTheSpot.bat @@ -83,10 +83,23 @@ try { Write-Output $_ Sleep } +try { + $webClient.DownloadFile( + # Remote file URL + 'https://github.com/mrpond/BlockTheSpot/files/6234124/xpui.zip', + # Local file path + "$PWD\xpui.zip" + ) +} catch { + Write-Output $_ + Sleep +} Expand-Archive -Force -LiteralPath "$PWD\chrome_elf.zip" -DestinationPath $PWD Remove-Item -LiteralPath "$PWD\chrome_elf.zip" Expand-Archive -Force -LiteralPath "$PWD\zlink.zip" -DestinationPath $PWD Remove-Item -LiteralPath "$PWD\zlink.zip" +Expand-Archive -Force -LiteralPath "$PWD\xpui.zip" -DestinationPath $PWD +Remove-Item -LiteralPath "$PWD\xpui.zip" $spotifyInstalled = (Test-Path -LiteralPath $SpotifyExecutable) if (-not $spotifyInstalled) { @@ -125,6 +138,7 @@ if (!(test-path $SpotifyDirectory/chrome_elf.dll.bak)){ Write-Host 'Patching Spotify...' $patchFiles = "$PWD\chrome_elf.dll", "$PWD\config.ini" $remup = "$PWD\zlink.spa" +$uipat = "$PWD\xpui.spa" Copy-Item -LiteralPath $patchFiles -Destination "$SpotifyDirectory" $ch = Read-Host -Prompt "Optional - Remove Upgrade Button. (Y/N) " @@ -136,6 +150,18 @@ if ($ch -eq 'y'){ Won't remove Upgrade Button. '@`n } + +$ch = Read-Host -Prompt "Change Alpha UI back to Old UI. (BTS only supports Old UI). (Y/N) " +if ($ch -eq 'y'){ + move $SpotifyApps\xpui.spa $SpotifyApps\xpui.spa.bak >$null 2>&1 + Copy-Item -LiteralPath $uipat -Destination "$SpotifyApps" +} else{ + Write-Host @' +UI isn't changed. +'@`n +} + + $tempDirectory = $PWD Pop-Location diff --git a/uninstall.bat b/uninstall.bat index 7e933c7..c72c7de 100644 --- a/uninstall.bat +++ b/uninstall.bat @@ -3,8 +3,24 @@ echo ***************** echo Author: @rednek46 echo ***************** echo Removing Patch -del /s /q "%APPDATA%\Spotify\chrome_elf.dll" > NUL 2>&1 -del /s /q "%APPDATA%\Spotify\Apps\zlink.spa" > NUL 2>&1 -move "%APPDATA%\Spotify\chrome_elf.dll.bak" "%APPDATA%\Spotify\chrome_elf.dll" > NUL 2>&1 -move "%APPDATA%\Spotify\Apps\zlink.spa.bak" "%APPDATA%\Spotify\Apps\zlink.spa" > NUL 2>&1 +if exist "%APPDATA%\Spotify\chrome_elf.dll.bak" ( + del /s /q "%APPDATA%\Spotify\chrome_elf.dll" > NUL 2>&1 + move "%APPDATA%\Spotify\chrome_elf.dll.bak" "%APPDATA%\Spotify\chrome_elf.dll" > NUL 2>&1 +) else ( + echo done +) + +if exist "%APPDATA%\Spotify\Apps\zlink.spa.bak" ( + del /s /q "%APPDATA%\Spotify\Apps\zlink.spa" > NUL 2>&1 + move "%APPDATA%\Spotify\Apps\zlink.spa.bak" "%APPDATA%\Spotify\Apps\zlink.spa" > NUL 2>&1 +) else ( + echo done +) + +if exist "%APPDATA%\Spotify\Apps\xpui.spa.bak" ( + del /s /q "%APPDATA%\Spotify\Apps\xpui.spa" > NUL 2>&1 + move "%APPDATA%\Spotify\Apps\xpui.spa.bak" "%APPDATA%\Spotify\Apps\xpui.spa" > NUL 2>&1 +) else ( + echo done +) pause