fix: remove microsoft store spotify before extraction

This commit is contained in:
amd64fox
2026-10-07 20:50:27 +03:00
parent 3f3fd30a95
commit 0447e6eb03
+12 -6
View File
@@ -1777,7 +1777,7 @@ function Kill-Spotify {
}
# Defer removal until the replacement is ready
# Defer Store removal until the replacement installer is downloaded
if ($win10 -or $win11 -or $win8_1 -or $win8 -or $win12) {
if (Get-AppxPackage -Name SpotifyAB.SpotifyMusic) {
@@ -5333,7 +5333,6 @@ function Test-SpotifyInstall {
function Expand-SpotifyInstaller {
param([string]$DownloadFolder, [version]$ExpectedVersion, [string]$ExpectedArchitecture)
downloadSp -DownloadFolder $DownloadFolder
$setupExe = Join-Path $DownloadFolder 'SpotifySetup.exe'
$destination = Join-Path $DownloadFolder 'client'
$process = $null
@@ -5388,13 +5387,12 @@ try {
Write-Host ($lang).DownSpoti2`n
$architecture = Get-SpotifyInstallerArchitecture -SystemArchitecture $systemArchitecture `
-SpotifyVersion ([version]$online) -LastX86SupportedVersion $last_x86
$preparedClient = Expand-SpotifyInstaller -DownloadFolder $tempDirectory `
-ExpectedVersion ([version]$online) -ExpectedArchitecture $architecture
Write-Host
downloadSp -DownloadFolder $tempDirectory
}
Kill-Spotify
# Store detection runs before /extract in the Spotify installer
if ($uninstallStoreSpotify) {
Kill-Spotify
$previousProgressPreference = $ProgressPreference
try {
$ProgressPreference = 'SilentlyContinue'
@@ -5405,6 +5403,14 @@ try {
finally { $ProgressPreference = $previousProgressPreference }
}
if ($installSpotify) {
$preparedClient = Expand-SpotifyInstaller -DownloadFolder $tempDirectory `
-ExpectedVersion ([version]$online) -ExpectedArchitecture $architecture
Write-Host
}
if (!$uninstallStoreSpotify) { Kill-Spotify }
if ($installSpotify) {
$null = Unlock-Folder
if ($uninstallSpotify) {