From a38b07af45eb36cc13fcd2546ac45e6f769e4d6f Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Sat, 17 Feb 2024 17:56:57 -0500 Subject: 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 +- src/wix/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 f243c97d..86772ae9 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 22e94260..fcd46e0b 100644 --- a/src/test/burn/WixToolsetTest.BurnE2E/VariableTests.cs +++ b/src/test/burn/WixToolsetTest.BurnE2E/VariableTests.cs @@ -30,7 +30,7 @@ namespace WixToolsetTest.BurnE2E // 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 7790d50d..bf68f3bd 100644 --- a/src/wix/WixToolset.Core/Compiler_Bundle.cs +++ b/src/wix/WixToolset.Core/Compiler_Bundle.cs @@ -3340,7 +3340,7 @@ namespace WixToolset.Core 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 840334b1..7b5aeab6 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/BundleFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/BundleFixture.cs @@ -177,6 +177,15 @@ namespace WixToolsetTest.CoreIntegration { "", }, 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 01b9e716..0593cd0f 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 @@ + -- cgit v1.2.3-55-g6feb