aboutsummaryrefslogtreecommitdiff
path: root/src/ext
diff options
context:
space:
mode:
Diffstat (limited to 'src/ext')
-rw-r--r--src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp44
1 files changed, 28 insertions, 16 deletions
diff --git a/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp b/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp
index fc262e0e..d57d78a6 100644
--- a/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp
+++ b/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp
@@ -322,6 +322,21 @@ public: // IBootstrapperApplication
322 // Best effort 322 // Best effort
323 } 323 }
324 324
325 if (BOOTSTRAPPER_ACTION_INSTALL == m_command.action && BOOTSTRAPPER_RELATION_UPGRADE == relationType)
326 {
327 int nResult = 0;
328 HRESULT hr = VerCompareStringVersions(m_sczBundleVersion, wzVersion, TRUE/*fStrict*/, &nResult);
329 BalExitOnFailure(hr, "Failed to compare bundle version: %ls to related bundle version: %ls.", m_sczBundleVersion, wzVersion);
330
331 if (0 > nResult)
332 {
333 m_fDowngrading = TRUE;
334
335 BalLog(BOOTSTRAPPER_LOG_LEVEL_VERBOSE, "Related bundle version: %ls is a downgrade for bundle version: %ls.", wzVersion, m_sczBundleVersion);
336 }
337 }
338
339 LExit:
325 return CBalBaseBootstrapperApplication::OnDetectRelatedBundle(wzBundleId, relationType, wzBundleTag, fPerMachine, wzVersion, fMissingFromCache, pfCancel); 340 return CBalBaseBootstrapperApplication::OnDetectRelatedBundle(wzBundleId, relationType, wzBundleTag, fPerMachine, wzVersion, fMissingFromCache, pfCancel);
326 } 341 }
327 342
@@ -333,6 +348,15 @@ public: // IBootstrapperApplication
333 { 348 {
334 HRESULT hr = S_OK; 349 HRESULT hr = S_OK;
335 350
351 if (m_fSuppressDowngradeFailure && m_fDowngrading)
352 {
353 SetState(WIXSTDBA_STATE_APPLIED, hrStatus);
354
355 BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Bundle downgrade was attempted but downgrade failure has been suppressed.");
356
357 ExitFunction();
358 }
359
336 // If we're not interacting with the user or we're doing a layout or we're resuming just after a force restart 360 // If we're not interacting with the user or we're doing a layout or we're resuming just after a force restart
337 // then automatically start planning. 361 // then automatically start planning.
338 BOOL fSkipToPlan = SUCCEEDED(hrStatus) && 362 BOOL fSkipToPlan = SUCCEEDED(hrStatus) &&
@@ -365,6 +389,7 @@ public: // IBootstrapperApplication
365 } 389 }
366 } 390 }
367 391
392 LExit:
368 return hr; 393 return hr;
369 } 394 }
370 395
@@ -1188,21 +1213,6 @@ public: // IBootstrapperApplication
1188 return hr; 1213 return hr;
1189 } 1214 }
1190 1215
1191 virtual STDMETHODIMP OnApplyDowngrade(
1192 __in HRESULT /*hrRecommendation*/,
1193 __in HRESULT* phrStatus
1194 )
1195 {
1196 HRESULT hr = S_OK;
1197
1198 if (m_fSuppressDowngradeFailure)
1199 {
1200 *phrStatus = S_OK;
1201 }
1202
1203 return hr;
1204 }
1205
1206 virtual STDMETHODIMP OnApplyComplete( 1216 virtual STDMETHODIMP OnApplyComplete(
1207 __in HRESULT hrStatus, 1217 __in HRESULT hrStatus,
1208 __in BOOTSTRAPPER_APPLY_RESTART restart, 1218 __in BOOTSTRAPPER_APPLY_RESTART restart,
@@ -3888,7 +3898,7 @@ private:
3888 hr = ThemeShowPage(m_pTheme, dwNewPageId, SW_SHOW); 3898 hr = ThemeShowPage(m_pTheme, dwNewPageId, SW_SHOW);
3889 if (FAILED(hr)) 3899 if (FAILED(hr))
3890 { 3900 {
3891 BalLogError(hr, "Failed to show page: %u", dwOldPageId); 3901 BalLogError(hr, "Failed to show page: %u", dwNewPageId);
3892 } 3902 }
3893 3903
3894 // On the install page set the focus to the install button or the next enabled control if install is disabled. 3904 // On the install page set the focus to the install button or the next enabled control if install is disabled.
@@ -4643,6 +4653,7 @@ public:
4643 m_sczLicenseFile = NULL; 4653 m_sczLicenseFile = NULL;
4644 m_sczLicenseUrl = NULL; 4654 m_sczLicenseUrl = NULL;
4645 m_fSuppressDowngradeFailure = FALSE; 4655 m_fSuppressDowngradeFailure = FALSE;
4656 m_fDowngrading = FALSE;
4646 m_fSuppressRepair = FALSE; 4657 m_fSuppressRepair = FALSE;
4647 m_fSupportCacheOnly = FALSE; 4658 m_fSupportCacheOnly = FALSE;
4648 m_fRequestedCacheOnly = FALSE; 4659 m_fRequestedCacheOnly = FALSE;
@@ -4949,6 +4960,7 @@ private:
4949 LPWSTR m_sczLicenseFile; 4960 LPWSTR m_sczLicenseFile;
4950 LPWSTR m_sczLicenseUrl; 4961 LPWSTR m_sczLicenseUrl;
4951 BOOL m_fSuppressDowngradeFailure; 4962 BOOL m_fSuppressDowngradeFailure;
4963 BOOL m_fDowngrading;
4952 BOOL m_fSuppressRepair; 4964 BOOL m_fSuppressRepair;
4953 BOOL m_fSupportCacheOnly; 4965 BOOL m_fSupportCacheOnly;
4954 BOOL m_fRequestedCacheOnly; 4966 BOOL m_fRequestedCacheOnly;