aboutsummaryrefslogtreecommitdiff
path: root/src/burn/engine/core.cpp
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2021-08-03 15:41:34 -0500
committerSean Hall <r.sean.hall@gmail.com>2021-08-04 10:03:57 -0500
commitce8acddf52bde840571535c3dfd56a2371d80684 (patch)
tree8c462caa2642bfddcb644f1353f321ecceeb2aca /src/burn/engine/core.cpp
parent6d7a275edafb3ae0f3cff94d66503a82dafb71f7 (diff)
downloadwix-ce8acddf52bde840571535c3dfd56a2371d80684.tar.gz
wix-ce8acddf52bde840571535c3dfd56a2371d80684.tar.bz2
wix-ce8acddf52bde840571535c3dfd56a2371d80684.zip
Add BURN_DEPENDENCIES struct to store Dependency state.
Diffstat (limited to 'src/burn/engine/core.cpp')
-rw-r--r--src/burn/engine/core.cpp29
1 files changed, 18 insertions, 11 deletions
diff --git a/src/burn/engine/core.cpp b/src/burn/engine/core.cpp
index 8985ab27..bccdfa9f 100644
--- a/src/burn/engine/core.cpp
+++ b/src/burn/engine/core.cpp
@@ -111,6 +111,12 @@ extern "C" HRESULT CoreInitialize(
111 hr = VariableSetNumeric(&pEngineState->variables, BURN_BUNDLE_UILEVEL, pEngineState->command.display, TRUE); 111 hr = VariableSetNumeric(&pEngineState->variables, BURN_BUNDLE_UILEVEL, pEngineState->command.display, TRUE);
112 ExitOnFailure(hr, "Failed to overwrite the %ls built-in variable.", BURN_BUNDLE_UILEVEL); 112 ExitOnFailure(hr, "Failed to overwrite the %ls built-in variable.", BURN_BUNDLE_UILEVEL);
113 113
114 if (pEngineState->internalCommand.sczActiveParent && *pEngineState->internalCommand.sczActiveParent)
115 {
116 hr = VariableSetString(&pEngineState->variables, BURN_BUNDLE_ACTIVE_PARENT, pEngineState->internalCommand.sczActiveParent, TRUE, FALSE);
117 ExitOnFailure(hr, "Failed to overwrite the bundle active parent built-in variable.");
118 }
119
114 if (pEngineState->internalCommand.sczSourceProcessPath) 120 if (pEngineState->internalCommand.sczSourceProcessPath)
115 { 121 {
116 hr = VariableSetString(&pEngineState->variables, BURN_BUNDLE_SOURCE_PROCESS_PATH, pEngineState->internalCommand.sczSourceProcessPath, TRUE, FALSE); 122 hr = VariableSetString(&pEngineState->variables, BURN_BUNDLE_SOURCE_PROCESS_PATH, pEngineState->internalCommand.sczSourceProcessPath, TRUE, FALSE);
@@ -172,7 +178,7 @@ extern "C" HRESULT CoreInitializeConstants(
172 HRESULT hr = S_OK; 178 HRESULT hr = S_OK;
173 BURN_REGISTRATION* pRegistration = &pEngineState->registration; 179 BURN_REGISTRATION* pRegistration = &pEngineState->registration;
174 180
175 hr = DependencyInitialize(pRegistration, pEngineState->sczIgnoreDependencies); 181 hr = DependencyInitialize(&pEngineState->internalCommand, &pEngineState->dependencies, pRegistration);
176 ExitOnFailure(hr, "Failed to initialize dependency data."); 182 ExitOnFailure(hr, "Failed to initialize dependency data.");
177 183
178 // Support passing Ancestors to embedded burn bundles. 184 // Support passing Ancestors to embedded burn bundles.
@@ -360,7 +366,7 @@ extern "C" HRESULT CoreDetect(
360 } 366 }
361 } 367 }
362 368
363 hr = DependencyDetect(pEngineState); 369 hr = DependencyDetect(&pEngineState->dependencies, &pEngineState->packages, &pEngineState->registration);
364 ExitOnFailure(hr, "Failed to detect the dependencies."); 370 ExitOnFailure(hr, "Failed to detect the dependencies.");
365 371
366 // Log the detected states. 372 // Log the detected states.
@@ -453,6 +459,7 @@ extern "C" HRESULT CorePlan(
453 // we make everywhere. 459 // we make everywhere.
454 pEngineState->plan.action = action; 460 pEngineState->plan.action = action;
455 pEngineState->plan.pCache = &pEngineState->cache; 461 pEngineState->plan.pCache = &pEngineState->cache;
462 pEngineState->plan.pInternalCommand = &pEngineState->internalCommand;
456 pEngineState->plan.pPayloads = &pEngineState->payloads; 463 pEngineState->plan.pPayloads = &pEngineState->payloads;
457 pEngineState->plan.wzBundleId = pEngineState->registration.sczId; 464 pEngineState->plan.wzBundleId = pEngineState->registration.sczId;
458 pEngineState->plan.wzBundleProviderKey = pEngineState->registration.sczId; 465 pEngineState->plan.wzBundleProviderKey = pEngineState->registration.sczId;
@@ -463,10 +470,10 @@ extern "C" HRESULT CorePlan(
463 ExitOnFailure(hr, "Failed to update action."); 470 ExitOnFailure(hr, "Failed to update action.");
464 471
465 // Set resume commandline 472 // Set resume commandline
466 hr = PlanSetResumeCommand(&pEngineState->registration, action, &pEngineState->command, &pEngineState->log); 473 hr = PlanSetResumeCommand(&pEngineState->plan, &pEngineState->registration, &pEngineState->command, &pEngineState->log);
467 ExitOnFailure(hr, "Failed to set resume command"); 474 ExitOnFailure(hr, "Failed to set resume command");
468 475
469 hr = DependencyPlanInitialize(&pEngineState->registration, &pEngineState->plan); 476 hr = DependencyPlanInitialize(&pEngineState->dependencies, &pEngineState->plan);
470 ExitOnFailure(hr, "Failed to initialize the dependencies for the plan."); 477 ExitOnFailure(hr, "Failed to initialize the dependencies for the plan.");
471 478
472 if (BOOTSTRAPPER_ACTION_LAYOUT == action) 479 if (BOOTSTRAPPER_ACTION_LAYOUT == action)
@@ -508,7 +515,7 @@ extern "C" HRESULT CorePlan(
508 { 515 {
509 pEngineState->plan.fPerMachine = pEngineState->registration.fPerMachine; // default the scope of the plan to the per-machine state of the bundle. 516 pEngineState->plan.fPerMachine = pEngineState->registration.fPerMachine; // default the scope of the plan to the per-machine state of the bundle.
510 517
511 hr = PlanRegistration(&pEngineState->plan, &pEngineState->registration, pEngineState->command.resumeType, pEngineState->command.relationType, &fContinuePlanning); 518 hr = PlanRegistration(&pEngineState->plan, &pEngineState->registration, &pEngineState->dependencies, pEngineState->command.resumeType, pEngineState->command.relationType, &fContinuePlanning);
512 ExitOnFailure(hr, "Failed to plan registration."); 519 ExitOnFailure(hr, "Failed to plan registration.");
513 520
514 if (fContinuePlanning) 521 if (fContinuePlanning)
@@ -921,10 +928,10 @@ extern "C" LPCWSTR CoreRelationTypeToCommandLineString(
921extern "C" HRESULT CoreRecreateCommandLine( 928extern "C" HRESULT CoreRecreateCommandLine(
922 __deref_inout_z LPWSTR* psczCommandLine, 929 __deref_inout_z LPWSTR* psczCommandLine,
923 __in BOOTSTRAPPER_ACTION action, 930 __in BOOTSTRAPPER_ACTION action,
924 __in BOOTSTRAPPER_DISPLAY display, 931 __in BURN_ENGINE_COMMAND* pInternalCommand,
932 __in BOOTSTRAPPER_COMMAND* pCommand,
925 __in BOOTSTRAPPER_RELATION_TYPE relationType, 933 __in BOOTSTRAPPER_RELATION_TYPE relationType,
926 __in BOOL fPassthrough, 934 __in BOOL fPassthrough,
927 __in_z_opt LPCWSTR wzActiveParent,
928 __in_z_opt LPCWSTR wzAncestors, 935 __in_z_opt LPCWSTR wzAncestors,
929 __in_z_opt LPCWSTR wzAppendLogPath, 936 __in_z_opt LPCWSTR wzAppendLogPath,
930 __in_z_opt LPCWSTR wzAdditionalCommandLineArguments 937 __in_z_opt LPCWSTR wzAdditionalCommandLineArguments
@@ -937,7 +944,7 @@ extern "C" HRESULT CoreRecreateCommandLine(
937 hr = StrAllocString(psczCommandLine, L"", 0); 944 hr = StrAllocString(psczCommandLine, L"", 0);
938 ExitOnFailure(hr, "Failed to empty command line."); 945 ExitOnFailure(hr, "Failed to empty command line.");
939 946
940 switch (display) 947 switch (pCommand->display)
941 { 948 {
942 case BOOTSTRAPPER_DISPLAY_NONE: 949 case BOOTSTRAPPER_DISPLAY_NONE:
943 hr = StrAllocConcat(psczCommandLine, L" /quiet", 0); 950 hr = StrAllocConcat(psczCommandLine, L" /quiet", 0);
@@ -962,11 +969,11 @@ extern "C" HRESULT CoreRecreateCommandLine(
962 } 969 }
963 ExitOnFailure(hr, "Failed to append action state to command-line"); 970 ExitOnFailure(hr, "Failed to append action state to command-line");
964 971
965 if (wzActiveParent) 972 if (pInternalCommand->sczActiveParent)
966 { 973 {
967 if (*wzActiveParent) 974 if (*pInternalCommand->sczActiveParent)
968 { 975 {
969 hr = StrAllocFormatted(&scz, L" /%ls \"%ls\"", BURN_COMMANDLINE_SWITCH_PARENT, wzActiveParent); 976 hr = StrAllocFormatted(&scz, L" /%ls \"%ls\"", BURN_COMMANDLINE_SWITCH_PARENT, pInternalCommand->sczActiveParent);
970 ExitOnFailure(hr, "Failed to format active parent command-line for command-line."); 977 ExitOnFailure(hr, "Failed to format active parent command-line for command-line.");
971 } 978 }
972 else 979 else