aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xrunprebuild.bat43
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
3bin\Prebuild.exe /target nant
4bin\Prebuild.exe /target vs2015 3bin\Prebuild.exe /target vs2015
5 4
6setlocal ENABLEEXTENSIONS 5setlocal ENABLEEXTENSIONS
7set KEY_NAME="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0"
8set VALUE_NAME=MSBuildToolsPath 6set VALUE_NAME=MSBuildToolsPath
9 7
8
9rem try find vs2017
10if "%PROCESSOR_ARCHITECTURE%"=="x86" set PROGRAMS=%ProgramFiles%
11if defined ProgramFiles(x86) set PROGRAMS=%ProgramFiles(x86)%
12
13for %%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
10rem We have to use grep or find to locate the correct line, because reg query spits 24rem We have to use grep or find to locate the correct line, because reg query spits
11rem out 4 lines before Windows 7 but 2 lines after Windows 7. 25rem out 4 lines before Windows 7 but 2 lines after Windows 7.
12rem We use grep if it's on the path; otherwise we use the built-in find command 26rem 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
22FOR /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 37for %%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
28if 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% 46exit
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)