Skip to content

Commit 43297fb

Browse files
committed
Reuse previously downloaded nasm binaries.
1 parent bbd7d81 commit 43297fb

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

install_script.bat

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -220,23 +220,27 @@ if %ERRORLEVEL% neq 0 (
220220
echo Ensure that this script is run in a shell with the necessary write privileges
221221
goto Terminate
222222
)
223-
224223
REM Download the latest nasm binary for windows
224+
if exist "%SCRIPTDIR%\nasm_%NASMVERSION%.zip" (
225+
echo Using existing NASM binary...
226+
goto InstallNASM
227+
)
225228
set NASMDOWNLOAD=%NASMDL%/%NASMVERSION%/win%SYSARCH%/nasm-%NASMVERSION%-win%SYSARCH%.zip
226229
echo Downloading required NASM release binary...
227-
powershell.exe -Command (New-Object Net.WebClient).DownloadFile('%NASMDOWNLOAD%', '%SCRIPTDIR%\nasm.zip') >nul 2>&1
228-
if not exist "%SCRIPTDIR%\nasm.zip" (
230+
powershell.exe -Command (New-Object Net.WebClient).DownloadFile('%NASMDOWNLOAD%', '%SCRIPTDIR%\nasm_%NASMVERSION%.zip') >nul 2>&1
231+
if not exist "%SCRIPTDIR%\nasm_%NASMVERSION%.zip" (
229232
echo Error: Failed to download required NASM binary!
230233
echo The following link could not be resolved "%NASMDOWNLOAD%"
231234
goto Terminate
232235
)
233-
powershell.exe -Command Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('"%SCRIPTDIR%\nasm.zip"', '"%SCRIPTDIR%\TempNASMUnpack"') >nul 2>&1
236+
237+
:InstallNASM
238+
powershell.exe -Command Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('"%SCRIPTDIR%\nasm_%NASMVERSION%.zip"', '"%SCRIPTDIR%\TempNASMUnpack"') >nul 2>&1
234239
if not exist "%SCRIPTDIR%\TempNASMUnpack" (
235240
echo Error: Failed to unpack NASM download!
236-
del /F /Q "%SCRIPTDIR%\nasm.zip" >nul 2>&1
241+
del /F /Q "%SCRIPTDIR%\nasm_.zip" >nul 2>&1
237242
goto Terminate
238243
)
239-
del /F /Q "%SCRIPTDIR%\nasm.zip" >nul 2>&1
240244

241245
REM copy nasm executable to VC installation folder
242246
echo Installing required NASM release binary...

0 commit comments

Comments
 (0)