Browse Source

Update scripts for downloading

pull/702/head
Dmitry Nefedov 3 months ago
parent
commit
dc99d9918c
  1. 39
      Download_Latest_Sophia.ps1
  2. 31
      Download_Sophia.ps1

39
Download_Latest_Sophia.ps1

@ -53,6 +53,9 @@ catch [System.Net.WebException]
} }
Write-Warning -Message "You're using $(if ($DNS.Count -gt 1) {$DNS -join ', '} else {$DNS}) DNS records" Write-Warning -Message "You're using $(if ($DNS.Count -gt 1) {$DNS -join ', '} else {$DNS}) DNS records"
Write-Verbose -Message "https://t.me/sophia_chat" -Verbose
Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose
pause pause
exit exit
} }
@ -68,7 +71,7 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
} }
else else
{ {
Write-Verbose -Message "Windows version is not supported. Update your Windows" -Verbose Write-Verbose -Message "Windows version is not supported. Update your Windows and try again." -Verbose
# Receive updates for other Microsoft products when you update Windows # Receive updates for other Microsoft products when you update Windows
(New-Object -ComObject Microsoft.Update.ServiceManager).AddService2("7971f918-a847-4430-9279-4a52d1efe18d", 7, "") (New-Object -ComObject Microsoft.Update.ServiceManager).AddService2("7971f918-a847-4430-9279-4a52d1efe18d", 7, "")
@ -79,6 +82,9 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
# Open the "Windows Update" page # Open the "Windows Update" page
Start-Process -FilePath "ms-settings:windowsupdate" Start-Process -FilePath "ms-settings:windowsupdate"
Write-Verbose -Message "https://t.me/sophia_chat" -Verbose
Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose
pause pause
exit exit
} }
@ -92,7 +98,7 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
} }
else else
{ {
Write-Verbose -Message "Windows version is not supported. Update your Windows" -Verbose Write-Verbose -Message "Windows version is not supported. Update your Windows and try again." -Verbose
# Receive updates for other Microsoft products when you update Windows # Receive updates for other Microsoft products when you update Windows
(New-Object -ComObject Microsoft.Update.ServiceManager).AddService2("7971f918-a847-4430-9279-4a52d1efe18d", 7, "") (New-Object -ComObject Microsoft.Update.ServiceManager).AddService2("7971f918-a847-4430-9279-4a52d1efe18d", 7, "")
@ -103,6 +109,9 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
# Open the "Windows Update" page # Open the "Windows Update" page
Start-Process -FilePath "ms-settings:windowsupdate" Start-Process -FilePath "ms-settings:windowsupdate"
Write-Verbose -Message "https://t.me/sophia_chat" -Verbose
Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose
pause pause
exit exit
} }
@ -151,22 +160,35 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
$Version = "Sophia_Script_for_Windows_11_LTSC_2024" $Version = "Sophia_Script_for_Windows_11_LTSC_2024"
} }
} }
} default
if (Test-Path -Path "$DownloadsFolder\SophiaScriptTemp")
{ {
Write-Verbose -Message "Please remove `"$DownloadsFolder\SophiaScriptTemp`" manually and try to download again." -Verbose Write-Verbose -Message "Windows version is not supported. Update your Windows and try again." -Verbose
Remove-Item -Path "$DownloadsFolder\master.zip" -Force
# Receive updates for other Microsoft products when you update Windows
(New-Object -ComObject Microsoft.Update.ServiceManager).AddService2("7971f918-a847-4430-9279-4a52d1efe18d", 7, "")
# Check for updates
& "$env:SystemRoot\System32\UsoClient.exe" StartInteractiveScan
# Open the "Windows Update" page
Start-Process -FilePath "ms-settings:windowsupdate"
Write-Verbose -Message "https://t.me/sophia_chat" -Verbose
Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose
pause pause
exit exit
} }
}
if (Test-Path -Path "$DownloadsFolder\$($Version)_Latest") if (Test-Path -Path "$DownloadsFolder\$($Version)_Latest")
{ {
Write-Verbose -Message "Please remove `"$DownloadsFolder\$($Version)_Latest`" manually and try to download again." -Verbose Write-Verbose -Message "Please remove `"$DownloadsFolder\$($Version)_Latest`" manually and try to download again." -Verbose
Remove-Item -Path "$DownloadsFolder\master.zip" -Force Remove-Item -Path "$DownloadsFolder\master.zip" -Force
Write-Verbose -Message "https://t.me/sophia_chat" -Verbose
Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose
pause pause
exit exit
} }
@ -187,6 +209,9 @@ catch
# Open t"Windows Update" page # Open t"Windows Update" page
Start-Process -FilePath "ms-settings:windowsupdate" Start-Process -FilePath "ms-settings:windowsupdate"
Write-Verbose -Message "https://t.me/sophia_chat" -Verbose
Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose
pause pause
exit exit
} }

31
Download_Sophia.ps1

@ -49,6 +49,9 @@ catch [System.Net.WebException]
} }
Write-Warning -Message "You're using $(if ($DNS.Count -gt 1) {$DNS -join ', '} else {$DNS}) DNS records" Write-Warning -Message "You're using $(if ($DNS.Count -gt 1) {$DNS -join ', '} else {$DNS}) DNS records"
Write-Verbose -Message "https://t.me/sophia_chat" -Verbose
Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose
pause pause
exit exit
} }
@ -81,7 +84,7 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
} }
else else
{ {
Write-Verbose -Message "Windows version is not supported. Update your Windows" -Verbose Write-Verbose -Message "Windows version is not supported. Update your Windows and try again." -Verbose
# Receive updates for other Microsoft products when you update Windows # Receive updates for other Microsoft products when you update Windows
(New-Object -ComObject Microsoft.Update.ServiceManager).AddService2("7971f918-a847-4430-9279-4a52d1efe18d", 7, "") (New-Object -ComObject Microsoft.Update.ServiceManager).AddService2("7971f918-a847-4430-9279-4a52d1efe18d", 7, "")
@ -92,6 +95,9 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
# Open the "Windows Update" page # Open the "Windows Update" page
Start-Process -FilePath "ms-settings:windowsupdate" Start-Process -FilePath "ms-settings:windowsupdate"
Write-Verbose -Message "https://t.me/sophia_chat" -Verbose
Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose
pause pause
exit exit
} }
@ -114,7 +120,7 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
} }
else else
{ {
Write-Verbose -Message "Windows version is not supported. Update your Windows" -Verbose Write-Verbose -Message "Windows version is not supported. Update your Windows and try again." -Verbose
# Receive updates for other Microsoft products when you update Windows # Receive updates for other Microsoft products when you update Windows
(New-Object -ComObject Microsoft.Update.ServiceManager).AddService2("7971f918-a847-4430-9279-4a52d1efe18d", 7, "") (New-Object -ComObject Microsoft.Update.ServiceManager).AddService2("7971f918-a847-4430-9279-4a52d1efe18d", 7, "")
@ -125,6 +131,9 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
# Open the "Windows Update" page # Open the "Windows Update" page
Start-Process -FilePath "ms-settings:windowsupdate" Start-Process -FilePath "ms-settings:windowsupdate"
Write-Verbose -Message "https://t.me/sophia_chat" -Verbose
Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose
pause pause
exit exit
} }
@ -240,21 +249,26 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
$Version = "Windows_11_LTSC2024" $Version = "Windows_11_LTSC2024"
} }
} }
} default
if (-not (Test-Path -Path "$DownloadsFolder\Sophia.Script.zip"))
{ {
Write-Verbose -Message "Your Windows build is unsupported. Run Windows Update and try again." -Verbose Write-Verbose -Message "Windows version is not supported. Update your Windows and try again." -Verbose
# Receive updates for other Microsoft products when you update Windows
(New-Object -ComObject Microsoft.Update.ServiceManager).AddService2("7971f918-a847-4430-9279-4a52d1efe18d", 7, "")
# Check for updates # Check for updates
& "$env:SystemRoot\System32\UsoClient.exe" StartInteractiveScan & "$env:SystemRoot\System32\UsoClient.exe" StartInteractiveScan
# Open t"Windows Update" page # Open the "Windows Update" page
Start-Process -FilePath "ms-settings:windowsupdate" Start-Process -FilePath "ms-settings:windowsupdate"
Write-Verbose -Message "https://t.me/sophia_chat" -Verbose
Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose
pause pause
exit exit
} }
}
try try
{ {
@ -276,6 +290,9 @@ catch
# Open t"Windows Update" page # Open t"Windows Update" page
Start-Process -FilePath "ms-settings:windowsupdate" Start-Process -FilePath "ms-settings:windowsupdate"
Write-Verbose -Message "https://t.me/sophia_chat" -Verbose
Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose
pause pause
exit exit
} }

Loading…
Cancel
Save