From 7ee55cbcc15939da5296e54da902db18890a651f Mon Sep 17 00:00:00 2001 From: amd64fox <62529699+amd64fox@users.noreply.github.com> Date: Tue, 14 Mar 2023 04:45:22 +0300 Subject: [PATCH] installation restriction for Win 7-8.1 #341 --- Install.ps1 | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/Install.ps1 b/Install.ps1 index c87d37a..5a69811 100644 --- a/Install.ps1 +++ b/Install.ps1 @@ -452,8 +452,27 @@ function DesktopFolder { return $desktop_folder } +# Check version Windows +$os = Get-WmiObject -Class Win32_OperatingSystem +$osCaption = $os.Caption +$pattern = "\bWindows (7|8(\.1)?|10|11|12)\b" +$reg = [regex]::Matches($osCaption, $pattern) +$win_os = $reg.value + +$win12 = $win_os -match "\windows 12\b" +$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" + # Recommended version for spotx -$onlineFull = "1.2.7.1275.g586348e7-182" +if ($win10 -or $win11 -or $win12) { + $onlineFull = "1.2.7.1275.g586348e7-182" +} +else { + $onlineFull = "1.2.5.1006.g22820f93-1078" +} + $online = ($onlineFull -split ".g")[0] # Check version Spotify offline @@ -471,16 +490,10 @@ if ($psv -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" +# Remove Spotify Windows Store If Any -if ($win11 -or $win10 -or $win8_1 -or $win8) { +if ($win10 -or $win11 -or $win8_1 -or $win8 -or $win12) { - # Remove Spotify Windows Store If Any if (Get-AppxPackage -Name SpotifyAB.SpotifyMusic) { Write-Host ($lang).MsSpoti`n