aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2020-03-29 19:27:25 +1000
committerSean Hall <r.sean.hall@gmail.com>2020-03-30 21:40:34 +1000
commit8af9c39dceb6a6ccb55b5a4d76bb71c7c4df133a (patch)
treeb7ddb8c23a36cdfc950c66eb7fba08760f72049b
parent1a0190bd31953a5ffb68cac75866328dccbf03f2 (diff)
downloadwix-8af9c39dceb6a6ccb55b5a4d76bb71c7c4df133a.tar.gz
wix-8af9c39dceb6a6ccb55b5a4d76bb71c7c4df133a.tar.bz2
wix-8af9c39dceb6a6ccb55b5a4d76bb71c7c4df133a.zip
Help BAs and BundleExtensions find their data file.
-rw-r--r--src/engine/burnextension.cpp8
-rw-r--r--src/engine/core.cpp6
-rw-r--r--src/engine/engine.cpp2
-rw-r--r--src/engine/userexperience.cpp2
4 files changed, 17 insertions, 1 deletions
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(
104 ) 104 )
105{ 105{
106 HRESULT hr = S_OK; 106 HRESULT hr = S_OK;
107 LPWSTR sczBundleExtensionDataPath = NULL;
107 BUNDLE_EXTENSION_CREATE_ARGS args = { }; 108 BUNDLE_EXTENSION_CREATE_ARGS args = { };
108 BUNDLE_EXTENSION_CREATE_RESULTS results = { }; 109 BUNDLE_EXTENSION_CREATE_RESULTS results = { };
109 110
@@ -112,6 +113,9 @@ EXTERN_C HRESULT BurnExtensionLoad(
112 ExitFunction(); 113 ExitFunction();
113 } 114 }
114 115
116 hr = PathConcat(pEngineContext->pEngineState->userExperience.sczTempDirectory, L"BundleExtensionData.xml", &sczBundleExtensionDataPath);
117 ExitOnFailure(hr, "Failed to get BundleExtensionDataPath.");
118
115 for (DWORD i = 0; i < pBurnExtensions->cExtensions; ++i) 119 for (DWORD i = 0; i < pBurnExtensions->cExtensions; ++i)
116 { 120 {
117 BURN_EXTENSION* pExtension = &pBurnExtensions->rgExtensions[i]; 121 BURN_EXTENSION* pExtension = &pBurnExtensions->rgExtensions[i];
@@ -123,6 +127,8 @@ EXTERN_C HRESULT BurnExtensionLoad(
123 args.pfnBundleExtensionEngineProc = EngineForExtensionProc; 127 args.pfnBundleExtensionEngineProc = EngineForExtensionProc;
124 args.pvBundleExtensionEngineProcContext = pEngineContext; 128 args.pvBundleExtensionEngineProcContext = pEngineContext;
125 args.qwEngineAPIVersion = MAKEQWORDVERSION(0, 0, 0, 1); // TODO: need to decide whether to keep this, and if so when to update it. 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;
126 132
127 results.cbSize = sizeof(BUNDLE_EXTENSION_CREATE_RESULTS); 133 results.cbSize = sizeof(BUNDLE_EXTENSION_CREATE_RESULTS);
128 134
@@ -143,6 +149,8 @@ EXTERN_C HRESULT BurnExtensionLoad(
143 } 149 }
144 150
145LExit: 151LExit:
152 ReleaseStr(sczBundleExtensionDataPath);
153
146 return hr; 154 return hr;
147} 155}
148 156
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(
151 // Load the catalog files as soon as they are extracted. 151 // Load the catalog files as soon as they are extracted.
152 hr = CatalogLoadFromPayload(&pEngineState->catalogs, &pEngineState->userExperience.payloads); 152 hr = CatalogLoadFromPayload(&pEngineState->catalogs, &pEngineState->userExperience.payloads);
153 ExitOnFailure(hr, "Failed to load catalog files."); 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.");
154 } 160 }
155 161
156LExit: 162LExit:
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(
368 SectionUninitialize(&pEngineState->section); 368 SectionUninitialize(&pEngineState->section);
369 ContainersUninitialize(&pEngineState->containers); 369 ContainersUninitialize(&pEngineState->containers);
370 370
371 ReleaseStr(pEngineState->command.wzBootstrapperApplicationDataPath);
372 ReleaseStr(pEngineState->command.wzBootstrapperWorkingFolder);
371 ReleaseStr(pEngineState->command.wzLayoutDirectory); 373 ReleaseStr(pEngineState->command.wzLayoutDirectory);
372 ReleaseStr(pEngineState->command.wzCommandLine); 374 ReleaseStr(pEngineState->command.wzCommandLine);
373 375
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(
97 args.pCommand = pCommand; 97 args.pCommand = pCommand;
98 args.pfnBootstrapperEngineProc = EngineForApplicationProc; 98 args.pfnBootstrapperEngineProc = EngineForApplicationProc;
99 args.pvBootstrapperEngineProcContext = pEngineContext; 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 101
102 results.cbSize = sizeof(BOOTSTRAPPER_CREATE_RESULTS); 102 results.cbSize = sizeof(BOOTSTRAPPER_CREATE_RESULTS);
103 103