runprebuild.bat 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. @echo OFF
  2. bin\Prebuild.exe /target nant
  3. bin\Prebuild.exe /target vs2010
  4. setlocal ENABLEEXTENSIONS
  5. set KEY_NAME="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0"
  6. set VALUE_NAME=MSBuildToolsPath
  7. rem We have to use grep or find to locate the correct line, because reg query spits
  8. rem out 4 lines before Windows 7 but 2 lines after Windows 7.
  9. rem We use grep if it's on the path; otherwise we use the built-in find command
  10. rem from Windows. (We must use grep on Cygwin because it overrides the "find" command.)
  11. for %%X in (grep.exe) do (set FOUNDGREP=%%~$PATH:X)
  12. if defined FOUNDGREP (
  13. set FINDCMD=grep
  14. ) else (
  15. set FINDCMD=find
  16. )
  17. FOR /F "usebackq tokens=1-3" %%A IN (`REG QUERY %KEY_NAME% /v %VALUE_NAME% 2^>nul ^| %FINDCMD% "%VALUE_NAME%"`) DO (
  18. set ValueName=%%A
  19. set ValueType=%%B
  20. set ValueValue=%%C
  21. )
  22. if defined ValueName (
  23. @echo Found msbuild path registry entry
  24. @echo Value Name = %ValueName%
  25. @echo Value Type = %ValueType%
  26. @echo Value Value = %ValueValue%
  27. @echo Creating compile.bat
  28. @echo %ValueValue%\msbuild opensim.sln > compile.bat
  29. ) else (
  30. @echo %KEY_NAME%\%VALUE_NAME% not found.
  31. @echo Not creating compile.bat
  32. )