1
0

runprebuild.bat 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. @echo OFF
  2. bin\Prebuild.exe /target vs2015
  3. setlocal ENABLEEXTENSIONS
  4. set VALUE_NAME=MSBuildToolsPath
  5. rem try find vs2017
  6. if "%PROCESSOR_ARCHITECTURE%"=="x86" set PROGRAMS=%ProgramFiles%
  7. if defined ProgramFiles(x86) set PROGRAMS=%ProgramFiles(x86)%
  8. for %%e in (Enterprise Professional Community) do (
  9. if exist "%PROGRAMS%\Microsoft Visual Studio\2017\%%e\MSBuild\15.0\Bin\MSBuild.exe" (
  10. set ValueValue="%PROGRAMS%\Microsoft Visual Studio\2017\%%e\MSBuild\15.0\Bin\"
  11. goto :found
  12. )
  13. )
  14. rem We have to use grep or find to locate the correct line, because reg query spits
  15. rem out 4 lines before Windows 7 but 2 lines after Windows 7.
  16. rem We use grep if it's on the path; otherwise we use the built-in find command
  17. rem from Windows. (We must use grep on Cygwin because it overrides the "find" command.)
  18. for %%X in (grep.exe) do (set FOUNDGREP=%%~$PATH:X)
  19. if defined FOUNDGREP (
  20. set FINDCMD=grep
  21. ) else (
  22. set FINDCMD=find
  23. )
  24. rem try vs2015
  25. FOR /F "usebackq tokens=1-3" %%A IN (`REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0" /v %VALUE_NAME% 2^>nul ^| %FINDCMD% "%VALUE_NAME%"`) DO (
  26. set ValueValue=%%C
  27. goto :found
  28. )
  29. @echo msbuild for at least VS2015 not found, please install a (Community) edition of VS2017 or VS2015
  30. @echo Not creating compile.bat
  31. if exist "compile.bat" (
  32. del compile.bat
  33. )
  34. goto :done
  35. :found
  36. @echo Found msbuild at %ValueValue%
  37. @echo Creating compile.bat
  38. @echo %ValueValue%\msbuild opensim.sln > compile.bat
  39. :done