diff options
| author | Bob Arnson <bob@firegiant.com> | 2020-11-16 22:13:33 -0500 |
|---|---|---|
| committer | Bob Arnson <bob@firegiant.com> | 2020-11-16 22:19:41 -0500 |
| commit | 2a8f47e357bfbfe20c962cade4455793e45dae7c (patch) | |
| tree | b13563d0df7652d01bd11bfb1d2e7d67ae040c1e /src | |
| parent | af854e4c8341cc90fb41c8b5122d4308574e8a9a (diff) | |
| download | wix-2a8f47e357bfbfe20c962cade4455793e45dae7c.tar.gz wix-2a8f47e357bfbfe20c962cade4455793e45dae7c.tar.bz2 wix-2a8f47e357bfbfe20c962cade4455793e45dae7c.zip | |
Support an empty multiString registry value
Diffstat (limited to 'src')
3 files changed, 4 insertions, 7 deletions
diff --git a/src/WixToolset.Core/Compiler_2.cs b/src/WixToolset.Core/Compiler_2.cs index f55264e5..1922a70b 100644 --- a/src/WixToolset.Core/Compiler_2.cs +++ b/src/WixToolset.Core/Compiler_2.cs | |||
| @@ -1977,16 +1977,11 @@ namespace WixToolset.Core | |||
| 1977 | } | 1977 | } |
| 1978 | } | 1978 | } |
| 1979 | 1979 | ||
| 1980 | if (multiStringValue == null) | ||
| 1981 | { | ||
| 1982 | this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Value")); | ||
| 1983 | } | ||
| 1984 | |||
| 1985 | this.Core.VerifyNoInnerText(sourceLineNumbers, node); | 1980 | this.Core.VerifyNoInnerText(sourceLineNumbers, node); |
| 1986 | 1981 | ||
| 1987 | this.Core.ParseForExtensionElements(node); | 1982 | this.Core.ParseForExtensionElements(node); |
| 1988 | 1983 | ||
| 1989 | return (null == value) ? multiStringValue : String.Concat(value, "[~]", multiStringValue); | 1984 | return null == value ? multiStringValue ?? "[~]" : String.Concat(value, "[~]", multiStringValue); |
| 1990 | } | 1985 | } |
| 1991 | 1986 | ||
| 1992 | /// <summary> | 1987 | /// <summary> |
diff --git a/src/test/WixToolsetTest.CoreIntegration/RegistryFixture.cs b/src/test/WixToolsetTest.CoreIntegration/RegistryFixture.cs index 2a1e2a49..699155d4 100644 --- a/src/test/WixToolsetTest.CoreIntegration/RegistryFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/RegistryFixture.cs | |||
| @@ -74,7 +74,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 74 | Assert.Equal(new[] | 74 | Assert.Equal(new[] |
| 75 | { | 75 | { |
| 76 | "Registry:regitq_Wx9LfvJuNSc2un6gIHAzr4A\t2\tPath\\To\\AnotherKey\tSecret\t#x\tMultiStringComponent", | 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); | 78 | }, results); |
| 79 | } | 79 | } |
| 80 | } | 80 | } |
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/Registry/RegistryValueMultiString.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/Registry/RegistryValueMultiString.wxs index d5c680ee..c62c571d 100644 --- a/src/test/WixToolsetTest.CoreIntegration/TestData/Registry/RegistryValueMultiString.wxs +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/Registry/RegistryValueMultiString.wxs | |||
| @@ -6,7 +6,9 @@ | |||
| 6 | <RegistryValue Root="HKLM" Key="Path\To\Key" Type="multiString" KeyPath="yes"> | 6 | <RegistryValue Root="HKLM" Key="Path\To\Key" Type="multiString" KeyPath="yes"> |
| 7 | <MultiString Value="a" /> | 7 | <MultiString Value="a" /> |
| 8 | <MultiStringValue Value="b" /> | 8 | <MultiStringValue Value="b" /> |
| 9 | <MultiStringValue /> | ||
| 9 | <MultiString Value="c" /> | 10 | <MultiString Value="c" /> |
| 11 | <MultiStringValue /> | ||
| 10 | </RegistryValue> | 12 | </RegistryValue> |
| 11 | <RegistryValue Root="HKLM" Key="Path\To\AnotherKey" Name="Secret" Type="binary" /> | 13 | <RegistryValue Root="HKLM" Key="Path\To\AnotherKey" Name="Secret" Type="binary" /> |
| 12 | </Component> | 14 | </Component> |
