diff --git a/qxldod/buildAll.bat b/qxldod/buildAll.bat new file mode 100755 index 0000000..eed3b82 --- /dev/null +++ b/qxldod/buildAll.bat @@ -0,0 +1,31 @@ +@echo off + +call clean.bat + +rem WIN8_64 +setlocal +if exist Install\win8\amd64 rmdir Install\win8\amd64 /s /q +call callVisualStudio.bat 11 qxldod.vcxproj /Rebuild "Win8 Release|x64" /Out buildfre_win8_amd64.log +mkdir .\Install\Win8\x64 +del /Q .\Install\Win8\x64\* +copy /Y objfre_win8_amd64\amd64\qxldod.sys .\Install\Win8\x64 +copy /Y objfre_win8_amd64\amd64\qxldod.inf .\Install\Win8\x64 +copy /Y objfre_win8_amd64\amd64\qxldod.cat .\Install\Win8\x64 +copy /Y objfre_win8_amd64\amd64\qxldod.pdb .\Install\Win8\x64 +endlocal +if %ERRORLEVEL% NEQ 0 goto :eof + +rem WIN8_32 +setlocal +if exist Install\win8\x86 rmdir Install\win8\x86 /s /q +call callVisualStudio.bat 11 qxldod.vcxproj /Rebuild "Win8 Release|Win32" /Out buildfre_win8_x86.log +mkdir .\Install\Win8\x86 +del /Q .\Install\Win8\x86\* +copy /Y objfre_win8_x86\i386\qxldod.sys .\Install\Win8\x86 +copy /Y objfre_win8_x86\i386\qxldod.inf .\Install\Win8\x86 +copy /Y objfre_win8_x86\i386\qxldod.cat .\Install\Win8\x86 +copy /Y objfre_win8_x86\i386\qxldod.pdb .\Install\Win8\x86 +endlocal +if %ERRORLEVEL% NEQ 0 goto :eof + +:eof diff --git a/qxldod/callVisualStudio.bat b/qxldod/callVisualStudio.bat new file mode 100755 index 0000000..769752d --- /dev/null +++ b/qxldod/callVisualStudio.bat @@ -0,0 +1,28 @@ +@echo off + +call %~dp0\checkWin8Tools.bat + +for /f "tokens=*" %%a in ( +'cscript.exe /nologo "%~dp0\getVisualStudioCmdLine.vbs" %*' +) do ( +set vs_cmd=%%a +) + +IF NOT DEFINED vs_cmd ( +echo Visual Studio not found +EXIT /b 1 +) + +SET vs_cmd_no_quotes="%vs_cmd:"=%" +IF "vs_cmd_no_quotes" == "" ( +echo Visual Studio not found +EXIT /b 2 +) + +call %vs_cmd% +if %ERRORLEVEL% GEQ 1 ( +echo Build with Visual Studio FAILED +exit /b %ERRORLEVEL% +) + +exit /b 0 diff --git a/qxldod/checkWin8Tools.bat b/qxldod/checkWin8Tools.bat new file mode 100755 index 0000000..c95d30b --- /dev/null +++ b/qxldod/checkWin8Tools.bat @@ -0,0 +1,16 @@ +@echo off + +reg query "HKLM\Software\Microsoft\Windows Kits\WDK" /v WDKProductVersion >nul 2>nul +if %ERRORLEVEL% EQU 0 goto checkVS11 +reg query "HKLM\Software\Wow6432Node\Microsoft\Windows Kits\WDK" /v WDKProductVersion > nul 2>nul +if %ERRORLEVEL% EQU 0 goto checkVS11 +echo ERROR building Win8 drivers: Win8 WDK is not installed +exit /b 1 + +:checkVS11 +reg query HKLM\Software\Microsoft\VisualStudio\11.0 /v InstallDir > nul 2>nul +if %ERRORLEVEL% EQU 0 exit /b 0 +reg query HKLM\Software\Wow6432Node\Microsoft\VisualStudio\11.0 /v InstallDir > nul 2>nul +if %ERRORLEVEL% EQU 0 exit /b 0 +echo ERROR building Win8 drivers: VS11 is not installed +exit /b 2 \ No newline at end of file diff --git a/qxldod/clean.bat b/qxldod/clean.bat new file mode 100755 index 0000000..83da6de --- /dev/null +++ b/qxldod/clean.bat @@ -0,0 +1,12 @@ +@echo on + +rmdir /S /Q .\Install + +rmdir /S /Q objfre_win8_x86 +rmdir /S /Q objfre_win8_amd64 +rmdir /S /Q objchk_win8_x86 +rmdir /S /Q objchk_win8_amd64 + +del /F *.log *.wrn *.err + + diff --git a/qxldod/getVisualStudioCmdLine.vbs b/qxldod/getVisualStudioCmdLine.vbs new file mode 100755 index 0000000..07939d0 --- /dev/null +++ b/qxldod/getVisualStudioCmdLine.vbs @@ -0,0 +1,28 @@ +' $1 - Visual studio version to run (10 or 11) +' $2 ... Parameters to pass + +Dim strCmdLine, strTemp +Set WshShell = Wscript.CreateObject("Wscript.Shell") + +On Error Resume Next +strCmdLine = WshShell.RegRead("HKLM\SOFTWARE\Microsoft\VisualStudio\" + Wscript.Arguments(0) + ".0\InstallDir") +' In case of error assume WoW64 case +If Err <> 0 Then + On Error Goto 0 + strCmdLine = WshShell.RegRead("HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\" + Wscript.Arguments(0) + ".0\InstallDir") +End If + +On Error Goto 0 +strCmdLine = chr(34) + strCmdLine + "devenv.com" + chr(34) +For i = 0 to (Wscript.Arguments.Count - 1) + If i > 0 Then + strTemp = Wscript.Arguments(i) + If InStr(strTemp, " ") Or InStr(strTemp, "|") Then + strCmdLine = strCmdLine + " " + chr(34) + strTemp + chr(34) + Else + strCmdLine = strCmdLine + " " + strTemp + End If + End If +Next + +WScript.Echo strCmdLine + vbCrLf