Fix null argument issue

This commit is contained in:
Calyx Hikari 2025-06-29 14:39:34 +08:00
parent 427eb4abfa
commit 2ab3c169e9
4 changed files with 24 additions and 12 deletions

View file

@ -107,7 +107,7 @@ function Main {
}
$outFile = Join-Path $tempDir $item.Name
Write-Host "Downloading $($item.Name)..."
Start-Process -FilePath $aria2Exe -ArgumentList @(
$argumentList = @(
"--dir=`"$($outFile | Split-Path)`"",
"--out=`"$(Split-Path -Leaf $outFile)`"",
"--allow-overwrite=true",
@ -115,9 +115,12 @@ function Main {
"--max-connection-per-server=8",
"--split=8",
"--min-split-size=1M",
"$regionalWorkaround",
"`"$($item.Url)`""
) -NoNewWindow -Wait
)
if (![string]::IsNullOrEmpty($regionalWorkaround)) {
$argumentList += $regionalWorkaround
}
Start-Process -FilePath $aria2Exe -ArgumentList $argumentList -NoNewWindow -Wait
}
# --- Install DirectX ---