From 28c8abfda013d6aa568fde8b26da65522748d376 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Mon, 1 Aug 2022 17:07:49 -0500 Subject: Downgrade error to warning when search refs a reserved prefix variable. The engine doesn't actually prevent external callers from setting variables that start with 'Wix'. --- src/burn/test/BurnUnitTest/VariableTest.cpp | 33 +++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'src/burn') diff --git a/src/burn/test/BurnUnitTest/VariableTest.cpp b/src/burn/test/BurnUnitTest/VariableTest.cpp index f864307c..8ee6e179 100644 --- a/src/burn/test/BurnUnitTest/VariableTest.cpp +++ b/src/burn/test/BurnUnitTest/VariableTest.cpp @@ -162,6 +162,39 @@ namespace Bootstrapper } } + [Fact] + void VariablesSetCustomWixVariableTest() + { + HRESULT hr = S_OK; + IXMLDOMElement* pixeBundle = NULL; + BURN_VARIABLES variables = { }; + + try + { + LPCWSTR wzDocument = + L"" + L" " + L""; + + hr = VariableInitialize(&variables); + TestThrowOnFailure(hr, L"Failed to initialize variables."); + + // load XML document + LoadBundleXmlHelper(wzDocument, &pixeBundle); + + hr = VariablesParseFromXml(&variables, pixeBundle); + NativeAssert::Succeeded(hr, "Failed to parse variables from XML."); + + hr = VariableSetString(&variables, L"WixCustomVariable", L"something", FALSE, FALSE); + NativeAssert::Succeeded(hr, "Failed to set 'WixCustomVariable' variable."); + } + finally + { + ReleaseObject(pixeBundle); + VariablesUninitialize(&variables); + } + } + [Fact] void VariablesFormatTest() { -- cgit v1.2.3-55-g6feb