Compare commits

..

8 Commits

Author SHA1 Message Date
92828931c0 Detect Sysnative path 2025-08-11 05:03:37 +05:30
dd429f89fa 3.5 2025-08-11 02:46:05 +05:30
bda8e25dc6 skip cmd relaunch on PS 2.0 2025-08-11 01:41:53 +05:30
66b1789202 Fix start-process and write-progress on PS 2.0 2025-08-10 22:22:43 +05:30
836a6d277b Update print info, different progress bar, and add -verb runas 2025-08-10 06:57:10 +05:30
1d4c5a232a Fix script block, print homepage info 2025-08-10 04:24:34 +05:30
8de888f52f Revert "Add script block"
This reverts commit 8dafebad65.
2025-08-10 03:57:43 +05:30
8dafebad65 Add script block 2025-08-10 01:50:33 +05:30

View File

@@ -1,5 +1,13 @@
# This script is hosted on <b>https://get.activated.win</b> for <b>https://massgrave.dev</b><hr><pre> # This script is hosted on <b>https://get.activated.win</b> for <b>https://massgrave.dev</b><hr><pre>
if (-not $args) {
Write-Host ''
Write-Host 'Need help? Check our homepage: ' -NoNewline
Write-Host 'https://massgrave.dev' -ForegroundColor Green
Write-Host ''
}
& {
$psv = (Get-Host).Version.Major $psv = (Get-Host).Version.Major
$troubleshoot = 'https://massgrave.dev/troubleshoot' $troubleshoot = 'https://massgrave.dev/troubleshoot'
@@ -43,16 +51,16 @@ function CheckFile {
try { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 } catch {} try { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 } catch {}
$URLs = @( $URLs = @(
'https://raw.githubusercontent.com/massgravel/Microsoft-Activation-Scripts/67abcd0c8925832fcf4365b9cf3706ab6fbf8571/MAS/All-In-One-Version-KL/MAS_AIO.cmd', 'https://raw.githubusercontent.com/massgravel/Microsoft-Activation-Scripts/3917497c826685ffc6f3d025397e5c8c4f7fa744/MAS/All-In-One-Version-KL/MAS_AIO.cmd',
'https://dev.azure.com/massgrave/Microsoft-Activation-Scripts/_apis/git/repositories/Microsoft-Activation-Scripts/items?path=/MAS/All-In-One-Version-KL/MAS_AIO.cmd&versionType=Commit&version=67abcd0c8925832fcf4365b9cf3706ab6fbf8571', 'https://dev.azure.com/massgrave/Microsoft-Activation-Scripts/_apis/git/repositories/Microsoft-Activation-Scripts/items?path=/MAS/All-In-One-Version-KL/MAS_AIO.cmd&versionType=Commit&version=3917497c826685ffc6f3d025397e5c8c4f7fa744',
'https://git.activated.win/massgrave/Microsoft-Activation-Scripts/raw/commit/67abcd0c8925832fcf4365b9cf3706ab6fbf8571/MAS/All-In-One-Version-KL/MAS_AIO.cmd' 'https://git.activated.win/massgrave/Microsoft-Activation-Scripts/raw/commit/3917497c826685ffc6f3d025397e5c8c4f7fa744/MAS/All-In-One-Version-KL/MAS_AIO.cmd'
) )
Write-Progress -Activity "Downloading..." -Status "Please wait"
$errors = @() $errors = @()
foreach ($URL in $URLs | Sort-Object { Get-Random }) { foreach ($URL in $URLs | Sort-Object { Get-Random }) {
try { try {
if ($psv -ge 3) { if ($psv -ge 3) {
$response = Invoke-WebRequest -Uri $URL -UseBasicParsing $response = Invoke-RestMethod $URL
} }
else { else {
$w = New-Object Net.WebClient $w = New-Object Net.WebClient
@@ -64,6 +72,7 @@ foreach ($URL in $URLs | Sort-Object { Get-Random }) {
$errors += $_ $errors += $_
} }
} }
Write-Progress -Activity "Downloading..." -Status "Done" -Completed
if (-not $response) { if (-not $response) {
Check3rdAV Check3rdAV
@@ -77,7 +86,7 @@ if (-not $response) {
} }
# Verify script integrity # Verify script integrity
$releaseHash = 'EF2F705B9E8BE2816598E2E8B70BADB200733F2287B917D6C9666D95C63AFBF9' $releaseHash = '4A0123C97E7859679DD49F22D5948FD77A775CC526B9E07797FC293C6C7731BC'
$stream = New-Object IO.MemoryStream $stream = New-Object IO.MemoryStream
$writer = New-Object IO.StreamWriter $stream $writer = New-Object IO.StreamWriter $stream
$writer.Write($response) $writer.Write($response)
@@ -109,14 +118,20 @@ $chkcmd = & $env:ComSpec /c "echo CMD is working"
if ($chkcmd -notcontains "CMD is working") { if ($chkcmd -notcontains "CMD is working") {
Write-Warning "cmd.exe is not working.`nReport this issue at $troubleshoot" Write-Warning "cmd.exe is not working.`nReport this issue at $troubleshoot"
} }
saps -FilePath $env:ComSpec -ArgumentList "/c """"$FilePath"" $args""" -Wait
CheckFile $FilePath
if ($psv -lt 3) { if ($psv -lt 3) {
write-host "" if (Test-Path "$env:SystemRoot\Sysnative") {
write-host "Press any key to exit when process is done..." Write-Warning "Command is running with x86 Powershell, run it with x64 Powershell instead..."
[void][System.Console]::ReadKey($true) return
} }
$p = saps -FilePath $env:ComSpec -ArgumentList "/c """"$FilePath"" -el -qedit $args""" -Verb RunAs -PassThru
$p.WaitForExit()
}
else {
saps -FilePath $env:ComSpec -ArgumentList "/c """"$FilePath"" -el $args""" -Wait -Verb RunAs
}
CheckFile $FilePath
$FilePaths = @("$env:SystemRoot\Temp\MAS*.cmd", "$env:USERPROFILE\AppData\Local\Temp\MAS*.cmd") $FilePaths = @("$env:SystemRoot\Temp\MAS*.cmd", "$env:USERPROFILE\AppData\Local\Temp\MAS*.cmd")
foreach ($FilePath in $FilePaths) { Get-Item $FilePath -ErrorAction SilentlyContinue | Remove-Item } foreach ($FilePath in $FilePaths) { Get-Item $FilePath -ErrorAction SilentlyContinue | Remove-Item }
} @args