|
| 1 | +@echo off |
| 2 | +setlocal |
| 3 | +if "%PROCESSOR_ARCHITECTURE%"=="x86" set PROGRAMS=%ProgramFiles% |
| 4 | +if defined ProgramFiles(x86) set PROGRAMS=%ProgramFiles(x86)% |
| 5 | +for %%e in (Community Professional Enterprise) do ( |
| 6 | + if exist "%PROGRAMS%\Microsoft Visual Studio\2017\%%e\MSBuild\15.0\Bin\MSBuild.exe" ( |
| 7 | + set "MSBUILD=%PROGRAMS%\Microsoft Visual Studio\2017\%%e\MSBuild\15.0\Bin\MSBuild.exe" |
| 8 | + ) |
| 9 | +) |
| 10 | +if exist "%MSBUILD%" goto :build |
| 11 | +set MSBUILD= |
| 12 | +for %%i in (MSBuild.exe) do set MSBUILD=%%~dpnx$PATH:i |
| 13 | +if not defined MSBUILD goto :nomsbuild |
| 14 | +set MSBUILD_VERSION_MAJOR= |
| 15 | +set MSBUILD_VERSION_MINOR= |
| 16 | +for /f "delims=. tokens=1,2,3,4" %%m in ('msbuild /version /nologo') do ( |
| 17 | + set MSBUILD_VERSION_MAJOR=%%m |
| 18 | + set MSBUILD_VERSION_MINOR=%%n |
| 19 | +) |
| 20 | +if not defined MSBUILD_VERSION_MAJOR goto :nomsbuild |
| 21 | +if not defined MSBUILD_VERSION_MINOR goto :nomsbuild |
| 22 | +if %MSBUILD_VERSION_MAJOR% lss 15 goto :nomsbuild |
| 23 | +if %MSBUILD_VERSION_MINOR% lss 1 goto :nomsbuild |
| 24 | +:build |
| 25 | +"%MSBUILD%" %* |
| 26 | +goto :EOF |
| 27 | + |
| 28 | +:nomsbuild |
| 29 | +echo>&2 Microsoft Build Engine 15.1 is required to build the solution. For |
| 30 | +echo>&2 installation instructions, see: |
| 31 | +echo>&2 https://docs.microsoft.com/en-us/visualstudio/install/use-command-line-parameters-to-install-visual-studio |
| 32 | +echo>&2 At the very least, you will want to install the MSBuilt Tool workload |
| 33 | +echo>&2 that has the identifier "Microsoft.VisualStudio.Workload.MSBuildTools": |
| 34 | +echo>&2 https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-build-tools#msbuild-tools |
| 35 | +exit /b s |
0 commit comments