From 809df264ba5e5a5f1b60a596064768e9b63dc617 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sun, 28 Feb 2021 20:57:27 -0600 Subject: Add PackagePayload symbols, errors, and ComplexReferenceChildType. #4183 --- src/WixToolset.Data/ComplexReferenceChildType.cs | 3 ++ src/WixToolset.Data/ErrorMessages.cs | 58 +++++++++++++++++++--- src/WixToolset.Data/Symbols/SymbolDefinitions.cs | 16 ++++++ .../Symbols/WixBundleExePackagePayloadSymbol.cs | 36 ++++++++++++++ .../Symbols/WixBundleMsiPackagePayloadSymbol.cs | 36 ++++++++++++++ .../Symbols/WixBundleMspPackagePayloadSymbol.cs | 36 ++++++++++++++ .../Symbols/WixBundleMsuPackagePayloadSymbol.cs | 36 ++++++++++++++ 7 files changed, 215 insertions(+), 6 deletions(-) create mode 100644 src/WixToolset.Data/Symbols/WixBundleExePackagePayloadSymbol.cs create mode 100644 src/WixToolset.Data/Symbols/WixBundleMsiPackagePayloadSymbol.cs create mode 100644 src/WixToolset.Data/Symbols/WixBundleMspPackagePayloadSymbol.cs create mode 100644 src/WixToolset.Data/Symbols/WixBundleMsuPackagePayloadSymbol.cs (limited to 'src') diff --git a/src/WixToolset.Data/ComplexReferenceChildType.cs b/src/WixToolset.Data/ComplexReferenceChildType.cs index 0a355afe..62e233b6 100644 --- a/src/WixToolset.Data/ComplexReferenceChildType.cs +++ b/src/WixToolset.Data/ComplexReferenceChildType.cs @@ -37,6 +37,9 @@ namespace WixToolset.Data /// PackageGroup child of complex reference. PackageGroup, + /// PackagePayload child of complex reference. + PackagePayload, + /// PatchFamily child of complex reference. PatchFamily, diff --git a/src/WixToolset.Data/ErrorMessages.cs b/src/WixToolset.Data/ErrorMessages.cs index c4b74e4e..7924c2ab 100644 --- a/src/WixToolset.Data/ErrorMessages.cs +++ b/src/WixToolset.Data/ErrorMessages.cs @@ -493,6 +493,16 @@ namespace WixToolset.Data return Message(sourceLineNumbers, Ids.ExpectedAttributeWithElement, "The {0} element must have attribute '{1}' when child element '{2}' is present.", elementName, attribute, childElementName); } + public static Message ExpectedAttributeWithoutOtherAttribute(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string otherAttributeName) + { + return Message(sourceLineNumbers, Ids.ExpectedAttributeWithoutOtherAttributes, "The {0} element's {1} attribute was not found; it is required without attribute {2} present.", elementName, attributeName, otherAttributeName); + } + + public static Message ExpectedAttributeWithoutOtherAttributes(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string otherAttributeName1, string otherAttributeName2) + { + return Message(sourceLineNumbers, Ids.ExpectedAttributeWithoutOtherAttributes, "The {0} element's {1} attribute was not found; it is required without attribute {2} or {3} present.", elementName, attributeName, otherAttributeName1, otherAttributeName2); + } + public static Message ExpectedBinaryCategory(SourceLineNumber sourceLineNumbers) { return Message(sourceLineNumbers, Ids.ExpectedBinaryCategory, "The Column element specifies a binary column but does not have the correct Category specified. Windows Installer requires binary columns to specify their category as binary. Please set the Category attribute's value to 'Binary'."); @@ -1499,6 +1509,11 @@ namespace WixToolset.Data return Message(sourceLineNumbers, Ids.MissingOrInvalidModuleInstallerVersion, "The merge module '{0}' from file '{1}' is either missing or has an invalid installer version. The value read from the installer version in module's summary information was '{2}'. This should be a numeric value representing a valid installer version such as 200 or 301.", moduleId, mergeModuleFile, productInstallerVersion); } + public static Message MissingPackagePayload(SourceLineNumber sourceLineNumbers, string packageId, string packageType) + { + return Message(sourceLineNumbers, Ids.MissingPackagePayload, "There is no payload defined for package '{0}'. This is specified on the {1}Package element or a child {1}PackagePayload element.", packageId, packageType); + } + public static Message MissingTableDefinition(string tableName) { return Message(null, Ids.MissingTableDefinition, "Cannot find the table definitions for the '{0}' table. This is likely due to a typing error or missing extension. Please ensure all the necessary extensions are supplied on the command line with the -ext parameter.", tableName); @@ -1539,6 +1554,21 @@ namespace WixToolset.Data return Message(sourceLineNumbers, Ids.MultipleIdentifiersFound, "Under a '{0}' element, multiple identifiers were found: '{1}' and '{2}'. All search elements under this element must have the same id.", elementName, identifier, mismatchIdentifier); } + public static Message MultiplePackagePayloads(SourceLineNumber sourceLineNumbers, string packageId, string packagePayloadId1, string packagePayloadId2) + { + return Message(sourceLineNumbers, Ids.MultiplePackagePayloads, "The package '{0}' has multiple PackagePayloads: '{1}' and '{2}'. This normally happens when the payload is defined on the package element and a child PackagePayload element.", packageId, packagePayloadId1, packagePayloadId2); + } + + public static Message MultiplePackagePayloads2(SourceLineNumber sourceLineNumbers) + { + return Message(sourceLineNumbers, Ids.MultiplePackagePayloads2, "The location of the package payload related to previous error."); + } + + public static Message MultiplePackagePayloads3(SourceLineNumber sourceLineNumbers) + { + return Message(sourceLineNumbers, Ids.MultiplePackagePayloads3, "The location of the package related to previous error."); + } + public static Message MultiplePrimaryReferences(SourceLineNumber sourceLineNumbers, string crefChildType, string crefChildId, string crefParentType, string crefParentId, string conflictParentType, string conflictParentId) { return Message(sourceLineNumbers, Ids.MultiplePrimaryReferences, "Multiple primary references were found for {0} '{1}' in {2} '{3}' and {4} '{5}'.", crefChildType, crefChildId, crefParentType, crefParentId, conflictParentType, conflictParentId); @@ -1634,6 +1664,16 @@ namespace WixToolset.Data return Message(sourceLineNumbers, Ids.OverridableActionCollision2, "The location of the action related to previous error."); } + public static Message PackagePayloadUnsupported(SourceLineNumber sourceLineNumbers, string packageType) + { + return Message(sourceLineNumbers, Ids.PackagePayloadUnsupported, "The {0}PackagePayload element can only be used for {0}Packages.", packageType); + } + + public static Message PackagePayloadUnsupported2(SourceLineNumber sourceLineNumbers) + { + return Message(sourceLineNumbers, Ids.PackagePayloadUnsupported2, "The location of the package related to previous error."); + } + public static Message ParentElementAttributeRequired(SourceLineNumber sourceLineNumbers, string parentElement, string parentAttribute, string childElement) { return Message(sourceLineNumbers, Ids.ParentElementAttributeRequired, "The parent {0} element is missing the {1} attribute that is required for the {2} child element.", parentElement, parentAttribute, childElement); @@ -1774,11 +1814,6 @@ namespace WixToolset.Data return Message(sourceLineNumbers, Ids.RelativePathForRegistryElement, "Cannot convert RelativePath into Registry elements."); } - public static Message RemotePayloadUnsupported(SourceLineNumber sourceLineNumbers) - { - return Message(sourceLineNumbers, Ids.RemotePayloadUnsupported, "The RemotePayload element can only be used for ExePackage and MsuPackage payloads."); - } - public static Message ReservedNamespaceViolation(SourceLineNumber sourceLineNumbers, string element, string attribute, string prefix) { return Message(sourceLineNumbers, Ids.ReservedNamespaceViolation, "The {0}/@{1} attribute's value begins with the reserved prefix '{2}'. Some prefixes are reserved by the Windows Installer and WiX toolset for well-known values. Change your attribute's value to not begin with the same prefix.", element, attribute, prefix); @@ -2024,6 +2059,11 @@ namespace WixToolset.Data return Message(sourceLineNumbers, Ids.UnexpectedElementWithAttribute, "The {0} element cannot have a child element '{1}' when attribute '{2}' is set.", elementName, childElementName, attribute); } + public static Message UnexpectedElementWithAttribute(SourceLineNumber sourceLineNumbers, string elementName, string childElementName, string attribute1, string attribute2, string attribute3, string attribute4) + { + return Message(sourceLineNumbers, Ids.UnexpectedElementWithAttribute, "The {0} element cannot have a child element '{1}' when any of attributes '{2}', '{3}', '{4}', or '{5}' are set.", elementName, childElementName, attribute1, attribute2, attribute3, attribute4); + } + public static Message UnexpectedElementWithAttributeValue(SourceLineNumber sourceLineNumbers, string elementName, string childElementName, string attribute, string attributeValue) { return Message(sourceLineNumbers, Ids.UnexpectedElementWithAttributeValue, "The {0} element cannot have a child element '{1}' unless attribute '{2}' is set to '{3}'.", elementName, childElementName, attribute, attributeValue); @@ -2661,7 +2701,6 @@ namespace WixToolset.Data InvalidModuleOrBundleVersion = 380, UnsupportedPlatformForElement = 381, MissingMedia = 382, - RemotePayloadUnsupported = 383, IllegalYesNoAlwaysValue = 384, TooDeeplyIncluded = 385, TooManyColumnsInRealTable = 386, @@ -2680,6 +2719,13 @@ namespace WixToolset.Data UnknownSymbolType = 399, IllegalInnerText = 400, ExpectedAttributeWithValueWithOtherAttribute = 401, + PackagePayloadUnsupported = 402, + PackagePayloadUnsupported2 = 403, + MultiplePackagePayloads = 404, + MultiplePackagePayloads2 = 405, + MultiplePackagePayloads3 = 406, + MissingPackagePayload = 407, + ExpectedAttributeWithoutOtherAttributes = 408, } } } diff --git a/src/WixToolset.Data/Symbols/SymbolDefinitions.cs b/src/WixToolset.Data/Symbols/SymbolDefinitions.cs index a224b742..9024e58c 100644 --- a/src/WixToolset.Data/Symbols/SymbolDefinitions.cs +++ b/src/WixToolset.Data/Symbols/SymbolDefinitions.cs @@ -125,12 +125,16 @@ namespace WixToolset.Data WixBundleCustomDataAttribute, WixBundleCustomDataCell, WixBundleExePackage, + WixBundleExePackagePayload, WixBundleExtension, WixBundleMsiFeature, WixBundleMsiPackage, + WixBundleMsiPackagePayload, WixBundleMsiProperty, WixBundleMspPackage, + WixBundleMspPackagePayload, WixBundleMsuPackage, + WixBundleMsuPackagePayload, WixBundlePackage, WixBundlePackageCommandLine, WixBundlePackageExitCode, @@ -568,21 +572,33 @@ namespace WixToolset.Data case SymbolDefinitionType.WixBundleExePackage: return SymbolDefinitions.WixBundleExePackage; + case SymbolDefinitionType.WixBundleExePackagePayload: + return SymbolDefinitions.WixBundleExePackagePayload; + case SymbolDefinitionType.WixBundleMsiFeature: return SymbolDefinitions.WixBundleMsiFeature; case SymbolDefinitionType.WixBundleMsiPackage: return SymbolDefinitions.WixBundleMsiPackage; + case SymbolDefinitionType.WixBundleMsiPackagePayload: + return SymbolDefinitions.WixBundleMsiPackagePayload; + case SymbolDefinitionType.WixBundleMsiProperty: return SymbolDefinitions.WixBundleMsiProperty; case SymbolDefinitionType.WixBundleMspPackage: return SymbolDefinitions.WixBundleMspPackage; + case SymbolDefinitionType.WixBundleMspPackagePayload: + return SymbolDefinitions.WixBundleMspPackagePayload; + case SymbolDefinitionType.WixBundleMsuPackage: return SymbolDefinitions.WixBundleMsuPackage; + case SymbolDefinitionType.WixBundleMsuPackagePayload: + return SymbolDefinitions.WixBundleMsuPackagePayload; + case SymbolDefinitionType.WixBundlePackage: return SymbolDefinitions.WixBundlePackage; diff --git a/src/WixToolset.Data/Symbols/WixBundleExePackagePayloadSymbol.cs b/src/WixToolset.Data/Symbols/WixBundleExePackagePayloadSymbol.cs new file mode 100644 index 00000000..c0bf603f --- /dev/null +++ b/src/WixToolset.Data/Symbols/WixBundleExePackagePayloadSymbol.cs @@ -0,0 +1,36 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Data +{ + using WixToolset.Data.Symbols; + + public static partial class SymbolDefinitions + { + public static readonly IntermediateSymbolDefinition WixBundleExePackagePayload = new IntermediateSymbolDefinition( + SymbolDefinitionType.WixBundleExePackagePayload, + new IntermediateFieldDefinition[] + { + }, + typeof(WixBundleExePackagePayloadSymbol)); + } +} + +namespace WixToolset.Data.Symbols +{ + public enum WixBundleExePackagePayloadSymbolFields + { + } + + public class WixBundleExePackagePayloadSymbol : IntermediateSymbol + { + public WixBundleExePackagePayloadSymbol() : base(SymbolDefinitions.WixBundleExePackagePayload, null, null) + { + } + + public WixBundleExePackagePayloadSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.WixBundleExePackagePayload, sourceLineNumber, id) + { + } + + public IntermediateField this[WixBundleExePackagePayloadSymbolFields index] => this.Fields[(int)index]; + } +} diff --git a/src/WixToolset.Data/Symbols/WixBundleMsiPackagePayloadSymbol.cs b/src/WixToolset.Data/Symbols/WixBundleMsiPackagePayloadSymbol.cs new file mode 100644 index 00000000..e5af1044 --- /dev/null +++ b/src/WixToolset.Data/Symbols/WixBundleMsiPackagePayloadSymbol.cs @@ -0,0 +1,36 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Data +{ + using WixToolset.Data.Symbols; + + public static partial class SymbolDefinitions + { + public static readonly IntermediateSymbolDefinition WixBundleMsiPackagePayload = new IntermediateSymbolDefinition( + SymbolDefinitionType.WixBundleMsiPackagePayload, + new IntermediateFieldDefinition[] + { + }, + typeof(WixBundleMsiPackagePayloadSymbol)); + } +} + +namespace WixToolset.Data.Symbols +{ + public enum WixBundleMsiPackagePayloadSymbolFields + { + } + + public class WixBundleMsiPackagePayloadSymbol : IntermediateSymbol + { + public WixBundleMsiPackagePayloadSymbol() : base(SymbolDefinitions.WixBundleMsiPackagePayload, null, null) + { + } + + public WixBundleMsiPackagePayloadSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.WixBundleMsiPackagePayload, sourceLineNumber, id) + { + } + + public IntermediateField this[WixBundleMsiPackagePayloadSymbolFields index] => this.Fields[(int)index]; + } +} diff --git a/src/WixToolset.Data/Symbols/WixBundleMspPackagePayloadSymbol.cs b/src/WixToolset.Data/Symbols/WixBundleMspPackagePayloadSymbol.cs new file mode 100644 index 00000000..d1a21243 --- /dev/null +++ b/src/WixToolset.Data/Symbols/WixBundleMspPackagePayloadSymbol.cs @@ -0,0 +1,36 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Data +{ + using WixToolset.Data.Symbols; + + public static partial class SymbolDefinitions + { + public static readonly IntermediateSymbolDefinition WixBundleMspPackagePayload = new IntermediateSymbolDefinition( + SymbolDefinitionType.WixBundleMspPackagePayload, + new IntermediateFieldDefinition[] + { + }, + typeof(WixBundleMspPackagePayloadSymbol)); + } +} + +namespace WixToolset.Data.Symbols +{ + public enum WixBundleMspPackagePayloadSymbolFields + { + } + + public class WixBundleMspPackagePayloadSymbol : IntermediateSymbol + { + public WixBundleMspPackagePayloadSymbol() : base(SymbolDefinitions.WixBundleMspPackagePayload, null, null) + { + } + + public WixBundleMspPackagePayloadSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.WixBundleMspPackagePayload, sourceLineNumber, id) + { + } + + public IntermediateField this[WixBundleMspPackagePayloadSymbolFields index] => this.Fields[(int)index]; + } +} diff --git a/src/WixToolset.Data/Symbols/WixBundleMsuPackagePayloadSymbol.cs b/src/WixToolset.Data/Symbols/WixBundleMsuPackagePayloadSymbol.cs new file mode 100644 index 00000000..88c7deb2 --- /dev/null +++ b/src/WixToolset.Data/Symbols/WixBundleMsuPackagePayloadSymbol.cs @@ -0,0 +1,36 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Data +{ + using WixToolset.Data.Symbols; + + public static partial class SymbolDefinitions + { + public static readonly IntermediateSymbolDefinition WixBundleMsuPackagePayload = new IntermediateSymbolDefinition( + SymbolDefinitionType.WixBundleMsuPackagePayload, + new IntermediateFieldDefinition[] + { + }, + typeof(WixBundleMsuPackagePayloadSymbol)); + } +} + +namespace WixToolset.Data.Symbols +{ + public enum WixBundleMsuPackagePayloadSymbolFields + { + } + + public class WixBundleMsuPackagePayloadSymbol : IntermediateSymbol + { + public WixBundleMsuPackagePayloadSymbol() : base(SymbolDefinitions.WixBundleMsuPackagePayload, null, null) + { + } + + public WixBundleMsuPackagePayloadSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.WixBundleMsuPackagePayload, sourceLineNumber, id) + { + } + + public IntermediateField this[WixBundleMsuPackagePayloadSymbolFields index] => this.Fields[(int)index]; + } +} -- cgit v1.2.3-55-g6feb