aboutsummaryrefslogtreecommitdiff
path: root/src/burn/engine/variable.cpp
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2021-07-01 09:30:10 -0500
committerSean Hall <r.sean.hall@gmail.com>2021-07-02 12:50:09 -0500
commit9bdf3730cd43e1af8a4ea9be6cf2fba77fcff2d2 (patch)
treeea2a05de5a8a1dfcb2af8e9e3805fe015729f66a /src/burn/engine/variable.cpp
parent8cbfc326cccf8d9b3b63cb6f752fc770f7dee0fc (diff)
downloadwix-9bdf3730cd43e1af8a4ea9be6cf2fba77fcff2d2.tar.gz
wix-9bdf3730cd43e1af8a4ea9be6cf2fba77fcff2d2.tar.bz2
wix-9bdf3730cd43e1af8a4ea9be6cf2fba77fcff2d2.zip
Add bundle option for command line variables to always be uppercase.
Fixes #3777
Diffstat (limited to 'src/burn/engine/variable.cpp')
-rw-r--r--src/burn/engine/variable.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/burn/engine/variable.cpp b/src/burn/engine/variable.cpp
index 6f818ff3..e2b1f1f2 100644
--- a/src/burn/engine/variable.cpp
+++ b/src/burn/engine/variable.cpp
@@ -294,6 +294,7 @@ extern "C" HRESULT VariablesParseFromXml(
294 ) 294 )
295{ 295{
296 HRESULT hr = S_OK; 296 HRESULT hr = S_OK;
297 IXMLDOMNode* pixnCommandLine = NULL;
297 IXMLDOMNodeList* pixnNodes = NULL; 298 IXMLDOMNodeList* pixnNodes = NULL;
298 IXMLDOMNode* pixnNode = NULL; 299 IXMLDOMNode* pixnNode = NULL;
299 DWORD cNodes = 0; 300 DWORD cNodes = 0;
@@ -307,6 +308,32 @@ extern "C" HRESULT VariablesParseFromXml(
307 308
308 ::EnterCriticalSection(&pVariables->csAccess); 309 ::EnterCriticalSection(&pVariables->csAccess);
309 310
311 // select registration node
312 hr = XmlSelectSingleNode(pixnBundle, L"CommandLine", &pixnCommandLine);
313 if (S_FALSE == hr)
314 {
315 hr = E_NOTFOUND;
316 }
317 ExitOnFailure(hr, "Failed to select CommandLine node.");
318
319 // @Variables
320 hr = XmlGetAttributeEx(pixnCommandLine, L"Variables", &scz);
321 ExitOnFailure(hr, "Failed to get CommandLine/@Variables.");
322
323 if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, scz, -1, L"upperCase", -1))
324 {
325 pVariables->commandLineType = BURN_VARIABLE_COMMAND_LINE_TYPE_UPPER_CASE;
326 }
327 else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, scz, -1, L"caseSensitive", -1))
328 {
329 pVariables->commandLineType = BURN_VARIABLE_COMMAND_LINE_TYPE_CASE_SENSITIVE;
330 }
331 else
332 {
333 hr = E_INVALIDARG;
334 ExitOnFailure(hr, "Invalid value for CommandLine/@Variables: %ls", scz);
335 }
336
310 // select variable nodes 337 // select variable nodes
311 hr = XmlSelectNodes(pixnBundle, L"Variable", &pixnNodes); 338 hr = XmlSelectNodes(pixnBundle, L"Variable", &pixnNodes);
312 ExitOnFailure(hr, "Failed to select variable nodes."); 339 ExitOnFailure(hr, "Failed to select variable nodes.");
@@ -434,6 +461,7 @@ extern "C" HRESULT VariablesParseFromXml(
434LExit: 461LExit:
435 ::LeaveCriticalSection(&pVariables->csAccess); 462 ::LeaveCriticalSection(&pVariables->csAccess);
436 463
464 ReleaseObject(pixnCommandLine);
437 ReleaseObject(pixnNodes); 465 ReleaseObject(pixnNodes);
438 ReleaseObject(pixnNode); 466 ReleaseObject(pixnNode);
439 ReleaseStr(scz); 467 ReleaseStr(scz);