diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2020-12-15 20:56:00 -0600 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2020-12-15 21:07:14 -0600 |
commit | 5f00aece054d074fc651e542432f349e3055f582 (patch) | |
tree | 770287b8349415d71e1eeba48d3dfb845621e9ac /src | |
parent | b9ba35486245a65cd8e376cc7a808f6fa7d41682 (diff) | |
download | wix-5f00aece054d074fc651e542432f349e3055f582.tar.gz wix-5f00aece054d074fc651e542432f349e3055f582.tar.bz2 wix-5f00aece054d074fc651e542432f349e3055f582.zip |
WIXFEAT:5267 - Skip bal:Conditions for special actions like layout.
Diffstat (limited to 'src')
-rw-r--r-- | src/wixstdba/WixStandardBootstrapperApplication.cpp | 68 |
1 files changed, 41 insertions, 27 deletions
diff --git a/src/wixstdba/WixStandardBootstrapperApplication.cpp b/src/wixstdba/WixStandardBootstrapperApplication.cpp index 3fa7d8a6..59b23b19 100644 --- a/src/wixstdba/WixStandardBootstrapperApplication.cpp +++ b/src/wixstdba/WixStandardBootstrapperApplication.cpp | |||
@@ -311,11 +311,29 @@ public: // IBootstrapperApplication | |||
311 | ) | 311 | ) |
312 | { | 312 | { |
313 | HRESULT hr = S_OK; | 313 | HRESULT hr = S_OK; |
314 | 314 | // If we're not interacting with the user or we're doing a layout or we're resuming just after a force restart | |
315 | if (SUCCEEDED(hrStatus)) | 315 | // then automatically start planning. |
316 | BOOL fSkipToPlan = SUCCEEDED(hrStatus) && | ||
317 | (BOOTSTRAPPER_DISPLAY_FULL > m_command.display || | ||
318 | BOOTSTRAPPER_ACTION_LAYOUT == m_command.action || | ||
319 | BOOTSTRAPPER_RESUME_TYPE_REBOOT == m_command.resumeType); | ||
320 | // If we're requiring user input (which currently means Install, Repair, or Uninstall) | ||
321 | // or if we're skipping to an action that modifies machine state | ||
322 | // then evaluate conditions. | ||
323 | BOOL fEvaluateConditions = SUCCEEDED(hrStatus) && | ||
324 | (!fSkipToPlan || BOOTSTRAPPER_ACTION_LAYOUT < m_command.action && BOOTSTRAPPER_ACTION_UPDATE_REPLACE > m_command.action); | ||
325 | |||
326 | if (fEvaluateConditions) | ||
316 | { | 327 | { |
317 | hrStatus = EvaluateConditions(); | 328 | hrStatus = EvaluateConditions(); |
329 | } | ||
318 | 330 | ||
331 | if (FAILED(hrStatus)) | ||
332 | { | ||
333 | fSkipToPlan = FALSE; | ||
334 | } | ||
335 | else | ||
336 | { | ||
319 | if (m_fPrereq) | 337 | if (m_fPrereq) |
320 | { | 338 | { |
321 | m_fPrereqAlreadyInstalled = TRUE; | 339 | m_fPrereqAlreadyInstalled = TRUE; |
@@ -336,32 +354,9 @@ public: // IBootstrapperApplication | |||
336 | 354 | ||
337 | SetState(WIXSTDBA_STATE_DETECTED, hrStatus); | 355 | SetState(WIXSTDBA_STATE_DETECTED, hrStatus); |
338 | 356 | ||
339 | if (BOOTSTRAPPER_ACTION_CACHE == m_plannedAction) | 357 | if (fSkipToPlan) |
340 | { | ||
341 | if (m_fSupportCacheOnly) | ||
342 | { | ||
343 | // Doesn't make sense to prompt the user if cache only is requested. | ||
344 | if (BOOTSTRAPPER_DISPLAY_PASSIVE < m_command.display) | ||
345 | { | ||
346 | m_command.display = BOOTSTRAPPER_DISPLAY_PASSIVE; | ||
347 | } | ||
348 | |||
349 | m_command.action = BOOTSTRAPPER_ACTION_CACHE; | ||
350 | } | ||
351 | else | ||
352 | { | ||
353 | BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Ignoring attempt to only cache a bundle that does not explicitly support it."); | ||
354 | } | ||
355 | } | ||
356 | |||
357 | // If we're not interacting with the user or we're doing a layout or we're just after a force restart | ||
358 | // then automatically start planning. | ||
359 | if (BOOTSTRAPPER_DISPLAY_FULL > m_command.display || BOOTSTRAPPER_ACTION_LAYOUT == m_command.action || BOOTSTRAPPER_RESUME_TYPE_REBOOT == m_command.resumeType) | ||
360 | { | 358 | { |
361 | if (SUCCEEDED(hrStatus)) | 359 | ::PostMessageW(m_hWnd, WM_WIXSTDBA_PLAN_PACKAGES, 0, m_command.action); |
362 | { | ||
363 | ::PostMessageW(m_hWnd, WM_WIXSTDBA_PLAN_PACKAGES, 0, m_command.action); | ||
364 | } | ||
365 | } | 360 | } |
366 | 361 | ||
367 | return hr; | 362 | return hr; |
@@ -2000,6 +1995,25 @@ private: // privates | |||
2000 | BalExitOnFailure(hr, "Failed to read bootstrapper application data."); | 1995 | BalExitOnFailure(hr, "Failed to read bootstrapper application data."); |
2001 | } | 1996 | } |
2002 | 1997 | ||
1998 | if (BOOTSTRAPPER_ACTION_CACHE == m_plannedAction) | ||
1999 | { | ||
2000 | if (m_fSupportCacheOnly) | ||
2001 | { | ||
2002 | // Doesn't make sense to prompt the user if cache only is requested. | ||
2003 | if (BOOTSTRAPPER_DISPLAY_PASSIVE < m_command.display) | ||
2004 | { | ||
2005 | m_command.display = BOOTSTRAPPER_DISPLAY_PASSIVE; | ||
2006 | } | ||
2007 | |||
2008 | m_command.action = BOOTSTRAPPER_ACTION_CACHE; | ||
2009 | } | ||
2010 | else | ||
2011 | { | ||
2012 | BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Ignoring attempt to only cache a bundle that does not explicitly support it."); | ||
2013 | m_plannedAction = BOOTSTRAPPER_ACTION_UNKNOWN; | ||
2014 | } | ||
2015 | } | ||
2016 | |||
2003 | LExit: | 2017 | LExit: |
2004 | ReleaseObject(pixdManifest); | 2018 | ReleaseObject(pixdManifest); |
2005 | ReleaseStr(sczModulePath); | 2019 | ReleaseStr(sczModulePath); |