aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/runprebuild.bat
diff options
context:
space:
mode:
Diffstat (limited to 'runprebuild.bat')
-rwxr-xr-xrunprebuild.bat23
1 files changed, 15 insertions, 8 deletions
diff --git a/runprebuild.bat b/runprebuild.bat
index e2b6832..0bee6f5 100755
--- a/runprebuild.bat
+++ b/runprebuild.bat
@@ -5,22 +5,27 @@ bin\Prebuild.exe /target vs2015
5setlocal ENABLEEXTENSIONS 5setlocal ENABLEEXTENSIONS
6set VALUE_NAME=MSBuildToolsPath 6set VALUE_NAME=MSBuildToolsPath
7 7
8
9rem try find vs2017
10if "%PROCESSOR_ARCHITECTURE%"=="x86" set PROGRAMS=%ProgramFiles% 8if "%PROCESSOR_ARCHITECTURE%"=="x86" set PROGRAMS=%ProgramFiles%
11if defined ProgramFiles(x86) set PROGRAMS=%ProgramFiles(x86)% 9if defined ProgramFiles(x86) set PROGRAMS=%ProgramFiles(x86)%
12 10
11rem Try to find VS2019
13for %%e in (Enterprise Professional Community) do ( 12for %%e in (Enterprise Professional Community) do (
13 if exist "%PROGRAMS%\Microsoft Visual Studio\2019\%%e\MSBuild\Current\Bin\MSBuild.exe" (
14
15 set ValueValue="%PROGRAMS%\Microsoft Visual Studio\2019\%%e\MSBuild\Current\Bin\MSBuild"
16 goto :found
17 )
18)
14 19
20rem try find vs2017
21for %%e in (Enterprise Professional Community) do (
15 if exist "%PROGRAMS%\Microsoft Visual Studio\2017\%%e\MSBuild\15.0\Bin\MSBuild.exe" ( 22 if exist "%PROGRAMS%\Microsoft Visual Studio\2017\%%e\MSBuild\15.0\Bin\MSBuild.exe" (
16 23
17 set ValueValue="%PROGRAMS%\Microsoft Visual Studio\2017\%%e\MSBuild\15.0\Bin\" 24 set ValueValue="%PROGRAMS%\Microsoft Visual Studio\2017\%%e\MSBuild\15.0\Bin\MSBuild"
18 goto :found 25 goto :found
19 ) 26 )
20
21) 27)
22 28
23
24rem We have to use grep or find to locate the correct line, because reg query spits 29rem We have to use grep or find to locate the correct line, because reg query spits
25rem out 4 lines before Windows 7 but 2 lines after Windows 7. 30rem out 4 lines before Windows 7 but 2 lines after Windows 7.
26rem We use grep if it's on the path; otherwise we use the built-in find command 31rem We use grep if it's on the path; otherwise we use the built-in find command
@@ -35,7 +40,7 @@ if defined FOUNDGREP (
35 40
36rem try vs2015 41rem try vs2015
37FOR /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 ( 42FOR /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 (
38 set ValueValue=%%C 43 set ValueValue=%%C\msbuild
39 goto :found 44 goto :found
40) 45)
41 46
@@ -49,6 +54,8 @@ goto :done
49:found 54:found
50 @echo Found msbuild at %ValueValue% 55 @echo Found msbuild at %ValueValue%
51 @echo Creating compile.bat 56 @echo Creating compile.bat
52 @echo %ValueValue%\msbuild opensim.sln > compile.bat 57rem To compile in debug mode
53 58 @echo %ValueValue% opensim.sln > compile.bat
59rem To compile in release mode comment line (add rem to start) above and uncomment next (remove rem)
60rem @echo %ValueValue% /P:Config=Release opensim.sln > compile.bat
54:done \ No newline at end of file 61:done \ No newline at end of file