@joebigelow / wix / commits / 10ef9d5b

Determine whether to ignore forward compatible bundles during Plan.

Sean Hall committed Mar 10, 2021 at 15:47 UTC 10ef9d5bfbf81f454113a1c2716009831a916222
12 files changed +200 -110
src/WixToolset.BootstrapperCore.Native/inc/BootstrapperApplication.h
+19 -1
@@ -143,6 +143,7 @@ enum BOOTSTRAPPER_APPLICATION_MESSAGE
143 BOOTSTRAPPER_APPLICATION_MESSAGE_ONSYSTEMRESTOREPOINTBEGIN,
144 BOOTSTRAPPER_APPLICATION_MESSAGE_ONSYSTEMRESTOREPOINTCOMPLETE,
145 BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANNEDPACKAGE,
146 + BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANFORWARDCOMPATIBLEBUNDLE,
147 };
148
149 enum BOOTSTRAPPER_APPLYCOMPLETE_ACTION
@@ -496,7 +497,6 @@ struct BA_ONDETECTFORWARDCOMPATIBLEBUNDLE_RESULTS
497 {
498 DWORD cbSize;
499 BOOL fCancel;
499 - BOOL fIgnoreBundle;
500 };
501
502 struct BA_ONDETECTMSIFEATURE_ARGS
@@ -854,6 +854,24 @@ struct BA_ONPLANCOMPLETE_RESULTS
854 DWORD cbSize;
855 };
856
857 +struct BA_ONPLANFORWARDCOMPATIBLEBUNDLE_ARGS
858 +{
859 + DWORD cbSize;
860 + LPCWSTR wzBundleId;
861 + BOOTSTRAPPER_RELATION_TYPE relationType;
862 + LPCWSTR wzBundleTag;
863 + BOOL fPerMachine;
864 + LPCWSTR wzVersion;
865 + BOOL fRecommendedIgnoreBundle;
866 +};
867 +
868 +struct BA_ONPLANFORWARDCOMPATIBLEBUNDLE_RESULTS
869 +{
870 + DWORD cbSize;
871 + BOOL fCancel;
872 + BOOL fIgnoreBundle;
873 +};
874 +
875 struct BA_ONPLANMSIFEATURE_ARGS
876 {
877 DWORD cbSize;
src/engine/core.cpp
+32 -33
@@ -319,15 +319,8 @@ extern "C" HRESULT CoreDetect(
319 hr = DependencyDetectProviderKeyBundleId(&pEngineState->registration);
320 if (SUCCEEDED(hr))
321 {
322 - hr = DetectForwardCompatibleBundle(&pEngineState->userExperience, &pEngineState->command, &pEngineState->registration);
322 + hr = DetectForwardCompatibleBundles(&pEngineState->userExperience, &pEngineState->registration);
323 ExitOnFailure(hr, "Failed to detect forward compatible bundle.");
324 -
325 - // If a forward compatible bundle was detected, skip rest of bundle detection
326 - // since we will passthrough.
327 - if (pEngineState->registration.fEnabledForwardCompatibleBundle)
328 - {
329 - ExitFunction();
330 - }
324 }
325 else if (E_NOTFOUND == hr)
326 {
@@ -504,39 +497,45 @@ extern "C" HRESULT CorePlan(
497 hr = PlanUpdateBundle(&pEngineState->userExperience, pUpgradeBundlePackage, &pEngineState->plan, &pEngineState->log, &pEngineState->variables, pEngineState->command.display, pEngineState->command.relationType, &hSyncpointEvent);
498 ExitOnFailure(hr, "Failed to plan update.");
499 }
507 - else if (pEngineState->registration.fEnabledForwardCompatibleBundle)
500 + else
501 {
509 - Assert(!pEngineState->plan.fPerMachine);
502 + hr = PlanForwardCompatibleBundles(&pEngineState->userExperience, &pEngineState->command, &pEngineState->plan, &pEngineState->registration, action);
503 + ExitOnFailure(hr, "Failed to plan forward compatible bundles.");
504
511 - pForwardCompatibleBundlePackage = &pEngineState->registration.forwardCompatibleBundle;
512 -
513 - hr = PlanPassThroughBundle(&pEngineState->userExperience, pForwardCompatibleBundlePackage, &pEngineState->plan, &pEngineState->log, &pEngineState->variables, pEngineState->command.display, pEngineState->command.relationType, &hSyncpointEvent);
514 - ExitOnFailure(hr, "Failed to plan passthrough.");
515 - }
516 - else // doing an action that modifies the machine state.
517 - {
518 - pEngineState->plan.fPerMachine = pEngineState->registration.fPerMachine; // default the scope of the plan to the per-machine state of the bundle.
505 + if (pEngineState->plan.fEnabledForwardCompatibleBundle)
506 + {
507 + Assert(!pEngineState->plan.fPerMachine);
508
520 - hr = PlanRegistration(&pEngineState->plan, &pEngineState->registration, pEngineState->command.resumeType, pEngineState->command.relationType, &fContinuePlanning);
521 - ExitOnFailure(hr, "Failed to plan registration.");
509 + pForwardCompatibleBundlePackage = &pEngineState->plan.forwardCompatibleBundle;
510
523 - if (fContinuePlanning)
511 + hr = PlanPassThroughBundle(&pEngineState->userExperience, pForwardCompatibleBundlePackage, &pEngineState->plan, &pEngineState->log, &pEngineState->variables, pEngineState->command.display, pEngineState->command.relationType, &hSyncpointEvent);
512 + ExitOnFailure(hr, "Failed to plan passthrough.");
513 + }
514 + else // doing an action that modifies the machine state.
515 {
525 - // Remember the early index, because we want to be able to insert some related bundles
526 - // into the plan before other executed packages. This particularly occurs for uninstallation
527 - // of addons and patches, which should be uninstalled before the main product.
528 - DWORD dwExecuteActionEarlyIndex = pEngineState->plan.cExecuteActions;
516 + pEngineState->plan.fPerMachine = pEngineState->registration.fPerMachine; // default the scope of the plan to the per-machine state of the bundle.
517
530 - // Plan the related bundles first to support downgrades with ref-counting.
531 - hr = PlanRelatedBundlesBegin(&pEngineState->userExperience, &pEngineState->registration, pEngineState->command.relationType, &pEngineState->plan);
532 - ExitOnFailure(hr, "Failed to plan related bundles.");
518 + hr = PlanRegistration(&pEngineState->plan, &pEngineState->registration, pEngineState->command.resumeType, pEngineState->command.relationType, &fContinuePlanning);
519 + ExitOnFailure(hr, "Failed to plan registration.");
520
534 - hr = PlanPackages(&pEngineState->userExperience, &pEngineState->packages, &pEngineState->plan, &pEngineState->log, &pEngineState->variables, pEngineState->command.display, pEngineState->command.relationType, NULL, &hSyncpointEvent);
535 - ExitOnFailure(hr, "Failed to plan packages.");
521 + if (fContinuePlanning)
522 + {
523 + // Remember the early index, because we want to be able to insert some related bundles
524 + // into the plan before other executed packages. This particularly occurs for uninstallation
525 + // of addons and patches, which should be uninstalled before the main product.
526 + DWORD dwExecuteActionEarlyIndex = pEngineState->plan.cExecuteActions;
527
537 - // Schedule the update of related bundles last.
538 - hr = PlanRelatedBundlesComplete(&pEngineState->registration, &pEngineState->plan, &pEngineState->log, &pEngineState->variables, &hSyncpointEvent, dwExecuteActionEarlyIndex);
539 - ExitOnFailure(hr, "Failed to schedule related bundles.");
528 + // Plan the related bundles first to support downgrades with ref-counting.
529 + hr = PlanRelatedBundlesBegin(&pEngineState->userExperience, &pEngineState->registration, pEngineState->command.relationType, &pEngineState->plan);
530 + ExitOnFailure(hr, "Failed to plan related bundles.");
531 +
532 + hr = PlanPackages(&pEngineState->userExperience, &pEngineState->packages, &pEngineState->plan, &pEngineState->log, &pEngineState->variables, pEngineState->command.display, pEngineState->command.relationType, NULL, &hSyncpointEvent);
533 + ExitOnFailure(hr, "Failed to plan packages.");
534 +
535 + // Schedule the update of related bundles last.
536 + hr = PlanRelatedBundlesComplete(&pEngineState->registration, &pEngineState->plan, &pEngineState->log, &pEngineState->variables, &hSyncpointEvent, dwExecuteActionEarlyIndex);
537 + ExitOnFailure(hr, "Failed to schedule related bundles.");
538 + }
539 }
540 }
541
src/engine/dependency.cpp
+9 -14
@@ -234,6 +234,8 @@ extern "C" HRESULT DependencyDetect(
234 BURN_REGISTRATION* pRegistration = &pEngineState->registration;
235 STRINGDICT_HANDLE sdIgnoredDependents = NULL;
236 BURN_PACKAGE* pPackage = NULL;
237 + BOOL fSelfDependent = NULL != pRegistration->wzSelfDependent;
238 + BOOL fActiveParent = NULL != pRegistration->sczActiveParent && NULL != *pRegistration->sczActiveParent;
239
240 // Always leave this empty so that all dependents get detected. Plan will ignore dependents based on its own logic.
241 hr = DictCreateStringList(&sdIgnoredDependents, INITIAL_STRINGDICT_SIZE, DICT_FLAG_CASEINSENSITIVE);
@@ -263,16 +265,20 @@ extern "C" HRESULT DependencyDetect(
265 ExitOnFailure(hr, "Failed to detect dependents for related bundle '%ls'", pPackage->sczId);
266 }
267
266 - if (pRegistration->wzSelfDependent)
268 + if (fSelfDependent || fActiveParent)
269 {
270 for (DWORD i = 0; i < pRegistration->cDependents; ++i)
271 {
272 DEPENDENCY* pDependent = pRegistration->rgDependents + i;
273
272 - if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, NORM_IGNORECASE, pRegistration->wzSelfDependent, -1, pDependent->sczKey, -1))
274 + if (fActiveParent && CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, NORM_IGNORECASE, pRegistration->sczActiveParent, -1, pDependent->sczKey, -1))
275 + {
276 + pRegistration->fParentRegisteredAsDependent = TRUE;
277 + }
278 +
279 + if (fSelfDependent && CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, NORM_IGNORECASE, pRegistration->wzSelfDependent, -1, pDependent->sczKey, -1))
280 {
281 pRegistration->fSelfRegisteredAsDependent = TRUE;
275 - break;
282 }
283 }
284 }
@@ -348,17 +354,6 @@ LExit:
354 return hr;
355 }
356
351 -extern "C" BOOL DependencyDependentExists(
352 - __in const BURN_REGISTRATION* pRegistration,
353 - __in_z LPCWSTR wzDependentProviderKey
354 - )
355 -{
356 - HRESULT hr = S_OK;
357 -
358 - hr = DepDependentExists(pRegistration->hkRoot, pRegistration->sczProviderKey, wzDependentProviderKey);
359 - return SUCCEEDED(hr);
360 -}
361 -
357 extern "C" HRESULT DependencyPlanPackageBegin(
358 __in BOOL fPerMachine,
359 __in BURN_PACKAGE* pPackage,
src/engine/dependency.h
-10
@@ -84,16 +84,6 @@ HRESULT DependencyAddIgnoreDependencies(
84 __in_z LPCWSTR wzAddIgnoreDependencies
85 );
86
87 -/********************************************************************
88 - DependencyDependentExists - Checks to see if the provider key is
89 - already dependent on this bundle.
90 -
91 -*********************************************************************/
92 -BOOL DependencyDependentExists(
93 - __in const BURN_REGISTRATION* pRegistration,
94 - __in_z LPCWSTR wzDependentProviderKey
95 - );
96 -
87 /********************************************************************
88 DependencyPlanPackageBegin - Updates the dependency registration
89 action depending on the calculated state for the package.
src/engine/detect.cpp
+8 -40
@@ -39,9 +39,9 @@ extern "C" void DetectReset(
39 {
40 RelatedBundlesUninitialize(&pRegistration->relatedBundles);
41 ReleaseNullStr(pRegistration->sczDetectedProviderKeyBundleId);
42 - pRegistration->fEnabledForwardCompatibleBundle = FALSE;
43 - PackageUninitialize(&pRegistration->forwardCompatibleBundle);
42 pRegistration->fSelfRegisteredAsDependent = FALSE;
43 + pRegistration->fParentRegisteredAsDependent = FALSE;
44 + pRegistration->fForwardCompatibleBundleExists = FALSE;
45 pRegistration->fEligibleForCleanup = FALSE;
46
47 if (pRegistration->rgIgnoredDependencies)
@@ -120,46 +120,20 @@ extern "C" void DetectReset(
120 }
121 }
122
123 -extern "C" HRESULT DetectForwardCompatibleBundle(
123 +extern "C" HRESULT DetectForwardCompatibleBundles(
124 __in BURN_USER_EXPERIENCE* pUX,
125 - __in BOOTSTRAPPER_COMMAND* pCommand,
125 __in BURN_REGISTRATION* pRegistration
126 )
127 {
128 HRESULT hr = S_OK;
130 - BOOL fRecommendIgnore = TRUE;
131 - BOOL fIgnoreBundle = FALSE;
129 int nCompareResult = 0;
130
131 if (pRegistration->sczDetectedProviderKeyBundleId &&
132 CSTR_EQUAL != ::CompareStringW(LOCALE_NEUTRAL, NORM_IGNORECASE, pRegistration->sczDetectedProviderKeyBundleId, -1, pRegistration->sczId, -1))
133 {
137 - // Only change the recommendation if an active parent was provided.
138 - if (pRegistration->sczActiveParent && *pRegistration->sczActiveParent)
139 - {
140 - // On install, recommend running the forward compatible bundle because there is an active parent. This
141 - // will essentially register the parent with the forward compatible bundle.
142 - if (BOOTSTRAPPER_ACTION_INSTALL == pCommand->action)
143 - {
144 - fRecommendIgnore = FALSE;
145 - }
146 - else if (BOOTSTRAPPER_ACTION_UNINSTALL == pCommand->action ||
147 - BOOTSTRAPPER_ACTION_MODIFY == pCommand->action ||
148 - BOOTSTRAPPER_ACTION_REPAIR == pCommand->action)
149 - {
150 - // When modifying the bundle, only recommend running the forward compatible bundle if the parent
151 - // is already registered as a dependent of the provider key.
152 - if (DependencyDependentExists(pRegistration, pRegistration->sczActiveParent))
153 - {
154 - fRecommendIgnore = FALSE;
155 - }
156 - }
157 - }
158 -
134 for (DWORD iRelatedBundle = 0; iRelatedBundle < pRegistration->relatedBundles.cRelatedBundles; ++iRelatedBundle)
135 {
136 BURN_RELATED_BUNDLE* pRelatedBundle = pRegistration->relatedBundles.rgRelatedBundles + iRelatedBundle;
162 - fIgnoreBundle = fRecommendIgnore;
137
138 if (BOOTSTRAPPER_RELATION_UPGRADE == pRelatedBundle->relationType &&
139 CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, NORM_IGNORECASE, pRegistration->sczDetectedProviderKeyBundleId, -1, pRelatedBundle->package.sczId, -1))
@@ -169,19 +143,13 @@ extern "C" HRESULT DetectForwardCompatibleBundle(
143
144 if (nCompareResult <= 0)
145 {
172 - hr = UserExperienceOnDetectForwardCompatibleBundle(pUX, pRelatedBundle->package.sczId, pRelatedBundle->relationType, pRelatedBundle->sczTag, pRelatedBundle->package.fPerMachine, pRelatedBundle->pVersion, &fIgnoreBundle);
173 - ExitOnRootFailure(hr, "BA aborted detect forward compatible bundle.");
174 -
175 - if (!fIgnoreBundle)
176 - {
177 - hr = PseudoBundleInitializePassthrough(&pRegistration->forwardCompatibleBundle, pCommand, NULL, pRegistration->sczActiveParent, pRegistration->sczAncestors, &pRelatedBundle->package);
178 - ExitOnFailure(hr, "Failed to initialize update bundle.");
146 + pRelatedBundle->fForwardCompatible = TRUE;
147 + pRegistration->fForwardCompatibleBundleExists = TRUE;
148
180 - pRegistration->fEnabledForwardCompatibleBundle = TRUE;
181 - }
149 + hr = UserExperienceOnDetectForwardCompatibleBundle(pUX, pRelatedBundle->package.sczId, pRelatedBundle->relationType, pRelatedBundle->sczTag, pRelatedBundle->package.fPerMachine, pRelatedBundle->pVersion);
150 + ExitOnRootFailure(hr, "BA aborted detect forward compatible bundle.");
151
183 - LogId(REPORT_STANDARD, MSG_DETECTED_FORWARD_COMPATIBLE_BUNDLE, pRelatedBundle->package.sczId, LoggingRelationTypeToString(pRelatedBundle->relationType), LoggingPerMachineToString(pRelatedBundle->package.fPerMachine), pRelatedBundle->pVersion->sczVersion, LoggingBoolToString(pRegistration->fEnabledForwardCompatibleBundle));
184 - break;
152 + LogId(REPORT_STANDARD, MSG_DETECTED_FORWARD_COMPATIBLE_BUNDLE, pRelatedBundle->package.sczId, LoggingRelationTypeToString(pRelatedBundle->relationType), LoggingPerMachineToString(pRelatedBundle->package.fPerMachine), pRelatedBundle->pVersion->sczVersion);
153 }
154 }
155 }
src/engine/detect.h
+1 -2
@@ -20,9 +20,8 @@ void DetectReset(
20 __in BURN_PACKAGES* pPackages
21 );
22
23 -HRESULT DetectForwardCompatibleBundle(
23 +HRESULT DetectForwardCompatibleBundles(
24 __in BURN_USER_EXPERIENCE* pUX,
25 - __in BOOTSTRAPPER_COMMAND* pCommand,
25 __in BURN_REGISTRATION* pRegistration
26 );
27
src/engine/engine.mc
+1 -1
@@ -237,7 +237,7 @@ MessageId=107
237 Severity=Success
238 SymbolicName=MSG_DETECTED_FORWARD_COMPATIBLE_BUNDLE
239 Language=English
240 -Detected forward compatible bundle: %1!ls!, type: %2!hs!, scope: %3!hs!, version: %4!ls!, enabled: %5!hs!
240 +Detected forward compatible bundle: %1!ls!, type: %2!hs!, scope: %3!hs!, version: %4!ls!
241 .
242
243 MessageId=120
src/engine/plan.cpp
+68
@@ -194,6 +194,8 @@ extern "C" void PlanReset(
194 __in BURN_PACKAGES* pPackages
195 )
196 {
197 + PackageUninitialize(&pPlan->forwardCompatibleBundle);
198 +
199 if (pPlan->rgRegistrationActions)
200 {
201 for (DWORD i = 0; i < pPlan->cRegistrationActions; ++i)
@@ -488,6 +490,72 @@ LExit:
490 return hr;
491 }
492
493 +extern "C" HRESULT PlanForwardCompatibleBundles(
494 + __in BURN_USER_EXPERIENCE* pUX,
495 + __in BOOTSTRAPPER_COMMAND* pCommand,
496 + __in BURN_PLAN* pPlan,
497 + __in BURN_REGISTRATION* pRegistration,
498 + __in BOOTSTRAPPER_ACTION action
499 + )
500 +{
501 + HRESULT hr = S_OK;
502 + BOOL fRecommendIgnore = TRUE;
503 + BOOL fIgnoreBundle = FALSE;
504 +
505 + if (!pRegistration->fForwardCompatibleBundleExists)
506 + {
507 + ExitFunction();
508 + }
509 +
510 + // Only change the recommendation if an active parent was provided.
511 + if (pRegistration->sczActiveParent && *pRegistration->sczActiveParent)
512 + {
513 + // On install, recommend running the forward compatible bundle because there is an active parent. This
514 + // will essentially register the parent with the forward compatible bundle.
515 + if (BOOTSTRAPPER_ACTION_INSTALL == action)
516 + {
517 + fRecommendIgnore = FALSE;
518 + }
519 + else if (BOOTSTRAPPER_ACTION_UNINSTALL == action ||
520 + BOOTSTRAPPER_ACTION_MODIFY == action ||
521 + BOOTSTRAPPER_ACTION_REPAIR == action)
522 + {
523 + // When modifying the bundle, only recommend running the forward compatible bundle if the parent
524 + // is already registered as a dependent of the provider key.
525 + if (pRegistration->fParentRegisteredAsDependent)
526 + {
527 + fRecommendIgnore = FALSE;
528 + }
529 + }
530 + }
531 +
532 + for (DWORD iRelatedBundle = 0; iRelatedBundle < pRegistration->relatedBundles.cRelatedBundles; ++iRelatedBundle)
533 + {
534 + BURN_RELATED_BUNDLE* pRelatedBundle = pRegistration->relatedBundles.rgRelatedBundles + iRelatedBundle;
535 + if (!pRelatedBundle->fForwardCompatible)
536 + {
537 + continue;
538 + }
539 +
540 + fIgnoreBundle = fRecommendIgnore;
541 +
542 + hr = UserExperienceOnPlanForwardCompatibleBundle(pUX, pRelatedBundle->package.sczId, pRelatedBundle->relationType, pRelatedBundle->sczTag, pRelatedBundle->package.fPerMachine, pRelatedBundle->pVersion, &fIgnoreBundle);
543 + ExitOnRootFailure(hr, "BA aborted plan forward compatible bundle.");
544 +
545 + if (!fIgnoreBundle)
546 + {
547 + hr = PseudoBundleInitializePassthrough(&pPlan->forwardCompatibleBundle, pCommand, NULL, pRegistration->sczActiveParent, pRegistration->sczAncestors, &pRelatedBundle->package);
548 + ExitOnFailure(hr, "Failed to initialize pass through bundle.");
549 +
550 + pPlan->fEnabledForwardCompatibleBundle = TRUE;
551 + break;
552 + }
553 + }
554 +
555 +LExit:
556 + return hr;
557 +}
558 +
559 extern "C" HRESULT PlanPackages(
560 __in BURN_USER_EXPERIENCE* pUX,
561 __in BURN_PACKAGES* pPackages,
src/engine/plan.h
+10
@@ -322,6 +322,9 @@ typedef struct _BURN_PLAN
322 DWORD cExecutePackagesTotal;
323 DWORD cOverallProgressTicksTotal;
324
325 + BOOL fEnabledForwardCompatibleBundle;
326 + BURN_PACKAGE forwardCompatibleBundle;
327 +
328 BURN_DEPENDENCY_REGISTRATION_ACTION dependencyRegistrationAction;
329
330 BURN_DEPENDENT_REGISTRATION_ACTION* rgRegistrationActions;
@@ -392,6 +395,13 @@ HRESULT PlanLayoutBundle(
395 __in BURN_PAYLOADS* pPayloads,
396 __out_z LPWSTR* psczLayoutDirectory
397 );
398 +HRESULT PlanForwardCompatibleBundles(
399 + __in BURN_USER_EXPERIENCE* pUX,
400 + __in BOOTSTRAPPER_COMMAND* pCommand,
401 + __in BURN_PLAN* pPlan,
402 + __in BURN_REGISTRATION* pRegistration,
403 + __in BOOTSTRAPPER_ACTION action
404 + );
405 HRESULT PlanPackages(
406 __in BURN_USER_EXPERIENCE* pUX,
407 __in BURN_PACKAGES* pPackages,
src/engine/registration.h
+3 -3
@@ -58,6 +58,7 @@ typedef struct _BURN_UPDATE_REGISTRATION
58 typedef struct _BURN_RELATED_BUNDLE
59 {
60 BOOTSTRAPPER_RELATION_TYPE relationType;
61 + BOOL fForwardCompatible;
62
63 VERUTIL_VERSION* pVersion;
64 LPWSTR sczTag;
@@ -146,14 +147,13 @@ typedef struct _BURN_REGISTRATION
147 UINT cDependents; // Only valid after detect.
148 LPCWSTR wzSelfDependent; // Only valid after detect.
149 BOOL fSelfRegisteredAsDependent; // Only valid after detect.
150 + BOOL fParentRegisteredAsDependent; // Only valid after detect.
151 + BOOL fForwardCompatibleBundleExists; // Only valid after detect.
152 BOOL fEligibleForCleanup; // Only valid after detect.
153
154 LPWSTR sczDetectedProviderKeyBundleId;
155 LPWSTR sczAncestors;
156 LPWSTR sczBundlePackageAncestors;
154 -
155 - BOOL fEnabledForwardCompatibleBundle;
156 - BURN_PACKAGE forwardCompatibleBundle;
157 } BURN_REGISTRATION;
158
159
src/engine/userexperience.cpp
+39 -4
@@ -763,8 +763,7 @@ EXTERN_C BAAPI UserExperienceOnDetectForwardCompatibleBundle(
763 __in BOOTSTRAPPER_RELATION_TYPE relationType,
764 __in_z LPCWSTR wzBundleTag,
765 __in BOOL fPerMachine,
766 - __in VERUTIL_VERSION* pVersion,
767 - __inout BOOL* pfIgnoreBundle
766 + __in VERUTIL_VERSION* pVersion
767 )
768 {
769 HRESULT hr = S_OK;
@@ -779,7 +778,6 @@ EXTERN_C BAAPI UserExperienceOnDetectForwardCompatibleBundle(
778 args.wzVersion = pVersion->sczVersion;
779
780 results.cbSize = sizeof(results);
782 - results.fIgnoreBundle = *pfIgnoreBundle;
781
782 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTFORWARDCOMPATIBLEBUNDLE, &args, &results);
783 ExitOnFailure(hr, "BA OnDetectForwardCompatibleBundle failed.");
@@ -788,7 +786,6 @@ EXTERN_C BAAPI UserExperienceOnDetectForwardCompatibleBundle(
786 {
787 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
788 }
791 - *pfIgnoreBundle = results.fIgnoreBundle;
789
790 LExit:
791 return hr;
@@ -1567,6 +1564,44 @@ LExit:
1564 return hr;
1565 }
1566
1567 +EXTERN_C BAAPI UserExperienceOnPlanForwardCompatibleBundle(
1568 + __in BURN_USER_EXPERIENCE* pUserExperience,
1569 + __in_z LPCWSTR wzBundleId,
1570 + __in BOOTSTRAPPER_RELATION_TYPE relationType,
1571 + __in_z LPCWSTR wzBundleTag,
1572 + __in BOOL fPerMachine,
1573 + __in VERUTIL_VERSION* pVersion,
1574 + __inout BOOL* pfIgnoreBundle
1575 + )
1576 +{
1577 + HRESULT hr = S_OK;
1578 + BA_ONPLANFORWARDCOMPATIBLEBUNDLE_ARGS args = { };
1579 + BA_ONPLANFORWARDCOMPATIBLEBUNDLE_RESULTS results = { };
1580 +
1581 + args.cbSize = sizeof(args);
1582 + args.wzBundleId = wzBundleId;
1583 + args.relationType = relationType;
1584 + args.wzBundleTag = wzBundleTag;
1585 + args.fPerMachine = fPerMachine;
1586 + args.wzVersion = pVersion->sczVersion;
1587 + args.fRecommendedIgnoreBundle = *pfIgnoreBundle;
1588 +
1589 + results.cbSize = sizeof(results);
1590 + results.fIgnoreBundle = *pfIgnoreBundle;
1591 +
1592 + hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANFORWARDCOMPATIBLEBUNDLE, &args, &results);
1593 + ExitOnFailure(hr, "BA OnPlanForwardCompatibleBundle failed.");
1594 +
1595 + if (results.fCancel)
1596 + {
1597 + hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
1598 + }
1599 + *pfIgnoreBundle = results.fIgnoreBundle;
1600 +
1601 +LExit:
1602 + return hr;
1603 +}
1604 +
1605 EXTERN_C BAAPI UserExperienceOnPlanMsiPackage(
1606 __in BURN_USER_EXPERIENCE* pUserExperience,
1607 __in_z LPCWSTR wzPackageId,
src/engine/userexperience.h
+10 -2
@@ -200,8 +200,7 @@ BAAPI UserExperienceOnDetectForwardCompatibleBundle(
200 __in BOOTSTRAPPER_RELATION_TYPE relationType,
201 __in_z LPCWSTR wzBundleTag,
202 __in BOOL fPerMachine,
203 - __in VERUTIL_VERSION* pVersion,
204 - __inout BOOL* pfIgnoreBundle
203 + __in VERUTIL_VERSION* pVersion
204 );
205 BAAPI UserExperienceOnDetectMsiFeature(
206 __in BURN_USER_EXPERIENCE* pUserExperience,
@@ -357,6 +356,15 @@ BAAPI UserExperienceOnPlanComplete(
356 __in BURN_USER_EXPERIENCE* pUserExperience,
357 __in HRESULT hrStatus
358 );
359 +BAAPI UserExperienceOnPlanForwardCompatibleBundle(
360 + __in BURN_USER_EXPERIENCE* pUserExperience,
361 + __in_z LPCWSTR wzBundleId,
362 + __in BOOTSTRAPPER_RELATION_TYPE relationType,
363 + __in_z LPCWSTR wzBundleTag,
364 + __in BOOL fPerMachine,
365 + __in VERUTIL_VERSION* pVersion,
366 + __inout BOOL* pfIgnoreBundle
367 + );
368 BAAPI UserExperienceOnPlanMsiFeature(
369 __in BURN_USER_EXPERIENCE* pUserExperience,
370 __in_z LPCWSTR wzPackageId,