From 5ee8d5a470755205069c3f03918a915b8e19316a Mon Sep 17 00:00:00 2001 From: ospab Date: Fri, 15 May 2026 16:56:10 +0300 Subject: [PATCH] fix: prevent PowerShell Invoke-WebRequest hangs by disabling ProgressPreference --- ostp-client/src/tunnel/wintun_downloader.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ostp-client/src/tunnel/wintun_downloader.rs b/ostp-client/src/tunnel/wintun_downloader.rs index 8150567..740e566 100644 --- a/ostp-client/src/tunnel/wintun_downloader.rs +++ b/ostp-client/src/tunnel/wintun_downloader.rs @@ -33,7 +33,8 @@ pub fn download_wintun_dll(debug: bool) -> Result<()> { // Explicitly filter via Where-Object to select ONLY the single architecture matching dll. // This guarantees we never overwrite the correct x64 dll with x86/ARM formats during Expand-Archive recursions. let ps_script = format!( - "Invoke-WebRequest -Uri 'https://www.wintun.net/builds/wintun-0.14.1.zip' -OutFile '{}' -UseBasicParsing -ErrorAction Stop; \ + "$ProgressPreference = 'SilentlyContinue'; \ + Invoke-WebRequest -Uri 'https://www.wintun.net/builds/wintun-0.14.1.zip' -OutFile '{}' -UseBasicParsing -ErrorAction Stop; \ Expand-Archive -Path '{}' -DestinationPath '{}' -Force; \ Get-ChildItem -Path '{}' -Filter 'wintun.dll' -Recurse | Where-Object {{ $_.FullName -match 'bin[\\\\/]{}[\\\\/]' }} | Copy-Item -Destination '{}' -Force; \ Remove-Item '{}', '{}' -Recurse -Force", @@ -89,7 +90,8 @@ pub fn download_tun2socks(debug: bool) -> Result<()> { let url = format!("https://github.com/xjasonlyu/tun2socks/releases/download/v2.6.0/tun2socks-windows-{}.zip", arch); let ps_script = format!( - "Invoke-WebRequest -Uri '{}' -OutFile '{}' -UseBasicParsing -ErrorAction Stop; \ + "$ProgressPreference = 'SilentlyContinue'; \ + Invoke-WebRequest -Uri '{}' -OutFile '{}' -UseBasicParsing -ErrorAction Stop; \ Expand-Archive -Path '{}' -DestinationPath '{}' -Force; \ Get-ChildItem -Path '{}' -Filter '*.exe' -Recurse | Copy-Item -Destination '{}' -Force; \ Remove-Item '{}', '{}' -Recurse -Force",