-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* enable explicit detection of prerelease VS versions with `set VSWHERE_WITH_PRERELEASE=1` PR-URL: #14557 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
- Loading branch information
1 parent
a4fc432
commit 97908ea
Showing
1 changed file
with
18 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,32 @@ | ||
:: Copyright 2017 - Refael Ackermann | ||
:: Distributed under MIT style license | ||
:: See accompanying file LICENSE at https://github.com/node4good/windows-autoconf | ||
:: version: 1.14.0 | ||
:: version: 2.0.0 | ||
|
||
@if not defined DEBUG_HELPER @ECHO OFF | ||
setlocal | ||
if "%~1"=="prerelease" set VSWHERE_WITH_PRERELEASE=1 | ||
set "InstallerPath=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer" | ||
if not exist "%InstallerPath%" set "InstallerPath=%ProgramFiles%\Microsoft Visual Studio\Installer" | ||
if not exist "%InstallerPath%" goto :no-vswhere | ||
:: Manipulate %Path% for easier " handeling | ||
set "Path=%Path%;%InstallerPath%" | ||
where vswhere 2> nul > nul | ||
if errorlevel 1 goto :no-vswhere | ||
set VSWHERE_REQ=-requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 | ||
set VSWHERE_PRP=-property installationPath | ||
set VSWHERE_LMT=-version "[15.0,16.0)" | ||
vswhere -prerelease > nul | ||
if not errorlevel 1 if "%VSWHERE_WITH_PRERELEASE%"=="1" set "VSWHERE_LMT=%VSWHERE_LMT% -prerelease" | ||
SET VSWHERE_ARGS=-latest -products * %VSWHERE_REQ% %VSWHERE_PRP% %VSWHERE_LMT% | ||
set "VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer" | ||
if not exist "%VSWHERE%" set "VSWHERE=%ProgramFiles%\Microsoft Visual Studio\Installer" | ||
if not exist "%VSWHERE%" exit /B 1 | ||
set Path=%Path%;%VSWHERE% | ||
for /f "usebackq tokens=*" %%i in (`vswhere %VSWHERE_ARGS%`) do ( | ||
endlocal | ||
set "VCINSTALLDIR=%%i\VC\" | ||
set "VS150COMNTOOLS=%%i\Common7\Tools\" | ||
exit /B 0) | ||
exit /B 0 | ||
) | ||
|
||
:no-vswhere | ||
endlocal | ||
echo could not find "vswhere" | ||
exit /B 1 |