diff --git a/apps/desktop/scripts/download-ollama.ps1 b/apps/desktop/scripts/download-ollama.ps1 index ba0d007..2544665 100644 --- a/apps/desktop/scripts/download-ollama.ps1 +++ b/apps/desktop/scripts/download-ollama.ps1 @@ -23,11 +23,15 @@ if (Test-Path (Join-Path $DEST_DIR "ollama.exe")) { if (Test-Path $TEMP_ZIP) { Remove-Item -Force $TEMP_ZIP } Write-Host "Downloading: $OLLAMA_URL" -try { - [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 - Invoke-WebRequest -Uri $OLLAMA_URL -OutFile $TEMP_ZIP -UseBasicParsing -} catch { - Write-Host "Auto-download failed: $_" -ForegroundColor Red +# curl.exe (Win10+ native) handles GitHub redirects, progress output, large files +# better than Invoke-WebRequest. -L follow redirects, --fail error on HTTP >=400, +# --retry 3, --max-time 1800 (30min), --progress-bar human readable. +$curlExe = "$env:SystemRoot\System32\curl.exe" +if (-not (Test-Path $curlExe)) { $curlExe = "curl.exe" } +& $curlExe -L --fail --retry 3 --max-time 1800 --progress-bar ` + -o $TEMP_ZIP $OLLAMA_URL +if ($LASTEXITCODE -ne 0) { + Write-Host "curl download failed with exit code $LASTEXITCODE" -ForegroundColor Red Write-Host "" Write-Host "=== Manual install ===" -ForegroundColor Yellow Write-Host "Download ollama-windows-amd64.zip from:"