From 8dfadd0c9068965af138949b630ef8496b4f7bbb Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Thu, 30 Dec 2021 15:32:57 -0600 Subject: Don't report related operation in OnDetectRelatedBundle. #5796 --- src/burn/engine/core.cpp | 2 +- src/burn/engine/detect.cpp | 52 ++------------------------------------ src/burn/engine/detect.h | 1 - src/burn/engine/engine.mc | 2 +- src/burn/engine/userexperience.cpp | 4 +-- src/burn/engine/userexperience.h | 1 - 6 files changed, 5 insertions(+), 57 deletions(-) (limited to 'src/burn') 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( ExitOnFailure(hr, "Failed to detect provider key bundle id."); // Report the related bundles. - hr = DetectReportRelatedBundles(&pEngineState->userExperience, &pEngineState->registration, pEngineState->command.relationType, pEngineState->command.action, &pEngineState->registration.fEligibleForCleanup); + hr = DetectReportRelatedBundles(&pEngineState->userExperience, &pEngineState->registration, pEngineState->command.relationType, &pEngineState->registration.fEligibleForCleanup); ExitOnFailure(hr, "Failed to report detected related bundles."); // 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( __in BURN_USER_EXPERIENCE* pUX, __in BURN_REGISTRATION* pRegistration, __in BOOTSTRAPPER_RELATION_TYPE relationType, - __in BOOTSTRAPPER_ACTION action, __out BOOL* pfEligibleForCleanup ) { HRESULT hr = S_OK; - int nCompareResult = 0; BOOTSTRAPPER_REQUEST_STATE uninstallRequestState = BOOTSTRAPPER_REQUEST_STATE_NONE; *pfEligibleForCleanup = pRegistration->fInstalled || pRegistration->fCached; for (DWORD iRelatedBundle = 0; iRelatedBundle < pRegistration->relatedBundles.cRelatedBundles; ++iRelatedBundle) { const BURN_RELATED_BUNDLE* pRelatedBundle = pRegistration->relatedBundles.rgRelatedBundles + iRelatedBundle; - BOOTSTRAPPER_RELATED_OPERATION operation = BOOTSTRAPPER_RELATED_OPERATION_NONE; - - switch (pRelatedBundle->relationType) - { - case BOOTSTRAPPER_RELATION_UPGRADE: - if (BOOTSTRAPPER_RELATION_UPGRADE != relationType && BOOTSTRAPPER_ACTION_UNINSTALL < action) - { - hr = VerCompareParsedVersions(pRegistration->pVersion, pRelatedBundle->pVersion, &nCompareResult); - ExitOnFailure(hr, "Failed to compare bundle version '%ls' to related bundle version '%ls'", pRegistration->pVersion->sczVersion, pRelatedBundle->pVersion->sczVersion); - - if (nCompareResult < 0) - { - operation = BOOTSTRAPPER_RELATED_OPERATION_DOWNGRADE; - } - else - { - operation = BOOTSTRAPPER_RELATED_OPERATION_MAJOR_UPGRADE; - } - } - break; - - case BOOTSTRAPPER_RELATION_PATCH: __fallthrough; - case BOOTSTRAPPER_RELATION_ADDON: - if (BOOTSTRAPPER_ACTION_UNINSTALL == action) - { - operation = BOOTSTRAPPER_RELATED_OPERATION_REMOVE; - } - else if (BOOTSTRAPPER_ACTION_INSTALL == action || BOOTSTRAPPER_ACTION_MODIFY == action) - { - operation = BOOTSTRAPPER_RELATED_OPERATION_INSTALL; - } - else if (BOOTSTRAPPER_ACTION_REPAIR == action) - { - operation = BOOTSTRAPPER_RELATED_OPERATION_REPAIR; - } - break; - - case BOOTSTRAPPER_RELATION_DETECT: __fallthrough; - case BOOTSTRAPPER_RELATION_DEPENDENT: - break; - - default: - hr = E_FAIL; - ExitOnRootFailure(hr, "Unexpected relation type encountered: %d", pRelatedBundle->relationType); - break; - } - 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)); + LogId(REPORT_STANDARD, MSG_DETECTED_RELATED_BUNDLE, pRelatedBundle->package.sczId, LoggingRelationTypeToString(pRelatedBundle->relationType), LoggingPerMachineToString(pRelatedBundle->package.fPerMachine), pRelatedBundle->pVersion->sczVersion, LoggingBoolToString(pRelatedBundle->package.fCached)); - hr = UserExperienceOnDetectRelatedBundle(pUX, pRelatedBundle->package.sczId, pRelatedBundle->relationType, pRelatedBundle->sczTag, pRelatedBundle->package.fPerMachine, pRelatedBundle->pVersion, operation, !pRelatedBundle->package.fCached); + hr = UserExperienceOnDetectRelatedBundle(pUX, pRelatedBundle->package.sczId, pRelatedBundle->relationType, pRelatedBundle->sczTag, pRelatedBundle->package.fPerMachine, pRelatedBundle->pVersion, !pRelatedBundle->package.fCached); ExitOnRootFailure(hr, "BA aborted detect related bundle."); // 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( __in BURN_USER_EXPERIENCE* pUX, __in BURN_REGISTRATION* pRegistration, __in BOOTSTRAPPER_RELATION_TYPE relationType, - __in BOOTSTRAPPER_ACTION action, __out BOOL* pfEligibleForCleanup ); 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 Severity=Success SymbolicName=MSG_DETECTED_RELATED_BUNDLE Language=English -Detected related bundle: %1!ls!, type: %2!hs!, scope: %3!hs!, version: %4!ls!, operation: %5!hs!, cached: %6!hs! +Detected related bundle: %1!ls!, type: %2!hs!, scope: %3!hs!, version: %4!ls!, cached: %5!hs! . 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( args.pCommand = pCommand; args.pfnBootstrapperEngineProc = EngineForApplicationProc; args.pvBootstrapperEngineProcContext = pEngineContext; - args.qwEngineAPIVersion = MAKEQWORDVERSION(2021, 12, 7, 0); + args.qwEngineAPIVersion = MAKEQWORDVERSION(2021, 12, 30, 0); results.cbSize = sizeof(BOOTSTRAPPER_CREATE_RESULTS); @@ -1164,7 +1164,6 @@ EXTERN_C BAAPI UserExperienceOnDetectRelatedBundle( __in_z LPCWSTR wzBundleTag, __in BOOL fPerMachine, __in VERUTIL_VERSION* pVersion, - __in BOOTSTRAPPER_RELATED_OPERATION operation, __in BOOL fMissingFromCache ) { @@ -1178,7 +1177,6 @@ EXTERN_C BAAPI UserExperienceOnDetectRelatedBundle( args.wzBundleTag = wzBundleTag; args.fPerMachine = fPerMachine; args.wzVersion = pVersion->sczVersion; - args.operation = operation; args.fMissingFromCache = fMissingFromCache; 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( __in_z LPCWSTR wzBundleTag, __in BOOL fPerMachine, __in VERUTIL_VERSION* pVersion, - __in BOOTSTRAPPER_RELATED_OPERATION operation, __in BOOL fMissingFromCache ); BAAPI UserExperienceOnDetectRelatedMsiPackage( -- cgit v1.2.3-55-g6feb