init.bat 700 B

123456789101112131415161718192021222324
  1. @echo off
  2. type build.logo
  3. echo finding Visual Studio...
  4. rem VS2017U2 contains vswhere.exe
  5. if "%VSWHERE%"=="" set "VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
  6. for /f "usebackq tokens=*" %%i in (`"%VSWHERE%" -latest -products * -requires Microsoft.Component.MSBuild -property installationPath`) do (
  7. set InstallDir=%%i
  8. )
  9. set MSBuildExe=MSBuild\Current\Bin\MSBuild.exe
  10. if exist "%InstallDir%\%MSBuildExe%" (
  11. echo ...
  12. ) else (
  13. set MSBuildExe=MSBuild\15.0\Bin\MSBuild.exe
  14. )
  15. if exist "%InstallDir%\%MSBuildExe%" (
  16. echo Studio found at "%InstallDir%"
  17. echo MSBuild found at "%InstallDir%\%MSBuildExe%"
  18. ) else (
  19. echo Error: No Visual Studio or MSBuild found.
  20. )