diff options
author | Bob Arnson <bob@firegiant.com> | 2019-11-04 13:15:39 -0500 |
---|---|---|
committer | Bob Arnson <bob@firegiant.com> | 2019-11-04 13:26:21 -0500 |
commit | e6f381b0ce2011ced88697ca7ddaae8a053b57d7 (patch) | |
tree | cae29c941c440e3b2284bd53171fefc034917987 /src | |
parent | 34e002b3a9043ff3062c676c74fb124b5feef784 (diff) | |
download | wix-e6f381b0ce2011ced88697ca7ddaae8a053b57d7.tar.gz wix-e6f381b0ce2011ced88697ca7ddaae8a053b57d7.tar.bz2 wix-e6f381b0ce2011ced88697ca7ddaae8a053b57d7.zip |
Tolerate missing RegistryValue/@Value when @Type="binary".
Diffstat (limited to 'src')
3 files changed, 4 insertions, 2 deletions
diff --git a/src/WixToolset.Core/Compiler_2.cs b/src/WixToolset.Core/Compiler_2.cs index 10416850..2f578e61 100644 --- a/src/WixToolset.Core/Compiler_2.cs +++ b/src/WixToolset.Core/Compiler_2.cs | |||
@@ -2006,11 +2006,11 @@ namespace WixToolset.Core | |||
2006 | //} | 2006 | //} |
2007 | 2007 | ||
2008 | // value may be set by child MultiStringValue elements, so it must be checked here | 2008 | // value may be set by child MultiStringValue elements, so it must be checked here |
2009 | if (null == value) | 2009 | if (null == value && valueType != RegistryValueType.Binary) |
2010 | { | 2010 | { |
2011 | this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Value")); | 2011 | this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Value")); |
2012 | } | 2012 | } |
2013 | else if (0 == value.Length && ("+" == name || "-" == name || "*" == name)) // prevent accidental authoring of special name values | 2013 | else if (0 == value?.Length && ("+" == name || "-" == name || "*" == name)) // prevent accidental authoring of special name values |
2014 | { | 2014 | { |
2015 | this.Core.Write(ErrorMessages.RegistryNameValueIncorrect(sourceLineNumbers, node.Name.LocalName, "Name", name)); | 2015 | this.Core.Write(ErrorMessages.RegistryNameValueIncorrect(sourceLineNumbers, node.Name.LocalName, "Name", name)); |
2016 | } | 2016 | } |
diff --git a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs index 7c3dddd7..fff37618 100644 --- a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs | |||
@@ -610,6 +610,7 @@ namespace WixToolsetTest.CoreIntegration | |||
610 | var results = Query.QueryDatabase(msiPath, new[] { "Registry" }); | 610 | var results = Query.QueryDatabase(msiPath, new[] { "Registry" }); |
611 | Assert.Equal(new[] | 611 | Assert.Equal(new[] |
612 | { | 612 | { |
613 | "Registry:reg04OIwIchl.9ZTjisTT6NzGSsQSM\t2\tPath\\To\\AnotherKey\tSecret\t#x\tMiscComponent", | ||
613 | "Registry:regEblTuusqFNSUQNy88zaP_UA5kIY\t2\tPath\\To\\Key\t\t1.0.1234.123\tMiscComponent", | 614 | "Registry:regEblTuusqFNSUQNy88zaP_UA5kIY\t2\tPath\\To\\Key\t\t1.0.1234.123\tMiscComponent", |
614 | }, results); | 615 | }, results); |
615 | } | 616 | } |
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/Registry/RegistryValue.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/Registry/RegistryValue.wxs index 3d88d4cd..fe6e179e 100644 --- a/src/test/WixToolsetTest.CoreIntegration/TestData/Registry/RegistryValue.wxs +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/Registry/RegistryValue.wxs | |||
@@ -4,6 +4,7 @@ | |||
4 | <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> | 4 | <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> |
5 | <Component Id="MiscComponent" Guid="7C40C257-AB36-4B8C-8FD1-C56E0AC4AAEF"> | 5 | <Component Id="MiscComponent" Guid="7C40C257-AB36-4B8C-8FD1-C56E0AC4AAEF"> |
6 | <RegistryValue Root="HKLM" Key="Path\To\Key" Value="1.0.1234.123" Type="string" KeyPath="yes" /> | 6 | <RegistryValue Root="HKLM" Key="Path\To\Key" Value="1.0.1234.123" Type="string" KeyPath="yes" /> |
7 | <RegistryValue Root="HKLM" Key="Path\To\AnotherKey" Name="Secret" Type="binary" /> | ||
7 | </Component> | 8 | </Component> |
8 | </ComponentGroup> | 9 | </ComponentGroup> |
9 | </Fragment> | 10 | </Fragment> |