@@ -5,8 +5,8 @@ set NASMDL=http://www.nasm.us/pub/nasm/releasebuilds
55set NASMVERSION = 2.12.02
66
77REM Store current directory and ensure working directory is the location of current .bat
8- SET CALLDIR = %CD%
9- cd %~dp0
8+ set CALLDIR = %CD%
9+ set SCRIPTDIR = %~dp0
1010
1111REM Initialise error check value
1212SET ERROR = 0
@@ -146,7 +146,8 @@ if not "%CURRDIR%"=="%CD%" (
146146
147147REM copy the BuildCustomizations to VCTargets folder
148148echo Installing build customisations...
149- copy /B /Y /V " ./nasm.*" " %VCTargetsPath% \BuildCustomizations\" 1 > NUL 2 > NUL
149+ del /F /Q " %VCTargetsPath% \BuildCustomizations\nasm.*" 1 > NUL 2 > NUL
150+ copy /B /Y /V " %SCRIPTDIR% \nasm.*" " %VCTargetsPath% \BuildCustomizations\" 1 > NUL 2 > NUL
150151if not exist " %VCTargetsPath% \BuildCustomizations\nasm.props" (
151152 echo Error: Failed to copy build customisations!
152153 echo Ensure that this script is run in a shell with the necessary write privileges
@@ -162,30 +163,31 @@ if "%SYSARCH%"=="x32" (
162163 goto Terminate
163164)
164165echo Downloading required NASM release binary...
165- powershell.exe -Command (New-Object Net.WebClient).DownloadFile('%NASMDOWNLOAD% ', './ nasm.zip') 1 > NUL 2 > NUL
166- if not exist " ./ nasm.zip" (
166+ powershell.exe -Command (New-Object Net.WebClient).DownloadFile('%NASMDOWNLOAD% ', '%SCRIPTDIR% \ nasm.zip') 1 > NUL 2 > NUL
167+ if not exist " %SCRIPTDIR% \ nasm.zip" (
167168 echo Error: Failed to download required NASM binary!
168169 echo The following link could not be resolved " %NASMDOWNLOAD% "
169170 goto Terminate
170171)
171- powershell.exe -Command Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('" ./ nasm.zip" ', '" ./ TempNASMUnpack" ') 1 > NUL 2 > NUL
172- if not exist " ./ TempNASMUnpack" (
172+ powershell.exe -Command Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('" %SCRIPTDIR% \ nasm.zip" ', '" %SCRIPTDIR% \ TempNASMUnpack" ') 1 > NUL 2 > NUL
173+ if not exist " %SCRIPTDIR% \ TempNASMUnpack" (
173174 echo Error: Failed to unpack NASM download!
174- del /F /Q " ./ nasm.zip" 1 > NUL 2 > NUL
175+ del /F /Q " %SCRIPTDIR% \ nasm.zip" 1 > NUL 2 > NUL
175176 goto Terminate
176177)
177- del /F /Q " ./ nasm.zip" 1 > NUL 2 > NUL
178+ del /F /Q " %SCRIPTDIR% \ nasm.zip" 1 > NUL 2 > NUL
178179
179180REM copy nasm executable to VC installation folder
180181echo Installing required NASM release binary...
181- copy /B /Y /V " ./TempNASMUnpack\nasm-%NASMVERSION% \*.exe" " %VCINSTALLDIR% \" 1 > NUL 2 > NUL
182+ del /F /Q " %VCINSTALLDIR% \nasm.exe" 1 > NUL 2 > NUL
183+ copy /B /Y /V " %SCRIPTDIR% \TempNASMUnpack\nasm-%NASMVERSION% \nasm.exe" " %VCINSTALLDIR% \" 1 > NUL 2 > NUL
182184if not exist " %VCINSTALLDIR% \nasm.exe" (
183185 echo Error: Failed to install NASM binary!
184186 echo Ensure that this script is run in a shell with the necessary write privileges
185- rd /S /Q " ./ TempNASMUnpack" 1 > NUL 2 > NUL
187+ rd /S /Q " %SCRIPTDIR% \ TempNASMUnpack" 1 > NUL 2 > NUL
186188 goto Terminate
187189)
188- rd /S /Q " ./ TempNASMUnpack"
190+ rd /S /Q " %SCRIPTDIR% \ TempNASMUnpack"
189191echo Finished Successfully
190192goto Exit
191193
0 commit comments