set BUILDX86=
set BUILDX64=
set BUILDDOC=
-set BUILDTEST=--test-marker
+set BUILDTEST=
set BUILDPACK=
set REBUILD=
if "%~1" EQU "-x64" (set BUILDX64=1) && shift && goto CheckOpts
if "%~1" EQU "--doc" (set BUILDDOC=1) && shift && goto CheckOpts
if "%~1" EQU "--no-test-marker" (set BUILDTEST=) && shift && goto CheckOpts
+if "%~1" EQU "--test-marker" (set BUILDTEST=--test-marker) && shift && goto CheckOpts
if "%~1" EQU "--pack" (set BUILDPACK=1) && shift && goto CheckOpts
if "%~1" EQU "-r" (set REBUILD=-r) && shift && goto CheckOpts
exit /B 0
:Help
-echo build.bat [-x86] [-x64] [--doc] [-h] [--no-test-marker] [--pack] [-r]
+echo build.bat [-x86] [-x64] [--doc] [-h] [--test-marker] [--pack] [-r]
echo.
echo -x86 Build x86 installers
echo -x64 Build x64 installers
echo --doc Build CHM documentation
-echo --no-test-marker Build without test markers
+echo --test-marker Build with test markers
+echo --no-test-marker Build without test markers (default)
echo --pack Embed core MSIs into installer
echo -r Rebuild rather than incremental build
LOC_STRING *pLocString = nullptr;
if (IsWindowsServer()) {
- if (IsWindowsVersionOrGreater(6, 1, 1)) {
- BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Target OS is Windows Server 2008 R2 or later");
+ if (IsWindowsVersionOrGreater(6, 2, 0)) {
+ BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Target OS is Windows Server 2012 or later");
return;
+ } else if (IsWindowsVersionOrGreater(6, 1, 1)) {
+ HMODULE hKernel32 = GetModuleHandleW(L"kernel32");
+ if (hKernel32 && !GetProcAddress(hKernel32, "AddDllDirectory")) {
+ BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows Server 2008 R2 without KB2533625");
+ BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "KB2533625 update is required to continue.");
+ /* The "MissingSP1" error also specifies updates are required */
+ LocGetString(_wixLoc, L"#(loc.FailureWS2K8R2MissingSP1)", &pLocString);
+ } else {
+ BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Target OS is Windows Server 2008 R2 or later");
+ return;
+ }
} else if (IsWindowsVersionOrGreater(6, 1, 0)) {
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows Server 2008 R2");
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Service Pack 1 is required to continue installation");
LocGetString(_wixLoc, L"#(loc.FailureWS2K3OrEarlier)", &pLocString);
}
} else {
- if (IsWindows7SP1OrGreater()) {
- BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Target OS is Windows 7 SP1 or later");
+ if (IsWindows8OrGreater()) {
+ BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Target OS is Windows 8 or later");
return;
+ } else if (IsWindows7SP1OrGreater()) {
+ HMODULE hKernel32 = GetModuleHandleW(L"kernel32");
+ if (hKernel32 && !GetProcAddress(hKernel32, "AddDllDirectory")) {
+ BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows 7 SP1 without KB2533625");
+ BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "KB2533625 update is required to continue.");
+ /* The "MissingSP1" error also specifies updates are required */
+ LocGetString(_wixLoc, L"#(loc.FailureWin7MissingSP1)", &pLocString);
+ } else {
+ BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Target OS is Windows 7 SP1 or later");
+ return;
+ }
} else if (IsWindows7OrGreater()) {
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Detected Windows 7 RTM");
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Service Pack 1 is required to continue installation");