Skip to content

Commit

Permalink
install_script: Improve vswhere detection.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sibras committed Jul 7, 2019
1 parent 89cc965 commit db360f1
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions install_script.bat
Original file line number Diff line number Diff line change
Expand Up @@ -77,26 +77,24 @@ if not exist "%SCRIPTDIR%\vswhere.exe" (

:VSwhereDetection
REM Use vswhere to list detected installs
for /f "usebackq tokens=1* delims=: " %%i in (`"%SCRIPTDIR%\vswhere.exe" -prerelease -requires Microsoft.Component.MSBuild`) do (
if /i "%%i"=="installationPath" (
for /f "delims=" %%a in ('echo %%j ^| find "2019"') do (
if not "%%a"=="" (
echo Visual Studio 2019 environment detected...
call "%~0" "16" "%%j"
if not ERRORLEVEL 1 (
set MSVC16=1
set MSVCFOUND=1
)
for /f "usebackq tokens=1* delims=: " %%i in (`"%SCRIPTDIR%\vswhere.exe" -prerelease -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do (
for /f "delims=" %%a in ('echo %%j ^| find "2019"') do (
if not "%%a"=="" (
echo Visual Studio 2019 environment detected...
call "%~0" "16" "%%j"
if not ERRORLEVEL 1 (
set MSVC16=1
set MSVCFOUND=1
)
)
for /f "delims=" %%a in ('echo %%j ^| find "2017"') do (
if not "%%a"=="" (
echo Visual Studio 2017 environment detected...
call "%~0" "15" "%%j"
if not ERRORLEVEL 1 (
set MSVC15=1
set MSVCFOUND=1
)
)
for /f "delims=" %%a in ('echo %%j ^| find "2017"') do (
if not "%%a"=="" (
echo Visual Studio 2017 environment detected...
call "%~0" "15" "%%j"
if not ERRORLEVEL 1 (
set MSVC15=1
set MSVCFOUND=1
)
)
)
Expand Down

0 comments on commit db360f1

Please sign in to comment.