diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2021-02-02 18:09:58 -0600 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2021-02-04 22:16:10 -0600 |
commit | fd8c2b0899bfbce07386af245c04eb21dc01cbdf (patch) | |
tree | 33d928124b0028729916189ddb9f239a9574c75d /src/engine/msuengine.cpp | |
parent | 39725a1a6d1c72a6748bd3c306af32bcae6dbf8f (diff) | |
download | wix-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/msuengine.cpp')
-rw-r--r-- | src/engine/msuengine.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/engine/msuengine.cpp b/src/engine/msuengine.cpp index 641d55b1..b7a503ad 100644 --- a/src/engine/msuengine.cpp +++ b/src/engine/msuengine.cpp | |||
@@ -69,6 +69,11 @@ extern "C" HRESULT MsuEngineDetectPackage( | |||
69 | // update detect state | 69 | // update detect state |
70 | pPackage->currentState = fDetected ? BOOTSTRAPPER_PACKAGE_STATE_PRESENT : BOOTSTRAPPER_PACKAGE_STATE_ABSENT; | 70 | pPackage->currentState = fDetected ? BOOTSTRAPPER_PACKAGE_STATE_PRESENT : BOOTSTRAPPER_PACKAGE_STATE_ABSENT; |
71 | 71 | ||
72 | if (pPackage->fCanAffectRegistration) | ||
73 | { | ||
74 | pPackage->installRegistrationState = BOOTSTRAPPER_PACKAGE_STATE_CACHED < pPackage->currentState ? BURN_PACKAGE_REGISTRATION_STATE_PRESENT : BURN_PACKAGE_REGISTRATION_STATE_ABSENT; | ||
75 | } | ||
76 | |||
72 | LExit: | 77 | LExit: |
73 | return hr; | 78 | return hr; |
74 | } | 79 | } |
@@ -424,6 +429,31 @@ LExit: | |||
424 | return hr; | 429 | return hr; |
425 | } | 430 | } |
426 | 431 | ||
432 | extern "C" void MsuEngineUpdateInstallRegistrationState( | ||
433 | __in BURN_EXECUTE_ACTION* pAction, | ||
434 | __in HRESULT hrExecute | ||
435 | ) | ||
436 | { | ||
437 | BURN_PACKAGE* pPackage = pAction->msuPackage.pPackage; | ||
438 | |||
439 | if (FAILED(hrExecute) || !pPackage->fCanAffectRegistration) | ||
440 | { | ||
441 | ExitFunction(); | ||
442 | } | ||
443 | |||
444 | if (BOOTSTRAPPER_ACTION_STATE_UNINSTALL == pAction->msuPackage.action) | ||
445 | { | ||
446 | pPackage->installRegistrationState = BURN_PACKAGE_REGISTRATION_STATE_ABSENT; | ||
447 | } | ||
448 | else | ||
449 | { | ||
450 | pPackage->installRegistrationState = BURN_PACKAGE_REGISTRATION_STATE_PRESENT; | ||
451 | } | ||
452 | |||
453 | LExit: | ||
454 | return; | ||
455 | } | ||
456 | |||
427 | static HRESULT EnsureWUServiceEnabled( | 457 | static HRESULT EnsureWUServiceEnabled( |
428 | __in BOOL fStopWusaService, | 458 | __in BOOL fStopWusaService, |
429 | __out SC_HANDLE* pschWu, | 459 | __out SC_HANDLE* pschWu, |