From 0f16612400ed959146362810fb21d32656c9b844 Mon Sep 17 00:00:00 2001 From: justincc Date: Wed, 13 Nov 2013 00:00:55 +0000 Subject: [PATCH] Fix runprebuild.bat on Windows 7 systems and later MS changed Windows 7 "reg query" command to spit out fewer lines in its preamble Annoyingly there is no option to print raw values and not this preamble. So now using the Windows find command. But this has the side effect of stopping this working with Cygwin as it uses its own GNU find command. Might fix in the future but not simple since Windows find itself is in different locations --- runprebuild.bat | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/runprebuild.bat b/runprebuild.bat index 0fd7bbff4d..5f75982e79 100755 --- a/runprebuild.bat +++ b/runprebuild.bat @@ -7,18 +7,24 @@ setlocal ENABLEEXTENSIONS set KEY_NAME="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0" set VALUE_NAME=MSBuildToolsPath -FOR /F "usebackq skip=4 tokens=1-3" %%A IN (`REG QUERY %KEY_NAME% /v %VALUE_NAME% 2^>nul`) DO ( +rem We have to use find here as req query spits out 4 lines before Windows 7 +rem But 2 lines after Windows 7. Unfortunately, this screws up cygwin +rem as it uses its own find command. This could be fixed but it could be +rem complex to find the location of find on all windows systems +FOR /F "usebackq tokens=1-3" %%A IN (`REG QUERY %KEY_NAME% /v %VALUE_NAME% 2^>nul ^| FIND "%VALUE_NAME%"`) DO ( set ValueName=%%A set ValueType=%%B set ValueValue=%%C ) if defined ValueName ( + @echo Found msbuild path registry entry @echo Value Name = %ValueName% @echo Value Type = %ValueType% @echo Value Value = %ValueValue% + @echo Creating compile.bat + @echo %ValueValue%\msbuild opensim.sln > compile.bat ) else ( @echo %KEY_NAME%\%VALUE_NAME% not found. + @echo Not creating compile.bat ) - -@echo %ValueValue%\msbuild opensim.sln > compile.bat