Pick the ws2tcp-local download URL by CPU architecture
Use windows_arm64_url on ARM64 and windows_x64_url otherwise, instead of the generic windows_url. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d7d96faf19
commit
fccc7986d9
1 file changed
+7
-2
@@ -12,9 +12,14 @@ if errorlevel 1 (
|
||||
set "MANIFEST=https://wangguofang.net/ws2tcp-local/releases/latest.json"
|
||||
set "INSTALLER=%TEMP%\ws2tcp-local-setup.exe"
|
||||
|
||||
echo Looking up the latest ws2tcp-local release...
|
||||
set "ARCH=%PROCESSOR_ARCHITECTURE%"
|
||||
if defined PROCESSOR_ARCHITEW6432 set "ARCH=%PROCESSOR_ARCHITEW6432%"
|
||||
set "KEY=windows_x64_url"
|
||||
if /i "%ARCH%"=="ARM64" set "KEY=windows_arm64_url"
|
||||
|
||||
echo Looking up the latest ws2tcp-local release (%ARCH%)...
|
||||
set "URL="
|
||||
for /f "usebackq delims=" %%U in (`powershell -NoProfile -ExecutionPolicy Bypass -Command "(Invoke-RestMethod -UseBasicParsing '%MANIFEST%').windows_url"`) do set "URL=%%U"
|
||||
for /f "usebackq delims=" %%U in (`powershell -NoProfile -ExecutionPolicy Bypass -Command "(Invoke-RestMethod -UseBasicParsing '%MANIFEST%').'%KEY%'"`) do set "URL=%%U"
|
||||
if not defined URL (
|
||||
echo Could not read the download URL from %MANIFEST%.
|
||||
if not defined INSTALL_ALL pause
|
||||
|
||||
Reference in new issue
Block a user