aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2023-01-12 08:47:45 -0800
committerRob Mensching <rob@firegiant.com>2023-01-12 12:47:53 -0800
commitbcb75416e20cc16d85fc2c0e44a8fd78449f3b3c (patch)
treee29045586433541ce67dd19a9330a00cb18f3847
parent8176844f2b5b6558dcd417b189cab793018e6e2c (diff)
downloadwix-bcb75416e20cc16d85fc2c0e44a8fd78449f3b3c.tar.gz
wix-bcb75416e20cc16d85fc2c0e44a8fd78449f3b3c.tar.bz2
wix-bcb75416e20cc16d85fc2c0e44a8fd78449f3b3c.zip
Ensure a CustomAction source is provided
Fixes 7139
-rw-r--r--src/wix/WixToolset.Core/Compiler.cs7
-rw-r--r--src/wix/test/WixToolsetTest.Converters/CustomActionFixture.cs20
2 files changed, 17 insertions, 10 deletions
diff --git a/src/wix/WixToolset.Core/Compiler.cs b/src/wix/WixToolset.Core/Compiler.cs
index df0020b5..3da24e2f 100644
--- a/src/wix/WixToolset.Core/Compiler.cs
+++ b/src/wix/WixToolset.Core/Compiler.cs
@@ -3502,11 +3502,16 @@ namespace WixToolset.Core
3502 this.Core.Write(ErrorMessages.IllegalPropertyCustomActionAttributes(sourceLineNumbers)); 3502 this.Core.Write(ErrorMessages.IllegalPropertyCustomActionAttributes(sourceLineNumbers));
3503 } 3503 }
3504 3504
3505 if (!targetType.HasValue /*0 == targetBits*/) 3505 if (!targetType.HasValue)
3506 { 3506 {
3507 this.Core.Write(ErrorMessages.ExpectedAttributes(sourceLineNumbers, node.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall")); 3507 this.Core.Write(ErrorMessages.ExpectedAttributes(sourceLineNumbers, node.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall"));
3508 } 3508 }
3509 3509
3510 if (!sourceType.HasValue)
3511 {
3512 this.Core.Write(ErrorMessages.ExpectedAttributes(sourceLineNumbers, node.Name.LocalName, "BinaryRef", "Directory", "Error", "FileRef", "Property", "Script"));
3513 }
3514
3510 this.Core.ParseForExtensionElements(node); 3515 this.Core.ParseForExtensionElements(node);
3511 3516
3512 if (!this.Core.EncounteredError) 3517 if (!this.Core.EncounteredError)
diff --git a/src/wix/test/WixToolsetTest.Converters/CustomActionFixture.cs b/src/wix/test/WixToolsetTest.Converters/CustomActionFixture.cs
index 7d646bd4..6766096e 100644
--- a/src/wix/test/WixToolsetTest.Converters/CustomActionFixture.cs
+++ b/src/wix/test/WixToolsetTest.Converters/CustomActionFixture.cs
@@ -18,19 +18,21 @@ namespace WixToolsetTest.Converters
18 var parse = String.Join(Environment.NewLine, 18 var parse = String.Join(Environment.NewLine,
19 "<?xml version='1.0' encoding='utf-8'?>", 19 "<?xml version='1.0' encoding='utf-8'?>",
20 "<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>", 20 "<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>",
21 " <CustomAction Id='Foo' BinaryKey='WixCA' DllEntry='CAQuietExec' />", 21 " <CustomAction Id='Foo1' BinaryKey='WixCA' DllEntry='CAQuietExec' />",
22 " <CustomAction Id='Foo' BinaryKey='WixCA_x64' DllEntry='CAQuietExec64' />", 22 " <CustomAction Id='Foo2' BinaryKey='WixCA_x64' DllEntry='CAQuietExec64' />",
23 " <CustomAction Id='Foo' BinaryKey='UtilCA' DllEntry='WixQuietExec' />", 23 " <CustomAction Id='Foo3' BinaryKey='UtilCA' DllEntry='WixQuietExec' />",
24 " <CustomAction Id='Foo' BinaryKey='UtilCA_x64' DllEntry='WixQuietExec64' />", 24 " <CustomAction Id='Foo4' BinaryKey='UtilCA_x64' DllEntry='WixQuietExec64' />",
25 " <CustomAction Id='Foo5' BinaryKey='WixCA' DllEntry='CAQuietExec64' Execute='deferred' Return='check' Impersonate='no' />",
25 "</Wix>"); 26 "</Wix>");
26 27
27 var expected = new[] 28 var expected = new[]
28 { 29 {
29 "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", 30 "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
30 " <CustomAction Id=\"Foo\" DllEntry=\"WixQuietExec\" BinaryRef=\"Wix4UtilCA_X86\" />", 31 " <CustomAction Id=\"Foo1\" DllEntry=\"WixQuietExec\" BinaryRef=\"Wix4UtilCA_X86\" />",
31 " <CustomAction Id=\"Foo\" DllEntry=\"WixQuietExec64\" BinaryRef=\"Wix4UtilCA_X64\" />", 32 " <CustomAction Id=\"Foo2\" DllEntry=\"WixQuietExec64\" BinaryRef=\"Wix4UtilCA_X64\" />",
32 " <CustomAction Id=\"Foo\" DllEntry=\"WixQuietExec\" BinaryRef=\"Wix4UtilCA_X86\" />", 33 " <CustomAction Id=\"Foo3\" DllEntry=\"WixQuietExec\" BinaryRef=\"Wix4UtilCA_X86\" />",
33 " <CustomAction Id=\"Foo\" DllEntry=\"WixQuietExec64\" BinaryRef=\"Wix4UtilCA_X64\" />", 34 " <CustomAction Id=\"Foo4\" DllEntry=\"WixQuietExec64\" BinaryRef=\"Wix4UtilCA_X64\" />",
35 " <CustomAction Id=\"Foo5\" DllEntry=\"WixQuietExec64\" Execute=\"deferred\" Return=\"check\" Impersonate=\"no\" BinaryRef=\"Wix4UtilCA_X86\" />",
34 "</Wix>", 36 "</Wix>",
35 }; 37 };
36 38
@@ -43,8 +45,8 @@ namespace WixToolsetTest.Converters
43 45
44 var actual = UnformattedDocumentLines(document); 46 var actual = UnformattedDocumentLines(document);
45 47
46 Assert.Equal(11, errors);
47 WixAssert.CompareLineByLine(expected, actual); 48 WixAssert.CompareLineByLine(expected, actual);
49 Assert.Equal(14, errors);
48 } 50 }
49 51
50 [Fact] 52 [Fact]