From d5985a1688bc878e42ffd3ce3939fa52303cab16 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Fri, 13 May 2022 15:39:40 -0500 Subject: Add option to hosts to always install prereqs. Add PrereqPackage to BundlePackage Implements 4718 --- src/ext/Bal/dnchost/dnchost.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/ext/Bal/dnchost/dnchost.cpp') diff --git a/src/ext/Bal/dnchost/dnchost.cpp b/src/ext/Bal/dnchost/dnchost.cpp index 6c066f43..36970f83 100644 --- a/src/ext/Bal/dnchost/dnchost.cpp +++ b/src/ext/Bal/dnchost/dnchost.cpp @@ -76,6 +76,16 @@ extern "C" HRESULT WINAPI BootstrapperApplicationCreate( vstate.fInitialized = TRUE; } + if (vstate.prereqData.fAlwaysInstallPrereqs && !vstate.prereqData.fCompleted) + { + BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Loading prerequisite bootstrapper application since it's configured to always run before loading the runtime."); + + hr = CreatePrerequisiteBA(&vstate, pEngine, pArgs, pResults); + BalExitOnFailure(hr, "Failed to create the pre-requisite bootstrapper application."); + + ExitFunction(); + } + if (!vstate.fInitializedRuntime) { hr = LoadRuntime(&vstate); @@ -214,6 +224,15 @@ static HRESULT LoadDncConfiguration( hr = StrAllocConcat(&pState->sczBaFactoryRuntimeConfigPath, L".runtimeconfig.json", 0); BalExitOnFailure(hr, "Failed to concat extension to runtime config path."); + hr = XmlSelectSingleNode(pixdManifest, L"/BootstrapperApplicationData/WixMbaPrereqOptions", &pixnHost); + BalExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed to find WixMbaPrereqOptions element in bootstrapper application config."); + + if (fXmlFound) + { + hr = XmlGetAttributeNumber(pixnHost, L"AlwaysInstallPrereqs", reinterpret_cast(&pState->prereqData.fAlwaysInstallPrereqs)); + BalExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed to get AlwaysInstallPrereqs value."); + } + pState->type = DNCHOSTTYPE_FDD; hr = XmlSelectSingleNode(pixdManifest, L"/BootstrapperApplicationData/WixDncOptions", &pixnHost); -- cgit v1.2.3-55-g6feb