mirror of
https://github.com/msvc-win/get.msvc.win.git
synced 2025-12-16 05:07:39 +00:00
Add vstor redist and signature check
This commit is contained in:
parent
cabd291242
commit
34551e59f2
4 changed files with 107 additions and 0 deletions
23
dx
23
dx
|
|
@ -104,6 +104,29 @@ function Main {
|
|||
Start-Process -FilePath $aria2Exe -ArgumentList $argumentList -NoNewWindow -Wait
|
||||
}
|
||||
|
||||
# --- Check Signature ---
|
||||
foreach ($item in $downloads) {
|
||||
$outFile = Join-Path $tempDir $item.Name
|
||||
Write-Host "Verifying signature of $($item.Name)..."
|
||||
$signature = Get-AuthenticodeSignature $outFile
|
||||
if ($signature.SignerCertificate.Subject -like "*CN=Microsoft Corporation*" -and $signature.Status -eq "Valid") {
|
||||
Write-Host "✅ Valid Microsoft signature found from $($item.Name)."
|
||||
}
|
||||
else {
|
||||
Write-Warning "⚠️ $($item.Name) is not signed by Microsoft. The download may get corrupted or your PC is infected with virus."
|
||||
$response = Read-Host -Prompt "Would you like to proceed anyway? (Y/N)"
|
||||
if ($response -eq 'Y' -or $response -eq 'y') {
|
||||
continue
|
||||
}
|
||||
elseif ($response -eq 'N' -or $response -eq 'n') {
|
||||
return 1
|
||||
}
|
||||
else {
|
||||
Write-Host "Invalid input. Please enter Y or N."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# --- Install DirectX ---
|
||||
Write-Host "Installing DirectX..."
|
||||
Start-Process -FilePath "$tempDir\directx_redist.exe" -ArgumentList "/Q /T:`"$tempDir`"" -Wait
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue