Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow MsiProperty/@Value to be an empty string. #493

Merged
merged 1 commit into from
Feb 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading