@joebigelow / wix-1 / commits / cce48bc9

Add messages for ExePackage/@DetectCondition recommendations

First part of fix for wixtoolset/issues#6197

Rob Mensching committed Jan 8, 2021 at 13:46 UTC cce48bc96c334acc9a60bce4172f6d463a4dbbd1
2 files changed +12
src/WixToolset.Data/ErrorMessages.cs
+6
@@ -438,6 +438,11 @@ namespace WixToolset.Data
438 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);
439 }
440
441 + public static Message ExpectedAttributeWithValueWithOtherAttribute(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string attributeName2)
442 + {
443 + return Message(sourceLineNumbers, Ids.ExpectedAttributeWithValueWithOtherAttribute, "The {0}/@{1} attribute is required to have a value when attribute {2} is present.", elementName, attributeName, attributeName2);
444 + }
445 +
446 public static Message ExpectedAttributeOrElement(SourceLineNumber sourceLineNumbers, string parentElement, string attribute, string childElement)
447 {
448 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
2697 CircularSearchReference = 398,
2698 UnknownSymbolType = 399,
2699 IllegalInnerText = 400,
2700 + ExpectedAttributeWithValueWithOtherAttribute = 401,
2701 }
2702 }
2703 }
src/WixToolset.Data/WarningMessages.cs
+6
@@ -232,6 +232,11 @@ namespace WixToolset.Data
232 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);
233 }
234
235 + public static Message DetectConditionRecommended(SourceLineNumber sourceLineNumbers, string elementName)
236 + {
237 + return Message(sourceLineNumbers, Ids.DetectConditionRecommended, "The {0}/@DetectCondition attribute is recommended so the package is only installed when absent.", elementName);
238 + }
239 +
240 public static Message DownloadUrlNotSupportedForAttachedContainers(SourceLineNumber sourceLineNumbers, string containerId)
241 {
242 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
797 SymbolNotTranslatedToOutput = 1150,
798 MsiTransactionLimitations = 1151,
799 PathCanonicalized = 1152,
800 + DetectConditionRecommended = 1153,
801 }
802 }
803 }