diff options
-rwxr-xr-x | runprebuild.bat | 43 |
1 files changed, 28 insertions, 15 deletions
diff --git a/runprebuild.bat b/runprebuild.bat index af56ee8..78ac8dc 100755 --- a/runprebuild.bat +++ b/runprebuild.bat | |||
@@ -1,12 +1,26 @@ | |||
1 | @echo OFF | 1 | @echo OFF |
2 | 2 | ||
3 | bin\Prebuild.exe /target nant | ||
4 | bin\Prebuild.exe /target vs2015 | 3 | bin\Prebuild.exe /target vs2015 |
5 | 4 | ||
6 | setlocal ENABLEEXTENSIONS | 5 | setlocal ENABLEEXTENSIONS |
7 | set KEY_NAME="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0" | ||
8 | set VALUE_NAME=MSBuildToolsPath | 6 | set VALUE_NAME=MSBuildToolsPath |
9 | 7 | ||
8 | |||
9 | rem try find vs2017 | ||
10 | if "%PROCESSOR_ARCHITECTURE%"=="x86" set PROGRAMS=%ProgramFiles% | ||
11 | if defined ProgramFiles(x86) set PROGRAMS=%ProgramFiles(x86)% | ||
12 | |||
13 | for %%e in (Enterprise Professional Community) do ( | ||
14 | |||
15 | if exist "%PROGRAMS%\Microsoft Visual Studio\2017\%%e\MSBuild\15.0\Bin\MSBuild.exe" ( | ||
16 | |||
17 | set ValueValue="%PROGRAMS%\Microsoft Visual Studio\2017\%%e\MSBuild\15.0\Bin\" | ||
18 | goto :found | ||
19 | ) | ||
20 | |||
21 | ) | ||
22 | |||
23 | |||
10 | rem We have to use grep or find to locate the correct line, because reg query spits | 24 | rem We have to use grep or find to locate the correct line, because reg query spits |
11 | rem out 4 lines before Windows 7 but 2 lines after Windows 7. | 25 | rem out 4 lines before Windows 7 but 2 lines after Windows 7. |
12 | rem We use grep if it's on the path; otherwise we use the built-in find command | 26 | rem We use grep if it's on the path; otherwise we use the built-in find command |
@@ -19,20 +33,19 @@ if defined FOUNDGREP ( | |||
19 | set FINDCMD=find | 33 | set FINDCMD=find |
20 | ) | 34 | ) |
21 | 35 | ||
22 | FOR /F "usebackq tokens=1-3" %%A IN (`REG QUERY %KEY_NAME% /v %VALUE_NAME% 2^>nul ^| %FINDCMD% "%VALUE_NAME%"`) DO ( | 36 | |
23 | set ValueName=%%A | 37 | for %%v in (14.0, 12.0, 4.0) do ( |
24 | set ValueType=%%B | 38 | FOR /F "usebackq tokens=1-3" %%A IN (`REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\%%v" /v %VALUE_NAME% 2^>nul ^| %FINDCMD% "%VALUE_NAME%"`) DO ( |
25 | set ValueValue=%%C | 39 | set ValueValue=%%C |
40 | goto :found | ||
41 | ) | ||
26 | ) | 42 | ) |
27 | 43 | ||
28 | if defined ValueName ( | 44 | @echo %KEY_NAME%\%VALUE_NAME% not found. |
29 | @echo Found msbuild path registry entry | 45 | @echo Not creating compile.bat |
30 | @echo Value Name = %ValueName% | 46 | exit |
31 | @echo Value Type = %ValueType% | 47 | |
32 | @echo Value Value = %ValueValue% | 48 | :found |
49 | @echo Found msbuild at %ValueValue% | ||
33 | @echo Creating compile.bat | 50 | @echo Creating compile.bat |
34 | @echo %ValueValue%\msbuild opensim.sln > compile.bat | 51 | @echo %ValueValue%\msbuild opensim.sln > compile.bat |
35 | ) else ( | ||
36 | @echo %KEY_NAME%\%VALUE_NAME% not found. | ||
37 | @echo Not creating compile.bat | ||
38 | ) | ||