summaryrefslogtreecommitdiff
path: root/src/burn/engine/detect.cpp
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2022-03-13 23:45:32 -0500
committerSean Hall <r.sean.hall@gmail.com>2022-03-14 14:53:29 -0500
commit4cd1c4e06145434ca940ac828772dc47b9d9738e (patch)
treea754d685039173c63303dc6d0d8b1a2bf3ab506b /src/burn/engine/detect.cpp
parent89adb2e3cc232b11b28e5bdeccb0c522c8124a29 (diff)
downloadwix-4cd1c4e06145434ca940ac828772dc47b9d9738e.tar.gz
wix-4cd1c4e06145434ca940ac828772dc47b9d9738e.tar.bz2
wix-4cd1c4e06145434ca940ac828772dc47b9d9738e.zip
Allow the BA to override the bundle relation type during plan.
Diffstat (limited to 'src/burn/engine/detect.cpp')
-rw-r--r--src/burn/engine/detect.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/burn/engine/detect.cpp b/src/burn/engine/detect.cpp
index f7a030ff..7628b26a 100644
--- a/src/burn/engine/detect.cpp
+++ b/src/burn/engine/detect.cpp
@@ -129,7 +129,7 @@ extern "C" HRESULT DetectForwardCompatibleBundles(
129 { 129 {
130 BURN_RELATED_BUNDLE* pRelatedBundle = pRegistration->relatedBundles.rgRelatedBundles + iRelatedBundle; 130 BURN_RELATED_BUNDLE* pRelatedBundle = pRegistration->relatedBundles.rgRelatedBundles + iRelatedBundle;
131 131
132 if (BOOTSTRAPPER_RELATION_UPGRADE == pRelatedBundle->relationType && 132 if (BOOTSTRAPPER_RELATION_UPGRADE == pRelatedBundle->detectRelationType &&
133 CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, NORM_IGNORECASE, pRegistration->sczDetectedProviderKeyBundleId, -1, pRelatedBundle->package.sczId, -1)) 133 CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, NORM_IGNORECASE, pRegistration->sczDetectedProviderKeyBundleId, -1, pRelatedBundle->package.sczId, -1))
134 { 134 {
135 hr = VerCompareParsedVersions(pRegistration->pVersion, pRelatedBundle->pVersion, &nCompareResult); 135 hr = VerCompareParsedVersions(pRegistration->pVersion, pRelatedBundle->pVersion, &nCompareResult);
@@ -143,10 +143,10 @@ extern "C" HRESULT DetectForwardCompatibleBundles(
143 pRegistration->fForwardCompatibleBundleExists = TRUE; 143 pRegistration->fForwardCompatibleBundleExists = TRUE;
144 } 144 }
145 145
146 hr = UserExperienceOnDetectForwardCompatibleBundle(pUX, pRelatedBundle->package.sczId, pRelatedBundle->relationType, pRelatedBundle->sczTag, pRelatedBundle->package.fPerMachine, pRelatedBundle->pVersion, !pRelatedBundle->package.fCached); 146 hr = UserExperienceOnDetectForwardCompatibleBundle(pUX, pRelatedBundle->package.sczId, pRelatedBundle->detectRelationType, pRelatedBundle->sczTag, pRelatedBundle->package.fPerMachine, pRelatedBundle->pVersion, !pRelatedBundle->package.fCached);
147 ExitOnRootFailure(hr, "BA aborted detect forward compatible bundle."); 147 ExitOnRootFailure(hr, "BA aborted detect forward compatible bundle.");
148 148
149 LogId(REPORT_STANDARD, MSG_DETECTED_FORWARD_COMPATIBLE_BUNDLE, pRelatedBundle->package.sczId, LoggingRelationTypeToString(pRelatedBundle->relationType), LoggingPerMachineToString(pRelatedBundle->package.fPerMachine), pRelatedBundle->pVersion->sczVersion, LoggingBoolToString(pRelatedBundle->package.fCached)); 149 LogId(REPORT_STANDARD, MSG_DETECTED_FORWARD_COMPATIBLE_BUNDLE, pRelatedBundle->package.sczId, LoggingRelationTypeToString(pRelatedBundle->detectRelationType), LoggingPerMachineToString(pRelatedBundle->package.fPerMachine), pRelatedBundle->pVersion->sczVersion, LoggingBoolToString(pRelatedBundle->package.fCached));
150 } 150 }
151 } 151 }
152 } 152 }
@@ -164,6 +164,7 @@ extern "C" HRESULT DetectReportRelatedBundles(
164 ) 164 )
165{ 165{
166 HRESULT hr = S_OK; 166 HRESULT hr = S_OK;
167 BOOTSTRAPPER_RELATED_BUNDLE_PLAN_TYPE planRelationType = BOOTSTRAPPER_RELATED_BUNDLE_PLAN_TYPE_NONE;
167 BOOTSTRAPPER_REQUEST_STATE uninstallRequestState = BOOTSTRAPPER_REQUEST_STATE_NONE; 168 BOOTSTRAPPER_REQUEST_STATE uninstallRequestState = BOOTSTRAPPER_REQUEST_STATE_NONE;
168 *pfEligibleForCleanup = BOOTSTRAPPER_REGISTRATION_TYPE_NONE != pRegistration->detectedRegistrationType || pRegistration->fCached; 169 *pfEligibleForCleanup = BOOTSTRAPPER_REGISTRATION_TYPE_NONE != pRegistration->detectedRegistrationType || pRegistration->fCached;
169 170
@@ -171,16 +172,21 @@ extern "C" HRESULT DetectReportRelatedBundles(
171 { 172 {
172 const BURN_RELATED_BUNDLE* pRelatedBundle = pRegistration->relatedBundles.rgRelatedBundles + iRelatedBundle; 173 const BURN_RELATED_BUNDLE* pRelatedBundle = pRegistration->relatedBundles.rgRelatedBundles + iRelatedBundle;
173 174
174 LogId(REPORT_STANDARD, MSG_DETECTED_RELATED_BUNDLE, pRelatedBundle->package.sczId, LoggingRelationTypeToString(pRelatedBundle->relationType), LoggingPerMachineToString(pRelatedBundle->package.fPerMachine), pRelatedBundle->pVersion->sczVersion, LoggingBoolToString(pRelatedBundle->package.fCached)); 175 LogId(REPORT_STANDARD, MSG_DETECTED_RELATED_BUNDLE, pRelatedBundle->package.sczId, LoggingRelationTypeToString(pRelatedBundle->detectRelationType), LoggingPerMachineToString(pRelatedBundle->package.fPerMachine), pRelatedBundle->pVersion->sczVersion, LoggingBoolToString(pRelatedBundle->package.fCached));
175 176
176 hr = UserExperienceOnDetectRelatedBundle(pUX, pRelatedBundle->package.sczId, pRelatedBundle->relationType, pRelatedBundle->sczTag, pRelatedBundle->package.fPerMachine, pRelatedBundle->pVersion, !pRelatedBundle->package.fCached); 177 hr = UserExperienceOnDetectRelatedBundle(pUX, pRelatedBundle->package.sczId, pRelatedBundle->detectRelationType, pRelatedBundle->sczTag, pRelatedBundle->package.fPerMachine, pRelatedBundle->pVersion, !pRelatedBundle->package.fCached);
177 ExitOnRootFailure(hr, "BA aborted detect related bundle."); 178 ExitOnRootFailure(hr, "BA aborted detect related bundle.");
178 179
179 // For now, if any related bundles will be executed during uninstall by default then never automatically clean up the bundle. 180 // For now, if any related bundles will be executed during uninstall by default then never automatically clean up the bundle.
180 if (*pfEligibleForCleanup && pRelatedBundle->fPlannable) 181 if (*pfEligibleForCleanup && pRelatedBundle->fPlannable)
181 { 182 {
183 planRelationType = BOOTSTRAPPER_RELATED_BUNDLE_PLAN_TYPE_NONE;
182 uninstallRequestState = BOOTSTRAPPER_REQUEST_STATE_NONE; 184 uninstallRequestState = BOOTSTRAPPER_REQUEST_STATE_NONE;
183 hr = PlanDefaultRelatedBundleRequestState(relationType, pRelatedBundle->relationType, BOOTSTRAPPER_ACTION_UNINSTALL, pRegistration->pVersion, pRelatedBundle->pVersion, &uninstallRequestState); 185
186 hr = PlanDefaultRelatedBundlePlanType(pRelatedBundle->detectRelationType, pRegistration->pVersion, pRelatedBundle->pVersion, &planRelationType);
187 ExitOnFailure(hr, "Failed to get the default plan type for related bundle for calculating fEligibleForCleanup");
188
189 hr = PlanDefaultRelatedBundleRequestState(relationType, planRelationType, BOOTSTRAPPER_ACTION_UNINSTALL, &uninstallRequestState);
184 ExitOnFailure(hr, "Failed to get the default request state for related bundle for calculating fEligibleForCleanup"); 190 ExitOnFailure(hr, "Failed to get the default request state for related bundle for calculating fEligibleForCleanup");
185 191
186 if (BOOTSTRAPPER_REQUEST_STATE_NONE != uninstallRequestState) 192 if (BOOTSTRAPPER_REQUEST_STATE_NONE != uninstallRequestState)