Skip to content

Commit 3be0cb2

Browse files
committed
Update to correspond to changes in VSYASM.
1 parent b21c70d commit 3be0cb2

File tree

3 files changed

+17
-14
lines changed

3 files changed

+17
-14
lines changed

install_script.bat

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ set NASMDL=http://www.nasm.us/pub/nasm/releasebuilds
55
set NASMVERSION=2.12.02
66

77
REM 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

1111
REM Initialise error check value
1212
SET ERROR=0
@@ -146,7 +146,8 @@ if not "%CURRDIR%"=="%CD%" (
146146

147147
REM copy the BuildCustomizations to VCTargets folder
148148
echo 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
150151
if 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
)
164165
echo 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

179180
REM copy nasm executable to VC installation folder
180181
echo 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
182184
if 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"
189191
echo Finished Successfully
190192
goto Exit
191193

nasm.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<NASM>
1313
<OutputFormat>$(IntDir)%(FileName).obj</OutputFormat>
1414
<CommandLineTemplate>"$(NasmPath)"nasm.exe -Xvc -f win$(PlatformArchitecture) [AllOptions] [AdditionalOptions] "%(FullPath)"</CommandLineTemplate>
15-
<ExecutionDescription>Assembling %(Identity)...</ExecutionDescription>
15+
<ExecutionDescription>%(Identity)</ExecutionDescription>
1616
</NASM>
1717
</ItemDefinitionGroup>
1818
</Project>

nasm.targets

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
</NASM_tlog>
4141
</ItemGroup>
4242
<Message
43+
Condition="'@(NASM)' != '' and '%(NASM.ExcludedFromBuild)' != 'true'"
4344
Importance="High"
4445
Text="%(NASM.ExecutionDescription)" />
4546
<WriteLinesToFile
@@ -58,7 +59,7 @@
5859
TreatWarningsAsErrors="%(NASM.TreatWarningsAsErrors)"
5960
CommandLineTemplate="%(NASM.CommandLineTemplate)"
6061
AdditionalOptions="%(NASM.AdditionalOptions)"
61-
/>
62+
/>
6263
</Target>
6364
<Target
6465
Name="ComputeNASMOutput"

0 commit comments

Comments
 (0)