diff --git a/Cache/cache_spotify_ru.ps1 b/Cache/cache_spotify_ru.ps1 index 6703dac..23a4ed2 100644 --- a/Cache/cache_spotify_ru.ps1 +++ b/Cache/cache_spotify_ru.ps1 @@ -4,14 +4,14 @@ Описание: Скрипт очищает устаревший кеш от прослушанной музыки в Spotify. Срабатывает каждый раз когда вы полностью закрываете клиент (Если клиент был свернут в трей то скрипт не сработает). -Для папки APPDATA\Spotify\Data действует правило, все файлы кеша которые не использовадись +Для папки APPDATA\Spotify\Data действует правило, все файлы кеша которые не использовались клиентом больше указанного количества дней будут удалены. #> $day = 7 # Количество дней после которых кеш считается устаревшим -# Очищаем папку \Data если найдет устаревший кеш +# Очищаем папку \Data если был найден устаревший кеш try { If (!(Test-Path -Path $env:LOCALAPPDATA\Spotify\Data)) { diff --git a/Install.ps1 b/Install.ps1 index 3040865..f1c96cd 100644 --- a/Install.ps1 +++ b/Install.ps1 @@ -185,7 +185,6 @@ if ($spotifyInstalled) { # If there is no client or it is outdated, then install - if (-not $spotifyInstalled -or $upgrade_client) { $version_client_check = (get-item $PWD\SpotifySetup.exe).VersionInfo.ProductVersion @@ -197,7 +196,6 @@ if (-not $spotifyInstalled -or $upgrade_client) { # Try deleting chrome_elf files if Spotify folder exists - if (Test-Path -LiteralPath $spotifyDirectory) { $ErrorActionPreference = 'SilentlyContinue' # extinguishes light mistakes Stop-Process -Name Spotify @@ -226,7 +224,6 @@ if (-not $spotifyInstalled -or $upgrade_client) { } # Create backup chrome_elf.dll - if (!(Test-Path -LiteralPath $chrome_elf_bak)) { Move-Item $chrome_elf $chrome_elf_bak } @@ -458,14 +455,12 @@ if (Test-Path $xpui_js_patch) { $writer.BaseStream.SetLength(0) $writer.Write($xpuiContents_html) $writer.Close() - } If (Test-Path $xpui_spa_patch) { # Make a backup copy of xpui.spa if it is original - Add-Type -Assembly 'System.IO.Compression.FileSystem' $zip = [System.IO.Compression.ZipFile]::Open($xpui_spa_patch, 'update') $entry = $zip.GetEntry('xpui.js') @@ -550,7 +545,7 @@ If (Test-Path $xpui_spa_patch) { $xpuiContents_css = $xpuiContents_css ` - <# Remove RTL #>` + <# Remove RTL #>` -replace "}\[dir=ltr\]\s?", "} " ` -replace "html\[dir=ltr\]", "html" ` -replace ",\s?\[dir=rtl\].+?(\{.+?\})", '$1' ` @@ -572,10 +567,8 @@ If (Test-Path $xpui_spa_patch) { $writer.BaseStream.SetLength(0) $writer.Write($xpuiContents_css) $writer.Close() - } - # licenses.html minification $zip.Entries | Where-Object FullName -like '*licenses.html' | ForEach-Object { $reader = New-Object System.IO.StreamReader($_.Open()) @@ -621,7 +614,6 @@ If (Test-Path $xpui_spa_patch) { $writer.BaseStream.SetLength(0) $writer.Write($xpuiContents_json) $writer.Close() - } $zip.Dispose() } @@ -632,8 +624,7 @@ $ErrorActionPreference = 'SilentlyContinue' if (Test-Path "$env:USERPROFILE\Desktop") { - $desktop_folder = "$env:USERPROFILE\Desktop" - + $desktop_folder = "$env:USERPROFILE\Desktop" } $regedit_desktop_folder = Get-ItemProperty -Path "Registry::HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\" @@ -641,7 +632,6 @@ $regedit_desktop = $regedit_desktop_folder.'{754AC886-DF64-4CBA-86B5-F7FBF4FBCEF if (!(Test-Path "$env:USERPROFILE\Desktop")) { $desktop_folder = $regedit_desktop - } # Shortcut bug @@ -663,7 +653,6 @@ If (!(Test-Path $env:USERPROFILE\Desktop\Spotify.lnk)) { # Block updates $ErrorActionPreference = 'SilentlyContinue' - $update_directory = Test-Path -Path $env:LOCALAPPDATA\Spotify $migrator_bak = Test-Path -Path $env:APPDATA\Spotify\SpotifyMigrator.bak $migrator_exe = Test-Path -Path $env:APPDATA\Spotify\SpotifyMigrator.exe @@ -695,7 +684,6 @@ if ($block_update) { if ($migrator_exe) { Rename-Item -path $env:APPDATA\Spotify\SpotifyMigrator.exe -NewName $env:APPDATA\Spotify\SpotifyMigrator.bak } - } # If the client has already been @@ -721,8 +709,6 @@ if ($block_update) { New-Item -Path $env:LOCALAPPDATA\Spotify\ -Name "Update" -ItemType "file" -Value "STOPIT" | Out-Null $file_upd = Get-ItemProperty -Path $env:LOCALAPPDATA\Spotify\Update $file_upd.Attributes = "ReadOnly", "System" - - } # Если оба файлав мигратора существуют то .bak удалить, а .exe переименовать в .bak If ($migrator_exe -and $migrator_bak) { @@ -738,7 +724,6 @@ if ($block_update) { } - # automatic cache clearing @@ -749,7 +734,7 @@ if ($cache_install) { if ($test_cache_folder) { Remove-item $env:APPDATA\Spotify\cache -Recurse -Force } - + Start-Sleep -Milliseconds 200 diff --git a/Install_rus.ps1 b/Install_rus.ps1 index 6d31804..d202524 100644 --- a/Install_rus.ps1 +++ b/Install_rus.ps1 @@ -50,7 +50,7 @@ if ($win11 -or $win10 -or $win8_1 -or $win8) { Get-AppxPackage -Name SpotifyAB.SpotifyMusic | Remove-AppxPackage } else { - Read-Host "Завершение работы...`nНажмите любую клавишу для выхода..." + Read-Host "Завершение работы скрипта...`nНажмите любую клавишу для выхода..." exit } } @@ -166,8 +166,8 @@ if ($spotifyInstalled) { Write-Host "" if (!($ch -eq 'n' -or $ch -eq 'y')) { - Write-Host "Oops, an incorrect value, " -ForegroundColor Red -NoNewline - Write-Host "enter again through..." -NoNewline + Write-Host "Ой, некорректное значение, " -ForegroundColor Red -NoNewline + Write-Host "повторите ввод через..." -NoNewline Start-Sleep -Milliseconds 1000 Write-Host "3" -NoNewline Start-Sleep -Milliseconds 1000 @@ -185,7 +185,6 @@ if ($spotifyInstalled) { # Если клиента нет или он устарел, то начинаем установку/обновление - if (-not $spotifyInstalled -or $upgrade_client) { $version_client_check = (get-item $PWD\SpotifySetup.exe).VersionInfo.ProductVersion @@ -197,7 +196,6 @@ if (-not $spotifyInstalled -or $upgrade_client) { # Попробовать удалить файлы chrome_elf если существует папка Spotify - if (Test-Path -LiteralPath $spotifyDirectory) { $ErrorActionPreference = 'SilentlyContinue' # Команда гасит легкие ошибки Stop-Process -Name Spotify @@ -214,9 +212,8 @@ if (-not $spotifyInstalled -or $upgrade_client) { Stop-Process -Name SpotifyWebHelper Stop-Process -Name SpotifyFullSetup - - $ErrorActionPreference = 'SilentlyContinue' # Команда гасит легкие ошибки # Удалите установщик Spotify + $ErrorActionPreference = 'SilentlyContinue' # Команда гасит легкие ошибки if (test-path "$env:LOCALAPPDATA\Microsoft\Windows\Temporary Internet Files\") { get-childitem -path "$env:LOCALAPPDATA\Microsoft\Windows\Temporary Internet Files\" -Recurse -Force -Filter "SpotifyFullSetup*" | remove-item -Force } @@ -227,7 +224,6 @@ if (-not $spotifyInstalled -or $upgrade_client) { # Создать резервную копию chrome_elf.dll - if (!(Test-Path -LiteralPath $chrome_elf_bak)) { Move-Item $chrome_elf $chrome_elf_bak } @@ -317,7 +313,6 @@ if ($ch -eq 'y') { while ($ch -notmatch '^[1-9][0-9]?$|^100$') if ($ch -match "^[1-9][0-9]?$|^100$") { $number_days = $ch } - } @@ -356,6 +351,7 @@ function OffRujs { $xpui_js } function ExpFeature { + # Эксперементальные фишки $exp_features1 = '(Show "Made For You" entry point in the left sidebar.,default:)(!1)', '$1!0' $exp_features2 = '(Enables the 2021 icons redraw which loads a different font asset for rendering icon glyphs.",default:)(!1)', '$1!0' $exp_features3 = '(Enable Liked Songs section on Artist page",default:)(!1)', '$1!0' @@ -376,9 +372,7 @@ function ExpFeature { } function ContentsHtml { - # Минификация html - $html_lic_min1 = '