Skip to content

Commit 5615b83

Browse files
committed
allow the install script to detect packaged binsaries and use those instead of downloading.
1 parent 2c1b54d commit 5615b83

File tree

1 file changed

+30
-13
lines changed

1 file changed

+30
-13
lines changed

install_script.bat

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -127,20 +127,19 @@ if not exist "%VCTargetsPath%\BuildCustomizations\yasm.props" (
127127
goto Terminate
128128
)
129129

130-
REM Download the latest yasm binary for windows
131-
if "%SYSARCH%"=="x32" (
132-
set YASMDOWNLOAD=%YASMDL%/yasm-%YASMVERSION%-win32.exe
133-
) else if "%SYSARCH%"=="x64" (
134-
set YASMDOWNLOAD=%YASMDL%/yasm-%YASMVERSION%-win64.exe
130+
REM Check if a yasm binary was bundled
131+
if not exist "./yasm" (
132+
REM Download the latest yasm binary for windows goto Terminate
133+
call :DownloadYasm
135134
) else (
136-
goto Terminate
137-
)
138-
echo Downloading required YASM release binary...
139-
powershell.exe -Command (New-Object Net.WebClient).DownloadFile('%YASMDOWNLOAD%', './yasm.exe') 1>NUL 2>NUL
140-
if not exist "./yasm.exe" (
141-
echo Error: Failed to download required YASM binary!
142-
echo The following link could not be resolved "%YASMDOWNLOAD%"
143-
goto Terminate
135+
REM Use the bundled binaries
136+
if "%SYSARCH%"=="x32" (
137+
copy /B /Y /V ".\yasm\yasm-32.exe" ".\yasm.exe" 1>NUL 2>NUL
138+
) else if "%SYSARCH%"=="x64" (
139+
copy /B /Y /V ".\yasm\yasm-64.exe" ".\yasm.exe" 1>NUL 2>NUL
140+
) else (
141+
goto Terminate
142+
)
144143
)
145144

146145
REM copy yasm executable to VC installation folder
@@ -156,3 +155,21 @@ echo Finished Successfully
156155

157156
:Terminate
158157
pause
158+
exit /b
159+
160+
:DownloadYasm
161+
if "%SYSARCH%"=="x32" (
162+
set YASMDOWNLOAD=%YASMDL%/yasm-%YASMVERSION%-win32.exe
163+
) else if "%SYSARCH%"=="x64" (
164+
set YASMDOWNLOAD=%YASMDL%/yasm-%YASMVERSION%-win64.exe
165+
) else (
166+
goto Terminate
167+
)
168+
echo Downloading required YASM release binary...
169+
powershell.exe -Command (New-Object Net.WebClient).DownloadFile('%YASMDOWNLOAD%', './yasm.exe') 1>NUL 2>NUL
170+
if not exist "./yasm.exe" (
171+
echo Error: Failed to download required YASM binary!
172+
echo The following link could not be resolved "%YASMDOWNLOAD%"
173+
goto Terminate
174+
)
175+
goto :eof

0 commit comments

Comments
 (0)