Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corefx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWes Haggard <Wes.Haggard@microsoft.com>2017-07-25 00:59:18 +0300
committerWes Haggard <Wes.Haggard@microsoft.com>2017-07-25 03:08:36 +0300
commitd1cbf92a882a96bdfb0066ee2f978deffe5d9420 (patch)
treeae70fea67342307af973bf8113636456fd4b4421 /run.cmd
parent35d03ba2411a372acdffa59d2e335f724bd9178e (diff)
Detect VS2017 in the run script
Diffstat (limited to 'run.cmd')
-rw-r--r--run.cmd19
1 files changed, 11 insertions, 8 deletions
diff --git a/run.cmd b/run.cmd
index 55e8bb5318..eca223aaa9 100644
--- a/run.cmd
+++ b/run.cmd
@@ -16,19 +16,22 @@ setlocal
:: is already configured to use that toolset. Otherwise, we will fallback to using the VS2015
:: toolset if it is installed. Finally, we will fail the script if no supported VS instance
:: can be found.
-if not defined VisualStudioVersion (
- if defined VS150COMNTOOLS (
- call "%VS150COMNTOOLS%\VsDevCmd.bat"
- goto :Run
- ) else if defined VS140COMNTOOLS (
- call "%VS140COMNTOOLS%\VsDevCmd.bat"
- goto :Run
- )
+
+if defined VisualStudioVersion goto :Run
+
+set _VSWHERE="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
+if exist %_VSWHERE% (
+ for /f "usebackq tokens=*" %%i in (`%_VSWHERE% -latest -property installationPath`) do set _VSCOMNTOOLS=%%i\Common7\Tools
+)
+if not exist "%_VSCOMNTOOLS%" set _VSCOMNTOOLS=%VS140COMNTOOLS%
+if not exist "%_VSCOMNTOOLS%" (
echo Error: Visual Studio 2015 or 2017 required.
echo Please see https://github.com/dotnet/corefx/blob/master/Documentation/project-docs/developer-guide.md for build instructions.
exit /b 1
)
+call "%_VSCOMNTOOLS%\VsDevCmd.bat"
+
:Run
:: Clear the 'Platform' env variable for this session, as it's a per-project setting within the build, and
:: misleading value (such as 'MCD' in HP PCs) may lead to build breakage (issue: #69).