mirror of
https://github.com/SpotX-Official/SpotX.git
synced 2026-04-11 17:37:21 +10:00
Update
- Backup and restore for Spotify.exe - Removing legacy code
This commit is contained in:
@@ -641,10 +641,12 @@ $update_test_exe = Test-Path -Path $spotifyExecutable
|
||||
if ($block_update) {
|
||||
|
||||
if ($update_test_exe) {
|
||||
$exe = "$env:APPDATA\Spotify\spotify.exe"
|
||||
$exe = "$env:APPDATA\Spotify\Spotify.exe"
|
||||
$exe_bak = "$env:APPDATA\Spotify\Spotify.bak"
|
||||
$ANSI = [Text.Encoding]::GetEncoding(1251)
|
||||
$old = [IO.File]::ReadAllText($exe, $ANSI)
|
||||
if ($old -match "(?<=wg:\/\/desktop-update\/.)2(\/update)") {
|
||||
copy-Item $exe $exe_bak
|
||||
$new = $old -replace "(?<=wg:\/\/desktop-update\/.)2(\/update)", '7/update'
|
||||
[IO.File]::WriteAllText($exe, $new, $ANSI)
|
||||
}
|
||||
|
||||
@@ -798,10 +798,12 @@ $update_test_exe = Test-Path -Path $spotifyExecutable
|
||||
if ($block_update) {
|
||||
|
||||
if ($update_test_exe) {
|
||||
$exe = "$env:APPDATA\Spotify\spotify.exe"
|
||||
$exe = "$env:APPDATA\Spotify\Spotify.exe"
|
||||
$exe_bak = "$env:APPDATA\Spotify\Spotify.bak"
|
||||
$ANSI = [Text.Encoding]::GetEncoding(1251)
|
||||
$old = [IO.File]::ReadAllText($exe, $ANSI)
|
||||
if ($old -match "(?<=wg:\/\/desktop-update\/.)2(\/update)") {
|
||||
copy-Item $exe $exe_bak
|
||||
$new = $old -replace "(?<=wg:\/\/desktop-update\/.)2(\/update)", '7/update'
|
||||
[IO.File]::WriteAllText($exe, $new, $ANSI)
|
||||
}
|
||||
|
||||
@@ -11,6 +11,11 @@ if exist "%Appdata%\Spotify\chrome_elf_bak.dll" (
|
||||
move "%Appdata%\Spotify\chrome_elf_bak.dll" "%Appdata%\Spotify\chrome_elf.dll" > NUL 2>&1
|
||||
)
|
||||
|
||||
if exist "%Appdata%\Spotify\Spotify.bak" (
|
||||
del /s /q "%Appdata%\Spotify.exe" > NUL 2>&1
|
||||
move "%Appdata%\Spotify\Spotify.bak" "%Appdata%\Spotify\Spotify.exe" > NUL 2>&1
|
||||
)
|
||||
|
||||
|
||||
if exist "%Appdata%\Spotify\config.ini" (
|
||||
del /s /q "%Appdata%\Spotify\config.ini" > NUL 2>&1
|
||||
@@ -33,21 +38,6 @@ if exist "%Appdata%\Spotify\blockthespot_log.txt" (
|
||||
del /s /q "%Appdata%\Spotify\blockthespot_log.txt" > NUL 2>&1
|
||||
)
|
||||
|
||||
|
||||
if exist "%localappdata%\Spotify\Update" (
|
||||
del /A:sr %localappdata%\Spotify\Update > NUL 2>&1
|
||||
)
|
||||
|
||||
|
||||
if exist "%Appdata%\Spotify\SpotifyMigrator.bak" (
|
||||
rename %Appdata%\Spotify\SpotifyMigrator.bak SpotifyMigrator.exe > NUL 2>&1
|
||||
)
|
||||
if exist "%Appdata%\Spotify\SpotifyMigrator.exe" (
|
||||
if exist "%Appdata%\Spotify\SpotifyMigrator.bak" (
|
||||
del /f /s /q %Appdata%\Spotify\SpotifyMigrator.bak > NUL 2>&1
|
||||
)
|
||||
)
|
||||
|
||||
if exist "%Appdata%\Spotify\cache" (
|
||||
rd /s /q %Appdata%\Spotify\cache > NUL 2>&1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user