From a38b07af45eb36cc13fcd2546ac45e6f769e4d6f Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Sat, 17 Feb 2024 17:56:57 -0500 Subject: [PATCH] Allow MsiProperty/@Value to be an empty string. Fixes https://github.com/wixtoolset/issues/issues/7798. --- src/test/burn/TestData/VariableTests/BundleA/BundleA.wxs | 1 + src/test/burn/WixToolsetTest.BurnE2E/VariableTests.cs | 2 +- src/wix/WixToolset.Core/Compiler_Bundle.cs | 2 +- .../test/WixToolsetTest.CoreIntegration/BundleFixture.cs | 9 +++++++++ .../TestData/SimpleBundle/Bundle.wxs | 1 + 5 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/test/burn/TestData/VariableTests/BundleA/BundleA.wxs b/src/test/burn/TestData/VariableTests/BundleA/BundleA.wxs index f243c97d6..86772ae96 100644 --- a/src/test/burn/TestData/VariableTests/BundleA/BundleA.wxs +++ b/src/test/burn/TestData/VariableTests/BundleA/BundleA.wxs @@ -8,6 +8,7 @@ + diff --git a/src/test/burn/WixToolsetTest.BurnE2E/VariableTests.cs b/src/test/burn/WixToolsetTest.BurnE2E/VariableTests.cs index 22e94260b..fcd46e0b9 100644 --- a/src/test/burn/WixToolsetTest.BurnE2E/VariableTests.cs +++ b/src/test/burn/WixToolsetTest.BurnE2E/VariableTests.cs @@ -30,7 +30,7 @@ public void CanHideHiddenVariables() // Burn logging its command line. Assert.True(LogVerifier.MessageInLogFile(logFilePath, "InstallLocation=nothingtoseehere licensekey=*****")); // Burn logging the MSI install command line. - Assert.True(LogVerifier.MessageInLogFile(logFilePath, "INSTALLLOCATION=\"nothingtoseehere\" LICENSEKEY=\"*****\"")); + Assert.True(LogVerifier.MessageInLogFile(logFilePath, "INSTALLLOCATION=\"nothingtoseehere\" LICENSEKEY=\"*****\" BLANKPROPERTY=\"\"")); Assert.False(LogVerifier.MessageInLogFile(logFilePath, "supersecretkey")); } diff --git a/src/wix/WixToolset.Core/Compiler_Bundle.cs b/src/wix/WixToolset.Core/Compiler_Bundle.cs index 7790d50d8..bf68f3bd8 100644 --- a/src/wix/WixToolset.Core/Compiler_Bundle.cs +++ b/src/wix/WixToolset.Core/Compiler_Bundle.cs @@ -3340,7 +3340,7 @@ private void ParseMsiPropertyElement(XElement node, string packageId) name = this.Core.GetAttributeMsiPropertyNameValue(sourceLineNumbers, attrib); break; case "Value": - value = this.Core.GetAttributeValue(sourceLineNumbers, attrib); + value = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); break; case "Condition": condition = this.Core.GetAttributeValue(sourceLineNumbers, attrib); diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/BundleFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/BundleFixture.cs index 840334b19..7b5aeab6f 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/BundleFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/BundleFixture.cs @@ -177,6 +177,15 @@ public void CanBuildSimpleBundle() { "", }, msiPayloads); + + var msiProperties = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Chain/burn:MsiPackage[@Id='test.msi']/burn:MsiProperty", ignoreAttributesByElementName); + WixAssert.CompareLineByLine(new[] + { + "", + "", + "", + "", + }, msiProperties); } var manifestResource = new Resource(ResourceType.Manifest, "#1", 1033); diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/TestData/SimpleBundle/Bundle.wxs b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/SimpleBundle/Bundle.wxs index 01b9e716c..0593cd0f7 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/TestData/SimpleBundle/Bundle.wxs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/SimpleBundle/Bundle.wxs @@ -6,6 +6,7 @@ +