From 099a5bc83bfde2a713a94d47e613dba16fdcee2a Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Wed, 17 Jun 2020 12:11:17 -0700 Subject: Introduce Message attribute to remove Error inner text --- src/WixToolset.Core/Compiler.cs | 11 ++++++++++- .../TestData/ErrorsInUI/PackageComponents.wxs | 6 ++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/WixToolset.Core/Compiler.cs b/src/WixToolset.Core/Compiler.cs index ae7f7624..d6c96b28 100644 --- a/src/WixToolset.Core/Compiler.cs +++ b/src/WixToolset.Core/Compiler.cs @@ -5358,6 +5358,7 @@ namespace WixToolset.Core { var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); var id = CompilerConstants.IntegerNotSet; + string message = null; foreach (var attrib in node.Attributes()) { @@ -5368,6 +5369,9 @@ namespace WixToolset.Core case "Id": id = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, Int16.MaxValue); break; + case "Message": + message = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); + break; default: this.Core.UnexpectedAttribute(node, attrib); break; @@ -5385,13 +5389,18 @@ namespace WixToolset.Core id = CompilerConstants.IllegalInteger; } + if (String.IsNullOrEmpty(message)) + { + message = Common.GetInnerText(node); + } + this.Core.ParseForExtensionElements(node); if (!this.Core.EncounteredError) { this.Core.AddTuple(new ErrorTuple(sourceLineNumbers, new Identifier(AccessModifier.Public, id)) { - Message = Common.GetInnerText(node) + Message = message }); } } diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/ErrorsInUI/PackageComponents.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/ErrorsInUI/PackageComponents.wxs index c9c65fc7..88a4ac81 100644 --- a/src/test/WixToolsetTest.CoreIntegration/TestData/ErrorsInUI/PackageComponents.wxs +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/ErrorsInUI/PackageComponents.wxs @@ -2,10 +2,8 @@ - - Category 55 Emergency Doomsday Crisis - - + + -- cgit v1.2.3-55-g6feb