aboutsummaryrefslogtreecommitdiff
path: root/src/engine/EngineForExtension.cpp
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2020-07-31 17:06:35 -0600
committerSean Hall <r.sean.hall@gmail.com>2020-08-09 10:33:49 -0600
commitd21eed76c48960707561c45c492c10a6a23c052e (patch)
treeebab09d099a699a24801fcfb4d7152cf82cc4a06 /src/engine/EngineForExtension.cpp
parentad80d6dc10f9bd6cb6a084857a8fb546cc55e756 (diff)
downloadwix-d21eed76c48960707561c45c492c10a6a23c052e.tar.gz
wix-d21eed76c48960707561c45c492c10a6a23c052e.tar.bz2
wix-d21eed76c48960707561c45c492c10a6a23c052e.zip
WIXFEAT:4763 Change "string" variable type to literal and add "formatted".
Diffstat (limited to 'src/engine/EngineForExtension.cpp')
-rw-r--r--src/engine/EngineForExtension.cpp30
1 files changed, 1 insertions, 29 deletions
diff --git a/src/engine/EngineForExtension.cpp b/src/engine/EngineForExtension.cpp
index 9667dd18..fdfa59b1 100644
--- a/src/engine/EngineForExtension.cpp
+++ b/src/engine/EngineForExtension.cpp
@@ -245,31 +245,6 @@ LExit:
245 return hr; 245 return hr;
246} 246}
247 247
248static HRESULT BEEngineSetVariableLiteralString(
249 __in BURN_EXTENSION_ENGINE_CONTEXT* pContext,
250 __in const BUNDLE_EXTENSION_ENGINE_SETVARIABLELITERALSTRING_ARGS* pArgs,
251 __in BUNDLE_EXTENSION_ENGINE_SETVARIABLELITERALSTRING_RESULTS* /*pResults*/
252 )
253{
254 HRESULT hr = S_OK;
255 LPCWSTR wzVariable = pArgs->wzVariable;
256 LPCWSTR wzValue = pArgs->wzValue;
257
258 if (wzVariable && *wzVariable)
259 {
260 hr = VariableSetLiteralString(&pContext->pEngineState->variables, wzVariable, wzValue, FALSE);
261 ExitOnFailure(hr, "Failed to set literal string variable.");
262 }
263 else
264 {
265 hr = E_INVALIDARG;
266 ExitOnFailure(hr, "Bundle Extension did not provide variable name.");
267 }
268
269LExit:
270 return hr;
271}
272
273static HRESULT BEEngineSetVariableNumeric( 248static HRESULT BEEngineSetVariableNumeric(
274 __in BURN_EXTENSION_ENGINE_CONTEXT* pContext, 249 __in BURN_EXTENSION_ENGINE_CONTEXT* pContext,
275 __in const BUNDLE_EXTENSION_ENGINE_SETVARIABLENUMERIC_ARGS* pArgs, 250 __in const BUNDLE_EXTENSION_ENGINE_SETVARIABLENUMERIC_ARGS* pArgs,
@@ -307,7 +282,7 @@ static HRESULT BEEngineSetVariableString(
307 282
308 if (wzVariable && *wzVariable) 283 if (wzVariable && *wzVariable)
309 { 284 {
310 hr = VariableSetString(&pContext->pEngineState->variables, wzVariable, wzValue, FALSE); 285 hr = VariableSetString(&pContext->pEngineState->variables, wzVariable, wzValue, FALSE, pArgs->fFormatted);
311 ExitOnFailure(hr, "Failed to set string variable."); 286 ExitOnFailure(hr, "Failed to set string variable.");
312 } 287 }
313 else 288 else
@@ -383,9 +358,6 @@ HRESULT WINAPI EngineForExtensionProc(
383 case BUNDLE_EXTENSION_ENGINE_MESSAGE_LOG: 358 case BUNDLE_EXTENSION_ENGINE_MESSAGE_LOG:
384 hr = BEEngineLog(pContext, reinterpret_cast<BUNDLE_EXTENSION_ENGINE_LOG_ARGS*>(pvArgs), reinterpret_cast<BUNDLE_EXTENSION_ENGINE_LOG_RESULTS*>(pvResults)); 359 hr = BEEngineLog(pContext, reinterpret_cast<BUNDLE_EXTENSION_ENGINE_LOG_ARGS*>(pvArgs), reinterpret_cast<BUNDLE_EXTENSION_ENGINE_LOG_RESULTS*>(pvResults));
385 break; 360 break;
386 case BUNDLE_EXTENSION_ENGINE_MESSAGE_SETVARIABLELITERALSTRING:
387 hr = BEEngineSetVariableLiteralString(pContext, reinterpret_cast<BUNDLE_EXTENSION_ENGINE_SETVARIABLELITERALSTRING_ARGS*>(pvArgs), reinterpret_cast<BUNDLE_EXTENSION_ENGINE_SETVARIABLELITERALSTRING_RESULTS*>(pvResults));
388 break;
389 case BUNDLE_EXTENSION_ENGINE_MESSAGE_SETVARIABLENUMERIC: 361 case BUNDLE_EXTENSION_ENGINE_MESSAGE_SETVARIABLENUMERIC:
390 hr = BEEngineSetVariableNumeric(pContext, reinterpret_cast<BUNDLE_EXTENSION_ENGINE_SETVARIABLENUMERIC_ARGS*>(pvArgs), reinterpret_cast<BUNDLE_EXTENSION_ENGINE_SETVARIABLENUMERIC_RESULTS*>(pvResults)); 362 hr = BEEngineSetVariableNumeric(pContext, reinterpret_cast<BUNDLE_EXTENSION_ENGINE_SETVARIABLENUMERIC_ARGS*>(pvArgs), reinterpret_cast<BUNDLE_EXTENSION_ENGINE_SETVARIABLENUMERIC_RESULTS*>(pvResults));
391 break; 363 break;