diff options
Diffstat (limited to '')
-rw-r--r-- | src/engine/detect.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/engine/detect.cpp b/src/engine/detect.cpp index 159df3d0..b702306e 100644 --- a/src/engine/detect.cpp +++ b/src/engine/detect.cpp | |||
@@ -42,6 +42,7 @@ extern "C" void DetectReset( | |||
42 | pRegistration->fEnabledForwardCompatibleBundle = FALSE; | 42 | pRegistration->fEnabledForwardCompatibleBundle = FALSE; |
43 | PackageUninitialize(&pRegistration->forwardCompatibleBundle); | 43 | PackageUninitialize(&pRegistration->forwardCompatibleBundle); |
44 | pRegistration->fSelfRegisteredAsDependent = FALSE; | 44 | pRegistration->fSelfRegisteredAsDependent = FALSE; |
45 | pRegistration->fEligibleForCleanup = FALSE; | ||
45 | 46 | ||
46 | if (pRegistration->rgIgnoredDependencies) | 47 | if (pRegistration->rgIgnoredDependencies) |
47 | { | 48 | { |
@@ -184,11 +185,14 @@ extern "C" HRESULT DetectReportRelatedBundles( | |||
184 | __in BURN_USER_EXPERIENCE* pUX, | 185 | __in BURN_USER_EXPERIENCE* pUX, |
185 | __in BURN_REGISTRATION* pRegistration, | 186 | __in BURN_REGISTRATION* pRegistration, |
186 | __in BOOTSTRAPPER_RELATION_TYPE relationType, | 187 | __in BOOTSTRAPPER_RELATION_TYPE relationType, |
187 | __in BOOTSTRAPPER_ACTION action | 188 | __in BOOTSTRAPPER_ACTION action, |
189 | __out BOOL* pfEligibleForCleanup | ||
188 | ) | 190 | ) |
189 | { | 191 | { |
190 | HRESULT hr = S_OK; | 192 | HRESULT hr = S_OK; |
191 | int nCompareResult = 0; | 193 | int nCompareResult = 0; |
194 | BOOTSTRAPPER_REQUEST_STATE uninstallRequestState = BOOTSTRAPPER_REQUEST_STATE_NONE; | ||
195 | *pfEligibleForCleanup = pRegistration->fInstalled; | ||
192 | 196 | ||
193 | for (DWORD iRelatedBundle = 0; iRelatedBundle < pRegistration->relatedBundles.cRelatedBundles; ++iRelatedBundle) | 197 | for (DWORD iRelatedBundle = 0; iRelatedBundle < pRegistration->relatedBundles.cRelatedBundles; ++iRelatedBundle) |
194 | { | 198 | { |
@@ -201,7 +205,7 @@ extern "C" HRESULT DetectReportRelatedBundles( | |||
201 | if (BOOTSTRAPPER_RELATION_UPGRADE != relationType && BOOTSTRAPPER_ACTION_UNINSTALL < action) | 205 | if (BOOTSTRAPPER_RELATION_UPGRADE != relationType && BOOTSTRAPPER_ACTION_UNINSTALL < action) |
202 | { | 206 | { |
203 | hr = VerCompareParsedVersions(pRegistration->pVersion, pRelatedBundle->pVersion, &nCompareResult); | 207 | hr = VerCompareParsedVersions(pRegistration->pVersion, pRelatedBundle->pVersion, &nCompareResult); |
204 | ExitOnFailure(hr, "Failed to compare bundle version '%ls' to related bundle version '%ls'", pRegistration->pVersion, pRelatedBundle->pVersion); | 208 | ExitOnFailure(hr, "Failed to compare bundle version '%ls' to related bundle version '%ls'", pRegistration->pVersion->sczVersion, pRelatedBundle->pVersion->sczVersion); |
205 | 209 | ||
206 | if (nCompareResult < 0) | 210 | if (nCompareResult < 0) |
207 | { | 211 | { |
@@ -244,6 +248,19 @@ extern "C" HRESULT DetectReportRelatedBundles( | |||
244 | 248 | ||
245 | hr = UserExperienceOnDetectRelatedBundle(pUX, pRelatedBundle->package.sczId, pRelatedBundle->relationType, pRelatedBundle->sczTag, pRelatedBundle->package.fPerMachine, pRelatedBundle->pVersion, operation); | 249 | hr = UserExperienceOnDetectRelatedBundle(pUX, pRelatedBundle->package.sczId, pRelatedBundle->relationType, pRelatedBundle->sczTag, pRelatedBundle->package.fPerMachine, pRelatedBundle->pVersion, operation); |
246 | ExitOnRootFailure(hr, "BA aborted detect related bundle."); | 250 | ExitOnRootFailure(hr, "BA aborted detect related bundle."); |
251 | |||
252 | // For now, if any related bundles will be executed during uninstall by default then never automatically clean up the bundle. | ||
253 | if (*pfEligibleForCleanup) | ||
254 | { | ||
255 | uninstallRequestState = BOOTSTRAPPER_REQUEST_STATE_NONE; | ||
256 | hr = PlanDefaultRelatedBundleRequestState(relationType, pRelatedBundle->relationType, BOOTSTRAPPER_ACTION_UNINSTALL, pRegistration->pVersion, pRelatedBundle->pVersion, &uninstallRequestState); | ||
257 | ExitOnFailure(hr, "Failed to get the default request state for related bundle for calculating fEligibleForCleanup"); | ||
258 | |||
259 | if (BOOTSTRAPPER_REQUEST_STATE_NONE != uninstallRequestState) | ||
260 | { | ||
261 | *pfEligibleForCleanup = FALSE; | ||
262 | } | ||
263 | } | ||
247 | } | 264 | } |
248 | 265 | ||
249 | LExit: | 266 | LExit: |