@joebigelow / wix-1 / commits / 2a8f47e3

Support an empty multiString registry value

Bob Arnson committed Nov 16, 2020 at 22:13 UTC 2a8f47e357bfbfe20c962cade4455793e45dae7c
3 files changed +4 -7
src/WixToolset.Core/Compiler_2.cs
+1 -6
@@ -1977,16 +1977,11 @@ namespace WixToolset.Core
1977 }
1978 }
1979
1980 - if (multiStringValue == null)
1981 - {
1982 - this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Value"));
1983 - }
1984 -
1980 this.Core.VerifyNoInnerText(sourceLineNumbers, node);
1981
1982 this.Core.ParseForExtensionElements(node);
1983
1989 - return (null == value) ? multiStringValue : String.Concat(value, "[~]", multiStringValue);
1984 + return null == value ? multiStringValue ?? "[~]" : String.Concat(value, "[~]", multiStringValue);
1985 }
1986
1987 /// <summary>
src/test/WixToolsetTest.CoreIntegration/RegistryFixture.cs
+1 -1
@@ -74,7 +74,7 @@ namespace WixToolsetTest.CoreIntegration
74 Assert.Equal(new[]
75 {
76 "Registry:regitq_Wx9LfvJuNSc2un6gIHAzr4A\t2\tPath\\To\\AnotherKey\tSecret\t#x\tMultiStringComponent",
77 - "Registry:regmeTJMpOD41igfxhTcUVZ7kNG1Mo\t2\tPath\\To\\Key\t\ta[~]b[~]c\tMultiStringComponent",
77 + "Registry:regmeTJMpOD41igfxhTcUVZ7kNG1Mo\t2\tPath\\To\\Key\t\ta[~]b[~][~]c[~]\tMultiStringComponent",
78 }, results);
79 }
80 }
src/test/WixToolsetTest.CoreIntegration/TestData/Registry/RegistryValueMultiString.wxs
+2
@@ -6,7 +6,9 @@
6 <RegistryValue Root="HKLM" Key="Path\To\Key" Type="multiString" KeyPath="yes">
7 <MultiString Value="a" />
8 <MultiStringValue Value="b" />
9 + <MultiStringValue />
10 <MultiString Value="c" />
11 + <MultiStringValue />
12 </RegistryValue>
13 <RegistryValue Root="HKLM" Key="Path\To\AnotherKey" Name="Secret" Type="binary" />
14 </Component>