diff --git a/src/test/WixToolsetTest.Dependency/DependencyExtensionFixture.cs b/src/test/WixToolsetTest.Dependency/DependencyExtensionFixture.cs index 07d6228..823532e 100644 --- a/src/test/WixToolsetTest.Dependency/DependencyExtensionFixture.cs +++ b/src/test/WixToolsetTest.Dependency/DependencyExtensionFixture.cs @@ -19,8 +19,8 @@ public void CanBuildUsingProvides() var results = build.BuildAndQuery(Build, "WixDependencyProvider"); Assert.Equal(new[] { - "WixDependencyProvider:depJQsOasf1FRUsKxq8THB9sXk8yws\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tUsingProvides\t\t\t0", - }, results.OrderBy(s => s).ToArray()); + "WixDependencyProvider:depJQsOasf1FRUsKxq8THB9sXk8yws\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tUsingProvides\t\t\t", + }, results); } private static void Build(string[] args) diff --git a/src/wixext/DependencyCompiler.cs b/src/wixext/DependencyCompiler.cs index dafcfb3..4ec6f47 100644 --- a/src/wixext/DependencyCompiler.cs +++ b/src/wixext/DependencyCompiler.cs @@ -8,6 +8,8 @@ namespace WixToolset.Dependency using System.Text; using System.Xml.Linq; using WixToolset.Data; + using WixToolset.Data.Tuples; + using WixToolset.Dependency.Tuples; using WixToolset.Extensibility; using WixToolset.Extensibility.Data; @@ -38,7 +40,7 @@ private enum PackageType /// Attribute to process. public override void ParseAttribute(Intermediate intermediate, IntermediateSection section, XElement parentElement, XAttribute attribute, IDictionary context) { - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(parentElement); + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(parentElement); switch (parentElement.Name.LocalName) { case "Bundle": @@ -67,7 +69,7 @@ public override void ParseAttribute(Intermediate intermediate, IntermediateSecti /// Extra information about the context in which this element is being parsed. public override void ParseElement(Intermediate intermediate, IntermediateSection section, XElement parentElement, XElement element, IDictionary context) { - PackageType packageType = PackageType.None; + var packageType = PackageType.None; switch (parentElement.Name.LocalName) { @@ -104,7 +106,7 @@ public override void ParseElement(Intermediate intermediate, IntermediateSection if (PackageType.None != packageType) { - string packageId = context["PackageId"]; + var packageId = context["PackageId"]; switch (element.Name.LocalName) { @@ -127,17 +129,16 @@ public override void ParseElement(Intermediate intermediate, IntermediateSection /// The component key path type if set. public override IComponentKeyPath ParsePossibleKeyPathElement(Intermediate intermediate, IntermediateSection section, XElement parentElement, XElement element, IDictionary context) { - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(parentElement); + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(parentElement); IComponentKeyPath keyPath = null; switch (parentElement.Name.LocalName) { case "Component": - string componentId = context["ComponentId"]; + var componentId = context["ComponentId"]; // 64-bit components may cause issues downlevel. - bool win64 = false; - Boolean.TryParse(context["Win64"], out win64); + Boolean.TryParse(context["Win64"], out var win64); switch (element.Name.LocalName) { @@ -191,7 +192,7 @@ private void ParseProviderKeyAttribute(IntermediateSection section, SourceLineNu } else if (0 <= (illegalChar = providerKey.IndexOfAny(DependencyCommon.InvalidCharacters))) { - StringBuilder sb = new StringBuilder(DependencyCommon.InvalidCharacters.Length * 2); + var sb = new StringBuilder(DependencyCommon.InvalidCharacters.Length * 2); Array.ForEach(DependencyCommon.InvalidCharacters, c => sb.Append(c).Append(" ")); this.Messaging.Write(DependencyErrors.IllegalCharactersInProvider(sourceLineNumbers, "ProviderKey", providerKey[illegalChar], sb.ToString())); @@ -206,12 +207,14 @@ private void ParseProviderKeyAttribute(IntermediateSection section, SourceLineNu if (!this.Messaging.EncounteredError) { - // Create the provider row for the bundle. The Component_ field is required + // Create the provider tuple for the bundle. The Component_ field is required // in the table definition but unused for bundles, so just set it to the valid ID. - var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixDependencyProvider", id); - row.Set(1, id.Id); - row.Set(2, providerKey); - row.Set(5, DependencyCommon.ProvidesAttributesBundle); + section.AddTuple(new WixDependencyProviderTuple(sourceLineNumbers, id) + { + ComponentRef = id.Id, + ProviderKey = providerKey, + Attributes = WixDependencyProviderAttributes.ProvidesAttributesBundle, + }); } } @@ -225,16 +228,15 @@ private void ParseProviderKeyAttribute(IntermediateSection section, SourceLineNu /// The type of key path if set. private IComponentKeyPath ParseProvidesElement(Intermediate intermediate, IntermediateSection section, XElement node, PackageType packageType, string parentId) { - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node); + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node); IComponentKeyPath keyPath = null; Identifier id = null; string key = null; string version = null; string displayName = null; - int attributes = 0; int illegalChar = -1; - foreach (XAttribute attrib in node.Attributes()) + foreach (var attrib in node.Attributes()) { if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) { @@ -270,7 +272,7 @@ private IComponentKeyPath ParseProvidesElement(Intermediate intermediate, Interm // Make sure the key does not contain any illegal characters or values. if (0 <= (illegalChar = key.IndexOfAny(DependencyCommon.InvalidCharacters))) { - StringBuilder sb = new StringBuilder(DependencyCommon.InvalidCharacters.Length * 2); + var sb = new StringBuilder(DependencyCommon.InvalidCharacters.Length * 2); Array.ForEach(DependencyCommon.InvalidCharacters, c => sb.Append(c).Append(" ")); this.Messaging.Write(DependencyErrors.IllegalCharactersInProvider(sourceLineNumbers, "Key", key[illegalChar], sb.ToString())); @@ -288,7 +290,7 @@ private IComponentKeyPath ParseProvidesElement(Intermediate intermediate, Interm else if (PackageType.None == packageType) { // Make sure the ProductCode is authored and set the key. - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "Property", "ProductCode"); + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, TupleDefinitions.Property, "ProductCode"); key = "!(bind.property.ProductCode)"; } @@ -317,7 +319,7 @@ private IComponentKeyPath ParseProvidesElement(Intermediate intermediate, Interm id = this.ParseHelper.CreateIdentifier("dep", node.Name.LocalName, parentId, key); } - foreach (XElement child in node.Elements()) + foreach (var child in node.Elements()) { if (this.Namespace == child.Name.Namespace) { @@ -342,24 +344,20 @@ private IComponentKeyPath ParseProvidesElement(Intermediate intermediate, Interm if (!this.Messaging.EncounteredError) { - // Create the row in the provider table. - var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixDependencyProvider", id); - row.Set(1, parentId); - row.Set(2, key); + var tuple = section.AddTuple(new WixDependencyProviderTuple(sourceLineNumbers, id) + { + ComponentRef = parentId, + ProviderKey = key, + }); if (!String.IsNullOrEmpty(version)) { - row.Set(3, version); + tuple.Version = version; } if (!String.IsNullOrEmpty(displayName)) { - row.Set(4, displayName); - } - - if (0 != attributes) - { - row.Set(5, attributes); + tuple.DisplayName = displayName; } if (PackageType.None == packageType) @@ -377,44 +375,24 @@ private IComponentKeyPath ParseProvidesElement(Intermediate intermediate, Interm } // Generate registry rows for the provider using binder properties. - string keyProvides = String.Concat(DependencyCommon.RegistryRoot, key); + var keyProvides = String.Concat(DependencyCommon.RegistryRoot, key); + var root = RegistryRootType.MachineUser; + + var value = "[ProductCode]"; + this.ParseHelper.CreateRegistryTuple(section, sourceLineNumbers, root, keyProvides, null, value, parentId, false); - row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "Registry", this.ParseHelper.CreateIdentifier("reg", id.Id, "(Default)")); - row.Set(1, -1); - row.Set(2, keyProvides); - row.Set(4, "[ProductCode]"); - row.Set(5, parentId); + value = !String.IsNullOrEmpty(version) ? version : "[ProductVersion]"; + var versionRegistryTuple = + this.ParseHelper.CreateRegistryTuple(section, sourceLineNumbers, root, keyProvides, "Version", value, parentId, false); + + value = !String.IsNullOrEmpty(displayName) ? displayName : "[ProductName]"; + this.ParseHelper.CreateRegistryTuple(section, sourceLineNumbers, root, keyProvides, "DisplayName", value, parentId, false); // Use the Version registry value and use that as a potential key path. - Identifier idVersion = this.ParseHelper.CreateIdentifier("reg", id.Id, "Version"); keyPath = this.CreateComponentKeyPath(); - keyPath.Id = idVersion.Id; + keyPath.Id = versionRegistryTuple.Id; keyPath.Explicit = false; keyPath.Type = PossibleKeyPathType.Registry; - - row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "Registry", idVersion); - row.Set(1, -1); - row.Set(2, keyProvides); - row.Set(3, "Version"); - row.Set(4, !String.IsNullOrEmpty(version) ? version : "[ProductVersion]"); - row.Set(5, parentId); - - row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "Registry", this.ParseHelper.CreateIdentifier("reg", id.Id, "DisplayName")); - row.Set(1, -1); - row.Set(2, keyProvides); - row.Set(3, "DisplayName"); - row.Set(4, !String.IsNullOrEmpty(displayName) ? displayName : "[ProductName]"); - row.Set(5, parentId); - - if (0 != attributes) - { - row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "Registry", this.ParseHelper.CreateIdentifier("reg", id.Id, "Attributes")); - row.Set(1, -1); - row.Set(2, keyProvides); - row.Set(3, "Attributes"); - row.Set(4, String.Concat("#", attributes.ToString(CultureInfo.InvariantCulture.NumberFormat))); - row.Set(5, parentId); - } } } @@ -429,7 +407,7 @@ private IComponentKeyPath ParseProvidesElement(Intermediate intermediate, Interm /// Whether the Requires custom action should be referenced. private void ParseRequiresElement(Intermediate intermediate, IntermediateSection section, XElement node, string providerId, bool requiresAction) { - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node); + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node); Identifier id = null; string providerKey = null; string minVersion = null; @@ -437,7 +415,7 @@ private void ParseRequiresElement(Intermediate intermediate, IntermediateSection int attributes = 0; int illegalChar = -1; - foreach (XAttribute attrib in node.Attributes()) + foreach (var attrib in node.Attributes()) { if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) { @@ -502,47 +480,40 @@ private void ParseRequiresElement(Intermediate intermediate, IntermediateSection // Make sure the key does not contain any illegal characters. else if (0 <= (illegalChar = providerKey.IndexOfAny(DependencyCommon.InvalidCharacters))) { - StringBuilder sb = new StringBuilder(DependencyCommon.InvalidCharacters.Length * 2); + var sb = new StringBuilder(DependencyCommon.InvalidCharacters.Length * 2); Array.ForEach(DependencyCommon.InvalidCharacters, c => sb.Append(c).Append(" ")); this.Messaging.Write(DependencyErrors.IllegalCharactersInProvider(sourceLineNumbers, "ProviderKey", providerKey[illegalChar], sb.ToString())); } - if (!this.Messaging.EncounteredError) { // Reference the Require custom action if required. if (requiresAction) { - if (Platform.ARM == this.Context.Platform) - { - // Ensure the ARM version of the CA is referenced. - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixDependencyRequire_ARM"); - } - else - { - // All other supported platforms use x86. - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixDependencyRequire"); - } + this.AddReferenceToWixDependencyRequire(section, sourceLineNumbers); } - var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixDependency", id); - row.Set(1, providerKey); - row.Set(2, minVersion); - row.Set(3, maxVersion); + var tuple = section.AddTuple(new WixDependencyTuple(sourceLineNumbers, id) + { + ProviderKey = providerKey, + MinVersion = minVersion, + MaxVersion = maxVersion, + }); if (0 != attributes) { - row.Set(4, attributes); + tuple.Attributes = attributes; } - // Create the relationship between this WixDependency row and the WixDependencyProvider row. + // Create the relationship between this WixDependency tuple and the WixDependencyProvider tuple. if (!String.IsNullOrEmpty(providerId)) { - // Create the relationship between the WixDependency row and the parent WixDependencyProvider row. - row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixDependencyRef"); - row.Set(0, providerId); - row.Set(1, id.Id); + section.AddTuple(new WixDependencyRefTuple(sourceLineNumbers) + { + WixDependencyProviderRef = providerId, + WixDependencyRef = id.Id, + }); } } } @@ -555,10 +526,10 @@ private void ParseRequiresElement(Intermediate intermediate, IntermediateSection /// Whether the Requires custom action should be referenced. private void ParseRequiresRefElement(Intermediate intermediate, IntermediateSection section, XElement node, string providerId, bool requiresAction) { - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node); + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node); string id = null; - foreach (XAttribute attrib in node.Attributes()) + foreach (var attrib in node.Attributes()) { if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) { @@ -590,25 +561,32 @@ private void ParseRequiresRefElement(Intermediate intermediate, IntermediateSect // Reference the Require custom action if required. if (requiresAction) { - if (Platform.ARM == this.Context.Platform) - { - // Ensure the ARM version of the CA is referenced. - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixDependencyRequire_ARM"); - } - else - { - // All other supported platforms use x86. - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixDependencyRequire"); - } + this.AddReferenceToWixDependencyRequire(section, sourceLineNumbers); } // Create a link dependency on the row that contains information we'll need during bind. - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "WixDependency", id); + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, DependencyTupleDefinitions.WixDependency, id); // Create the relationship between the WixDependency row and the parent WixDependencyProvider row. - var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixDependencyRef"); - row.Set(0, providerId); - row.Set(1, id); + section.AddTuple(new WixDependencyRefTuple(sourceLineNumbers) + { + WixDependencyProviderRef = providerId, + WixDependencyRef = id, + }); + } + } + + private void AddReferenceToWixDependencyRequire(IntermediateSection section, SourceLineNumber sourceLineNumbers) + { + if (Platform.ARM == this.Context.Platform) + { + // Ensure the ARM version of the CA is referenced. + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixDependencyRequire_ARM"); + } + else + { + // All other supported platforms use x86. + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixDependencyRequire"); } } } diff --git a/src/wixext/DependencyTableDefinitions.cs b/src/wixext/DependencyTableDefinitions.cs new file mode 100644 index 0000000..bc3e880 --- /dev/null +++ b/src/wixext/DependencyTableDefinitions.cs @@ -0,0 +1,57 @@ +// 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.Dependency +{ + using WixToolset.Data; + using WixToolset.Data.WindowsInstaller; + + public static class DependencyTableDefinitions + { + public static readonly TableDefinition WixDependencyProvider = new TableDefinition( + "WixDependencyProvider", + new[] + { + new ColumnDefinition("WixDependencyProvider", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "The non-localized primary key for the table.", modularizeType: ColumnModularizeType.Column), + new ColumnDefinition("Component_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, keyTable: "Component", keyColumn: 1, description: "The foreign key into the Component table used to determine install state.", modularizeType: ColumnModularizeType.Column), + new ColumnDefinition("ProviderKey", ColumnType.String, 255, primaryKey: false, nullable: false, ColumnCategory.Text, description: "The name of the registry key that holds the provider identity."), + new ColumnDefinition("Version", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Version, description: "The version of the package."), + new ColumnDefinition("DisplayName", ColumnType.String, 255, primaryKey: false, nullable: true, ColumnCategory.Text, description: "The display name of the package."), + new ColumnDefinition("Attributes", ColumnType.Number, 4, primaryKey: false, nullable: true, ColumnCategory.Unknown, minValue: 0, maxValue: 2147483647, description: "A 32-bit word that specifies the attribute flags to be applied."), + }, + tupleDefinitionName: TupleDefinitions.WixDependencyProvider.Name, + tupleIdIsPrimaryKey: true + ); + + public static readonly TableDefinition WixDependency = new TableDefinition( + "WixDependency", + new[] + { + new ColumnDefinition("WixDependency", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "The non-localized primary key for the table.", modularizeType: ColumnModularizeType.Column), + new ColumnDefinition("ProviderKey", ColumnType.String, 255, primaryKey: false, nullable: false, ColumnCategory.Text, description: "The name of the registry key that holds the provider identity."), + new ColumnDefinition("MinVersion", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Version, description: "The minimum version of the provider supported."), + new ColumnDefinition("MaxVersion", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Version, description: "The maximum version of the provider supported."), + new ColumnDefinition("Attributes", ColumnType.Number, 4, primaryKey: false, nullable: true, ColumnCategory.Unknown, minValue: 0, maxValue: 2147483647, description: "A 32-bit word that specifies the attribute flags to be applied."), + }, + tupleDefinitionName: DependencyTupleDefinitions.WixDependency.Name, + tupleIdIsPrimaryKey: true + ); + + public static readonly TableDefinition WixDependencyRef = new TableDefinition( + "WixDependencyRef", + new[] + { + new ColumnDefinition("WixDependencyProvider_", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, keyTable: "WixDependencyProvider", keyColumn: 1, description: "Foreign key into the Component table.", modularizeType: ColumnModularizeType.Column), + new ColumnDefinition("WixDependency_", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, keyTable: "WixDependency", keyColumn: 1, description: "Foreign key into the WixDependency table.", modularizeType: ColumnModularizeType.Column), + }, + tupleDefinitionName: DependencyTupleDefinitions.WixDependencyRef.Name, + tupleIdIsPrimaryKey: false + ); + + public static readonly TableDefinition[] All = new[] + { + WixDependencyProvider, + WixDependency, + WixDependencyRef, + }; + } +} diff --git a/src/wixext/DependencyWindowsInstallerBackendBinderExtension.cs b/src/wixext/DependencyWindowsInstallerBackendBinderExtension.cs index 265fdd4..f52f97f 100644 --- a/src/wixext/DependencyWindowsInstallerBackendBinderExtension.cs +++ b/src/wixext/DependencyWindowsInstallerBackendBinderExtension.cs @@ -3,28 +3,14 @@ namespace WixToolset.Dependency { using System.Collections.Generic; - using System.Linq; - using System.Xml; using WixToolset.Data.WindowsInstaller; using WixToolset.Extensibility; public class DependencyWindowsInstallerBackendBinderExtension : BaseWindowsInstallerBackendBinderExtension { - private static readonly TableDefinition[] Tables = LoadTables(); + public override IEnumerable TableDefinitions => DependencyTableDefinitions.All; - public override IEnumerable TableDefinitions => Tables; - - private static TableDefinition[] LoadTables() - { - using (var resourceStream = typeof(DependencyWindowsInstallerBackendBinderExtension).Assembly.GetManifestResourceStream("WixToolset.Dependency.tables.xml")) - using (var reader = XmlReader.Create(resourceStream)) - { - var tables = TableDefinitionCollection.Load(reader); - return tables.ToArray(); - } - } - -#if TODO_TAG_BINDER_EXTENSION +#if TODO_DEPENDENCY_BINDER_EXTENSION private Output output; /// diff --git a/src/wixext/Tuples/DependencyTupleDefinitions.cs b/src/wixext/Tuples/DependencyTupleDefinitions.cs index fdd3f0b..3309b0a 100644 --- a/src/wixext/Tuples/DependencyTupleDefinitions.cs +++ b/src/wixext/Tuples/DependencyTupleDefinitions.cs @@ -8,7 +8,6 @@ namespace WixToolset.Dependency public enum DependencyTupleDefinitionType { WixDependency, - WixDependencyProvider, WixDependencyRef, } @@ -33,9 +32,6 @@ public static IntermediateTupleDefinition ByType(DependencyTupleDefinitionType t case DependencyTupleDefinitionType.WixDependency: return DependencyTupleDefinitions.WixDependency; - case DependencyTupleDefinitionType.WixDependencyProvider: - return DependencyTupleDefinitions.WixDependencyProvider; - case DependencyTupleDefinitionType.WixDependencyRef: return DependencyTupleDefinitions.WixDependencyRef; diff --git a/src/wixext/Tuples/WixDependencyProviderTuple.cs b/src/wixext/Tuples/WixDependencyProviderTuple.cs deleted file mode 100644 index 2fd6a80..0000000 --- a/src/wixext/Tuples/WixDependencyProviderTuple.cs +++ /dev/null @@ -1,87 +0,0 @@ -// 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.Dependency -{ - using WixToolset.Data; - using WixToolset.Dependency.Tuples; - - public static partial class DependencyTupleDefinitions - { - public static readonly IntermediateTupleDefinition WixDependencyProvider = new IntermediateTupleDefinition( - DependencyTupleDefinitionType.WixDependencyProvider.ToString(), - new[] - { - new IntermediateFieldDefinition(nameof(WixDependencyProviderTupleFields.WixDependencyProvider), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixDependencyProviderTupleFields.Component_), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixDependencyProviderTupleFields.ProviderKey), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixDependencyProviderTupleFields.Version), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixDependencyProviderTupleFields.DisplayName), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixDependencyProviderTupleFields.Attributes), IntermediateFieldType.Number), - }, - typeof(WixDependencyProviderTuple)); - } -} - -namespace WixToolset.Dependency.Tuples -{ - using WixToolset.Data; - - public enum WixDependencyProviderTupleFields - { - WixDependencyProvider, - Component_, - ProviderKey, - Version, - DisplayName, - Attributes, - } - - public class WixDependencyProviderTuple : IntermediateTuple - { - public WixDependencyProviderTuple() : base(DependencyTupleDefinitions.WixDependencyProvider, null, null) - { - } - - public WixDependencyProviderTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(DependencyTupleDefinitions.WixDependencyProvider, sourceLineNumber, id) - { - } - - public IntermediateField this[WixDependencyProviderTupleFields index] => this.Fields[(int)index]; - - public string WixDependencyProvider - { - get => this.Fields[(int)WixDependencyProviderTupleFields.WixDependencyProvider].AsString(); - set => this.Set((int)WixDependencyProviderTupleFields.WixDependencyProvider, value); - } - - public string Component_ - { - get => this.Fields[(int)WixDependencyProviderTupleFields.Component_].AsString(); - set => this.Set((int)WixDependencyProviderTupleFields.Component_, value); - } - - public string ProviderKey - { - get => this.Fields[(int)WixDependencyProviderTupleFields.ProviderKey].AsString(); - set => this.Set((int)WixDependencyProviderTupleFields.ProviderKey, value); - } - - public string Version - { - get => this.Fields[(int)WixDependencyProviderTupleFields.Version].AsString(); - set => this.Set((int)WixDependencyProviderTupleFields.Version, value); - } - - public string DisplayName - { - get => this.Fields[(int)WixDependencyProviderTupleFields.DisplayName].AsString(); - set => this.Set((int)WixDependencyProviderTupleFields.DisplayName, value); - } - - public int Attributes - { - get => this.Fields[(int)WixDependencyProviderTupleFields.Attributes].AsNumber(); - set => this.Set((int)WixDependencyProviderTupleFields.Attributes, value); - } - } -} \ No newline at end of file diff --git a/src/wixext/Tuples/WixDependencyRefTuple.cs b/src/wixext/Tuples/WixDependencyRefTuple.cs index 3e996f5..9b5a5ee 100644 --- a/src/wixext/Tuples/WixDependencyRefTuple.cs +++ b/src/wixext/Tuples/WixDependencyRefTuple.cs @@ -11,8 +11,8 @@ public static partial class DependencyTupleDefinitions DependencyTupleDefinitionType.WixDependencyRef.ToString(), new[] { - new IntermediateFieldDefinition(nameof(WixDependencyRefTupleFields.WixDependencyProvider_), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixDependencyRefTupleFields.WixDependency_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixDependencyRefTupleFields.WixDependencyProviderRef), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixDependencyRefTupleFields.WixDependencyRef), IntermediateFieldType.String), }, typeof(WixDependencyRefTuple)); } @@ -24,8 +24,8 @@ namespace WixToolset.Dependency.Tuples public enum WixDependencyRefTupleFields { - WixDependencyProvider_, - WixDependency_, + WixDependencyProviderRef, + WixDependencyRef, } public class WixDependencyRefTuple : IntermediateTuple @@ -40,16 +40,16 @@ public WixDependencyRefTuple(SourceLineNumber sourceLineNumber, Identifier id = public IntermediateField this[WixDependencyRefTupleFields index] => this.Fields[(int)index]; - public string WixDependencyProvider_ + public string WixDependencyProviderRef { - get => this.Fields[(int)WixDependencyRefTupleFields.WixDependencyProvider_].AsString(); - set => this.Set((int)WixDependencyRefTupleFields.WixDependencyProvider_, value); + get => this.Fields[(int)WixDependencyRefTupleFields.WixDependencyProviderRef].AsString(); + set => this.Set((int)WixDependencyRefTupleFields.WixDependencyProviderRef, value); } - public string WixDependency_ + public string WixDependencyRef { - get => this.Fields[(int)WixDependencyRefTupleFields.WixDependency_].AsString(); - set => this.Set((int)WixDependencyRefTupleFields.WixDependency_, value); + get => this.Fields[(int)WixDependencyRefTupleFields.WixDependencyRef].AsString(); + set => this.Set((int)WixDependencyRefTupleFields.WixDependencyRef, value); } } } \ No newline at end of file diff --git a/src/wixext/Tuples/WixDependencyTuple.cs b/src/wixext/Tuples/WixDependencyTuple.cs index 81e05ad..1d62ae5 100644 --- a/src/wixext/Tuples/WixDependencyTuple.cs +++ b/src/wixext/Tuples/WixDependencyTuple.cs @@ -11,7 +11,6 @@ public static partial class DependencyTupleDefinitions DependencyTupleDefinitionType.WixDependency.ToString(), new[] { - new IntermediateFieldDefinition(nameof(WixDependencyTupleFields.WixDependency), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixDependencyTupleFields.ProviderKey), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixDependencyTupleFields.MinVersion), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixDependencyTupleFields.MaxVersion), IntermediateFieldType.String), @@ -27,7 +26,6 @@ namespace WixToolset.Dependency.Tuples public enum WixDependencyTupleFields { - WixDependency, ProviderKey, MinVersion, MaxVersion, @@ -46,12 +44,6 @@ public WixDependencyTuple(SourceLineNumber sourceLineNumber, Identifier id = nul public IntermediateField this[WixDependencyTupleFields index] => this.Fields[(int)index]; - public string WixDependency - { - get => this.Fields[(int)WixDependencyTupleFields.WixDependency].AsString(); - set => this.Set((int)WixDependencyTupleFields.WixDependency, value); - } - public string ProviderKey { get => this.Fields[(int)WixDependencyTupleFields.ProviderKey].AsString(); diff --git a/src/wixext/WixToolset.Dependency.wixext.csproj b/src/wixext/WixToolset.Dependency.wixext.csproj index 7e9f1e3..0221c1c 100644 --- a/src/wixext/WixToolset.Dependency.wixext.csproj +++ b/src/wixext/WixToolset.Dependency.wixext.csproj @@ -14,7 +14,6 @@ - diff --git a/src/wixext/tables.xml b/src/wixext/tables.xml deleted file mode 100644 index 03c9f26..0000000 --- a/src/wixext/tables.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - -