Skip to content

Commit e62d42d

Browse files
authored
Merge pull request #32 from GerHobbelt/patch-msvc2026
updated install script to include support for Visual Studio 2026
2 parents cd6067e + ad4e902 commit e62d42d

2 files changed

Lines changed: 25 additions & 6 deletions

File tree

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ VSNASM
1111

1212
This project provides a set of build customisations that can be used within Visual Studio to compile assembly code using NASM.
1313
Provides Visual Studio integration for the NASM assembler.
14-
Supports Visual Studio 2010, 2012, 2013, 2015, 2017, 2019 and 2022.
14+
Supports Visual Studio 2010, 2012, 2013, 2015, 2017, 2019, 2022 and 2026.
1515

1616
## NASM
1717

@@ -20,7 +20,7 @@ For more information on NASM refer to the official site: [www.nasm.us](https://w
2020

2121
## Installation
2222

23-
The project provides a basic installer script that can automatically detect any installed Visual Studio 2013, 2015, 2017, 2019 and 2022 installation and then install the required components.
23+
The project provides a basic installer script that can automatically detect any installed Visual Studio 2013, 2015, 2017, 2019, 2022 and 2026 installation and then install the required components.
2424
To use this script simply run '**install_script.bat**' from an elevated (i.e administrator) command prompt.
2525

2626
## Usage
@@ -55,6 +55,7 @@ For example the location for various Visual Studio Community Edition versions on
5555
3. Visual Studio 2017: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\BuildCustomizations
5656
4. Visual Studio 2019: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations
5757
5. Visual Studio 2022: C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\BuildCustomizations
58+
6. Visual Studio 2026: C:\Program Files\Microsoft Visual Studio\18\Community\MSBuild\Microsoft\VC\v180\BuildCustomizations
5859

5960
2. Copy these files to a convenient location and set that path in the 'Build Customisations Search Path' in the Visual Studio 'Projects and Solutions|VC++ Project Settings' item in the 'Tools|Options' menu.
6061

install_script.bat

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ setlocal
33

44
REM Defined script variables
55
set NASMDL=http://www.nasm.us/pub/nasm/releasebuilds
6-
set NASMVERSION=2.16.03
6+
set NASMVERSION=3.01
77
set VSWHEREDL=https://github.com/Microsoft/vswhere/releases/download
88
set VSWHEREVERSION=3.1.7
99

@@ -41,7 +41,11 @@ if "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
4141
REM Check if already running in an environment with VS setup
4242
if defined VCINSTALLDIR (
4343
if defined VisualStudioVersion (
44-
if "%VisualStudioVersion%"=="17.0" (
44+
if "%VisualStudioVersion%"=="18.0" (
45+
echo Existing Visual Studio 2026 environment detected...
46+
set MSVC_VER=18
47+
goto MSVCVarsDone
48+
) else if "%VisualStudioVersion%"=="17.0" (
4549
echo Existing Visual Studio 2022 environment detected...
4650
set MSVC_VER=17
4751
goto MSVCVarsDone
@@ -85,6 +89,16 @@ if not exist "%SCRIPTDIR%\vswhere.exe" (
8589
:VSwhereDetection
8690
REM Use vswhere to list detected installs
8791
for /f "usebackq tokens=* delims=" %%i in (`"%SCRIPTDIR%\vswhere.exe" -prerelease -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do (
92+
for /f "delims=" %%a in ('echo %%i ^| find "18"') do (
93+
if not "%%a"=="" (
94+
echo Visual Studio 2026 environment detected...
95+
call "%~0" "18" "%%i"
96+
if not ERRORLEVEL 1 (
97+
set MSVC18=1
98+
set MSVCFOUND=1
99+
)
100+
)
101+
)
88102
for /f "delims=" %%a in ('echo %%i ^| find "2022"') do (
89103
if not "%%a"=="" (
90104
echo Visual Studio 2022 environment detected...
@@ -234,7 +248,9 @@ if "%SYSARCH%"=="32" (
234248
goto Terminate
235249
)
236250
REM Call the required vcvars file in order to setup up build locations
237-
if "%MSVC_VER%"=="17" (
251+
if "%MSVC_VER%"=="18" (
252+
set VCVARS=%2\VC\Auxiliary\Build\vcvars%SYSARCH%.bat
253+
) else if "%MSVC_VER%"=="17" (
238254
set VCVARS=%2\VC\Auxiliary\Build\vcvars%SYSARCH%.bat
239255
) else if "%MSVC_VER%"=="16" (
240256
set VCVARS=%2\VC\Auxiliary\Build\vcvars%SYSARCH%.bat
@@ -266,7 +282,9 @@ if not ERRORLEVEL 1 (
266282
)
267283
set /p MSBUILDDIR=<"%SCRIPTDIR%\msbuild.txt"
268284
del /F /Q "%SCRIPTDIR%\msbuild.txt" >nul 2>&1
269-
if "%MSVC_VER%"=="17" (
285+
if "%MSVC_VER%"=="18" (
286+
set VCTargetsPath="..\..\..\Microsoft\VC\v180\BuildCustomizations"
287+
) else if "%MSVC_VER%"=="17" (
270288
set VCTargetsPath="..\..\..\Microsoft\VC\v170\BuildCustomizations"
271289
) else if "%MSVC_VER%"=="16" (
272290
set VCTargetsPath="..\..\Microsoft\VC\v160\BuildCustomizations"

0 commit comments

Comments
 (0)