aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2022-03-16 15:20:15 -0500
committerSean Hall <r.sean.hall@gmail.com>2022-03-16 20:14:37 -0500
commit8c9ca787bee29f969cd7ca9aeaa46626d557d196 (patch)
tree8a7278a4035b584e1f1585e3215766af3ca0a62b
parentc1694843f7c54c7f9feb3f7074a31ff8499c9644 (diff)
downloadwix-8c9ca787bee29f969cd7ca9aeaa46626d557d196.tar.gz
wix-8c9ca787bee29f969cd7ca9aeaa46626d557d196.tar.bz2
wix-8c9ca787bee29f969cd7ca9aeaa46626d557d196.zip
Add WixBundleCommandLineAction, don't set dynamic variables at startup.
Fixes 6736
-rw-r--r--src/burn/engine/core.cpp10
-rw-r--r--src/burn/engine/core.h1
-rw-r--r--src/burn/engine/engine.cpp4
-rw-r--r--src/burn/engine/plan.cpp3
-rw-r--r--src/burn/engine/plan.h1
-rw-r--r--src/burn/engine/registration.cpp3
-rw-r--r--src/burn/engine/variable.cpp1
-rw-r--r--src/burn/test/BurnUnitTest/PlanTest.cpp2
-rw-r--r--src/burn/test/BurnUnitTest/RegistrationTest.cpp7
-rw-r--r--src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp103
-rw-r--r--src/wix/WixToolset.Core/CompilerCore.cs1
11 files changed, 78 insertions, 58 deletions
diff --git a/src/burn/engine/core.cpp b/src/burn/engine/core.cpp
index 37872e52..becece86 100644
--- a/src/burn/engine/core.cpp
+++ b/src/burn/engine/core.cpp
@@ -309,7 +309,7 @@ extern "C" HRESULT CoreDetect(
309 pEngineState->fDetected = FALSE; 309 pEngineState->fDetected = FALSE;
310 pEngineState->fPlanned = FALSE; 310 pEngineState->fPlanned = FALSE;
311 DetectReset(&pEngineState->registration, &pEngineState->packages); 311 DetectReset(&pEngineState->registration, &pEngineState->packages);
312 PlanReset(&pEngineState->plan, &pEngineState->containers, &pEngineState->packages, &pEngineState->layoutPayloads); 312 PlanReset(&pEngineState->plan, &pEngineState->variables, &pEngineState->containers, &pEngineState->packages, &pEngineState->layoutPayloads);
313 313
314 hr = RegistrationSetDynamicVariables(&pEngineState->registration, &pEngineState->variables); 314 hr = RegistrationSetDynamicVariables(&pEngineState->registration, &pEngineState->variables);
315 ExitOnFailure(hr, "Failed to reset the dynamic registration variables during detect."); 315 ExitOnFailure(hr, "Failed to reset the dynamic registration variables during detect.");
@@ -441,6 +441,9 @@ extern "C" HRESULT CorePlan(
441 BURN_PACKAGE* pForwardCompatibleBundlePackage = NULL; 441 BURN_PACKAGE* pForwardCompatibleBundlePackage = NULL;
442 BOOL fContinuePlanning = TRUE; // assume we won't skip planning due to dependencies. 442 BOOL fContinuePlanning = TRUE; // assume we won't skip planning due to dependencies.
443 443
444 hr = PlanSetVariables(action, &pEngineState->variables);
445 ExitOnFailure(hr, "Failed to update action.");
446
444 LogId(REPORT_STANDARD, MSG_PLAN_BEGIN, pEngineState->packages.cPackages, LoggingBurnActionToString(action)); 447 LogId(REPORT_STANDARD, MSG_PLAN_BEGIN, pEngineState->packages.cPackages, LoggingBurnActionToString(action));
445 448
446 fPlanBegan = TRUE; 449 fPlanBegan = TRUE;
@@ -458,7 +461,7 @@ extern "C" HRESULT CorePlan(
458 461
459 // Always reset the plan. 462 // Always reset the plan.
460 pEngineState->fPlanned = FALSE; 463 pEngineState->fPlanned = FALSE;
461 PlanReset(&pEngineState->plan, &pEngineState->containers, &pEngineState->packages, &pEngineState->layoutPayloads); 464 PlanReset(&pEngineState->plan, &pEngineState->variables, &pEngineState->containers, &pEngineState->packages, &pEngineState->layoutPayloads);
462 465
463 // Remember the overall action state in the plan since it shapes the changes 466 // Remember the overall action state in the plan since it shapes the changes
464 // we make everywhere. 467 // we make everywhere.
@@ -472,9 +475,6 @@ extern "C" HRESULT CorePlan(
472 pEngineState->plan.fDisableRollback = pEngineState->fDisableRollback || BOOTSTRAPPER_ACTION_UNSAFE_UNINSTALL == pEngineState->plan.action; 475 pEngineState->plan.fDisableRollback = pEngineState->fDisableRollback || BOOTSTRAPPER_ACTION_UNSAFE_UNINSTALL == pEngineState->plan.action;
473 pEngineState->plan.fPlanPackageCacheRollback = BOOTSTRAPPER_REGISTRATION_TYPE_NONE == pEngineState->registration.detectedRegistrationType; 476 pEngineState->plan.fPlanPackageCacheRollback = BOOTSTRAPPER_REGISTRATION_TYPE_NONE == pEngineState->registration.detectedRegistrationType;
474 477
475 hr = PlanSetVariables(action, &pEngineState->variables);
476 ExitOnFailure(hr, "Failed to update action.");
477
478 // Set resume commandline 478 // Set resume commandline
479 hr = PlanSetResumeCommand(&pEngineState->plan, &pEngineState->registration, &pEngineState->log); 479 hr = PlanSetResumeCommand(&pEngineState->plan, &pEngineState->registration, &pEngineState->log);
480 ExitOnFailure(hr, "Failed to set resume command"); 480 ExitOnFailure(hr, "Failed to set resume command");
diff --git a/src/burn/engine/core.h b/src/burn/engine/core.h
index ff983d60..6ba1aa2a 100644
--- a/src/burn/engine/core.h
+++ b/src/burn/engine/core.h
@@ -37,6 +37,7 @@ const LPCWSTR BURN_COMMANDLINE_SWITCH_PREFIX = L"burn.";
37const LPCWSTR BURN_BUNDLE_LAYOUT_DIRECTORY = L"WixBundleLayoutDirectory"; 37const LPCWSTR BURN_BUNDLE_LAYOUT_DIRECTORY = L"WixBundleLayoutDirectory";
38const LPCWSTR BURN_BUNDLE_ACTION = L"WixBundleAction"; 38const LPCWSTR BURN_BUNDLE_ACTION = L"WixBundleAction";
39const LPCWSTR BURN_BUNDLE_ACTIVE_PARENT = L"WixBundleActiveParent"; 39const LPCWSTR BURN_BUNDLE_ACTIVE_PARENT = L"WixBundleActiveParent";
40const LPCWSTR BURN_BUNDLE_COMMAND_LINE_ACTION = L"WixBundleCommandLineAction";
40const LPCWSTR BURN_BUNDLE_EXECUTE_PACKAGE_CACHE_FOLDER = L"WixBundleExecutePackageCacheFolder"; 41const LPCWSTR BURN_BUNDLE_EXECUTE_PACKAGE_CACHE_FOLDER = L"WixBundleExecutePackageCacheFolder";
41const LPCWSTR BURN_BUNDLE_EXECUTE_PACKAGE_ACTION = L"WixBundleExecutePackageAction"; 42const LPCWSTR BURN_BUNDLE_EXECUTE_PACKAGE_ACTION = L"WixBundleExecutePackageAction";
42const LPCWSTR BURN_BUNDLE_FORCED_RESTART_PACKAGE = L"WixBundleForcedRestartPackage"; 43const LPCWSTR BURN_BUNDLE_FORCED_RESTART_PACKAGE = L"WixBundleForcedRestartPackage";
diff --git a/src/burn/engine/engine.cpp b/src/burn/engine/engine.cpp
index 1f2dac3c..9b94552b 100644
--- a/src/burn/engine/engine.cpp
+++ b/src/burn/engine/engine.cpp
@@ -557,8 +557,8 @@ static HRESULT RunNormal(
557 hr = S_OK; 557 hr = S_OK;
558 558
559 // Set some built-in variables before loading the BA. 559 // Set some built-in variables before loading the BA.
560 hr = PlanSetVariables(pEngineState->command.action, &pEngineState->variables); 560 hr = VariableSetNumeric(&pEngineState->variables, BURN_BUNDLE_COMMAND_LINE_ACTION, pEngineState->command.action, TRUE);
561 ExitOnFailure(hr, "Failed to set action variables."); 561 ExitOnFailure(hr, "Failed to set command line action variable.");
562 562
563 hr = RegistrationSetVariables(&pEngineState->registration, &pEngineState->variables); 563 hr = RegistrationSetVariables(&pEngineState->registration, &pEngineState->variables);
564 ExitOnFailure(hr, "Failed to set registration variables."); 564 ExitOnFailure(hr, "Failed to set registration variables.");
diff --git a/src/burn/engine/plan.cpp b/src/burn/engine/plan.cpp
index 46680636..5e1d2654 100644
--- a/src/burn/engine/plan.cpp
+++ b/src/burn/engine/plan.cpp
@@ -147,6 +147,7 @@ static BOOL ForceCache(
147 147
148extern "C" void PlanReset( 148extern "C" void PlanReset(
149 __in BURN_PLAN* pPlan, 149 __in BURN_PLAN* pPlan,
150 __in BURN_VARIABLES* pVariables,
150 __in BURN_CONTAINERS* pContainers, 151 __in BURN_CONTAINERS* pContainers,
151 __in BURN_PACKAGES* pPackages, 152 __in BURN_PACKAGES* pPackages,
152 __in BURN_PAYLOAD_GROUP* pLayoutPayloads 153 __in BURN_PAYLOAD_GROUP* pLayoutPayloads
@@ -274,6 +275,8 @@ extern "C" void PlanReset(
274 ResetPlannedRollbackBoundaryState(&pPackages->rgRollbackBoundaries[i]); 275 ResetPlannedRollbackBoundaryState(&pPackages->rgRollbackBoundaries[i]);
275 } 276 }
276 } 277 }
278
279 PlanSetVariables(BOOTSTRAPPER_ACTION_UNKNOWN, pVariables);
277} 280}
278 281
279extern "C" void PlanUninitializeExecuteAction( 282extern "C" void PlanUninitializeExecuteAction(
diff --git a/src/burn/engine/plan.h b/src/burn/engine/plan.h
index e73cbcfa..834d2567 100644
--- a/src/burn/engine/plan.h
+++ b/src/burn/engine/plan.h
@@ -306,6 +306,7 @@ typedef struct _BURN_PLAN
306 306
307void PlanReset( 307void PlanReset(
308 __in BURN_PLAN* pPlan, 308 __in BURN_PLAN* pPlan,
309 __in BURN_VARIABLES* pVariables,
309 __in BURN_CONTAINERS* pContainers, 310 __in BURN_CONTAINERS* pContainers,
310 __in BURN_PACKAGES* pPackages, 311 __in BURN_PACKAGES* pPackages,
311 __in BURN_PAYLOAD_GROUP* pLayoutPayloads 312 __in BURN_PAYLOAD_GROUP* pLayoutPayloads
diff --git a/src/burn/engine/registration.cpp b/src/burn/engine/registration.cpp
index 6bae2e7b..a65c30d3 100644
--- a/src/burn/engine/registration.cpp
+++ b/src/burn/engine/registration.cpp
@@ -445,9 +445,6 @@ extern "C" HRESULT RegistrationSetVariables(
445 HRESULT hr = S_OK; 445 HRESULT hr = S_OK;
446 LPWSTR scz = NULL; 446 LPWSTR scz = NULL;
447 447
448 hr = RegistrationSetDynamicVariables(pRegistration, pVariables);
449 ExitOnFailure(hr, "Failed to set the dynamic registration variables.");
450
451 // Ensure the registration bundle name is updated. 448 // Ensure the registration bundle name is updated.
452 hr = GetBundleInProgressName(pRegistration, pVariables, &scz); 449 hr = GetBundleInProgressName(pRegistration, pVariables, &scz);
453 ExitOnFailure(hr, "Failed to initialize bundle name."); 450 ExitOnFailure(hr, "Failed to initialize bundle name.");
diff --git a/src/burn/engine/variable.cpp b/src/burn/engine/variable.cpp
index ae06c1d5..718751e5 100644
--- a/src/burn/engine/variable.cpp
+++ b/src/burn/engine/variable.cpp
@@ -268,6 +268,7 @@ extern "C" HRESULT VariableInitialize(
268 {L"WindowsFolder", InitializeVariableCsidlFolder, CSIDL_WINDOWS}, 268 {L"WindowsFolder", InitializeVariableCsidlFolder, CSIDL_WINDOWS},
269 {L"WindowsVolume", InitializeVariableWindowsVolumeFolder, 0}, 269 {L"WindowsVolume", InitializeVariableWindowsVolumeFolder, 0},
270 {BURN_BUNDLE_ACTION, InitializeVariableNumeric, 0, FALSE, TRUE}, 270 {BURN_BUNDLE_ACTION, InitializeVariableNumeric, 0, FALSE, TRUE},
271 {BURN_BUNDLE_COMMAND_LINE_ACTION, InitializeVariableNumeric, 0, FALSE, TRUE},
271 {BURN_BUNDLE_EXECUTE_PACKAGE_CACHE_FOLDER, InitializeVariableString, NULL, FALSE, TRUE}, 272 {BURN_BUNDLE_EXECUTE_PACKAGE_CACHE_FOLDER, InitializeVariableString, NULL, FALSE, TRUE},
272 {BURN_BUNDLE_EXECUTE_PACKAGE_ACTION, InitializeVariableString, NULL, FALSE, TRUE}, 273 {BURN_BUNDLE_EXECUTE_PACKAGE_ACTION, InitializeVariableString, NULL, FALSE, TRUE},
273 {BURN_BUNDLE_FORCED_RESTART_PACKAGE, InitializeVariableString, NULL, TRUE, TRUE}, 274 {BURN_BUNDLE_FORCED_RESTART_PACKAGE, InitializeVariableString, NULL, TRUE, TRUE},
diff --git a/src/burn/test/BurnUnitTest/PlanTest.cpp b/src/burn/test/BurnUnitTest/PlanTest.cpp
index 0a8ac369..4d726fb4 100644
--- a/src/burn/test/BurnUnitTest/PlanTest.cpp
+++ b/src/burn/test/BurnUnitTest/PlanTest.cpp
@@ -2040,7 +2040,7 @@ namespace Bootstrapper
2040 void PlanTestDetect(BURN_ENGINE_STATE* pEngineState) 2040 void PlanTestDetect(BURN_ENGINE_STATE* pEngineState)
2041 { 2041 {
2042 DetectReset(&pEngineState->registration, &pEngineState->packages); 2042 DetectReset(&pEngineState->registration, &pEngineState->packages);
2043 PlanReset(&pEngineState->plan, &pEngineState->containers, &pEngineState->packages, &pEngineState->layoutPayloads); 2043 PlanReset(&pEngineState->plan, &pEngineState->variables, &pEngineState->containers, &pEngineState->packages, &pEngineState->layoutPayloads);
2044 2044
2045 pEngineState->userExperience.fEngineActive = TRUE; 2045 pEngineState->userExperience.fEngineActive = TRUE;
2046 pEngineState->fDetected = TRUE; 2046 pEngineState->fDetected = TRUE;
diff --git a/src/burn/test/BurnUnitTest/RegistrationTest.cpp b/src/burn/test/BurnUnitTest/RegistrationTest.cpp
index 86ea86b0..f01d92a4 100644
--- a/src/burn/test/BurnUnitTest/RegistrationTest.cpp
+++ b/src/burn/test/BurnUnitTest/RegistrationTest.cpp
@@ -313,6 +313,9 @@ namespace Bootstrapper
313 plan.pCommand = &command; 313 plan.pCommand = &command;
314 plan.pInternalCommand = &internalCommand; 314 plan.pInternalCommand = &internalCommand;
315 315
316 hr = RegistrationSetVariables(&registration, &variables);
317 TestThrowOnFailure(hr, L"Failed to set registration variables.");
318
316 hr = PlanSetResumeCommand(&plan, &registration, &logging); 319 hr = PlanSetResumeCommand(&plan, &registration, &logging);
317 TestThrowOnFailure(hr, L"Failed to set registration resume command."); 320 TestThrowOnFailure(hr, L"Failed to set registration resume command.");
318 321
@@ -339,8 +342,8 @@ namespace Bootstrapper
339 this->ValidateUninstallKeyDisplayName(L"Product1"); 342 this->ValidateUninstallKeyDisplayName(L"Product1");
340 registration.detectedRegistrationType = BOOTSTRAPPER_REGISTRATION_TYPE_FULL; 343 registration.detectedRegistrationType = BOOTSTRAPPER_REGISTRATION_TYPE_FULL;
341 344
342 hr = RegistrationSetVariables(&registration, &variables); 345 hr = RegistrationSetDynamicVariables(&registration, &variables);
343 TestThrowOnFailure(hr, L"Failed to set registration variables."); 346 TestThrowOnFailure(hr, L"Failed to set dynamic registration variables.");
344 347
345 Assert::Equal(1ll, VariableGetNumericHelper(&variables, BURN_BUNDLE_INSTALLED)); 348 Assert::Equal(1ll, VariableGetNumericHelper(&variables, BURN_BUNDLE_INSTALLED));
346 Assert::Equal<String^>(gcnew String(L"foo"), VariableGetStringHelper(&variables, BURN_BUNDLE_TAG)); 349 Assert::Equal<String^>(gcnew String(L"foo"), VariableGetStringHelper(&variables, BURN_BUNDLE_TAG));
diff --git a/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp b/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp
index 2a5d839a..84e32867 100644
--- a/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp
+++ b/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp
@@ -242,6 +242,60 @@ public: // IBootstrapperApplication
242 return hr; 242 return hr;
243 } 243 }
244 244
245 virtual STDMETHODIMP OnDetectBegin(
246 __in BOOL fCached,
247 __in BOOTSTRAPPER_REGISTRATION_TYPE registrationType,
248 __in DWORD cPackages,
249 __inout BOOL* pfCancel
250 )
251 {
252 HRESULT hr = S_OK;
253 BOOL fInstalled = BOOTSTRAPPER_REGISTRATION_TYPE_FULL == registrationType;
254
255 if (m_fPrereq)
256 {
257 // Pre-req BA should only show help or do an install (to launch the Managed BA which can then do the right action).
258 if (BOOTSTRAPPER_ACTION_HELP != m_command.action)
259 {
260 m_command.action = BOOTSTRAPPER_ACTION_INSTALL;
261 }
262 }
263 else // maybe modify the action state if the bundle is or is not already installed.
264 {
265 if (fInstalled && BOOTSTRAPPER_RESUME_TYPE_REBOOT != m_command.resumeType && BOOTSTRAPPER_ACTION_INSTALL == m_command.action)
266 {
267 m_command.action = BOOTSTRAPPER_ACTION_MODIFY;
268 }
269 else if (!fInstalled && (BOOTSTRAPPER_ACTION_MODIFY == m_command.action || BOOTSTRAPPER_ACTION_REPAIR == m_command.action))
270 {
271 m_command.action = BOOTSTRAPPER_ACTION_INSTALL;
272 }
273 }
274
275 // When resuming from restart doing some install-like operation, try to find the package that forced the
276 // restart. We'll use this information during planning.
277 if (BOOTSTRAPPER_RESUME_TYPE_REBOOT == m_command.resumeType && BOOTSTRAPPER_ACTION_UNINSTALL < m_command.action)
278 {
279 // Ensure the forced restart package variable is null when it is an empty string.
280 hr = BalGetStringVariable(L"WixBundleForcedRestartPackage", &m_sczAfterForcedRestartPackage);
281 if (FAILED(hr) || !m_sczAfterForcedRestartPackage || !*m_sczAfterForcedRestartPackage)
282 {
283 ReleaseNullStr(m_sczAfterForcedRestartPackage);
284 }
285
286 hr = S_OK;
287 }
288
289 // If the UI should be visible, display it now and hide the splash screen
290 if (BOOTSTRAPPER_DISPLAY_NONE < m_command.display)
291 {
292 ::ShowWindow(m_pTheme->hwndParent, SW_SHOW);
293 }
294
295 m_pEngine->CloseSplashScreen();
296
297 return __super::OnDetectBegin(fCached, registrationType, cPackages, pfCancel);
298 }
245 299
246 virtual STDMETHODIMP OnDetectRelatedBundle( 300 virtual STDMETHODIMP OnDetectRelatedBundle(
247 __in LPCWSTR wzBundleId, 301 __in LPCWSTR wzBundleId,
@@ -2123,7 +2177,6 @@ public: //CBalBaseBootstrapperApplication
2123 ) 2177 )
2124 { 2178 {
2125 HRESULT hr = S_OK; 2179 HRESULT hr = S_OK;
2126 LONGLONG llInstalled = 0;
2127 2180
2128 hr = __super::Initialize(pCreateArgs); 2181 hr = __super::Initialize(pCreateArgs);
2129 BalExitOnFailure(hr, "CBalBaseBootstrapperApplication initialization failed."); 2182 BalExitOnFailure(hr, "CBalBaseBootstrapperApplication initialization failed.");
@@ -2132,39 +2185,6 @@ public: //CBalBaseBootstrapperApplication
2132 memcpy_s(&m_createArgs, sizeof(m_createArgs), pCreateArgs, sizeof(BOOTSTRAPPER_CREATE_ARGS)); 2185 memcpy_s(&m_createArgs, sizeof(m_createArgs), pCreateArgs, sizeof(BOOTSTRAPPER_CREATE_ARGS));
2133 m_createArgs.pCommand = &m_command; 2186 m_createArgs.pCommand = &m_command;
2134 2187
2135 if (m_fPrereq)
2136 {
2137 // Pre-req BA should only show help or do an install (to launch the Managed BA which can then do the right action).
2138 if (BOOTSTRAPPER_ACTION_HELP != m_command.action)
2139 {
2140 m_command.action = BOOTSTRAPPER_ACTION_INSTALL;
2141 }
2142 }
2143 else // maybe modify the action state if the bundle is or is not already installed.
2144 {
2145 hr = BalGetNumericVariable(L"WixBundleInstalled", &llInstalled);
2146 if (SUCCEEDED(hr) && BOOTSTRAPPER_RESUME_TYPE_REBOOT != m_command.resumeType && llInstalled && BOOTSTRAPPER_ACTION_INSTALL == m_command.action)
2147 {
2148 m_command.action = BOOTSTRAPPER_ACTION_MODIFY;
2149 }
2150 else if (!llInstalled && (BOOTSTRAPPER_ACTION_MODIFY == m_command.action || BOOTSTRAPPER_ACTION_REPAIR == m_command.action))
2151 {
2152 m_command.action = BOOTSTRAPPER_ACTION_INSTALL;
2153 }
2154 }
2155
2156 // When resuming from restart doing some install-like operation, try to find the package that forced the
2157 // restart. We'll use this information during planning.
2158 if (BOOTSTRAPPER_RESUME_TYPE_REBOOT == m_command.resumeType && BOOTSTRAPPER_ACTION_UNINSTALL < m_command.action)
2159 {
2160 // Ensure the forced restart package variable is null when it is an empty string.
2161 hr = BalGetStringVariable(L"WixBundleForcedRestartPackage", &m_sczAfterForcedRestartPackage);
2162 if (FAILED(hr) || !m_sczAfterForcedRestartPackage || !*m_sczAfterForcedRestartPackage)
2163 {
2164 ReleaseNullStr(m_sczAfterForcedRestartPackage);
2165 }
2166 }
2167
2168 hr = BalGetStringVariable(L"WixBundleVersion", &m_sczBundleVersion); 2188 hr = BalGetStringVariable(L"WixBundleVersion", &m_sczBundleVersion);
2169 BalExitOnFailure(hr, "CWixStandardBootstrapperApplication initialization failed."); 2189 BalExitOnFailure(hr, "CWixStandardBootstrapperApplication initialization failed.");
2170 2190
@@ -2320,7 +2340,7 @@ private:
2320 BalExitOnFailure(hr, "Failed to read bootstrapper application data."); 2340 BalExitOnFailure(hr, "Failed to read bootstrapper application data.");
2321 } 2341 }
2322 2342
2323 if (BOOTSTRAPPER_ACTION_CACHE == m_plannedAction) 2343 if (m_fRequestedCacheOnly)
2324 { 2344 {
2325 if (m_fSupportCacheOnly) 2345 if (m_fSupportCacheOnly)
2326 { 2346 {
@@ -2335,7 +2355,6 @@ private:
2335 else 2355 else
2336 { 2356 {
2337 BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Ignoring attempt to only cache a bundle that does not explicitly support it."); 2357 BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Ignoring attempt to only cache a bundle that does not explicitly support it.");
2338 m_plannedAction = BOOTSTRAPPER_ACTION_UNKNOWN;
2339 } 2358 }
2340 } 2359 }
2341 2360
@@ -2385,7 +2404,7 @@ private:
2385 } 2404 }
2386 else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, &argv[i][1], -1, L"cache", -1)) 2405 else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, &argv[i][1], -1, L"cache", -1))
2387 { 2406 {
2388 m_plannedAction = BOOTSTRAPPER_ACTION_CACHE; 2407 m_fRequestedCacheOnly = TRUE;
2389 } 2408 }
2390 else 2409 else
2391 { 2410 {
@@ -3227,14 +3246,6 @@ private:
3227 3246
3228 SetState(WIXSTDBA_STATE_DETECTING, hr); 3247 SetState(WIXSTDBA_STATE_DETECTING, hr);
3229 3248
3230 // If the UI should be visible, display it now and hide the splash screen
3231 if (BOOTSTRAPPER_DISPLAY_NONE < m_command.display)
3232 {
3233 ::ShowWindow(m_pTheme->hwndParent, SW_SHOW);
3234 }
3235
3236 m_pEngine->CloseSplashScreen();
3237
3238 // Tell the core we're ready for the packages to be processed now. 3249 // Tell the core we're ready for the packages to be processed now.
3239 hr = m_pEngine->Detect(); 3250 hr = m_pEngine->Detect();
3240 BalExitOnFailure(hr, "Failed to start detecting chain."); 3251 BalExitOnFailure(hr, "Failed to start detecting chain.");
@@ -4232,6 +4243,7 @@ public:
4232 m_fSuppressDowngradeFailure = FALSE; 4243 m_fSuppressDowngradeFailure = FALSE;
4233 m_fSuppressRepair = FALSE; 4244 m_fSuppressRepair = FALSE;
4234 m_fSupportCacheOnly = FALSE; 4245 m_fSupportCacheOnly = FALSE;
4246 m_fRequestedCacheOnly = FALSE;
4235 4247
4236 m_pTaskbarList = NULL; 4248 m_pTaskbarList = NULL;
4237 m_uTaskbarButtonCreatedMessage = UINT_MAX; 4249 m_uTaskbarButtonCreatedMessage = UINT_MAX;
@@ -4536,6 +4548,7 @@ private:
4536 BOOL m_fSuppressDowngradeFailure; 4548 BOOL m_fSuppressDowngradeFailure;
4537 BOOL m_fSuppressRepair; 4549 BOOL m_fSuppressRepair;
4538 BOOL m_fSupportCacheOnly; 4550 BOOL m_fSupportCacheOnly;
4551 BOOL m_fRequestedCacheOnly;
4539 4552
4540 BOOL m_fPrereq; 4553 BOOL m_fPrereq;
4541 BOOL m_fPrereqInstalled; 4554 BOOL m_fPrereqInstalled;
diff --git a/src/wix/WixToolset.Core/CompilerCore.cs b/src/wix/WixToolset.Core/CompilerCore.cs
index 98bbd19e..dc44f1b6 100644
--- a/src/wix/WixToolset.Core/CompilerCore.cs
+++ b/src/wix/WixToolset.Core/CompilerCore.cs
@@ -94,6 +94,7 @@ namespace WixToolset.Core
94 "WindowsFolder", 94 "WindowsFolder",
95 "WindowsVolume", 95 "WindowsVolume",
96 "WixBundleAction", 96 "WixBundleAction",
97 "WixBundleCommandLineAction",
97 "WixBundleForcedRestartPackage", 98 "WixBundleForcedRestartPackage",
98 "WixBundleElevated", 99 "WixBundleElevated",
99 "WixBundleInstalled", 100 "WixBundleInstalled",