Skip to content

fix: replace WebClient with Invoke-WebRequest, fix ARM64 arch name#7

Open
jimbb wants to merge 1 commit into
kitephp:mainfrom
jimbb:main
Open

fix: replace WebClient with Invoke-WebRequest, fix ARM64 arch name#7
jimbb wants to merge 1 commit into
kitephp:mainfrom
jimbb:main

Conversation

@jimbb
Copy link
Copy Markdown

@jimbb jimbb commented May 30, 2026

Summary

  • Fix download failure: Replace WebClient.DownloadFile/DownloadFileAsync with Invoke-WebRequest in Invoke-PackageDownload. WebClient fails to handle GitHub CDN redirects reliably, causing silent update failures (the versions/vX.Y.Z/ directory gets created but remains empty). Invoke-WebRequest handles the redirect chain correctly.
  • Fix ARM64 arch name: Get-SystemArchitecture returned "arm64" but CLIProxyAPI release assets use "aarch64" (e.g. CLIProxyAPI_7.1.32_windows_aarch64.zip), causing ARM64 users to always fail asset lookup with "Asset not found".
  • Progress UI: Switch from WebClient async events (percentage bar) to a background PowerShell runspace + marquee progress bar with downloaded MB polling.

Root cause

WebClient uses HttpWebRequest under the hood and fails on GitHub's CDN redirect chain even when TLS 1.2 is explicitly set. Invoke-WebRequest handles the same redirects correctly.

- Replace WebClient.DownloadFile/DownloadFileAsync with Invoke-WebRequest
  in Invoke-PackageDownload to fix GitHub CDN redirect compatibility issue
  that caused silent update failures
- Fix Get-SystemArchitecture to return 'aarch64' instead of 'arm64' for
  ARM64 systems, matching the actual release asset naming convention
- Use background PowerShell runspace with marquee progress bar for async
  download with UI feedback

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant