2
0

msbuild.cmd 941 B

1234567891011121314151617181920
  1. @REM check and set Visual Studio environment
  2. rem There is vswhere.exe starting VS2017U2
  3. if "%VSWHERE%"=="" set "VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
  4. rem Use %ProgramFiles% in a 32-bit program prior to Windows 10)
  5. If Not Exist "%VSWHERE%" set "VSWHERE=%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe"
  6. If Not Exist "%VSWHERE%" (
  7. echo "WARNING: Can't find vswhere.exe. It is a part of VS 2017 version 15.2 or later. Trying known path..."
  8. set "InstallDir=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"
  9. ) ELSE (
  10. for /f "usebackq tokens=*" %%i in (`"%VSWHERE%" -latest -products * -requires Microsoft.Component.MSBuild -property installationPath`) do (
  11. set InstallDir=%%i
  12. )
  13. )
  14. echo Install dir is "%InstallDir%"
  15. if exist "%InstallDir%\MSBuild\Current\Bin\MSBuild.exe" (
  16. set msbuild="%InstallDir%\MSBuild\Current\Bin\MSBuild.exe"
  17. )