Skip to content

Commit

Permalink
Allow MsiProperty/@value to be an empty string.
Browse files Browse the repository at this point in the history
  • Loading branch information
barnson committed Feb 17, 2024
1 parent e98ff25 commit a38b07a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/test/burn/TestData/VariableTests/BundleA/BundleA.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<MsiPackage Id="PackageA" SourceFile="$(var.PackageA.TargetPath)">
<MsiProperty Name="INSTALLLOCATION" Value="[INSTALLLOCATION]" />
<MsiProperty Name="LICENSEKEY" Value="[LICENSEKEY]" />
<MsiProperty Name="BLANKPROPERTY" Value="" />
</MsiPackage>
</PackageGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/test/burn/WixToolsetTest.BurnE2E/VariableTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}

Expand Down
2 changes: 1 addition & 1 deletion src/wix/WixToolset.Core/Compiler_Bundle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
9 changes: 9 additions & 0 deletions src/wix/test/WixToolsetTest.CoreIntegration/BundleFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,15 @@ public void CanBuildSimpleBundle()
{
"<Payload Id='test.msi' FilePath='test.msi' FileSize='*' Hash='*' Packaging='embedded' SourcePath='a0' Container='WixAttachedContainer' />",
}, msiPayloads);

var msiProperties = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Chain/burn:MsiPackage[@Id='test.msi']/burn:MsiProperty", ignoreAttributesByElementName);
WixAssert.CompareLineByLine(new[]
{
"<MsiProperty Id='TEST' Value='1' />",
"<MsiProperty Id='TESTBLANK' Value='' />",
"<MsiProperty Id='ARPSYSTEMCOMPONENT' Value='1' />",
"<MsiProperty Id='MSIFASTINSTALL' Value='7' />",
}, msiProperties);
}

var manifestResource = new Resource(ResourceType.Manifest, "#1", 1033);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<Chain>
<MsiPackage SourceFile="test.msi">
<MsiProperty Name="TEST" Value="1" />
<MsiProperty Name="TESTBLANK" Value="" />
</MsiPackage>
</Chain>
</Bundle>
Expand Down

0 comments on commit a38b07a

Please sign in to comment.