diff --git a/32 b/32 index 5d39581..efc6168 100644 --- a/32 +++ b/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") { diff --git a/64 b/64 index 20ca102..dbfc6a1 100644 --- a/64 +++ b/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 diff --git a/index.html b/index.html index 2a09cf8..4a0bf0f 100644 --- a/index.html +++ b/index.html @@ -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