From cce48bc96c334acc9a60bce4172f6d463a4dbbd1 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Fri, 8 Jan 2021 13:46:29 -0800 Subject: Add messages for ExePackage/@DetectCondition recommendations First part of fix for wixtoolset/issues#6197 --- src/WixToolset.Data/ErrorMessages.cs | 6 ++++++ src/WixToolset.Data/WarningMessages.cs | 6 ++++++ 2 files changed, 12 insertions(+) (limited to 'src/WixToolset.Data') diff --git a/src/WixToolset.Data/ErrorMessages.cs b/src/WixToolset.Data/ErrorMessages.cs index 9e051e00..644f08d7 100644 --- a/src/WixToolset.Data/ErrorMessages.cs +++ b/src/WixToolset.Data/ErrorMessages.cs @@ -438,6 +438,11 @@ namespace WixToolset.Data return Message(sourceLineNumbers, Ids.ExpectedAttributeInElementOrParent, "The {0}/@{1} attribute was not found or empty; it is required, or it can be specified in the parent {2}/@{3} attribute.", elementName, attributeName, parentElementName, parentAttributeName); } + public static Message ExpectedAttributeWithValueWithOtherAttribute(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string attributeName2) + { + return Message(sourceLineNumbers, Ids.ExpectedAttributeWithValueWithOtherAttribute, "The {0}/@{1} attribute is required to have a value when attribute {2} is present.", elementName, attributeName, attributeName2); + } + public static Message ExpectedAttributeOrElement(SourceLineNumber sourceLineNumbers, string parentElement, string attribute, string childElement) { return Message(sourceLineNumbers, Ids.ExpectedAttributeOrElement, "Element '{0}' missing attribute '{1}' or child element '{2}'. Exactly one of those is required.", parentElement, attribute, childElement); @@ -2692,6 +2697,7 @@ namespace WixToolset.Data CircularSearchReference = 398, UnknownSymbolType = 399, IllegalInnerText = 400, + ExpectedAttributeWithValueWithOtherAttribute = 401, } } } diff --git a/src/WixToolset.Data/WarningMessages.cs b/src/WixToolset.Data/WarningMessages.cs index a1df1282..1ea0f3ea 100644 --- a/src/WixToolset.Data/WarningMessages.cs +++ b/src/WixToolset.Data/WarningMessages.cs @@ -232,6 +232,11 @@ namespace WixToolset.Data return Message(sourceLineNumbers, Ids.DiscouragedAllUsersValue, "Bundles require a package to be either per-machine or per-user. The MSI '{0}' ALLUSERS Property is set to '2' which may change from per-user to per-machine at install time. The Bundle will assume the package is per-{1} and will not work correctly if that changes. If possible, remove the Property with Id='ALLUSERS' and use Package/@InstallScope attribute instead.", path, machineOrUser); } + public static Message DetectConditionRecommended(SourceLineNumber sourceLineNumbers, string elementName) + { + return Message(sourceLineNumbers, Ids.DetectConditionRecommended, "The {0}/@DetectCondition attribute is recommended so the package is only installed when absent.", elementName); + } + public static Message DownloadUrlNotSupportedForAttachedContainers(SourceLineNumber sourceLineNumbers, string containerId) { return Message(sourceLineNumbers, Ids.DownloadUrlNotSupportedForAttachedContainers, "The Container '{0}' is attached but included a @DownloadUrl attribute. Attached Containers cannot be downloaded so the download URL is being ignored.", containerId); @@ -792,6 +797,7 @@ namespace WixToolset.Data SymbolNotTranslatedToOutput = 1150, MsiTransactionLimitations = 1151, PathCanonicalized = 1152, + DetectConditionRecommended = 1153, } } } -- cgit v1.2.3-55-g6feb