mirror of
https://github.com/SpotX-Official/SpotX.git
synced 2026-04-19 13:46:09 +10:00
32
Install.ps1
32
Install.ps1
@@ -116,7 +116,7 @@ if (-not $spotifyInstalled) {
|
|||||||
|
|
||||||
Write-Host "Downloading and installing Spotify " -NoNewline
|
Write-Host "Downloading and installing Spotify " -NoNewline
|
||||||
Write-Host $version_client -ForegroundColor Green
|
Write-Host $version_client -ForegroundColor Green
|
||||||
Write-Host "Please wait..."`n
|
Write-Host "Please wait..."
|
||||||
|
|
||||||
Start-Process -FilePath $PWD\SpotifySetup.exe; wait-process -name SpotifySetup
|
Start-Process -FilePath $PWD\SpotifySetup.exe; wait-process -name SpotifySetup
|
||||||
|
|
||||||
@@ -144,7 +144,7 @@ if (!(test-path $SpotifyDirectory/chrome_elf_bak.dll)) {
|
|||||||
Move-Item $SpotifyDirectory\chrome_elf.dll $SpotifyDirectory\chrome_elf_bak.dll >$null 2>&1
|
Move-Item $SpotifyDirectory\chrome_elf.dll $SpotifyDirectory\chrome_elf_bak.dll >$null 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Host 'Patching Spotify...'`n
|
Write-Host 'Patching Spotify...'
|
||||||
$patchFiles = "$PWD\chrome_elf.dll", "$PWD\config.ini"
|
$patchFiles = "$PWD\chrome_elf.dll", "$PWD\config.ini"
|
||||||
Copy-Item -LiteralPath $patchFiles -Destination "$SpotifyDirectory"
|
Copy-Item -LiteralPath $patchFiles -Destination "$SpotifyDirectory"
|
||||||
|
|
||||||
@@ -164,7 +164,7 @@ $xpui_spa_patch = "$env:APPDATA\Spotify\Apps\xpui.spa"
|
|||||||
$xpui_js_patch = "$env:APPDATA\Spotify\Apps\xpui\xpui.js"
|
$xpui_js_patch = "$env:APPDATA\Spotify\Apps\xpui\xpui.js"
|
||||||
|
|
||||||
If (Test-Path $xpui_js_patch) {
|
If (Test-Path $xpui_js_patch) {
|
||||||
Write-Host 'Spicetify detected'`n
|
"Spicetify detected"
|
||||||
$xpui_js = Get-Content $xpui_js_patch -Raw
|
$xpui_js = Get-Content $xpui_js_patch -Raw
|
||||||
|
|
||||||
If (!($xpui_js -match 'patched by spotx')) {
|
If (!($xpui_js -match 'patched by spotx')) {
|
||||||
@@ -190,7 +190,7 @@ If (Test-Path $xpui_js_patch) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Write-Host 'Spotify is already patched'`n
|
"Spotify is already patched"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -289,7 +289,7 @@ If (Test-Path $xpui_spa_patch) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$zip.Dispose()
|
$zip.Dispose()
|
||||||
Write-Host 'Spotify is already patched'`n
|
"Spotify is already patched"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -345,7 +345,7 @@ $Check_folder_file = Get-ItemProperty -Path $env:LOCALAPPDATA\Spotify\Update | S
|
|||||||
$folder_update_access = Get-Acl $env:LOCALAPPDATA\Spotify\Update
|
$folder_update_access = Get-Acl $env:LOCALAPPDATA\Spotify\Update
|
||||||
|
|
||||||
do {
|
do {
|
||||||
$ch = Read-Host -Prompt "Want to block updates ? (Y/N), Unlock updates (U)"`n
|
$ch = Read-Host -Prompt "Want to block updates ? (Y/N), Unlock updates (U)"
|
||||||
if (!($ch -eq 'n' -or $ch -eq 'y' -or $ch -eq 'u')) {
|
if (!($ch -eq 'n' -or $ch -eq 'y' -or $ch -eq 'u')) {
|
||||||
|
|
||||||
Write-Host "Oops, an incorrect value, " -ForegroundColor Red -NoNewline
|
Write-Host "Oops, an incorrect value, " -ForegroundColor Red -NoNewline
|
||||||
@@ -430,13 +430,13 @@ if ($ch -eq 'y') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Write-Host "Updates blocked successfully"`n -ForegroundColor Green
|
Write-Host "Updates blocked successfully" -ForegroundColor Green
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($ch -eq 'n') {
|
if ($ch -eq 'n') {
|
||||||
Write-Host "Left unchanged"`n
|
Write-Host "Left unchanged"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -459,7 +459,7 @@ if ($ch -eq 'u') {
|
|||||||
|
|
||||||
|
|
||||||
If (!($migrator_bak -or $Check_folder_file -match '\bSystem\b|\bReadOnly\b')) {
|
If (!($migrator_bak -or $Check_folder_file -match '\bSystem\b|\bReadOnly\b')) {
|
||||||
Write-Host "Oops, updates are not blocked"`n
|
Write-Host "Oops, updates are not blocked"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -468,7 +468,7 @@ if ($ch -eq 'u') {
|
|||||||
# automatic cache clearing
|
# automatic cache clearing
|
||||||
|
|
||||||
do {
|
do {
|
||||||
$ch = Read-Host -Prompt "Want to set up automatic cache cleanup? (Y/N) Delete script (U)"`n
|
$ch = Read-Host -Prompt "Want to set up automatic cache cleanup? (Y/N) Delete script (U)"
|
||||||
|
|
||||||
if (!($ch -eq 'n' -or $ch -eq 'y' -or $ch -eq 'u')) {
|
if (!($ch -eq 'n' -or $ch -eq 'y' -or $ch -eq 'u')) {
|
||||||
Write-Host "Oops, an incorrect value, " -ForegroundColor Red -NoNewline
|
Write-Host "Oops, an incorrect value, " -ForegroundColor Red -NoNewline
|
||||||
@@ -528,7 +528,7 @@ if ($ch -eq 'y') {
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
$ch = Read-Host -Prompt "Cache files that have not been used for more than XX days will be deleted.
|
$ch = Read-Host -Prompt "Cache files that have not been used for more than XX days will be deleted.
|
||||||
Enter the number of days from 1 to 100"`n
|
Enter the number of days from 1 to 100"
|
||||||
|
|
||||||
if (!($ch -match "^[1-9][0-9]?$|^100$")) {
|
if (!($ch -match "^[1-9][0-9]?$|^100$")) {
|
||||||
Write-Host "Oops, an incorrect value, " -ForegroundColor Red -NoNewline
|
Write-Host "Oops, an incorrect value, " -ForegroundColor Red -NoNewline
|
||||||
@@ -554,8 +554,8 @@ if ($ch -eq 'y') {
|
|||||||
$contentcache_spotify_ps1 = [System.IO.File]::ReadAllText("$env:APPDATA\Spotify\cache-spotify.ps1")
|
$contentcache_spotify_ps1 = [System.IO.File]::ReadAllText("$env:APPDATA\Spotify\cache-spotify.ps1")
|
||||||
$contentcache_spotify_ps1 = $contentcache_spotify_ps1.Trim()
|
$contentcache_spotify_ps1 = $contentcache_spotify_ps1.Trim()
|
||||||
[System.IO.File]::WriteAllText("$env:APPDATA\Spotify\cache-spotify.ps1", $contentcache_spotify_ps1)
|
[System.IO.File]::WriteAllText("$env:APPDATA\Spotify\cache-spotify.ps1", $contentcache_spotify_ps1)
|
||||||
Write-Host "Clearing the cache has been successfully installed"`n -ForegroundColor Green
|
Write-Host "Clearing the cache has been successfully installed" -ForegroundColor Green
|
||||||
Write-Host "installation completed"`n -ForegroundColor Green
|
Write-Host "installation completed" -ForegroundColor Green
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -563,7 +563,7 @@ if ($ch -eq 'y') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($ch -eq 'n') {
|
if ($ch -eq 'n') {
|
||||||
Write-Host "installation completed"`n -ForegroundColor Green
|
Write-Host "installation completed" -ForegroundColor Green
|
||||||
|
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
@@ -592,8 +592,8 @@ if ($ch -eq 'u') {
|
|||||||
|
|
||||||
|
|
||||||
If (!($test_cache_spotify_ps -and $test_spotify_vbs)) {
|
If (!($test_cache_spotify_ps -and $test_spotify_vbs)) {
|
||||||
Write-Host "Oops, no cache clearing script found"`n
|
Write-Host "Oops, no cache clearing script found"
|
||||||
Write-Host "Installation completed"`n -ForegroundColor Green
|
Write-Host "Installation completed" -ForegroundColor Green
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user