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/engine/detect.cpp | |
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/engine/detect.cpp')
-rw-r--r-- | src/burn/engine/detect.cpp | 52 |
1 files changed, 2 insertions, 50 deletions
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. |