mirror of
https://github.com/msvc-win/get.msvc.win.git
synced 2025-12-15 12:47:40 +00:00
Skip files that do not exist
This commit is contained in:
parent
c2e75e9880
commit
6dc822a57e
3 changed files with 15 additions and 0 deletions
3
32
3
32
|
|
@ -128,6 +128,9 @@ function Main {
|
|||
# --- Check Signature ---
|
||||
foreach ($item in $downloads) {
|
||||
$outFile = Join-Path $tempDir $item.Name
|
||||
if (-not (Test-Path -Path $outFile)) {
|
||||
continue
|
||||
}
|
||||
Write-Host "Verifying signature of $($item.Name)..."
|
||||
$signature = Get-AuthenticodeSignature $outFile
|
||||
if ($signature.SignerCertificate.Subject -like "*CN=Microsoft Corporation*" -and $signature.Status -eq "Valid") {
|
||||
|
|
|
|||
6
64
6
64
|
|
@ -146,6 +146,9 @@ function Main {
|
|||
# --- Check Signature ---
|
||||
foreach ($item in $downloads) {
|
||||
$outFile = Join-Path $tempDir $item.Name
|
||||
if (-not (Test-Path -Path $outFile)) {
|
||||
continue
|
||||
}
|
||||
Write-Host "Verifying signature of $($item.Name)..."
|
||||
$signature = Get-AuthenticodeSignature $outFile
|
||||
if ($signature.SignerCertificate.Subject -like "*CN=Microsoft Corporation*" -and $signature.Status -eq "Valid") {
|
||||
|
|
@ -179,6 +182,9 @@ function Main {
|
|||
# --- Install VC++ Redistributables ---
|
||||
foreach ($item in $downloads | Where-Object { $_.Name -like "vcredist*" }) {
|
||||
$exePath = Join-Path $tempDir $item.Name
|
||||
if (-not (Test-Path -Path $exePath)) {
|
||||
continue
|
||||
}
|
||||
$arguments = if ($item.Year -in @("2005", "2008")) { "/q" } else { "/quiet /norestart" }
|
||||
Write-Host "Installing $($item.Name)..."
|
||||
Start-Process -FilePath $exePath -ArgumentList $arguments -Wait
|
||||
|
|
|
|||
|
|
@ -159,6 +159,9 @@ function Main {
|
|||
# --- Check Signature ---
|
||||
foreach ($item in $downloads) {
|
||||
$outFile = Join-Path $tempDir $item.Name
|
||||
if (-not (Test-Path -Path $outFile)) {
|
||||
continue
|
||||
}
|
||||
Write-Host "Verifying signature of $($item.Name)..."
|
||||
$signature = Get-AuthenticodeSignature $outFile
|
||||
if ($signature.SignerCertificate.Subject -like "*CN=Microsoft Corporation*" -and $signature.Status -eq "Valid") {
|
||||
|
|
@ -202,6 +205,9 @@ function Main {
|
|||
continue
|
||||
}
|
||||
$exePath = Join-Path $tempDir $item.Name
|
||||
if (-not (Test-Path -Path $exePath)) {
|
||||
continue
|
||||
}
|
||||
$arguments = if ($item.Year -in @("2005", "2008")) { "/q" } else { "/quiet /norestart" }
|
||||
Write-Host "Installing $($item.Name)..."
|
||||
Start-Process -FilePath $exePath -ArgumentList $arguments -Wait
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue