@joebigelow / wix-1 / commits / 8af9c39d

Help BAs and BundleExtensions find their data file.

Sean Hall committed Mar 29, 2020 at 19:27 UTC 8af9c39dceb6a6ccb55b5a4d76bb71c7c4df133a
4 files changed +17 -1
src/engine/burnextension.cpp
+8
@@ -104,6 +104,7 @@ EXTERN_C HRESULT BurnExtensionLoad(
104 )
105 {
106 HRESULT hr = S_OK;
107 + LPWSTR sczBundleExtensionDataPath = NULL;
108 BUNDLE_EXTENSION_CREATE_ARGS args = { };
109 BUNDLE_EXTENSION_CREATE_RESULTS results = { };
110
@@ -112,6 +113,9 @@ EXTERN_C HRESULT BurnExtensionLoad(
113 ExitFunction();
114 }
115
116 + hr = PathConcat(pEngineContext->pEngineState->userExperience.sczTempDirectory, L"BundleExtensionData.xml", &sczBundleExtensionDataPath);
117 + ExitOnFailure(hr, "Failed to get BundleExtensionDataPath.");
118 +
119 for (DWORD i = 0; i < pBurnExtensions->cExtensions; ++i)
120 {
121 BURN_EXTENSION* pExtension = &pBurnExtensions->rgExtensions[i];
@@ -123,6 +127,8 @@ EXTERN_C HRESULT BurnExtensionLoad(
127 args.pfnBundleExtensionEngineProc = EngineForExtensionProc;
128 args.pvBundleExtensionEngineProcContext = pEngineContext;
129 args.qwEngineAPIVersion = MAKEQWORDVERSION(0, 0, 0, 1); // TODO: need to decide whether to keep this, and if so when to update it.
130 + args.wzBootstrapperWorkingFolder = pEngineContext->pEngineState->userExperience.sczTempDirectory;
131 + args.wzBundleExtensionDataPath = sczBundleExtensionDataPath;
132
133 results.cbSize = sizeof(BUNDLE_EXTENSION_CREATE_RESULTS);
134
@@ -143,6 +149,8 @@ EXTERN_C HRESULT BurnExtensionLoad(
149 }
150
151 LExit:
152 + ReleaseStr(sczBundleExtensionDataPath);
153 +
154 return hr;
155 }
156
src/engine/core.cpp
+6
@@ -151,6 +151,12 @@ extern "C" HRESULT CoreInitialize(
151 // Load the catalog files as soon as they are extracted.
152 hr = CatalogLoadFromPayload(&pEngineState->catalogs, &pEngineState->userExperience.payloads);
153 ExitOnFailure(hr, "Failed to load catalog files.");
154 +
155 + hr = PathConcat(pEngineState->userExperience.sczTempDirectory, L"BootstrapperApplicationData.xml", &pEngineState->command.wzBootstrapperApplicationDataPath);
156 + ExitOnFailure(hr, "Failed to get BootstrapperApplicationDataPath.");
157 +
158 + hr = StrAllocString(&pEngineState->command.wzBootstrapperWorkingFolder, pEngineState->userExperience.sczTempDirectory, 0);
159 + ExitOnFailure(hr, "Failed to copy sczBootstrapperWorkingFolder.");
160 }
161
162 LExit:
src/engine/engine.cpp
+2
@@ -368,6 +368,8 @@ static void UninitializeEngineState(
368 SectionUninitialize(&pEngineState->section);
369 ContainersUninitialize(&pEngineState->containers);
370
371 + ReleaseStr(pEngineState->command.wzBootstrapperApplicationDataPath);
372 + ReleaseStr(pEngineState->command.wzBootstrapperWorkingFolder);
373 ReleaseStr(pEngineState->command.wzLayoutDirectory);
374 ReleaseStr(pEngineState->command.wzCommandLine);
375
src/engine/userexperience.cpp
+1 -1
@@ -97,7 +97,7 @@ extern "C" HRESULT UserExperienceLoad(
97 args.pCommand = pCommand;
98 args.pfnBootstrapperEngineProc = EngineForApplicationProc;
99 args.pvBootstrapperEngineProcContext = pEngineContext;
100 - args.qwEngineAPIVersion = MAKEQWORDVERSION(0, 0, 0, 5); // TODO: need to decide whether to keep this, and if so when to update it.
100 + args.qwEngineAPIVersion = MAKEQWORDVERSION(0, 0, 0, 6); // TODO: need to decide whether to keep this, and if so when to update it.
101
102 results.cbSize = sizeof(BOOTSTRAPPER_CREATE_RESULTS);
103