From bcb75416e20cc16d85fc2c0e44a8fd78449f3b3c Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 12 Jan 2023 08:47:45 -0800 Subject: Ensure a CustomAction source is provided Fixes 7139 --- src/wix/WixToolset.Core/Compiler.cs | 7 ++++++- .../WixToolsetTest.Converters/CustomActionFixture.cs | 20 +++++++++++--------- 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 this.Core.Write(ErrorMessages.IllegalPropertyCustomActionAttributes(sourceLineNumbers)); } - if (!targetType.HasValue /*0 == targetBits*/) + if (!targetType.HasValue) { this.Core.Write(ErrorMessages.ExpectedAttributes(sourceLineNumbers, node.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall")); } + if (!sourceType.HasValue) + { + this.Core.Write(ErrorMessages.ExpectedAttributes(sourceLineNumbers, node.Name.LocalName, "BinaryRef", "Directory", "Error", "FileRef", "Property", "Script")); + } + this.Core.ParseForExtensionElements(node); 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 var parse = String.Join(Environment.NewLine, "", "", - " ", - " ", - " ", - " ", + " ", + " ", + " ", + " ", + " ", ""); var expected = new[] { "", - " ", - " ", - " ", - " ", + " ", + " ", + " ", + " ", + " ", "", }; @@ -43,8 +45,8 @@ namespace WixToolsetTest.Converters var actual = UnformattedDocumentLines(document); - Assert.Equal(11, errors); WixAssert.CompareLineByLine(expected, actual); + Assert.Equal(14, errors); } [Fact] -- cgit v1.2.3-55-g6feb