From 8af9c39dceb6a6ccb55b5a4d76bb71c7c4df133a Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sun, 29 Mar 2020 19:27:25 +1000 Subject: Help BAs and BundleExtensions find their data file. --- src/engine/burnextension.cpp | 8 ++++++++ src/engine/core.cpp | 6 ++++++ src/engine/engine.cpp | 2 ++ src/engine/userexperience.cpp | 2 +- 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/engine/burnextension.cpp b/src/engine/burnextension.cpp index 68d34123..59f84eca 100644 --- a/src/engine/burnextension.cpp +++ b/src/engine/burnextension.cpp @@ -104,6 +104,7 @@ EXTERN_C HRESULT BurnExtensionLoad( ) { HRESULT hr = S_OK; + LPWSTR sczBundleExtensionDataPath = NULL; BUNDLE_EXTENSION_CREATE_ARGS args = { }; BUNDLE_EXTENSION_CREATE_RESULTS results = { }; @@ -112,6 +113,9 @@ EXTERN_C HRESULT BurnExtensionLoad( ExitFunction(); } + hr = PathConcat(pEngineContext->pEngineState->userExperience.sczTempDirectory, L"BundleExtensionData.xml", &sczBundleExtensionDataPath); + ExitOnFailure(hr, "Failed to get BundleExtensionDataPath."); + for (DWORD i = 0; i < pBurnExtensions->cExtensions; ++i) { BURN_EXTENSION* pExtension = &pBurnExtensions->rgExtensions[i]; @@ -123,6 +127,8 @@ EXTERN_C HRESULT BurnExtensionLoad( args.pfnBundleExtensionEngineProc = EngineForExtensionProc; args.pvBundleExtensionEngineProcContext = pEngineContext; args.qwEngineAPIVersion = MAKEQWORDVERSION(0, 0, 0, 1); // TODO: need to decide whether to keep this, and if so when to update it. + args.wzBootstrapperWorkingFolder = pEngineContext->pEngineState->userExperience.sczTempDirectory; + args.wzBundleExtensionDataPath = sczBundleExtensionDataPath; results.cbSize = sizeof(BUNDLE_EXTENSION_CREATE_RESULTS); @@ -143,6 +149,8 @@ EXTERN_C HRESULT BurnExtensionLoad( } LExit: + ReleaseStr(sczBundleExtensionDataPath); + return hr; } diff --git a/src/engine/core.cpp b/src/engine/core.cpp index 10750be8..26e74588 100644 --- a/src/engine/core.cpp +++ b/src/engine/core.cpp @@ -151,6 +151,12 @@ extern "C" HRESULT CoreInitialize( // Load the catalog files as soon as they are extracted. hr = CatalogLoadFromPayload(&pEngineState->catalogs, &pEngineState->userExperience.payloads); ExitOnFailure(hr, "Failed to load catalog files."); + + hr = PathConcat(pEngineState->userExperience.sczTempDirectory, L"BootstrapperApplicationData.xml", &pEngineState->command.wzBootstrapperApplicationDataPath); + ExitOnFailure(hr, "Failed to get BootstrapperApplicationDataPath."); + + hr = StrAllocString(&pEngineState->command.wzBootstrapperWorkingFolder, pEngineState->userExperience.sczTempDirectory, 0); + ExitOnFailure(hr, "Failed to copy sczBootstrapperWorkingFolder."); } LExit: diff --git a/src/engine/engine.cpp b/src/engine/engine.cpp index 488dbfe8..36c58b49 100644 --- a/src/engine/engine.cpp +++ b/src/engine/engine.cpp @@ -368,6 +368,8 @@ static void UninitializeEngineState( SectionUninitialize(&pEngineState->section); ContainersUninitialize(&pEngineState->containers); + ReleaseStr(pEngineState->command.wzBootstrapperApplicationDataPath); + ReleaseStr(pEngineState->command.wzBootstrapperWorkingFolder); ReleaseStr(pEngineState->command.wzLayoutDirectory); ReleaseStr(pEngineState->command.wzCommandLine); diff --git a/src/engine/userexperience.cpp b/src/engine/userexperience.cpp index 26b20f39..566597a2 100644 --- a/src/engine/userexperience.cpp +++ b/src/engine/userexperience.cpp @@ -97,7 +97,7 @@ extern "C" HRESULT UserExperienceLoad( args.pCommand = pCommand; args.pfnBootstrapperEngineProc = EngineForApplicationProc; args.pvBootstrapperEngineProcContext = pEngineContext; - args.qwEngineAPIVersion = MAKEQWORDVERSION(0, 0, 0, 5); // TODO: need to decide whether to keep this, and if so when to update it. + args.qwEngineAPIVersion = MAKEQWORDVERSION(0, 0, 0, 6); // TODO: need to decide whether to keep this, and if so when to update it. results.cbSize = sizeof(BOOTSTRAPPER_CREATE_RESULTS); -- cgit v1.2.3-55-g6feb