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

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Osenkov <KirillOsenkov@users.noreply.github.com>2017-11-13 22:43:28 +0300
committerGitHub <noreply@github.com>2017-11-13 22:43:28 +0300
commit56cda3362bc2da22feb3149c2fcc42ab6f6a3dbe (patch)
tree9d1e6f639aebdceca2120e232a4065103cf7e669 /main/winbuild.bat
parentcfebe59bf25737503e562ee2dac7ae90d6d52c67 (diff)
winbuild.bat: try to use vswhere.exe to find MSBuild (#3337)
Diffstat (limited to 'main/winbuild.bat')
-rw-r--r--main/winbuild.bat8
1 files changed, 6 insertions, 2 deletions
diff --git a/main/winbuild.bat b/main/winbuild.bat
index 47826cda5d..a1b838579f 100644
--- a/main/winbuild.bat
+++ b/main/winbuild.bat
@@ -1,8 +1,12 @@
@echo off
setlocal enableextensions enabledelayedexpansion
-rem try to find MSBuild in VS2017
-rem the "correct" way is to use a COM API. not easy here.
+if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" (
+ FOR /F "delims=" %%E in ('"%ProgramFiles(x86)%\Microsoft Visual Studio\installer\vswhere.exe" -latest -property installationPath') DO (
+ set "MSBUILD_EXE=%%E\MSBuild\15.0\Bin\MSBuild.exe"
+ if exist "!MSBUILD_EXE!" goto :build
+ )
+)
FOR %%E in (Enterprise, Professional, Community) DO (
set "MSBUILD_EXE=%ProgramFiles(x86)%\Microsoft Visual Studio\2017\%%E\MSBuild\15.0\Bin\MSBuild.exe"