aboutsummaryrefslogtreecommitdiff
path: root/src/engine/msiengine.cpp
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2021-02-02 18:09:58 -0600
committerSean Hall <r.sean.hall@gmail.com>2021-02-04 22:16:10 -0600
commitfd8c2b0899bfbce07386af245c04eb21dc01cbdf (patch)
tree33d928124b0028729916189ddb9f239a9574c75d /src/engine/msiengine.cpp
parent39725a1a6d1c72a6748bd3c306af32bcae6dbf8f (diff)
downloadwix-fd8c2b0899bfbce07386af245c04eb21dc01cbdf.tar.gz
wix-fd8c2b0899bfbce07386af245c04eb21dc01cbdf.tar.bz2
wix-fd8c2b0899bfbce07386af245c04eb21dc01cbdf.zip
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.
Diffstat (limited to 'src/engine/msiengine.cpp')
-rw-r--r--src/engine/msiengine.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/engine/msiengine.cpp b/src/engine/msiengine.cpp
index 5bccb375..4fdf2b7a 100644
--- a/src/engine/msiengine.cpp
+++ b/src/engine/msiengine.cpp
@@ -661,6 +661,11 @@ extern "C" HRESULT MsiEngineDetectPackage(
661 } 661 }
662 } 662 }
663 663
664 if (pPackage->fCanAffectRegistration)
665 {
666 pPackage->installRegistrationState = BOOTSTRAPPER_PACKAGE_STATE_CACHED < pPackage->currentState ? BURN_PACKAGE_REGISTRATION_STATE_PRESENT : BURN_PACKAGE_REGISTRATION_STATE_ABSENT;
667 }
668
664LExit: 669LExit:
665 ReleaseStr(sczInstalledLanguage); 670 ReleaseStr(sczInstalledLanguage);
666 ReleaseStr(sczInstalledVersion); 671 ReleaseStr(sczInstalledVersion);
@@ -1397,6 +1402,42 @@ extern "C" HRESULT MsiEngineCalculateInstallUiLevel(
1397 return UserExperienceOnPlanMsiPackage(pUserExperience, wzPackageId, fExecute, actionState, pActionMsiProperty, pUiLevel, pfDisableExternalUiHandler); 1402 return UserExperienceOnPlanMsiPackage(pUserExperience, wzPackageId, fExecute, actionState, pActionMsiProperty, pUiLevel, pfDisableExternalUiHandler);
1398} 1403}
1399 1404
1405extern "C" void MsiEngineUpdateInstallRegistrationState(
1406 __in BURN_EXECUTE_ACTION* pAction,
1407 __in HRESULT hrExecute,
1408 __in BOOL fInsideMsiTransaction
1409 )
1410{
1411 BURN_PACKAGE_REGISTRATION_STATE newState = BURN_PACKAGE_REGISTRATION_STATE_UNKNOWN;
1412 BURN_PACKAGE* pPackage = pAction->msiPackage.pPackage;
1413
1414 if (FAILED(hrExecute) || !pPackage->fCanAffectRegistration)
1415 {
1416 ExitFunction();
1417 }
1418
1419 if (BOOTSTRAPPER_ACTION_STATE_UNINSTALL == pAction->msiPackage.action)
1420 {
1421 newState = BURN_PACKAGE_REGISTRATION_STATE_ABSENT;
1422 }
1423 else
1424 {
1425 newState = BURN_PACKAGE_REGISTRATION_STATE_PRESENT;
1426 }
1427
1428 if (fInsideMsiTransaction)
1429 {
1430 pPackage->transactionRegistrationState = newState;
1431 }
1432 else
1433 {
1434 pPackage->installRegistrationState = newState;
1435 }
1436
1437LExit:
1438 return;
1439}
1440
1400 1441
1401// internal helper functions 1442// internal helper functions
1402 1443