From dc99d9918c50e8bb65f886406b539bb1abeba61d Mon Sep 17 00:00:00 2001 From: Dmitry Nefedov Date: Mon, 12 Jan 2026 20:22:08 +0300 Subject: [PATCH] Update scripts for downloading --- Download_Latest_Sophia.ps1 | 45 +++++++++++++++++++++++++++++--------- Download_Sophia.ps1 | 41 ++++++++++++++++++++++++---------- 2 files changed, 64 insertions(+), 22 deletions(-) diff --git a/Download_Latest_Sophia.ps1 b/Download_Latest_Sophia.ps1 index c0ab21fb..0d0a219b 100644 --- a/Download_Latest_Sophia.ps1 +++ b/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-Verbose -Message "https://t.me/sophia_chat" -Verbose + Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose + pause exit } @@ -68,7 +71,7 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber) } 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 (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 Start-Process -FilePath "ms-settings:windowsupdate" + Write-Verbose -Message "https://t.me/sophia_chat" -Verbose + Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose + pause exit } @@ -92,7 +98,7 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber) } 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 (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 Start-Process -FilePath "ms-settings:windowsupdate" + Write-Verbose -Message "https://t.me/sophia_chat" -Verbose + Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose + pause exit } @@ -151,15 +160,25 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber) $Version = "Sophia_Script_for_Windows_11_LTSC_2024" } } -} + default + { + Write-Verbose -Message "Windows version is not supported. Update your Windows and try again." -Verbose -if (Test-Path -Path "$DownloadsFolder\SophiaScriptTemp") -{ - Write-Verbose -Message "Please remove `"$DownloadsFolder\SophiaScriptTemp`" manually and try to download again." -Verbose - Remove-Item -Path "$DownloadsFolder\master.zip" -Force - - pause - exit + # 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 + exit + } } if (Test-Path -Path "$DownloadsFolder\$($Version)_Latest") @@ -167,6 +186,9 @@ if (Test-Path -Path "$DownloadsFolder\$($Version)_Latest") Write-Verbose -Message "Please remove `"$DownloadsFolder\$($Version)_Latest`" manually and try to download again." -Verbose 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 exit } @@ -187,6 +209,9 @@ catch # Open t"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 exit } diff --git a/Download_Sophia.ps1 b/Download_Sophia.ps1 index 0f4f287c..b74700d0 100644 --- a/Download_Sophia.ps1 +++ b/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-Verbose -Message "https://t.me/sophia_chat" -Verbose + Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose + pause exit } @@ -81,7 +84,7 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber) } 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 (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 Start-Process -FilePath "ms-settings:windowsupdate" + Write-Verbose -Message "https://t.me/sophia_chat" -Verbose + Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose + pause exit } @@ -114,7 +120,7 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber) } 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 (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 Start-Process -FilePath "ms-settings:windowsupdate" + Write-Verbose -Message "https://t.me/sophia_chat" -Verbose + Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose + pause exit } @@ -240,20 +249,25 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber) $Version = "Windows_11_LTSC2024" } } -} + default + { + Write-Verbose -Message "Windows version is not supported. Update your Windows and try again." -Verbose -if (-not (Test-Path -Path "$DownloadsFolder\Sophia.Script.zip")) -{ - Write-Verbose -Message "Your Windows build is unsupported. Run Windows Update 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 - & "$env:SystemRoot\System32\UsoClient.exe" StartInteractiveScan + # Check for updates + & "$env:SystemRoot\System32\UsoClient.exe" StartInteractiveScan - # Open t"Windows Update" page - Start-Process -FilePath "ms-settings:windowsupdate" + # Open the "Windows Update" page + Start-Process -FilePath "ms-settings:windowsupdate" - pause - exit + Write-Verbose -Message "https://t.me/sophia_chat" -Verbose + Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose + + pause + exit + } } try @@ -276,6 +290,9 @@ catch # Open t"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 exit }