diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2021-12-30 15:32:57 -0600 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2021-12-30 18:40:49 -0600 |
commit | 8dfadd0c9068965af138949b630ef8496b4f7bbb (patch) | |
tree | 58bc40d5306d80a39712470aab0d5bf325eb3a45 /src/burn | |
parent | 84a1b0f8ffe40a26916b1dfb3e1b59b6b0c31ad4 (diff) | |
download | wix-8dfadd0c9068965af138949b630ef8496b4f7bbb.tar.gz wix-8dfadd0c9068965af138949b630ef8496b4f7bbb.tar.bz2 wix-8dfadd0c9068965af138949b630ef8496b4f7bbb.zip |
Don't report related operation in OnDetectRelatedBundle.
#5796
Diffstat (limited to 'src/burn')
-rw-r--r-- | src/burn/engine/core.cpp | 2 | ||||
-rw-r--r-- | src/burn/engine/detect.cpp | 52 | ||||
-rw-r--r-- | src/burn/engine/detect.h | 1 | ||||
-rw-r--r-- | src/burn/engine/engine.mc | 2 | ||||
-rw-r--r-- | src/burn/engine/userexperience.cpp | 4 | ||||
-rw-r--r-- | src/burn/engine/userexperience.h | 1 |
6 files changed, 5 insertions, 57 deletions
diff --git a/src/burn/engine/core.cpp b/src/burn/engine/core.cpp index 96845655..30c64b01 100644 --- a/src/burn/engine/core.cpp +++ b/src/burn/engine/core.cpp | |||
@@ -359,7 +359,7 @@ extern "C" HRESULT CoreDetect( | |||
359 | ExitOnFailure(hr, "Failed to detect provider key bundle id."); | 359 | ExitOnFailure(hr, "Failed to detect provider key bundle id."); |
360 | 360 | ||
361 | // Report the related bundles. | 361 | // Report the related bundles. |
362 | hr = DetectReportRelatedBundles(&pEngineState->userExperience, &pEngineState->registration, pEngineState->command.relationType, pEngineState->command.action, &pEngineState->registration.fEligibleForCleanup); | 362 | hr = DetectReportRelatedBundles(&pEngineState->userExperience, &pEngineState->registration, pEngineState->command.relationType, &pEngineState->registration.fEligibleForCleanup); |
363 | ExitOnFailure(hr, "Failed to report detected related bundles."); | 363 | ExitOnFailure(hr, "Failed to report detected related bundles."); |
364 | 364 | ||
365 | // Do update detection. | 365 | // Do update detection. |
diff --git a/src/burn/engine/detect.cpp b/src/burn/engine/detect.cpp index 4eda240e..be828366 100644 --- a/src/burn/engine/detect.cpp +++ b/src/burn/engine/detect.cpp | |||
@@ -154,68 +154,20 @@ extern "C" HRESULT DetectReportRelatedBundles( | |||
154 | __in BURN_USER_EXPERIENCE* pUX, | 154 | __in BURN_USER_EXPERIENCE* pUX, |
155 | __in BURN_REGISTRATION* pRegistration, | 155 | __in BURN_REGISTRATION* pRegistration, |
156 | __in BOOTSTRAPPER_RELATION_TYPE relationType, | 156 | __in BOOTSTRAPPER_RELATION_TYPE relationType, |
157 | __in BOOTSTRAPPER_ACTION action, | ||
158 | __out BOOL* pfEligibleForCleanup | 157 | __out BOOL* pfEligibleForCleanup |
159 | ) | 158 | ) |
160 | { | 159 | { |
161 | HRESULT hr = S_OK; | 160 | HRESULT hr = S_OK; |
162 | int nCompareResult = 0; | ||
163 | BOOTSTRAPPER_REQUEST_STATE uninstallRequestState = BOOTSTRAPPER_REQUEST_STATE_NONE; | 161 | BOOTSTRAPPER_REQUEST_STATE uninstallRequestState = BOOTSTRAPPER_REQUEST_STATE_NONE; |
164 | *pfEligibleForCleanup = pRegistration->fInstalled || pRegistration->fCached; | 162 | *pfEligibleForCleanup = pRegistration->fInstalled || pRegistration->fCached; |
165 | 163 | ||
166 | for (DWORD iRelatedBundle = 0; iRelatedBundle < pRegistration->relatedBundles.cRelatedBundles; ++iRelatedBundle) | 164 | for (DWORD iRelatedBundle = 0; iRelatedBundle < pRegistration->relatedBundles.cRelatedBundles; ++iRelatedBundle) |
167 | { | 165 | { |
168 | const BURN_RELATED_BUNDLE* pRelatedBundle = pRegistration->relatedBundles.rgRelatedBundles + iRelatedBundle; | 166 | const BURN_RELATED_BUNDLE* pRelatedBundle = pRegistration->relatedBundles.rgRelatedBundles + iRelatedBundle; |
169 | BOOTSTRAPPER_RELATED_OPERATION operation = BOOTSTRAPPER_RELATED_OPERATION_NONE; | ||
170 | |||
171 | switch (pRelatedBundle->relationType) | ||
172 | { | ||
173 | case BOOTSTRAPPER_RELATION_UPGRADE: | ||
174 | if (BOOTSTRAPPER_RELATION_UPGRADE != relationType && BOOTSTRAPPER_ACTION_UNINSTALL < action) | ||
175 | { | ||
176 | hr = VerCompareParsedVersions(pRegistration->pVersion, pRelatedBundle->pVersion, &nCompareResult); | ||
177 | ExitOnFailure(hr, "Failed to compare bundle version '%ls' to related bundle version '%ls'", pRegistration->pVersion->sczVersion, pRelatedBundle->pVersion->sczVersion); | ||
178 | |||
179 | if (nCompareResult < 0) | ||
180 | { | ||
181 | operation = BOOTSTRAPPER_RELATED_OPERATION_DOWNGRADE; | ||
182 | } | ||
183 | else | ||
184 | { | ||
185 | operation = BOOTSTRAPPER_RELATED_OPERATION_MAJOR_UPGRADE; | ||
186 | } | ||
187 | } | ||
188 | break; | ||
189 | |||
190 | case BOOTSTRAPPER_RELATION_PATCH: __fallthrough; | ||
191 | case BOOTSTRAPPER_RELATION_ADDON: | ||
192 | if (BOOTSTRAPPER_ACTION_UNINSTALL == action) | ||
193 | { | ||
194 | operation = BOOTSTRAPPER_RELATED_OPERATION_REMOVE; | ||
195 | } | ||
196 | else if (BOOTSTRAPPER_ACTION_INSTALL == action || BOOTSTRAPPER_ACTION_MODIFY == action) | ||
197 | { | ||
198 | operation = BOOTSTRAPPER_RELATED_OPERATION_INSTALL; | ||
199 | } | ||
200 | else if (BOOTSTRAPPER_ACTION_REPAIR == action) | ||
201 | { | ||
202 | operation = BOOTSTRAPPER_RELATED_OPERATION_REPAIR; | ||
203 | } | ||
204 | break; | ||
205 | |||
206 | case BOOTSTRAPPER_RELATION_DETECT: __fallthrough; | ||
207 | case BOOTSTRAPPER_RELATION_DEPENDENT: | ||
208 | break; | ||
209 | |||
210 | default: | ||
211 | hr = E_FAIL; | ||
212 | ExitOnRootFailure(hr, "Unexpected relation type encountered: %d", pRelatedBundle->relationType); | ||
213 | break; | ||
214 | } | ||
215 | 167 | ||
216 | LogId(REPORT_STANDARD, MSG_DETECTED_RELATED_BUNDLE, pRelatedBundle->package.sczId, LoggingRelationTypeToString(pRelatedBundle->relationType), LoggingPerMachineToString(pRelatedBundle->package.fPerMachine), pRelatedBundle->pVersion->sczVersion, LoggingRelatedOperationToString(operation), LoggingBoolToString(pRelatedBundle->package.fCached)); | 168 | LogId(REPORT_STANDARD, MSG_DETECTED_RELATED_BUNDLE, pRelatedBundle->package.sczId, LoggingRelationTypeToString(pRelatedBundle->relationType), LoggingPerMachineToString(pRelatedBundle->package.fPerMachine), pRelatedBundle->pVersion->sczVersion, LoggingBoolToString(pRelatedBundle->package.fCached)); |
217 | 169 | ||
218 | hr = UserExperienceOnDetectRelatedBundle(pUX, pRelatedBundle->package.sczId, pRelatedBundle->relationType, pRelatedBundle->sczTag, pRelatedBundle->package.fPerMachine, pRelatedBundle->pVersion, operation, !pRelatedBundle->package.fCached); | 170 | hr = UserExperienceOnDetectRelatedBundle(pUX, pRelatedBundle->package.sczId, pRelatedBundle->relationType, pRelatedBundle->sczTag, pRelatedBundle->package.fPerMachine, pRelatedBundle->pVersion, !pRelatedBundle->package.fCached); |
219 | ExitOnRootFailure(hr, "BA aborted detect related bundle."); | 171 | ExitOnRootFailure(hr, "BA aborted detect related bundle."); |
220 | 172 | ||
221 | // For now, if any related bundles will be executed during uninstall by default then never automatically clean up the bundle. | 173 | // For now, if any related bundles will be executed during uninstall by default then never automatically clean up the bundle. |
diff --git a/src/burn/engine/detect.h b/src/burn/engine/detect.h index 9bc34882..cdca2777 100644 --- a/src/burn/engine/detect.h +++ b/src/burn/engine/detect.h | |||
@@ -29,7 +29,6 @@ HRESULT DetectReportRelatedBundles( | |||
29 | __in BURN_USER_EXPERIENCE* pUX, | 29 | __in BURN_USER_EXPERIENCE* pUX, |
30 | __in BURN_REGISTRATION* pRegistration, | 30 | __in BURN_REGISTRATION* pRegistration, |
31 | __in BOOTSTRAPPER_RELATION_TYPE relationType, | 31 | __in BOOTSTRAPPER_RELATION_TYPE relationType, |
32 | __in BOOTSTRAPPER_ACTION action, | ||
33 | __out BOOL* pfEligibleForCleanup | 32 | __out BOOL* pfEligibleForCleanup |
34 | ); | 33 | ); |
35 | 34 | ||
diff --git a/src/burn/engine/engine.mc b/src/burn/engine/engine.mc index dde4d40b..5c1b0b69 100644 --- a/src/burn/engine/engine.mc +++ b/src/burn/engine/engine.mc | |||
@@ -223,7 +223,7 @@ MessageId=102 | |||
223 | Severity=Success | 223 | Severity=Success |
224 | SymbolicName=MSG_DETECTED_RELATED_BUNDLE | 224 | SymbolicName=MSG_DETECTED_RELATED_BUNDLE |
225 | Language=English | 225 | Language=English |
226 | Detected related bundle: %1!ls!, type: %2!hs!, scope: %3!hs!, version: %4!ls!, operation: %5!hs!, cached: %6!hs! | 226 | Detected related bundle: %1!ls!, type: %2!hs!, scope: %3!hs!, version: %4!ls!, cached: %5!hs! |
227 | . | 227 | . |
228 | 228 | ||
229 | MessageId=103 | 229 | MessageId=103 |
diff --git a/src/burn/engine/userexperience.cpp b/src/burn/engine/userexperience.cpp index ee22a318..6ea16905 100644 --- a/src/burn/engine/userexperience.cpp +++ b/src/burn/engine/userexperience.cpp | |||
@@ -104,7 +104,7 @@ extern "C" HRESULT UserExperienceLoad( | |||
104 | args.pCommand = pCommand; | 104 | args.pCommand = pCommand; |
105 | args.pfnBootstrapperEngineProc = EngineForApplicationProc; | 105 | args.pfnBootstrapperEngineProc = EngineForApplicationProc; |
106 | args.pvBootstrapperEngineProcContext = pEngineContext; | 106 | args.pvBootstrapperEngineProcContext = pEngineContext; |
107 | args.qwEngineAPIVersion = MAKEQWORDVERSION(2021, 12, 7, 0); | 107 | args.qwEngineAPIVersion = MAKEQWORDVERSION(2021, 12, 30, 0); |
108 | 108 | ||
109 | results.cbSize = sizeof(BOOTSTRAPPER_CREATE_RESULTS); | 109 | results.cbSize = sizeof(BOOTSTRAPPER_CREATE_RESULTS); |
110 | 110 | ||
@@ -1164,7 +1164,6 @@ EXTERN_C BAAPI UserExperienceOnDetectRelatedBundle( | |||
1164 | __in_z LPCWSTR wzBundleTag, | 1164 | __in_z LPCWSTR wzBundleTag, |
1165 | __in BOOL fPerMachine, | 1165 | __in BOOL fPerMachine, |
1166 | __in VERUTIL_VERSION* pVersion, | 1166 | __in VERUTIL_VERSION* pVersion, |
1167 | __in BOOTSTRAPPER_RELATED_OPERATION operation, | ||
1168 | __in BOOL fMissingFromCache | 1167 | __in BOOL fMissingFromCache |
1169 | ) | 1168 | ) |
1170 | { | 1169 | { |
@@ -1178,7 +1177,6 @@ EXTERN_C BAAPI UserExperienceOnDetectRelatedBundle( | |||
1178 | args.wzBundleTag = wzBundleTag; | 1177 | args.wzBundleTag = wzBundleTag; |
1179 | args.fPerMachine = fPerMachine; | 1178 | args.fPerMachine = fPerMachine; |
1180 | args.wzVersion = pVersion->sczVersion; | 1179 | args.wzVersion = pVersion->sczVersion; |
1181 | args.operation = operation; | ||
1182 | args.fMissingFromCache = fMissingFromCache; | 1180 | args.fMissingFromCache = fMissingFromCache; |
1183 | 1181 | ||
1184 | results.cbSize = sizeof(results); | 1182 | results.cbSize = sizeof(results); |
diff --git a/src/burn/engine/userexperience.h b/src/burn/engine/userexperience.h index 27d0a1e3..e4c5d3ee 100644 --- a/src/burn/engine/userexperience.h +++ b/src/burn/engine/userexperience.h | |||
@@ -286,7 +286,6 @@ BAAPI UserExperienceOnDetectRelatedBundle( | |||
286 | __in_z LPCWSTR wzBundleTag, | 286 | __in_z LPCWSTR wzBundleTag, |
287 | __in BOOL fPerMachine, | 287 | __in BOOL fPerMachine, |
288 | __in VERUTIL_VERSION* pVersion, | 288 | __in VERUTIL_VERSION* pVersion, |
289 | __in BOOTSTRAPPER_RELATED_OPERATION operation, | ||
290 | __in BOOL fMissingFromCache | 289 | __in BOOL fMissingFromCache |
291 | ); | 290 | ); |
292 | BAAPI UserExperienceOnDetectRelatedMsiPackage( | 291 | BAAPI UserExperienceOnDetectRelatedMsiPackage( |