Skip to content

Commit 479737f

Browse files
ppenzinrhuanjl
authored andcommitted
Tentative support for VS 2022
Add possible paths for VS 2022 bin directory, somewhat based on guesswork.
1 parent dd82265 commit 479737f

File tree

1 file changed

+31
-4
lines changed

1 file changed

+31
-4
lines changed

Build/scripts/add_msbuild_path.cmd

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
::-------------------------------------------------------------------------------------------------------
22
:: Copyright (C) Microsoft. All rights reserved.
3+
:: Copyright (c) 2021 ChakraCore Project Contributors. All rights reserved.
34
:: Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
45
::-------------------------------------------------------------------------------------------------------
56

@@ -10,22 +11,48 @@
1011
set FORCE_MSBUILD_VERSION=%1
1112

1213
if "%FORCE_MSBUILD_VERSION%" == "msbuild14" (
13-
echo Skipping Dev16 and trying Dev14...
14+
echo Skipping Dev17 and trying Dev14...
1415
goto :LABEL_USE_MSBUILD_14
1516
)
1617
if "%FORCE_MSBUILD_VERSION%" == "msbuild15" (
17-
echo Skipping Dev16 and trying Dev15...
18+
echo Skipping Dev17 and trying Dev15...
1819
goto :LABEL_USE_MSBUILD_15
1920
)
21+
if "%FORCE_MSBUILD_VERSION%" == "msbuild16" (
22+
echo Skipping Dev17 and trying Dev16...
23+
goto :LABEL_USE_MSBUILD_16
24+
)
2025

2126
where /q msbuild.exe
2227
if "%ERRORLEVEL%" == "0" (
2328
goto :SkipMsBuildSetup
2429
)
2530

26-
REM Try Dev16 first
31+
REM Try Dev17 first, then older versions
32+
33+
echo Trying to locate Dev17...
34+
35+
:LABEL_USE_MSBUILD_17
36+
set MSBUILD_VERSION=17.0
37+
set "MSBUILD_PATH=%ProgramFiles(x86)%\Microsoft Visual Studio\Preview\Enterprise\MSBuild\%MSBUILD_VERSION%\Bin"
38+
39+
if not exist "%MSBUILD_PATH%\msbuild.exe" (
40+
set "MSBUILD_PATH=%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64"
41+
)
42+
43+
if not exist "%MSBUILD_PATH%\msbuild.exe" (
44+
set "MSBUILD_PATH=%ProgramFiles(x86)%\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin"
45+
)
46+
47+
if not exist "%MSBUILD_PATH%\msbuild.exe" (
48+
set "MSBUILD_PATH=%ProgramFiles(x86)%\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64"
49+
)
50+
51+
if exist "%MSBUILD_PATH%\msbuild.exe" (
52+
goto :MSBuildFound
53+
)
2754

28-
echo Trying to locate Dev16...
55+
echo Dev17 not found, trying to locate Dev16...
2956

3057
:LABEL_USE_MSBUILD_16
3158
set MSBUILD_VERSION=16.0

0 commit comments

Comments
 (0)