diff --git a/racket/src/worksp/msvcprep.bat b/racket/src/worksp/msvcprep.bat index 38982300e5b..dbcd6a331d9 100644 --- a/racket/src/worksp/msvcprep.bat +++ b/racket/src/worksp/msvcprep.bat @@ -4,8 +4,8 @@ REM Expects something like "x86", "amd64", or "x86_amd64" as an argument. set VCMODE=%1 -set Applications=%ProgramFiles(x86)% -if "%Applications%" == "" set Applications=%ProgramFiles% +REM For 2022 and later, look in "Program Files" +set Applications=%ProgramFiles% set VCVARBAT=%Applications%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat @@ -13,6 +13,10 @@ if not exist "%VCVARBAT%" set VCVARBAT=%Applications%\Microsoft Visual Studio\20 if not exist "%VCVARBAT%" set VCVARBAT=%Applications%\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\vcvarsall.bat if not exist "%VCVARBAT%" set VCVARBAT=%Applications%\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat +REM For 2019 and earlier, look in "Program Files (x86)" +set Applications=%ProgramFiles(x86)% +if "%Applications%" == "" set Applications=%ProgramFiles% + if not exist "%VCVARBAT%" set VCVARBAT=%Applications%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat if not exist "%VCVARBAT%" set VCVARBAT=%Applications%\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvarsall.bat if not exist "%VCVARBAT%" set VCVARBAT=%Applications%\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat