param ( [Parameter(HelpMessage = 'Remove podcasts from homepage.')] [switch]$podcasts_off, [Parameter(HelpMessage = 'Do not remove podcasts from homepage.')] [switch]$podcasts_on, [Parameter(HelpMessage = 'Block Spotify automatic updates.')] [switch]$block_update_on, [Parameter(HelpMessage = 'Do not block Spotify automatic updates.')] [switch]$block_update_off, [Parameter(HelpMessage = 'Enable clear cache.')] [switch]$cache_on, [Parameter(HelpMessage = 'Specify the number of days. Default is 7 days.')] [int16]$number_days = 7, [Parameter(HelpMessage = 'Do not enable cache clearing.')] [switch]$cache_off, [Parameter(HelpMessage = 'Automatic uninstallation of Spotify MS if it was found.')] [switch]$confirm_uninstall_ms_spoti, [Parameter(HelpMessage = 'Overwrite outdated or unsupported version of Spotify with the recommended version.')] [switch]$confirm_spoti_recomended_over, [Parameter(HelpMessage = 'Uninstall outdated or unsupported version of Spotify and install the recommended version.')] [switch]$confirm_spoti_recomended_unistall, [Parameter(HelpMessage = 'Installation without ad blocking for premium accounts.')] [switch]$premium, [Parameter(HelpMessage = 'Automatic launch of Spotify after installation is complete.')] [switch]$start_spoti, [Parameter(HelpMessage = 'Experimental features operated by Spotify.')] [switch]$exp_spotify, [Parameter(HelpMessage = 'Experimental features of SpotX are not included')] [switch]$exp_standart, [Parameter(HelpMessage = 'Do not hide the icon of collaborations in playlists.')] [switch]$hide_col_icon_off, [Parameter(HelpMessage = 'Do not enable the made for you button on the left sidebar.')] [switch]$made_for_you_off, [Parameter(HelpMessage = 'Do not enable enhance playlist.')] [switch]$enhance_playlist_off, [Parameter(HelpMessage = 'Do not enable enhance liked songs.')] [switch]$enhance_like_off, [Parameter(HelpMessage = 'Do not enable new discography on artist.')] [switch]$new_artist_pages_off, [Parameter(HelpMessage = 'Do not enable new lyrics.')] [switch]$new_lyrics_off, [Parameter(HelpMessage = 'Do not enable exception playlists from recommendations.')] [switch]$ignore_in_recommendations_off, [Parameter(HelpMessage = 'Enable audio equalizer for Desktop.')] [switch]$equalizer_off, [Parameter(HelpMessage = 'Enable showing a new and improved device picker UI.')] [switch]$device_new_off, [Parameter(HelpMessage = 'Enabled the new home structure and navigation.')] [switch]$enablenavalt, #[Parameter(HelpMessage = 'Connect unlock test.')] #[switch]$testconnect, [Parameter(HelpMessage = 'Do not create desktop shortcut.')] [switch]$no_shortcut, [Parameter(HelpMessage = 'Select the desired language to use for installation. Default is the detected system language.')] [Alias('l')] [string]$Language ) # Ignore errors from `Stop-Process` $PSDefaultParameterValues['Stop-Process:ErrorAction'] = [System.Management.Automation.ActionPreference]::SilentlyContinue function Format-LanguageCode { # Normalizes and confirms support of the selected language. [CmdletBinding()] [OutputType([string])] param ( [string]$LanguageCode ) begin { $supportLanguages = @( 'en', 'ru', 'it', 'tr', 'ka', 'pl' ) } process { # Trim the language code down to two letter code. switch -Regex ($LanguageCode) { '^en' { $returnCode = 'en' break } '^(ru|py)' { $returnCode = 'ru' break } '^it' { $returnCode = 'it' break } '^tr' { $returnCode = 'tr' break } '^ka' { $returnCode = 'ka' break } '^pl' { $returnCode = 'pl' break } Default { $returnCode = $PSUICulture.Remove(2) break } } # Confirm that the language code is supported by this script. if ($returnCode -NotIn $supportLanguages) { # If the language code is not supported default to English. $returnCode = 'en' } } end { return $returnCode } } function Set-ScriptLanguageStrings { #Sets the language strings to be used. [CmdletBinding()] [OutputType([object])] param ( [Parameter(Mandatory = $true, HelpMessage = 'Two letter language code.')] [string]$LanguageCode ) begin { # Define language strings. $langStringsEN = [PSCustomObject]@{ Author = "Patch author:" Author2 = "@Amd64fox" Incorrect = "Oops, an incorrect value," Incorrect2 = "enter again through " Download = "Error downloading" Download2 = "Will re-request in 5 seconds..." Download3 = "Error again" Download4 = "Check your network settings and run the installation again" Download5 = "Downloading Spotify" StopScrpit = "Script is stopped" MsSpoti = "The Microsoft Store version of Spotify has been detected which is not supported" MsSpoti2 = "Uninstall Spotify Windows Store edition [Y/N]" MsSpoti3 = "Automatic uninstalling Spotify MS..." MsSpoti4 = "Uninstalling Spotify MS..." Prem = "Modification for premium account..." OldV = "Found outdated version of Spotify" OldV2 = "Your Spotify {0} version is outdated, it is recommended to upgrade to {1}" OldV3 = "Want to update ? [Y/N]" AutoUpd = "Automatic update to the recommended version" DelOrOver = "Do you want to uninstall the current version of {0} or install over it? Y [Uninstall] / N [Install Over]" DelOld = "Uninstalling old Spotify..." NewV = "Unsupported version of Spotify found" NewV2 = "Your Spotify {0} version hasn't been tested yet, currently it's a stable {1} version" NewV3 = "Do you want to continue with {0} version (errors possible) ? [Y/N]" Recom = "Do you want to install the recommended {0} version ? [Y/N]" DelNew = "Uninstalling an untested Spotify..." DownSpoti = "Downloading and installing Spotify" DownSpoti2 = "Please wait..." PodcatsOff = "Off Podcasts" PodcastsOn = "On Podcasts" PodcatsSelect = "Do you want to disable podcasts from the main page? [Y/N]" DowngradeNote = "It is recommended to block because there was a downgrade of Spotify" UpdBlock = "Spotify updates blocked" UpdUnblock = "Spotify updates are not blocked" UpdSelect = "Want to block Spotify updates? [Y/N]" CacheOn = "Clear cache enabled ({0})" CacheOff = "Clearing the cache is not enabled" CacheSelect = "Want to set up automatic cache cleanup? [Y/N]" CacheDays = "Cache older: XX days to be cleared " CacheDays2 = "Enter the number of days from 1 to 100" NoVariable = "Didn't find variable" NoVariable2 = "in xpui.js" NoVariable3 = "in licenses.html" NoVariable4 = "in html" ModSpoti = "Patching Spotify..." Error = "Error" FileLocBroken = "Location of Spotify files is broken, uninstall the client and run the script again" Spicetify = "Spicetify detected" NoRestore = "SpotX has already been installed, but files to recover xpui.js.bak and xpui.css.bak not found. `nPlease uninstall Spotify client and run Install.bat again" ExpSpotify = "Experimental features operated by Spotify" ExpStandart = "Experimental features of SpotX are not included" NoRestore2 = "SpotX has already been installed, xpui.bak not found. `nPlease uninstall Spotify client and run Install.bat again" UpdateBlocked = "Spotify updates are already blocked" UpdateError = "Failed to block updates" NoSpotifyExe = "Could not find Spotify.exe" InstallComplete = "installation completed" HostInfo = "Unwanted URLs found in hosts file" HostBak = "Backing up hosts.bak..." HostDel = "Trying to remove unwanted URLs from the original hosts file..." HostError = "Something went wrong while editing the hosts file, edit it manually or run the script as administrator" } $langStringsRU = [PSCustomObject]@{ Author = "Автор патча:" Author2 = "@Amd64fox" Incorrect = "Ой, некорректное значение," Incorrect2 = "повторите ввод через" Download = "Ошибка загрузки" Download2 = "Повторный запрос через 5 секунд..." Download3 = "Опять ошибка" Download4 = "Проверьте настройки вашей сети и снова запустите установку" Download5 = "Загрузка Spotify" StopScrpit = "Cкрипт остановлен" MsSpoti = "Обнаружена версия Spotify из Microsoft Store, которая не поддерживается" MsSpoti2 = "Хотите удалить Spotify Microsoft Store ? [Y/N]" MsSpoti3 = "Автоматическое удаление Spotify MS..." MsSpoti4 = "Удаление Spotify MS..." Prem = "Модификация для премиум аккаунта..." OldV = "Найдена устаревшая версия Spotify" OldV2 = "Ваша версия Spotify {0} устарела, рекомендуется обновиться до {1}" OldV3 = "Обновить ? [Y/N]" AutoUpd = "Автоматическое обновление до рекомендуемой версии" DelOrOver = "Вы хотите удалить текущую версию {0} или установить поверх нее? Y [Удалить] / N [Поверх]" DelOld = "Удаление устаревшего Spotify..." NewV = "Найдена неподдерживаемая версия Spotify" NewV2 = "Ваша версия Spotify {0} еще не тестировалась, стабильная версия сейчас {1}" NewV3 = "Хотите продолжить с {0} (возможны ошибки) ? [Y/N]" Recom = "Хотите установить рекомендуемую {0} версию ? [Y/N]" DelNew = "Удаление неподдерживаемого Spotify..." DownSpoti = "Загружаю и устанавливаю Spotify" DownSpoti2 = "Пожалуйста подождите..." PodcatsOff = "Подкасты отключены" PodcastsOn = "Подкасты не отключены" PodcatsSelect = "Хотите отключить подкасты c главной страницы ? [Y/N]" DowngradeNote = "Рекомендуется заблокировать т.к. было понижение версии Spotify" UpdBlock = "Обновления Spotify заблокированы" UpdUnblock = "Обновления Spotify не заблокированы" UpdSelect = "Хотите заблокировать обновления Spotify ? [Y/N]" CacheOn = "Очистка кеша включена ({0})" CacheOff = "Очистка кеша не включена" CacheSelect = "Хотите установить автоматическую очистку кеша ? [Y/N]" CacheDays = "Кэш старше: XX дней будет очищен" CacheDays2 = "Пожалуйста, введите количество дней от 1 до 100" NoVariable = "Не нашел переменную" NoVariable2 = "в xpui.js" NoVariable3 = "в licenses.html" NoVariable4 = "в html" NoVariable5 = "в ru.json" ModSpoti = "Модифицирую Spotify..." Error = "Ошибка" FileLocBroken = "Расположение файлов Spotify нарушено, удалите клиент и снова запустите скрипт" Spicetify = "Обнаружен Spicetify" NoRestore = "SpotX уже был установлен, но файлы для восстановления xpui.js.bak и xpui.css.bak не найдены. `nУдалите клиент Spotify и снова запустите Install.bat" ExpSpotify = "Экспериментальные функции управляются Spotify" ExpStandart = "Экспериментальные функции SpotX не включены" NoRestore2 = "SpotX уже был установлен, но файл для восстановления xpui.bak не найден. `nУдалите клиент Spotify и снова запустите Install.bat" UpdateBlocked = "Обновления Spotify уже заблокированы" UpdateError = "Не удалось заблокировать обновления" NoSpotifyExe = "Spotify.exe не найден" InstallComplete = "Установка завершена" HostInfo = "В файле hosts найдены нежелательные Url-адреса" HostBak = "Создаю резервную копию hosts.bak..." HostDel = "Попытка удалить нежелательные Url-адреса из оригинального файла hosts..." HostError = "Что-то пошло не так при редактировании файла hosts, отредактируйте его вручную или запустите скрипт от администратора" } $langStringsIT = [PSCustomObject]@{ Author = "Autore patch:" Author2 = "@Amd64fox" TranslationBy = "Autore traduzione:" TranslationBy2 = "@Francescoaracu" Incorrect = "Ops! Valore sbagliato," Incorrect2 = "Inserisci di nuovo" Download = "Errore nel download" Download2 = "Nuova richiesta in 5 secondi..." Download3 = "Nuovo errore" Download4 = "Verifica le tue impostazioni di rete e fai partire di nuovo l'installazione" Download5 = "Scarico Spotify" StopScrpit = "Lo script è stato fermato" MsSpoti = "Trovata versione del Microsoft Store di Spotify, che non è supportata" MsSpoti2 = "Disinstalla la versione Microsoft Store di Spotify [Y/N]" MsSpoti3 = "Disinstallazione automatica Spotify MS..." MsSpoti4 = "Disinstallo Spotify MS..." Prem = "Modifica per account premium..." OldV = "Trovata vecchia versione di Spotify" OldV2 = "La tua versione di Spotify {0} è vecchia, è consigliato aggiornare alla versione {1}" OldV3 = "Vuoi aggiornare? [Y/N]" AutoUpd = "Aggiornamento automatico alla versione consigliata" DelOrOver = "Vuoi disinstallare la versione installata {0} o sovrascriverla? Y [Disinstalla] / N [Sovrascrivi]" DelOld = "Disinstallo vecchio Spotify..." NewV = "Trovata versione di Spotify non supportata" NewV2 = "La tua versione {0} di Spotify non è stata ancora testata, al momento la {1} è stabile" NewV3 = "Vuoi continuare a installare la versione {0} (possibili errori)? [Y/N]" Recom = "Vuoi installare la versione consigliata {0}? [Y/N]" DelNew = "Disinstallo una versione non testata di Spotify..." DownSpoti = "Scarico e installo Spotify" DownSpoti2 = "Attendi..." PodcatsOff = "Podcasts OFF" PodcastsOn = "Podcasts ON" PodcatsSelect = "Vuoi rimuovere i podcast dalla home? [Y/N]" DowngradeNote = "Si consiglia il blocco degli aggiornamenti perché è stato eseguito un downgrade di Spotify" UpdBlock = "Aggiornamenti di Spotify bloccati" UpdUnblock = "Aggiornamenti di Spotify non bloccati" UpdSelect = "Vuoi bloccare gli aggiornamenti automatici di Spotify? [Y/N]" CacheOn = "Attivata la cancellazione automatica della cache ({0})" CacheOff = "Cancellazione automatica della cache non attiva" CacheSelect = "Vuoi attivare la cancellazione automatica della cache? [Y/N]" CacheDays = "Verrà cancellata la cache più vecchia di XX giorni" CacheDays2 = "Inserisci il numero dei giorni da 1 a 100" NoVariable = "Variabile non trovata" NoVariable2 = "in xpui.js" NoVariable3 = "in licenses.html" NoVariable4 = "in html" ModSpoti = "Patching Spotify..." Error = "Errore" FileLocBroken = "Il percorso dei file di Spotify non è stato trovato, disinstalla Spotify e fai ripartire lo script" Spicetify = "Rilevato Spicetify" NoRestore = "SpotX è già stato installato, ma file da recuperare xpui.js.bak e xpui.css.bak non trovati. `nPer favore, disinstalla Spotify e riapri il file Install.bat" ExpSpotify = "Features sperimentali attivate da Spotify" ExpStandart = "Features sperimentali di SpotX non incluse" NoRestore2 = "SpotX è già stato installato, xpui.bak non trovato. `nPer favore, disinstalla Spotify e riapri il file Install.bat" UpdateBlocked = "Gli aggiornamenti automatici di Spotify sono già stati bloccati" UpdateError = "Blocco degli aggiornamenti non riuscito" NoSpotifyExe = "Spotify.exe non trovato" InstallComplete = "Installazione completata" HostInfo = "Trovati URL non desiderati nel file hosts" HostBak = "Backup di hosts.bak in corso..." HostDel = "Provo a rimuovere URL non desiderati dal file hosts originale..." HostError = "Qualcosa è andato storto provando a modificare il file hosts, modificalo manualmente o fai partire lo script come amministratore" } $langStringsTR = [PSCustomObject]@{ Author = "Yama yapımcısı:" Author2 = "@Amd64fox" TranslationBy = "Tercüman:" TranslationBy2 = "@metezd" Incorrect = "Eyvah, yanlış bir değer," Incorrect2 = "tekrar girin " Download = "İndirirken hata oluştu" Download2 = "5 saniye içinde tekrar talep edilecek..." Download3 = "Yine hata oluştu" Download4 = "Ağ ayarlarınızı kontrol edin ve kurulumu tekrar çalıştırın" Download5 = "Spotify indiriliyor" StopScrpit = "Komut dosyası durduruldu" MsSpoti = "Spotify'ın desteklenmeyen Microsoft Mağazası sürümü tespit edildi" MsSpoti2 = "Spotify Windows Mağazası sürümünü kaldır [Y/N]" MsSpoti3 = "Spotify MS otomatik olarak kaldırlıyor..." MsSpoti4 = "Spotify MS kaldırılıyor..." Prem = "Premium hesap için modifikasyon ..." OldV = "Spotify'ın eski bir sürümü bulundu" OldV2 = "Spotify {0} sürümü güncel değil, {1} sürümüne yükseltmeniz önerilir" OldV3 = "Güncelleme yapılsın mı? [Y/N]" AutoUpd = "Önerilen sürüme otomatik olarak güncelle" DelOrOver = "Mevcut {0} sürümünü kaldırmak mı yoksa üzerine yüklemek mi istiyorsunuz? Y [Kaldır] / N [Üzerine Yükle]" DelOld = "Eski Spotify kaldırılıyor..." NewV = "Desteklenmeyen Spotify sürümü bulundu" NewV2 = "Spotify {0} sürümü henüz test edilmedi, şu anda kararlı olan {1} sürümüdür" NewV3 = "{0} sürümü ile devam etmek istiyor musunuz (hatalar olabilir) ? [Y/N]" Recom = "Önerilen {0} sürümünü yüklemek istiyor musunuz? [Y/N]" DelNew = "Test edilmemiş Spotify kaldırılıyor..." DownSpoti = "Spotify indiriliyor ve kuruluyor" DownSpoti2 = "Lütfen bekleyin..." PodcatsOff = "Podcast'ler Kapalı" PodcastsOn = "Podcast'ler Açık" PodcatsSelect = "Podcast'leri ana sayfadan kaldırmak istiyor musunuz? [Y/N]" DowngradeNote = "Spotify'da bir sürüm düşürme olduğu için engellemeniz önerilir" UpdBlock = "Spotify güncellemeleri engellendi" UpdUnblock = "Spotify güncellemeleri engellenmedi" UpdSelect = "Spotify güncellemelerini engellemek ister misiniz? [Y/N]" CacheOn = "Önbelleği temizleme etkin ({0})" CacheOff = "Önbelleğin temizlenmesi etkin değil" CacheSelect = "Otomatik önbellek temizlemeyi ayarlamak ister misiniz? [Y/N]" CacheDays = "Daha eski olan önbellek: XX gün içinde temizlenecek " CacheDays2 = "Gün sayısını 1 ile 100 arasında girin" NoVariable = "Değişken bulunamadı" NoVariable2 = "xpui.js içinde" NoVariable3 = "in licenses.html" NoVariable4 = "html içinde" ModSpoti = "Spotify'a yama yapılıyor..." Error = "Hata" FileLocBroken = "Spotify dosyalarının konumu bozuk, istemciyi kaldırın ve kodu tekrar çalıştırın" Spicetify = "Spicetify algılandı" NoRestore = "SpotX zaten yüklenmiş, ancak xpui.js.bak ve xpui.css.bak dosyalarının bulunamadığı tespit edildi. `nLütfen Spotify istemcisini kaldırın ve Install.bat dosyasını tekrar çalıştırın" ExpSpotify = "Spotify tarafından sunulan deneysel özellikler" ExpStandart = "SpotX'in deneysel özellikleri dahil değildir" NoRestore2 = "SpotX zaten kurulmuş, xpui.bak dosyası bulunamadı. `nLütfen Spotify istemcisini kaldırın ve Install.bat dosyasını tekrar çalıştırın" UpdateBlocked = "Spotify güncellemeleri zaten engellenmiş durumda" UpdateError = "Güncellemeler engellenemedi" NoSpotifyExe = "Spotify.exe bulunamadı" InstallComplete = "kurulum tamamlandı" HostInfo = "Hosts dosyasında istenmeyen URL'ler bulundu" HostBak = "hosts.bak dosyası yedekleniyor...." HostDel = "Orijinal hosts dosyasından istenmeyen URL'ler kaldırılmaya çalışılıyor..." HostError = "Hosts dosyasını düzenlerken bir şeyler ters gitti, elle düzenleyin veya kodu yönetici olarak çalıştırın" } $langStringsKA = [PSCustomObject]@{ Author = "პაჩის ავტორი:" Author2 = "@Amd64fox" TranslationBy = "თარგმანის ავტორი:" TranslationBy2 = "@Naviamold1" Incorrect = "უპს, არასწორი შენატანი," Incorrect2 = "მაგრამ თავიდან სცადე" Download = "შეცდომა ჩაწერის დროს" Download2 = "თავიდან ვცდი 5 წამში..." Download3 = "შეცდომა ისევ" Download4 = "შეამოწმეთ თქვენი კავშირი ქსელთან და თავიდან სცადე ინსტალაცია" Download5 = "Spotify იწერება" StopScrpit = "სკრიპტი ჩერდება" MsSpoti = "Microsoft Store-ის ვერსია მოიძებნა რომელიც არ არის მხარდაჯერილი" MsSpoti2 = "წავშალოთ Spotify Microsoft Store-ის ვერსია [Y/N]" MsSpoti3 = "ავტუმატურად იშლება Spotify MS..." MsSpoti4 = "იშლება Spotify MS..." Prem = "მოდიფიკაცია პრემიუმ აკკოუნტის..." OldV = "მოიძებნა მოძველებული Spotify-ს ვერსია" OldV2 = "თქვენი Spotify-ს {0} ვერსია არის მოძველებული, რეკომენდურია მისი აპგრეიდობა ამ ვერსიაზე {1}" OldV3 = "გინდა განაახლოთ ? [Y/N]" AutoUpd = "აუტომატიკური აპდაიტი რეკომენდებულ ვერსიაზე" DelOrOver = "გინდა წაშალო ეხლანდელი ვერსია: {0} თუ თავიდან ჩაწერა? Y [წაშლა] / N [თავიდან ჩაწერა]" DelOld = "ძველი Spotify იშლება..." NewV = "არა მხარდაჯერილი Spotify-ს ვერსია არის მოწებნილი" NewV2 = "თქვენი Spotify-ს {0} ვერსია ჯერ არ არის დატესტილი, ამჟამად არის სტაბილური {1} ვერსია" NewV3 = "გინდათ რომ გააგრძელოთ {0} ვერსიაზე (შეცდომები შესაძლებელია) ? [Y/N]" Recom = "გინდათ რო ჩაიწეროთ რეკომენდირებული {0} ვერსია ? [Y/N]" DelNew = "იშლება არა ტესტირებულ Spotify..." DownSpoti = "ვტვირთავთ და ვიწერთ Spotify-ს" DownSpoti2 = "გთხოვთ დაიცადოთ..." PodcatsOff = "პოდკასტები გათიშული" PodcastsOn = "პოდკასტები ჩართული" PodcatsSelect = "გინდათ რომ გათიშოთ პოდკასტები მთავარ გვერდიდან? [Y/N]" DowngradeNote = "რეკომენდირებული რომ დაბლოკოთ იმიტომ რომ იყო Spotify-ს დაქვეითება" UpdBlock = "Spotify-ს განახლებები დაბლოკილია" UpdUnblock = "Spotify-ს განახლებები არ არის დაბლოკილი" UpdSelect = "გინდათ რომ დაბლოკოთ Spotify-ს განახლებები? [Y/N]" CacheOn = "ქეშის გაწმენდა ჩართულია ({0})" CacheOff = "ქეშის გაწმენდა არ არის ჩართული" CacheSelect = "გინდათ რომ ჩართოთ ავტომატიკური ქეშის გაწმენდა? [Y/N]" CacheDays = "ქეში უფრო ძველია: XX დღეზე რომ იყოს გაწმენდილი " CacheDays2 = "შეიყვანეთ the დღეების რაოდენობა 1-იდან 100-ამდე" NoVariable = "ცვლადი არ არის მოძებნილი" NoVariable2 = "xpui.js -ში" NoVariable3 = "licenses.html -ში" NoVariable4 = "html =ში" ModSpoti = "Spotify იკერვება..." Error = "შეცდომა" FileLocBroken = "Spotify ფაილების ლოკაცია არის გადეხილი, წაშალეთ კლიენტი და თავიდან გაუშვით სკრიპტი" Spicetify = "Spicetify მოიზებნა" NoRestore = "SpotX უკვეა ჩაწერილი, მაგრამ ფაილები xpui.js.bak და xpui.css.bak აღსადგენად ვერ მოიძებნა. `nგთხოვთ წაშალეთ Spotify-ის აპლიკაცია და თავიდან გაუშვით Install.bat" ExpSpotify = "ექსპერიმენტული ფუნქციები, რომელსაც მართავს Spotify" ExpStandart = "ექსპერიმენტული ფუნქციები SpotX არ მოითავსება" NoRestore2 = "SpotX უკვე დაინსტალირებულია, xpui.bak ვერ მოიძებნა. `nგთხოვთ, წაშალოთ Spotify აპლიკაცია და თავიდან გაუშვით Install.bat" UpdateBlocked = "Spotify-ს განახლებები უკვე დაბლოკერიბული არიან" UpdateError = "განახლებების დაბლოკვა ვერ მოხერხდა" NoSpotifyExe = "Spotify.exe ვერ მოიძებნა" InstallComplete = "ინსტალაცია დასრულდა" HostInfo = "არასასურველი URL-ები ნაპოვნი მასპინძელის ფაილში" HostBak = "იქმნება hosts.bak-ის სარევეზნო ასლი..." HostDel = "ვცდილობთ რომ ამოვიღოთ არასასურველი URL-ები ორიგინალური მასპინძელის ფაილიდან..." HostError = "რაღაც შეცდომა მოხდა მასპინძელის ფაილის რედაქტირებისას, დაარედაქტირეთ ის ხელით ან გაუშვით სკრიპტი ადმინისტრატორის სახით" } $langStringsPL = [PSCustomObject]@{ Author = "Patch author:" Author2 = "@Amd64fox" TranslationBy = "Translation author:" TranslationBy2 = "@Nokxixr" Incorrect = "Oops, niewłaściwa wartość," Incorrect2 = "Wejdź ponownie przez " Download = "Błąd pobierania" Download2 = "Prośbę ponowię za 5 sekund..." Download3 = "Ponowny Błąd" Download4 = "Sprawdź swoje połączenie z siecią i spróbuj ponownie" Download5 = "Pobieranie Spotify" StopScrpit = "Skrypt wstrzymany" MsSpoti = "Wersja Microsoft Store Spotify została wykryta i nie jest wspierana" MsSpoti2 = "Odinstalować wersję od Spotify Windows Store? [Y/N]" MsSpoti3 = "Automatyczne odinstalowywanie Spotify MS..." MsSpoti4 = "Odinstalowywanie Spotify MS..." Prem = "Modyfikacja dla konta premium..." OldV = "Znaleziono nieaktualną wersję Spotify" OldV2 = "Twoja wersja Spotify {0} jest nieaktualna, zalecana jest aktualizacja do {1}" OldV3 = "Czy chcesz ją pobrać? [Y/N]" AutoUpd = "Automatyczna aktualizacja do zalecanej wersji" DelOrOver = "Chcesz odinstalować aktualną wersję {0}, czy pobrać nową? Y [Odinstaluj] / N [Pobierz Nowa]" DelOld = "Odinstalowywanie przedawnionego Spotify..." NewV = "Wykryto niewspieraną wersję Spotify" NewV2 = "Twoja wersja {0} nie została jeszcze przetestowana, obecna stabilna jest wersja {1} " NewV3 = "Czy chcesz kontynuować z wersją {0} (możliwe błędy) ? [Y/N]" Recom = "Czy chcesz pobrać zalecaną, {0} wersję ? [Y/N]" DelNew = "Odinstalowywanie niesprawdzonego Spotify..." DownSpoti = "Pobieranie i instalowanie Spotify" DownSpoti2 = "Proszę czekać..." PodcatsOff = "Wyłączanie Podcastsów" PodcastsOn = "Włączanie Podcastsów" PodcatsSelect = "Czy chcesz wyłączyć podcasty ze strony głównej?? [Y/N]" DowngradeNote = "Zalecane jest zablokowanie, ponieważ nastąpiło obniżenie wartości dla Spotify" UpdBlock = "Aktualizacje Spotify zablokowane" UpdUnblock = "Aktualizacje Spotify nie są zablokowane" UpdSelect = "Czy chcesz zablokować aktualizacje dla Spotify? [Y/N]" CacheOn = "Usuwanie plików cache ({0})" CacheOff = "Czyszczenie plików cache jest wyłączone" CacheSelect = "Chcesz ustawić automatyczne czyszczenie plików cache? [Y/N]" CacheDays = "Czyszczenie co: XX dni" CacheDays2 = "Wybierz co ile dni ma nastąpić czyszczenie od 1 to 100 do" NoVariable = "Nieznaleziono wartości" NoVariable2 = "w xpui.js" NoVariable3 = "w licenses.html" NoVariable4 = "w html" ModSpoti = "Patchowanie Spotify..." Error = "Błąd" FileLocBroken = "Lokalizacje plików spotify są zepsute, odinstaluj klienta i uruchom ponownie skrypt" Spicetify = "Spicetify wykryty" NoRestore = "SpotX został zainstalowany, jednak pliki do odzyskania xpui.js.bak i xpui.css.bak zostały nieznalezione. `nProszę odinstalować klienta i uruchomić Install.bat ponownie" ExpSpotify = "Eksperymentalne funkcje obsługiwane przez Spotify" ExpStandart = "Eksperymentalne funkcje SpotX nie są uwzględnione" NoRestore2 = "SpotX został pobrany, xpui.bak nie znaleziony. `nProszę odinstalować klienta Spotify i uruchomić Install.bat ponownie" UpdateBlocked = "Spotify aktualizacje są już zablokowane" UpdateError = "Nie udało się zablokować aktualizacji" NoSpotifyExe = "Nie można znaleźć Spotify.exe" InstallComplete = "Instalacja zakończona" HostInfo = "Niepożądane adresy URL znalezione w plikach hosts" HostBak = "Tworzenie kopii zapasowych hosts.bak..." HostDel = "Próba usunięcia niechcianych adresów URL z oryginalnego pliku hosts..." HostError = "Coś poszło nie tak podczas edycji pliku hosts, edytuj go ręcznie lub uruchom skrypt jako administrator" } } process { # Assign language strings. switch ($LangCode) { 'en' { $langStrings = $langStringsEN break } 'ru' { $langStrings = $langStringsRU break } 'it' { $langStrings = $langStringsIT break } 'tr' { $langStrings = $langStringsTR break } 'ka' { $langStrings = $langStringsKA break } 'pl' { $langStrings = $langStringsPL break } Default { # Default to English if unable to find a match. $langStrings = $langStringsEN break } } } end { return $langStrings } } # Set language code for script. $langCode = Format-LanguageCode -LanguageCode $Language # Set script language strings. $lang = Set-ScriptLanguageStrings -LanguageCode $langCode # Set variable 'ru'. if ($langCode -eq 'ru') { $ru = $true } # Set variable 'add transl line'. if ($langCode -match '^(it|tr|ka|pl)') { $line = $true } # Automatic length of stars $au = ($lang).Author.Length + ($lang).Author2.Length $by = ($lang).TranslationBy.Length + ($lang).TranslationBy2.Length if ($au -gt $by ) { $long = $au + 1 } else { $long = $by + 1 } $st = "" $star = $st.PadLeft($long, '*') Write-Host $star Write-Host ($lang).Author"" -NoNewline Write-Host ($lang).Author2 -ForegroundColor DarkYellow if (!($line)) { Write-Host $star`n } if ($line) { Write-Host ($lang).TranslationBy"" -NoNewline Write-Host ($lang).TranslationBy2 -ForegroundColor DarkYellow Write-Host $star`n } # Sending a statistical web query to cutt.ly $ErrorActionPreference = 'SilentlyContinue' $cutt_url = "https://cutt.ly/DK8UQub" try { Invoke-WebRequest -Uri $cutt_url | Out-Null } catch { Start-Sleep -Milliseconds 2300 try { Invoke-WebRequest -Uri $cutt_url | Out-Null } catch { } } $spotifyDirectory = "$env:APPDATA\Spotify" $spotifyDirectory2 = "$env:LOCALAPPDATA\Spotify" $spotifyExecutable = "$spotifyDirectory\Spotify.exe" $exe_bak = "$spotifyDirectory\Spotify.bak" $chrome_elf = "$spotifyDirectory\chrome_elf.dll" $chrome_elf_bak = "$spotifyDirectory\chrome_elf_bak.dll" $cache_folder = "$env:APPDATA\Spotify\cache" $spotifyUninstall = "$env:TEMP\SpotifyUninstall.exe" $start_menu = "$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Spotify.lnk" $upgrade_client = $false function incorrectValue { Write-Host ($lang).Incorrect"" -ForegroundColor Red -NoNewline Write-Host ($lang).Incorrect2"" -NoNewline Start-Sleep -Milliseconds 1000 Write-Host "3" -NoNewline Start-Sleep -Milliseconds 1000 Write-Host " 2" -NoNewline Start-Sleep -Milliseconds 1000 Write-Host " 1" Start-Sleep -Milliseconds 1000 Clear-Host } function Check_verison_clients($param2) { # checking the recommended version for spotx if ($param2 -eq "online") { $ProgressPreference = 'SilentlyContinue' # Hiding Progress Bars $readme = Invoke-WebRequest -UseBasicParsing -Uri https://raw.githubusercontent.com/amd64fox/SpotX/main/README.md $v = $readme.RawContent | Select-String "Recommended official version \[\d+\.\d+\.\d+\.\d+\]" -AllMatches $ver = $v.Matches.Value $ver = $ver -replace 'Recommended official version \[(\d+\.\d+\.\d+\.\d+)\]', '$1' return $ver } # Check version Spotify offline if ($param2 -eq "offline") { $check_offline = (Get-Item $spotifyExecutable).VersionInfo.FileVersion return $check_offline } # Check version Spotify.bak if ($param2 -eq "Spotify.bak") { $check_offline_bak = (Get-Item $exe_bak).VersionInfo.FileVersion return $check_offline_bak } } function unlockFolder { $ErrorActionPreference = 'SilentlyContinue' $block_File_update = "$env:LOCALAPPDATA\Spotify\Update" $Check_folder = Get-ItemProperty -Path $block_File_update | Select-Object Attributes $folder_update_access = Get-Acl $block_File_update # Check folder Update if it exists if ($Check_folder -match '\bDirectory\b') { # If the rights of the Update folder are blocked, then unblock if ($folder_update_access.AccessToString -match 'Deny') { ($ACL = Get-Acl $block_File_update).access | ForEach-Object { $Users = $_.IdentityReference $ACL.PurgeAccessRules($Users) } $ACL | Set-Acl $block_File_update } } } function downloadScripts($param1) { $webClient = New-Object -TypeName System.Net.WebClient if ($param1 -eq "Desktop") { Import-Module BitsTransfer $ver = Check_verison_clients -param2 "online" $l = "$PWD\links.tsv" $old = [IO.File]::ReadAllText($l) $links = $old -match "https:\/\/upgrade.scdn.co\/upgrade\/client\/win32-x86\/spotify_installer-$ver\.g[0-9a-f]{8}-[0-9]{1,3}\.exe" $links = $Matches.Values } if ($ru -and $param1 -eq "cache-spotify") { $links2 = "https://raw.githubusercontent.com/amd64fox/SpotX/main/scripts/cache/cache_spotify_ru.ps1" } if (!($ru) -and $param1 -eq "cache-spotify" ) { $links2 = "https://raw.githubusercontent.com/amd64fox/SpotX/main/scripts/cache/cache_spotify.ps1" } $web_Url_prev = "https://github.com/mrpond/BlockTheSpot/releases/latest/download/chrome_elf.zip", $links, ` $links2, "https://raw.githubusercontent.com/amd64fox/SpotX/main/scripts/cache/hide_window.vbs", ` "https://raw.githubusercontent.com/amd64fox/SpotX/main/scripts/cache/run_ps.bat", "https://docs.google.com/spreadsheets/d/e/2PACX-1vSFN2hWu4UO-ZWyVe8wlP9c0JsrduA49xBnRmSLOt8SWaOfIpCwjDLKXMTWJQ5aKj3WakQv6-Hnv9rz/pub?gid=0&single=true&output=tsv" $local_Url_prev = "$PWD\chrome_elf.zip", "$PWD\SpotifySetup.exe", "$cache_folder\cache_spotify.ps1", "$cache_folder\hide_window.vbs", "$cache_folder\run_ps.bat", "$PWD\links.tsv" $web_name_file_prev = "chrome_elf.zip", "SpotifySetup.exe", "cache_spotify.ps1", "hide_window.vbs", "run_ps.bat", "links.tsv" switch ( $param1 ) { "BTS" { $web_Url = $web_Url_prev[0]; $local_Url = $local_Url_prev[0]; $web_name_file = $web_name_file_prev[0] } "Desktop" { $web_Url = $web_Url_prev[1]; $local_Url = $local_Url_prev[1]; $web_name_file = $web_name_file_prev[1] } "cache-spotify" { $web_Url = $web_Url_prev[2]; $local_Url = $local_Url_prev[2]; $web_name_file = $web_name_file_prev[2] } "hide_window" { $web_Url = $web_Url_prev[3]; $local_Url = $local_Url_prev[3]; $web_name_file = $web_name_file_prev[3] } "run_ps" { $web_Url = $web_Url_prev[4]; $local_Url = $local_Url_prev[4]; $web_name_file = $web_name_file_prev[4] } "links.tsv" { $web_Url = $web_Url_prev[5]; $local_Url = $local_Url_prev[5]; $web_name_file = $web_name_file_prev[5] } } if ($param1 -eq "Desktop") { try { if (curl.exe -V) { $curl_check = $true } } catch { $curl_check = $false } $vernew = Check_verison_clients -param2 "online" } try { if ($param1 -eq "Desktop" -and $curl_check) { $stcode = curl.exe -I -s $web_Url if (!($stcode -match "200 OK")) { throw ($lang).Download6 } curl.exe $web_Url -o $local_Url --progress-bar --retry 3 --ssl-no-revoke } if ($param1 -eq "Desktop" -and $null -ne (Get-Module -Name BitsTransfer -ListAvailable) -and !($curl_check )) { Start-BitsTransfer -Source $web_Url -Destination $local_Url -DisplayName ($lang).Download5 -Description "$vernew " } if ($param1 -eq "Desktop" -and $null -eq (Get-Module -Name BitsTransfer -ListAvailable) -and !($curl_check )) { $webClient.DownloadFile($web_Url, $local_Url) } if ($param1 -ne "Desktop") { $ProgressPreference = 'SilentlyContinue' # Hiding Progress Bars $webClient.DownloadFile($web_Url, $local_Url) } } catch { Write-Host "" Write-Host ($lang).Download $web_name_file -ForegroundColor RED $Error[0].Exception Write-Host "" Write-Host ($lang).Download2`n Start-Sleep -Milliseconds 5000 try { if ($param1 -eq "Desktop" -and $curl_check) { $stcode = curl.exe -I -s $web_Url if (!($stcode -match "200 OK")) { throw ($lang).Download6 } curl.exe $web_Url -o $local_Url --progress-bar --retry 3 --ssl-no-revoke } if ($param1 -eq "Desktop" -and $null -ne (Get-Module -Name BitsTransfer -ListAvailable) -and !($curl_check )) { Start-BitsTransfer -Source $web_Url -Destination $local_Url -DisplayName ($lang).Download5 -Description "$vernew " } if ($param1 -eq "Desktop" -and $null -eq (Get-Module -Name BitsTransfer -ListAvailable) -and !($curl_check )) { $webClient.DownloadFile($web_Url, $local_Url) } if ($param1 -ne "Desktop") { $ProgressPreference = 'SilentlyContinue' # Hiding Progress Bars $webClient.DownloadFile($web_Url, $local_Url) } } catch { Write-Host ($lang).Download3 -ForegroundColor RED $Error[0].Exception Write-Host "" Write-Host ($lang).Download4`n ($lang).StopScrpit $tempDirectory = $PWD Pop-Location Start-Sleep -Milliseconds 200 Remove-Item -Recurse -LiteralPath $tempDirectory Pause Exit } } } function DesktopFolder { # If the default Dekstop folder does not exist, then try to find it through the registry. $ErrorActionPreference = 'SilentlyContinue' if (Test-Path "$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\" $regedit_desktop = $regedit_desktop_folder.'{754AC886-DF64-4CBA-86B5-F7FBF4FBCEF5}' if (!(Test-Path "$env:USERPROFILE\Desktop")) { $desktop_folder = $regedit_desktop } return $desktop_folder } # add Tls12 [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 Stop-Process -Name Spotify if ($PSVersionTable.PSVersion.major -ge 7) { Import-Module Appx -UseWindowsPowerShell -WarningAction:SilentlyContinue } # Check version Windows $win_os = (get-itemproperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name ProductName).ProductName $win11 = $win_os -match "\windows 11\b" $win10 = $win_os -match "\windows 10\b" $win8_1 = $win_os -match "\windows 8.1\b" $win8 = $win_os -match "\windows 8\b" if ($win11 -or $win10 -or $win8_1 -or $win8) { # Remove Spotify Windows Store If Any if (Get-AppxPackage -Name SpotifyAB.SpotifyMusic) { Write-Host ($lang).MsSpoti`n if (!($confirm_uninstall_ms_spoti)) { do { $ch = Read-Host -Prompt ($lang).MsSpoti2 Write-Host "" if (!($ch -eq 'n' -or $ch -eq 'y')) { incorrectValue } } while ($ch -notmatch '^y$|^n$') } if ($confirm_uninstall_ms_spoti) { $ch = 'y' } if ($ch -eq 'y') { $ProgressPreference = 'SilentlyContinue' # Hiding Progress Bars if ($confirm_uninstall_ms_spoti) { Write-Host ($lang).MsSpoti3`n } if (!($confirm_uninstall_ms_spoti)) { Write-Host ($lang).MsSpoti4`n } Get-AppxPackage -Name SpotifyAB.SpotifyMusic | Remove-AppxPackage } if ($ch -eq 'n') { Read-Host ($lang).StopScrpit Pause Exit } } } # Attempt to fix the hosts file $pathHosts = "$Env:windir\System32\Drivers\Etc\hosts" $pathHosts_bak = "$Env:windir\System32\Drivers\Etc\hosts.bak" $ErrorActionPreference = 'SilentlyContinue' $testHosts = Test-Path -Path $pathHosts if ($testHosts) { $hosts = Get-Content -Path $pathHosts if ($hosts -match '^[^\#|].+scdn.+|^[^\#|].+spotify.+') { Write-Host ($lang).HostInfo Write-Host ($lang).HostBak copy-Item $pathHosts $pathHosts_bak Write-Host ($lang).HostDel`n try { $hosts = $hosts -replace '^[^\#|].+scdn.+|^[^\#|].+spotify.+', '' Set-Content -Path $pathHosts -Value $hosts -Force $hosts | Where-Object { $_.trim() -ne "" } | Set-Content -Path $pathHosts -Force } catch { Write-Host ($lang).HostError`n -ForegroundColor Red } } } # Unique directory name based on time Push-Location -LiteralPath $env:TEMP New-Item -Type Directory -Name "SpotX_Temp-$(Get-Date -UFormat '%Y-%m-%d_%H-%M-%S')" | Convert-Path | Set-Location if ($premium) { Write-Host ($lang).Prem`n } if (!($premium)) { downloadScripts -param1 "BTS" Add-Type -Assembly 'System.IO.Compression.FileSystem' $zip = [System.IO.Compression.ZipFile]::Open("$PWD\chrome_elf.zip", 'read') [System.IO.Compression.ZipFileExtensions]::ExtractToDirectory($zip, $PWD) $zip.Dispose() } downloadScripts -param1 "links.tsv" $online = Check_verison_clients -param2 "online" $spotifyInstalled = (Test-Path -LiteralPath $spotifyExecutable) if ($spotifyInstalled) { $offline = Check_verison_clients -param2 "offline" if ($online -gt $offline) { if ($confirm_spoti_recomended_over -or $confirm_spoti_recomended_unistall) { Write-Host ($lang).OldV`n } if (!($confirm_spoti_recomended_over) -and !($confirm_spoti_recomended_unistall)) { do { Write-Host (($lang).OldV2 -f $offline, $online) $ch = Read-Host -Prompt ($lang).OldV3 Write-Host "" if (!($ch -eq 'n' -or $ch -eq 'y')) { incorrectValue } } while ($ch -notmatch '^y$|^n$') } if ($confirm_spoti_recomended_over -or $confirm_spoti_recomended_unistall) { $ch = 'y' Write-Host ($lang).AutoUpd`n } if ($ch -eq 'y') { $upgrade_client = $true if (!($confirm_spoti_recomended_over) -and !($confirm_spoti_recomended_unistall)) { do { $ch = Read-Host -Prompt (($lang).DelOrOver -f $offline) Write-Host "" if (!($ch -eq 'n' -or $ch -eq 'y')) { incorrectValue } } while ($ch -notmatch '^y$|^n$') } if ($confirm_spoti_recomended_unistall) { $ch = 'y' } if ($confirm_spoti_recomended_over) { $ch = 'n' } if ($ch -eq 'y') { Write-Host ($lang).DelOld`n unlockFolder cmd /c $spotifyExecutable /UNINSTALL /SILENT wait-process -name SpotifyUninstall Start-Sleep -Milliseconds 200 if (Test-Path $spotifyDirectory) { Remove-Item -Recurse -Force -LiteralPath $spotifyDirectory } if (Test-Path $spotifyDirectory2) { Remove-Item -Recurse -Force -LiteralPath $spotifyDirectory2 } if (Test-Path $spotifyUninstall ) { Remove-Item -Recurse -Force -LiteralPath $spotifyUninstall } } if ($ch -eq 'n') { $ch = $null } } if ($ch -eq 'n') { $downgrading = $true } } if ($online -lt $offline) { if ($confirm_spoti_recomended_over -or $confirm_spoti_recomended_unistall) { Write-Host ($lang).NewV`n } if (!($confirm_spoti_recomended_over) -and !($confirm_spoti_recomended_unistall)) { do { Write-Host (($lang).NewV2 -f $offline, $online) $ch = Read-Host -Prompt (($lang).NewV3 -f $offline) Write-Host "" if (!($ch -eq 'n' -or $ch -eq 'y')) { incorrectValue } } while ($ch -notmatch '^y$|^n$') } if ($confirm_spoti_recomended_over -or $confirm_spoti_recomended_unistall) { $ch = 'n' } if ($ch -eq 'y') { $upgrade_client = $false } if ($ch -eq 'n') { if (!($confirm_spoti_recomended_over) -and !($confirm_spoti_recomended_unistall)) { do { $ch = Read-Host -Prompt (($lang).Recom -f $online) Write-Host "" if (!($ch -eq 'n' -or $ch -eq 'y')) { incorrectValue } } while ($ch -notmatch '^y$|^n$') } if ($confirm_spoti_recomended_over -or $confirm_spoti_recomended_unistall) { $ch = 'y' Write-Host ($lang).AutoUpd`n } if ($ch -eq 'y') { $upgrade_client = $true $downgrading = $true if (!($confirm_spoti_recomended_over) -and !($confirm_spoti_recomended_unistall)) { do { $ch = Read-Host -Prompt (($lang).DelOrOver -f $offline) Write-Host "" if (!($ch -eq 'n' -or $ch -eq 'y')) { incorrectValue } } while ($ch -notmatch '^y$|^n$') } if ($confirm_spoti_recomended_unistall) { $ch = 'y' } if ($confirm_spoti_recomended_over) { $ch = 'n' } if ($ch -eq 'y') { Write-Host ($lang).DelNew`n unlockFolder cmd /c $spotifyExecutable /UNINSTALL /SILENT wait-process -name SpotifyUninstall Start-Sleep -Milliseconds 200 if (Test-Path $spotifyDirectory) { Remove-Item -Recurse -Force -LiteralPath $spotifyDirectory } if (Test-Path $spotifyDirectory2) { Remove-Item -Recurse -Force -LiteralPath $spotifyDirectory2 } if (Test-Path $spotifyUninstall ) { Remove-Item -Recurse -Force -LiteralPath $spotifyUninstall } } if ($ch -eq 'n') { $ch = $null } } if ($ch -eq 'n') { Write-Host ($lang).StopScrpit $tempDirectory = $PWD Pop-Location Start-Sleep -Milliseconds 200 Remove-Item -Recurse -LiteralPath $tempDirectory Pause Exit } } } } # If there is no client or it is outdated, then install if (-not $spotifyInstalled -or $upgrade_client) { Write-Host ($lang).DownSpoti"" -NoNewline Write-Host $online -ForegroundColor Green Write-Host ($lang).DownSpoti2`n # Delete old version files of Spotify before installing, leave only profile files $ErrorActionPreference = 'SilentlyContinue' Stop-Process -Name Spotify Start-Sleep -Milliseconds 600 unlockFolder Start-Sleep -Milliseconds 200 Get-ChildItem $spotifyDirectory -Exclude 'Users', 'prefs', 'cache' | Remove-Item -Recurse -Force Start-Sleep -Milliseconds 200 # Client download downloadScripts -param1 "Desktop" Write-Host "" Start-Sleep -Milliseconds 200 # Client installation Start-Process -FilePath explorer.exe -ArgumentList $PWD\SpotifySetup.exe while (-not (get-process | Where-Object { $_.ProcessName -eq 'SpotifySetup' })) {} wait-process -name SpotifySetup Stop-Process -Name Spotify if ($no_shortcut) { $ErrorActionPreference = 'SilentlyContinue' $desktop_folder = DesktopFolder Start-Sleep -Milliseconds 1000 remove-item "$desktop_folder\Spotify.lnk" -Recurse -Force } } # Delete the leveldb folder (Fixes bug with incorrect experimental features for some accounts) $leveldb = (Test-Path -LiteralPath "$spotifyDirectory2\Browser\Local Storage\leveldb") if ($leveldb) { $ErrorActionPreference = 'SilentlyContinue' remove-item "$spotifyDirectory2\Browser\Local Storage\leveldb" -Recurse -Force } # Create backup chrome_elf.dll if (!(Test-Path -LiteralPath $chrome_elf_bak) -and !($premium)) { Move-Item $chrome_elf $chrome_elf_bak } $ch = $null if ($podcasts_off) { Write-Host ($lang).PodcatsOff`n $ch = 'y' } if ($podcasts_on) { Write-Host ($lang).PodcastsOn`n $ch = 'n' } if (!($podcasts_off) -and !($podcasts_on)) { do { $ch = Read-Host -Prompt ($lang).PodcatsSelect Write-Host "" if (!($ch -eq 'n' -or $ch -eq 'y')) { incorrectValue } } while ($ch -notmatch '^y$|^n$') } if ($ch -eq 'y') { $podcast_off = $true } $ch = $null if ($downgrading) { $upd = "`n" + [string]($lang).DowngradeNote } else { $upd = "" } if ($block_update_on) { Write-Host ($lang).UpdBlock`n $ch = 'y' } if ($block_update_off) { Write-Host ($lang).UpdUnblock`n $ch = 'n' } if (!($block_update_on) -and !($block_update_off)) { do { $text_upd = [string]($lang).UpdSelect + $upd $ch = Read-Host -Prompt $text_upd Write-Host "" if (!($ch -eq 'n' -or $ch -eq 'y')) { incorrectValue } } while ($ch -notmatch '^y$|^n$') } if ($ch -eq 'y') { $block_update = $true } if ($ch -eq 'n') { $ErrorActionPreference = 'SilentlyContinue' $exe_onl_fn = Check_verison_clients -param2 "offline" $exe_bak_fn = Check_verison_clients -param2 'Spotify.bak' if ((Test-Path -LiteralPath $exe_bak) -and $exe_onl_fn -eq $exe_bak_fn) { Remove-Item $spotifyExecutable -Recurse -Force Rename-Item $exe_bak $spotifyExecutable } } $ch = $null if ($cache_on) { Write-Host (($lang).CacheOn -f $number_days)`n $cache_install = $true } if ($cache_off) { Write-Host ($lang).CacheOff`n $ErrorActionPreference = 'SilentlyContinue' $desktop_folder = DesktopFolder if (Test-Path -LiteralPath $cache_folder) { remove-item $cache_folder -Recurse -Force remove-item $desktop_folder\Spotify.lnk -Recurse -Force remove-item $start_menu -Recurse -Force } } if (!($cache_on) -and !($cache_off)) { do { $ch = Read-Host -Prompt ($lang).CacheSelect Write-Host "" if (!($ch -eq 'n' -or $ch -eq 'y')) { incorrectValue } } while ($ch -notmatch '^y$|^n$') if ($ch -eq 'y') { $cache_install = $true do { Write-Host ($lang).CacheDays $ch = Read-Host -Prompt ($lang).CacheDays2 Write-Host "" if (!($ch -match "^[1-9][0-9]?$|^100$")) { incorrectValue } } while ($ch -notmatch '^[1-9][0-9]?$|^100$') if ($ch -match "^[1-9][0-9]?$|^100$") { $number_days = $ch } } if ($ch -eq 'n') { $ErrorActionPreference = 'SilentlyContinue' $desktop_folder = DesktopFolder if (Test-Path -LiteralPath $cache_folder) { remove-item $cache_folder -Recurse -Force remove-item $desktop_folder\Spotify.lnk -Recurse -Force remove-item $start_menu -Recurse -Force } } } if ($exp_standart) { Write-Host ($lang).ExpStandart`n } if ($exp_spotify) { Write-Host ($lang).ExpSpotify`n } function Helper($paramname) { switch ( $paramname ) { "HtmlLicMin" { # licenses.html minification $html_lic_min = @{ HtmlLicMin1 = '