custom blockthespot installation to use winget instead of .exe from spotify.com

This commit is contained in:
Mylloon 2023-04-26 21:32:35 +02:00
parent da2e1c09ba
commit 785cdb2963
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -1,16 +1,32 @@
@ECHO OFF @ECHO OFF
:: Install latest version of spotify
ECHO Installe la derniere version de spotify
winget install -he Spotify.Spotify
:: Close spotify
PowerShell -Command "Stop-Process -Name Spotify -ErrorAction SilentlyContinue"
:: Patch spotify :: Patch spotify
PowerShell -Command "[Net.ServicePointManager]::SecurityProtocol =" ^ ECHO Patch spotify avec BlockTheSpot
"[Net.SecurityProtocolType]::Tls12; Invoke-Expression """"&" ^ PowerShell -Command "cd $HOME;" ^
"{ $(Invoke-WebRequest -UseBasicParsing" ^ "$url_elf = 'https://github.com/mrpond/BlockTheSpot/releases/latest/download/chrome_elf.zip';" ^
"'https://raw.githubusercontent.com/mrpond/BlockTheSpot/master/install.ps1')" ^ "$dest_elf = Join-Path -Path $PWD -ChildPath 'chrome_elf.zip';" ^
"} -UninstallSpotifyStoreEdition -UpdateSpotify"""" "$spotifyDirectory = Join-Path -Path $env:APPDATA -ChildPath 'Spotify';" ^
"$spotifyExecutable = Join-Path -Path $spotifyDirectory -ChildPath 'Spotify.exe';" ^
"Invoke-WebRequest -Uri $url_elf -OutFile $dest_elf;" ^
"Expand-Archive -Force -LiteralPath $dest_elf -DestinationPath $PWD | Wait-Process;" ^
"Remove-Item -LiteralPath $dest_elf -Force;" ^
"$patchFiles = (Join-Path -Path $PWD -ChildPath 'dpapi.dll')," ^
"(Join-Path -Path $PWD -ChildPath 'config.ini');" ^
"Copy-Item -LiteralPath $patchFiles -Destination $spotifyDirectory;" ^
"Remove-Item -LiteralPath $patchFiles;" ^
"Start-Process -WorkingDirectory $spotifyDirectory -FilePath $spotifyExecutable"
:: Delete newly created Spotify shortcut :: Delete newly created Spotify shortcut
DEL %HOMEPATH%\Desktop\Spotify.lnk DEL %HOMEPATH%\Desktop\Spotify.lnk 2>NUL
ie4uinit -show ie4uinit -show
ECHO Raccourci sur le bureau detruit ECHO Suppression du raccourci du bureau
PAUSE PAUSE
EXIT /B EXIT /B