From 6dc822a57e72df69ae4429a9070feffae63c216c Mon Sep 17 00:00:00 2001 From: Calyx Hikari Date: Mon, 4 Aug 2025 10:28:07 +0800 Subject: [PATCH] Skip files that do not exist --- 32 | 3 +++ 64 | 6 ++++++ index.html | 6 ++++++ 3 files changed, 15 insertions(+) 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