aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2021-02-24 17:30:28 -0600
committerSean Hall <r.sean.hall@gmail.com>2021-03-02 15:47:43 -0600
commit7cf03f0ecc0a54062548656fadcacfba996cd459 (patch)
treec2c64373a13e63dab20a0e8a0692459956c185ec
parentb5c4d92528dd088d0065c634eb1a353c424a4441 (diff)
downloadwix-7cf03f0ecc0a54062548656fadcacfba996cd459.tar.gz
wix-7cf03f0ecc0a54062548656fadcacfba996cd459.tar.bz2
wix-7cf03f0ecc0a54062548656fadcacfba996cd459.zip
Loosen restrictions for actions that don't affect machine state.
-rw-r--r--src/engine/core.cpp11
-rw-r--r--src/engine/core.h1
-rw-r--r--src/engine/plan.cpp2
-rw-r--r--src/engine/plan.h3
4 files changed, 8 insertions, 9 deletions
diff --git a/src/engine/core.cpp b/src/engine/core.cpp
index 0a19ac8e..2f18e4d2 100644
--- a/src/engine/core.cpp
+++ b/src/engine/core.cpp
@@ -282,7 +282,6 @@ extern "C" HRESULT CoreDetect(
282 // Always reset the detect state which means the plan should be reset too. 282 // Always reset the detect state which means the plan should be reset too.
283 pEngineState->fDetected = FALSE; 283 pEngineState->fDetected = FALSE;
284 pEngineState->fPlanned = FALSE; 284 pEngineState->fPlanned = FALSE;
285 pEngineState->fApplied = FALSE;
286 DetectReset(&pEngineState->registration, &pEngineState->packages); 285 DetectReset(&pEngineState->registration, &pEngineState->packages);
287 PlanReset(&pEngineState->plan, &pEngineState->packages); 286 PlanReset(&pEngineState->plan, &pEngineState->packages);
288 287
@@ -458,7 +457,7 @@ extern "C" HRESULT CorePlan(
458 { 457 {
459 ExitOnFailure(hr = E_INVALIDSTATE, "Plan cannot be done without a successful Detect."); 458 ExitOnFailure(hr = E_INVALIDSTATE, "Plan cannot be done without a successful Detect.");
460 } 459 }
461 else if (pEngineState->fApplied) 460 else if (pEngineState->plan.fAffectedMachineState)
462 { 461 {
463 ExitOnFailure(hr = E_INVALIDSTATE, "Plan requires a new successful Detect after calling Apply."); 462 ExitOnFailure(hr = E_INVALIDSTATE, "Plan requires a new successful Detect after calling Apply.");
464 } 463 }
@@ -624,7 +623,7 @@ extern "C" HRESULT CoreApply(
624 { 623 {
625 ExitOnFailure(hr = E_INVALIDSTATE, "Apply cannot be done without a successful Plan."); 624 ExitOnFailure(hr = E_INVALIDSTATE, "Apply cannot be done without a successful Plan.");
626 } 625 }
627 else if (pEngineState->fApplied) 626 else if (pEngineState->plan.fAffectedMachineState)
628 { 627 {
629 ExitOnFailure(hr = E_INVALIDSTATE, "Plans cannot be applied multiple times."); 628 ExitOnFailure(hr = E_INVALIDSTATE, "Plans cannot be applied multiple times.");
630 } 629 }
@@ -644,7 +643,7 @@ extern "C" HRESULT CoreApply(
644 hr = UserExperienceOnApplyBegin(&pEngineState->userExperience, dwPhaseCount); 643 hr = UserExperienceOnApplyBegin(&pEngineState->userExperience, dwPhaseCount);
645 ExitOnRootFailure(hr, "BA aborted apply begin."); 644 ExitOnRootFailure(hr, "BA aborted apply begin.");
646 645
647 pEngineState->fApplied = TRUE; 646 pEngineState->plan.fAffectedMachineState = pEngineState->plan.fCanAffectMachineState;
648 647
649 // Abort if this bundle already requires a restart. 648 // Abort if this bundle already requires a restart.
650 if (BOOTSTRAPPER_RESUME_TYPE_REBOOT_PENDING == pEngineState->command.resumeType) 649 if (BOOTSTRAPPER_RESUME_TYPE_REBOOT_PENDING == pEngineState->command.resumeType)
@@ -695,7 +694,7 @@ extern "C" HRESULT CoreApply(
695 } 694 }
696 695
697 // Register. 696 // Register.
698 if (pEngineState->plan.fRegister) 697 if (pEngineState->plan.fCanAffectMachineState)
699 { 698 {
700 fRegistered = TRUE; 699 fRegistered = TRUE;
701 hr = ApplyRegister(pEngineState); 700 hr = ApplyRegister(pEngineState);
@@ -1107,7 +1106,7 @@ extern "C" void CoreCleanup(
1107 1106
1108 LogId(REPORT_STANDARD, MSG_CLEANUP_BEGIN); 1107 LogId(REPORT_STANDARD, MSG_CLEANUP_BEGIN);
1109 1108
1110 if (pEngineState->fApplied && BOOTSTRAPPER_ACTION_LAYOUT < pEngineState->plan.action && BOOTSTRAPPER_ACTION_UPDATE_REPLACE > pEngineState->plan.action) 1109 if (pEngineState->plan.fAffectedMachineState)
1111 { 1110 {
1112 LogId(REPORT_STANDARD, MSG_CLEANUP_SKIPPED_APPLY); 1111 LogId(REPORT_STANDARD, MSG_CLEANUP_SKIPPED_APPLY);
1113 ExitFunction(); 1112 ExitFunction();
diff --git a/src/engine/core.h b/src/engine/core.h
index d98c7646..75a61614 100644
--- a/src/engine/core.h
+++ b/src/engine/core.h
@@ -80,7 +80,6 @@ typedef struct _BURN_ENGINE_STATE
80 // UX flow control 80 // UX flow control
81 BOOL fDetected; 81 BOOL fDetected;
82 BOOL fPlanned; 82 BOOL fPlanned;
83 BOOL fApplied;
84 BOOL fQuit; 83 BOOL fQuit;
85 //BOOL fSuspend; // Is TRUE when UX made Suspend() call on core. 84 //BOOL fSuspend; // Is TRUE when UX made Suspend() call on core.
86 //BOOL fForcedReboot; // Is TRUE when UX made Reboot() call on core. 85 //BOOL fForcedReboot; // Is TRUE when UX made Reboot() call on core.
diff --git a/src/engine/plan.cpp b/src/engine/plan.cpp
index b3cb0ee3..d6cc63ad 100644
--- a/src/engine/plan.cpp
+++ b/src/engine/plan.cpp
@@ -519,7 +519,7 @@ extern "C" HRESULT PlanRegistration(
519 STRINGDICT_HANDLE sdBundleDependents = NULL; 519 STRINGDICT_HANDLE sdBundleDependents = NULL;
520 STRINGDICT_HANDLE sdIgnoreDependents = NULL; 520 STRINGDICT_HANDLE sdIgnoreDependents = NULL;
521 521
522 pPlan->fRegister = TRUE; // register the bundle since we're modifying machine state. 522 pPlan->fCanAffectMachineState = TRUE; // register the bundle since we're modifying machine state.
523 523
524 pPlan->fDisallowRemoval = FALSE; // by default the bundle can be planned to be removed 524 pPlan->fDisallowRemoval = FALSE; // by default the bundle can be planned to be removed
525 525
diff --git a/src/engine/plan.h b/src/engine/plan.h
index 5e1985ea..c679d368 100644
--- a/src/engine/plan.h
+++ b/src/engine/plan.h
@@ -309,10 +309,11 @@ typedef struct _BURN_PLAN
309 LPWSTR wzBundleId; // points directly into parent the ENGINE_STATE. 309 LPWSTR wzBundleId; // points directly into parent the ENGINE_STATE.
310 LPWSTR wzBundleProviderKey; // points directly into parent the ENGINE_STATE. 310 LPWSTR wzBundleProviderKey; // points directly into parent the ENGINE_STATE.
311 BOOL fPerMachine; 311 BOOL fPerMachine;
312 BOOL fRegister; 312 BOOL fCanAffectMachineState;
313 DWORD dwRegistrationOperations; 313 DWORD dwRegistrationOperations;
314 BOOL fDisallowRemoval; 314 BOOL fDisallowRemoval;
315 BOOL fDisableRollback; 315 BOOL fDisableRollback;
316 BOOL fAffectedMachineState;
316 317
317 DWORD64 qwCacheSizeTotal; 318 DWORD64 qwCacheSizeTotal;
318 319