From fd8c2b0899bfbce07386af245c04eb21dc01cbdf Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Tue, 2 Feb 2021 18:09:58 -0600 Subject: Update the logic for determining when the bundle should be registered. The basic rule is that if a non-permanent package is present at the end of the chain, then the bundle should be registered. If no non-permanent packages are present at the end of the chain, then the bundle should not be registered. This required tracking what actually happened with each package during Apply. Include cache status in registration calculation. Include dependency ref-counting when determining whether the bundle should be registered. --- src/engine/package.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/engine/package.h') diff --git a/src/engine/package.h b/src/engine/package.h index 8f801e85..d3225fbc 100644 --- a/src/engine/package.h +++ b/src/engine/package.h @@ -78,6 +78,14 @@ enum BOOTSTRAPPER_FEATURE_ACTION BOOTSTRAPPER_FEATURE_ACTION_REMOVE, }; +enum BURN_PACKAGE_REGISTRATION_STATE +{ + BURN_PACKAGE_REGISTRATION_STATE_UNKNOWN, + BURN_PACKAGE_REGISTRATION_STATE_IGNORED, + BURN_PACKAGE_REGISTRATION_STATE_ABSENT, + BURN_PACKAGE_REGISTRATION_STATE_PRESENT, +}; + // structs typedef struct _BURN_EXE_EXIT_CODE @@ -106,6 +114,9 @@ typedef struct _BURN_MSPTARGETPRODUCT BOOTSTRAPPER_PACKAGE_STATE patchPackageState; // only valid after Detect. BOOTSTRAPPER_ACTION_STATE execute; // only valid during Plan. BOOTSTRAPPER_ACTION_STATE rollback; // only valid during Plan. + + BURN_PACKAGE_REGISTRATION_STATE registrationState; // initialized during Detect, updated during Apply. + BURN_PACKAGE_REGISTRATION_STATE transactionRegistrationState;// only valid during Apply inside an MSI transaction. } BURN_MSPTARGETPRODUCT; typedef struct _BURN_MSIPROPERTY @@ -190,6 +201,7 @@ typedef struct _BURN_PACKAGE BOOL fPerMachine; BOOL fUninstallable; BOOL fVital; + BOOL fCanAffectRegistration; BURN_CACHE_TYPE cacheType; LPWSTR sczCacheId; @@ -216,6 +228,12 @@ typedef struct _BURN_PACKAGE BOOL fDependencyManagerWasHere; // only valid during Plan. HRESULT hrCacheResult; // only valid during Apply. + BURN_PACKAGE_REGISTRATION_STATE cacheRegistrationState; // initialized during Detect, updated during Apply. + BURN_PACKAGE_REGISTRATION_STATE installRegistrationState; // initialized during Detect, updated during Apply. + BURN_PACKAGE_REGISTRATION_STATE expectedCacheRegistrationState; // only valid after Plan. + BURN_PACKAGE_REGISTRATION_STATE expectedInstallRegistrationState;// only valid after Plan. + BURN_PACKAGE_REGISTRATION_STATE transactionRegistrationState; // only valid during Apply inside an MSI transaction. + BURN_PACKAGE_PAYLOAD* rgPayloads; DWORD cPayloads; -- cgit v1.2.3-55-g6feb