From 021565eca7be6c3307821bd9d4500a73a5c1c68f Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 4 Jun 2020 10:19:31 -0700 Subject: Remove obsolete rows --- .../Rows/WixComplexReferenceRow.cs | 207 --------------------- .../WindowsInstaller/Rows/WixMergeRow.cs | 147 --------------- .../WindowsInstaller/Rows/WixPropertyRow.cs | 123 ------------ .../WindowsInstaller/Rows/WixSimpleReferenceRow.cs | 61 ------ .../WindowsInstallerTableDefinitions.cs | 104 ----------- 5 files changed, 642 deletions(-) delete mode 100644 src/WixToolset.Data/WindowsInstaller/Rows/WixComplexReferenceRow.cs delete mode 100644 src/WixToolset.Data/WindowsInstaller/Rows/WixMergeRow.cs delete mode 100644 src/WixToolset.Data/WindowsInstaller/Rows/WixPropertyRow.cs delete mode 100644 src/WixToolset.Data/WindowsInstaller/Rows/WixSimpleReferenceRow.cs diff --git a/src/WixToolset.Data/WindowsInstaller/Rows/WixComplexReferenceRow.cs b/src/WixToolset.Data/WindowsInstaller/Rows/WixComplexReferenceRow.cs deleted file mode 100644 index 0e942724..00000000 --- a/src/WixToolset.Data/WindowsInstaller/Rows/WixComplexReferenceRow.cs +++ /dev/null @@ -1,207 +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.Data.WindowsInstaller.Rows -{ - using System; - using System.Diagnostics.CodeAnalysis; - - /// - /// Specialization of a row for the WixComplexReference table. - /// - public sealed class WixComplexReferenceRow : Row, IComparable - { - /// - /// Creates a WixComplexReferenceRow row that belongs to a table. - /// - /// Original source lines for this row. - /// Table this row belongs to and should get its column definitions from. - public WixComplexReferenceRow(SourceLineNumber sourceLineNumbers, Table table) - : base(sourceLineNumbers, table) - { - } - - public WixComplexReferenceRow(SourceLineNumber sourceLineNumbers, TableDefinition tableDefinition) - : base(sourceLineNumbers, tableDefinition) - { - } - - /// - /// Gets the parent type of the complex reference. - /// - /// Parent type of the complex reference. - public ComplexReferenceParentType ParentType - { - get { return (ComplexReferenceParentType)Enum.ToObject(typeof(ComplexReferenceParentType), (int)this.Fields[1].Data); } - set { this.Fields[1].Data = (int)value; } - } - - /// - /// Gets or sets the parent identifier of the complex reference. - /// - /// Parent identifier of the complex reference. - public string ParentId - { - get { return (string)this.Fields[0].Data; } - set { this.Fields[0].Data = value; } - } - - /// - /// Gets the parent language of the complex reference. - /// - /// Parent language of the complex reference. - public string ParentLanguage - { - get { return (string)this.Fields[2].Data; } - set { this.Fields[2].Data = value; } - } - - /// - /// Gets the child type of the complex reference. - /// - /// Child type of the complex reference. - public ComplexReferenceChildType ChildType - { - get { return (ComplexReferenceChildType)Enum.ToObject(typeof(ComplexReferenceChildType), (int)this.Fields[4].Data); } - set { this.Fields[4].Data = (int)value; } - } - - /// - /// Gets the child identifier of the complex reference. - /// - /// Child identifier of the complex reference. - public string ChildId - { - get { return (string)this.Fields[3].Data; } - set { this.Fields[3].Data = value; } - } - - /// - /// Gets if this is the primary complex reference. - /// - /// true if primary complex reference. - public bool IsPrimary - { - get - { - return (0x1 == ((int)this.Fields[5].Data & 0x1)); - } - - set - { - if (null == this.Fields[5].Data) - { - this.Fields[5].Data = 0; - } - - if (value) - { - this.Fields[5].Data = (int)this.Fields[5].Data | 0x1; - } - else - { - this.Fields[5].Data = (int)this.Fields[5].Data & ~0x1; - } - } - } - - /// - /// Determines if two complex references are equivalent. - /// - /// Complex reference to compare. - /// True if complex references are equivalent. - public override bool Equals(object obj) - { - return 0 == this.CompareTo(obj); - } - - /// - /// Gets the hash code for the complex reference. - /// - /// Hash code for the complex reference. - public override int GetHashCode() - { - return this.ChildType.GetHashCode() ^ this.ChildId.GetHashCode() ^ this.ParentType.GetHashCode() ^ this.ParentLanguage.GetHashCode() ^ this.ParentId.GetHashCode() ^ this.IsPrimary.GetHashCode(); - } - - /// - /// Compares two complex references. - /// - /// Complex reference to compare to. - /// Zero if the objects are equivalent, negative number if the provided object is less, positive if greater. - public int CompareTo(object obj) - { - int comparison = this.CompareToWithoutConsideringPrimary(obj); - if (0 == comparison) - { - comparison = ((WixComplexReferenceRow)obj).IsPrimary.CompareTo(this.IsPrimary); // Note: the order of these is purposely switched to ensure that "Yes" is lower than "No" and "NotSet" - } - return comparison; - } - - /// - /// Compares two complex references without considering the primary bit. - /// - /// Complex reference to compare to. - /// Zero if the objects are equivalent, negative number if the provided object is less, positive if greater. - [SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", MessageId = "System.ArgumentException.#ctor(System.String,System.String)")] - public int CompareToWithoutConsideringPrimary(object obj) - { - var other = obj as WixComplexReferenceRow ?? throw new ArgumentNullException(nameof(obj)); - - int comparison = this.ChildType - other.ChildType; - if (0 == comparison) - { - comparison = String.Compare(this.ChildId, other.ChildId, StringComparison.Ordinal); - if (0 == comparison) - { - comparison = this.ParentType - other.ParentType; - if (0 == comparison) - { - string thisParentLanguage = null == this.ParentLanguage ? String.Empty : this.ParentLanguage; - string otherParentLanguage = null == other.ParentLanguage ? String.Empty : other.ParentLanguage; - comparison = String.Compare(thisParentLanguage, otherParentLanguage, StringComparison.Ordinal); - if (0 == comparison) - { - comparison = String.Compare(this.ParentId, other.ParentId, StringComparison.Ordinal); - } - } - } - } - - return comparison; - } - - /// - /// Creates a shallow copy of the ComplexReference. - /// - /// A shallow copy of the ComplexReference. - public WixComplexReferenceRow Clone() - { - WixComplexReferenceRow wixComplexReferenceRow = new WixComplexReferenceRow(this.SourceLineNumbers, this.Table); - wixComplexReferenceRow.ParentType = this.ParentType; - wixComplexReferenceRow.ParentId = this.ParentId; - wixComplexReferenceRow.ParentLanguage = this.ParentLanguage; - wixComplexReferenceRow.ChildType = this.ChildType; - wixComplexReferenceRow.ChildId = this.ChildId; - wixComplexReferenceRow.IsPrimary = this.IsPrimary; - - return wixComplexReferenceRow; - } - - /// - /// Changes all of the parent references to point to the passed in parent reference. - /// - /// New parent complex reference. - public void Reparent(WixComplexReferenceRow parent) - { - this.ParentId = parent.ParentId; - this.ParentLanguage = parent.ParentLanguage; - this.ParentType = parent.ParentType; - - if (!this.IsPrimary) - { - this.IsPrimary = parent.IsPrimary; - } - } - } -} diff --git a/src/WixToolset.Data/WindowsInstaller/Rows/WixMergeRow.cs b/src/WixToolset.Data/WindowsInstaller/Rows/WixMergeRow.cs deleted file mode 100644 index ac60452e..00000000 --- a/src/WixToolset.Data/WindowsInstaller/Rows/WixMergeRow.cs +++ /dev/null @@ -1,147 +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.Data.WindowsInstaller.Rows -{ - using System; - using System.Globalization; - - /// - /// Specialization of a row for tracking merge statements. - /// - public sealed class WixMergeRow : Row - { - /// - /// Creates a Merge row that does not belong to a table. - /// - /// Original source lines for this row. - /// TableDefinition this Merge row belongs to and should get its column definitions from. - public WixMergeRow(SourceLineNumber sourceLineNumbers, TableDefinition tableDef) : - base(sourceLineNumbers, tableDef) - { - } - - /// Creates a Merge row that belongs to a table. - /// Original source lines for this row. - /// Table this Merge row belongs to and should get its column definitions from. - public WixMergeRow(SourceLineNumber sourceLineNumbers, Table table) : - base(sourceLineNumbers, table) - { - } - - /// - /// Gets and sets the id for a merge row. - /// - /// Id for the row. - public string Id - { - get { return (string)this.Fields[0].Data; } - set { this.Fields[0].Data = value; } - } - - /// - /// Gets and sets the language for a merge row. - /// - /// Language for the row. - public string Language - { - get { return (string)this.Fields[1].Data; } - set { this.Fields[1].Data = value; } - } - - /// - /// Gets and sets the directory for a merge row. - /// - /// Direcotory for the row. - public string Directory - { - get { return (string)this.Fields[2].Data; } - set { this.Fields[2].Data = value; } - } - - /// - /// Gets and sets the path to the merge module for a merge row. - /// - /// Source path for the row. - public string SourceFile - { - get { return (string)this.Fields[3].Data; } - set { this.Fields[3].Data = value; } - } - - /// - /// Gets and sets the disk id the merge module should be placed on for a merge row. - /// - /// Disk identifier for row. - public int DiskId - { - get { return (int)this.Fields[4].Data; } - set { this.Fields[4].Data = value; } - } - - /// - /// Gets and sets the compression value for a merge row. - /// - /// Compression for a merge row. - public YesNoType FileCompression - { - get - { - if (null == this.Fields[5].Data) - { - return YesNoType.NotSet; - } - else if (1 == (int)this.Fields[5].Data) - { - return YesNoType.Yes; - } - else if (0 == (int)this.Fields[5].Data) - { - return YesNoType.No; - } - else - { - throw new InvalidOperationException(String.Format(CultureInfo.CurrentUICulture, WixDataStrings.EXP_MergeTableFileCompressionColumnContainsInvalidValue, this.Fields[5].Data)); - } - } - set - { - if (YesNoType.Yes == value) - { - this.Fields[5].Data = 1; - } - else if (YesNoType.No == value) - { - this.Fields[5].Data = 0; - } - else if (YesNoType.NotSet == value) - { - this.Fields[5].Data = null; - } - else - { - throw new InvalidOperationException(String.Format(CultureInfo.CurrentUICulture, WixDataStrings.EXP_CannotSetMergeTableFileCompressionColumnToInvalidValue, value)); - } - } - } - - /// - /// Gets and sets the configuration data for a merge row. - /// - /// Comma delimited string of "name=value" pairs. - public string ConfigurationData - { - get { return (string)this.Fields[6].Data; } - set { this.Fields[6].Data = value; } - } - - /// - /// Gets and sets the primary feature for a merge row. - /// - /// The primary feature for a merge row. - public string Feature - { - get { return (string)this.Fields[7].Data; } - set { this.Fields[7].Data = value; } - } - } -} diff --git a/src/WixToolset.Data/WindowsInstaller/Rows/WixPropertyRow.cs b/src/WixToolset.Data/WindowsInstaller/Rows/WixPropertyRow.cs deleted file mode 100644 index 8a54d36e..00000000 --- a/src/WixToolset.Data/WindowsInstaller/Rows/WixPropertyRow.cs +++ /dev/null @@ -1,123 +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.Data.WindowsInstaller.Rows -{ - using System; - using System.Globalization; - - /// - /// Specialization of a row for the WixProperty table. - /// - public sealed class WixPropertyRow : Row - { - /// Creates a WixProperty row that belongs to a table. - /// Original source lines for this row. - /// Table this WixProperty row belongs to and should get its column definitions from. - public WixPropertyRow(SourceLineNumber sourceLineNumbers, Table table) : - base(sourceLineNumbers, table) - { - } - - public WixPropertyRow(SourceLineNumber sourceLineNumbers, TableDefinition tableDefinition) : - base(sourceLineNumbers, tableDefinition) - { - } - - /// - /// Gets and sets the id for this property row. - /// - /// Id for the property. - public string Id - { - get { return (string)this.Fields[0].Data; } - set { this.Fields[0].Data = value; } - } - - /// - /// Gets and sets if this is an admin property row. - /// - /// Flag if this is an admin property. - public bool Admin - { - get - { - return (0x1 == (Convert.ToInt32(this.Fields[1].Data, CultureInfo.InvariantCulture) & 0x1)); - } - - set - { - if (null == this.Fields[1].Data) - { - this.Fields[1].Data = 0; - } - - if (value) - { - this.Fields[1].Data = (int)this.Fields[1].Data | 0x1; - } - else - { - this.Fields[1].Data = (int)this.Fields[1].Data & ~0x1; - } - } - } - - /// - /// Gets and sets if this is a hidden property row. - /// - /// Flag if this is a hidden property. - public bool Hidden - { - get - { - return (0x2 == (Convert.ToInt32(this.Fields[1].Data, CultureInfo.InvariantCulture) & 0x2)); - } - - set - { - if (null == this.Fields[1].Data) - { - this.Fields[1].Data = 0; - } - - if (value) - { - this.Fields[1].Data = (int)this.Fields[1].Data | 0x2; - } - else - { - this.Fields[1].Data = (int)this.Fields[1].Data & ~0x2; - } - } - } - - /// - /// Gets and sets if this is a secure property row. - /// - /// Flag if this is a secure property. - public bool Secure - { - get - { - return (0x4 == (Convert.ToInt32(this.Fields[1].Data, CultureInfo.InvariantCulture) & 0x4)); - } - - set - { - if (null == this.Fields[1].Data) - { - this.Fields[1].Data = 0; - } - - if (value) - { - this.Fields[1].Data = (int)this.Fields[1].Data | 0x4; - } - else - { - this.Fields[1].Data = (int)this.Fields[1].Data & ~0x4; - } - } - } - } -} diff --git a/src/WixToolset.Data/WindowsInstaller/Rows/WixSimpleReferenceRow.cs b/src/WixToolset.Data/WindowsInstaller/Rows/WixSimpleReferenceRow.cs deleted file mode 100644 index bf7dfb0e..00000000 --- a/src/WixToolset.Data/WindowsInstaller/Rows/WixSimpleReferenceRow.cs +++ /dev/null @@ -1,61 +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.Data.WindowsInstaller.Rows -{ - using System; - - /// - /// Specialization of a row for the WixSimpleReference table. - /// - public sealed class WixSimpleReferenceRow : Row - { - /// - /// Creates a WixSimpleReferenceRow that belongs to a table. - /// - /// Original source lines for this row. - /// Table this row belongs to and should get its column definitions from. - public WixSimpleReferenceRow(SourceLineNumber sourceLineNumbers, Table table) - : base(sourceLineNumbers, table) - { - } - - /// - /// Creates a WixSimpleReferenceRow that belongs to a table. - /// - /// Original source lines for this row. - /// Table definitions for this row. - public WixSimpleReferenceRow(SourceLineNumber sourceLineNumbers, TableDefinition tableDefinitions) - : base(sourceLineNumbers, tableDefinitions) - { - } - - /// - /// Gets or sets the primary keys of the simple reference. - /// - /// The primary keys of the simple reference. - public string PrimaryKeys - { - get { return (string)this.Fields[1].Data; } - set { this.Fields[1].Data = value; } - } - - /// - /// Gets the symbolic name. - /// - /// Symbolic name. - public string SymbolicName - { - get { return String.Concat(this.TableName, ":", this.PrimaryKeys); } - } - - /// - /// Gets or sets the table name of the simple reference. - /// - /// The table name of the simple reference. - public string TableName - { - get { return (string)this.Fields[0].Data; } - set { this.Fields[0].Data = value; } - } - } -} diff --git a/src/WixToolset.Data/WindowsInstaller/WindowsInstallerTableDefinitions.cs b/src/WixToolset.Data/WindowsInstaller/WindowsInstallerTableDefinitions.cs index 86db0f0a..7e6b2cc9 100644 --- a/src/WixToolset.Data/WindowsInstaller/WindowsInstallerTableDefinitions.cs +++ b/src/WixToolset.Data/WindowsInstaller/WindowsInstallerTableDefinitions.cs @@ -1692,23 +1692,6 @@ namespace WixToolset.Data.WindowsInstaller tupleIdIsPrimaryKey: false ); - public static readonly TableDefinition WixComplexReference = new TableDefinition( - "WixComplexReference", - TupleDefinitions.WixComplexReference, - new[] - { - new ColumnDefinition("Parent", ColumnType.String, 0, primaryKey: false, nullable: false, ColumnCategory.Unknown, forceLocalizable: true), - new ColumnDefinition("ParentAttributes", ColumnType.Number, 4, primaryKey: false, nullable: false, ColumnCategory.Unknown), - new ColumnDefinition("ParentLanguage", ColumnType.String, 0, primaryKey: false, nullable: true, ColumnCategory.Unknown), - new ColumnDefinition("Child", ColumnType.String, 0, primaryKey: false, nullable: false, ColumnCategory.Unknown, forceLocalizable: true), - new ColumnDefinition("ChildAttributes", ColumnType.Number, 4, primaryKey: false, nullable: false, ColumnCategory.Unknown), - new ColumnDefinition("Attributes", ColumnType.Number, 4, primaryKey: false, nullable: false, ColumnCategory.Unknown), - }, - unreal: true, - strongRowType: typeof(WixComplexReferenceRow), - tupleIdIsPrimaryKey: false - ); - public static readonly TableDefinition WixComponentGroup = new TableDefinition( "WixComponentGroup", TupleDefinitions.WixComponentGroup, @@ -1793,18 +1776,6 @@ namespace WixToolset.Data.WindowsInstaller tupleIdIsPrimaryKey: false ); - public static readonly TableDefinition WixFeatureModules = new TableDefinition( - "WixFeatureModules", - TupleDefinitions.WixFeatureModules, - new[] - { - new ColumnDefinition("Feature_", ColumnType.String, 38, primaryKey: true, nullable: false, ColumnCategory.Unknown), - new ColumnDefinition("WixMerge_", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Unknown), - }, - unreal: true, - tupleIdIsPrimaryKey: false - ); - public static readonly TableDefinition WixFile = new TableDefinition( "WixFile", null, @@ -1906,25 +1877,6 @@ namespace WixToolset.Data.WindowsInstaller tupleIdIsPrimaryKey: false ); - public static readonly TableDefinition WixMerge = new TableDefinition( - "WixMerge", - TupleDefinitions.WixMerge, - new[] - { - new ColumnDefinition("WixMerge", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Unknown), - new ColumnDefinition("Language", ColumnType.Number, 2, primaryKey: false, nullable: false, ColumnCategory.Unknown, forceLocalizable: true), - new ColumnDefinition("Directory_", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Unknown), - new ColumnDefinition("SourceFile", ColumnType.Object, 0, primaryKey: false, nullable: false, ColumnCategory.Unknown), - new ColumnDefinition("DiskId", ColumnType.Number, 2, primaryKey: false, nullable: false, ColumnCategory.Unknown), - new ColumnDefinition("FileCompression", ColumnType.Number, 2, primaryKey: false, nullable: true, ColumnCategory.Unknown), - new ColumnDefinition("ConfigurationData", ColumnType.String, 255, primaryKey: false, nullable: true, ColumnCategory.Unknown), - new ColumnDefinition("Feature_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Unknown), - }, - unreal: true, - strongRowType: typeof(WixMergeRow), - tupleIdIsPrimaryKey: true - ); - public static readonly TableDefinition WixOrdering = new TableDefinition( "WixOrdering", TupleDefinitions.WixOrdering, @@ -1970,55 +1922,6 @@ namespace WixToolset.Data.WindowsInstaller tupleIdIsPrimaryKey: false ); - public static readonly TableDefinition WixProperty = new TableDefinition( - "WixProperty", - TupleDefinitions.WixProperty, - new[] - { - new ColumnDefinition("Property_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Unknown, modularizeType: ColumnModularizeType.Column), - new ColumnDefinition("Attributes", ColumnType.Number, 4, primaryKey: false, nullable: false, ColumnCategory.Unknown), - }, - unreal: true, - strongRowType: typeof(WixPropertyRow), - tupleIdIsPrimaryKey: false - ); - - public static readonly TableDefinition WixSimpleReference = new TableDefinition( - "WixSimpleReference", - TupleDefinitions.WixSimpleReference, - new[] - { - new ColumnDefinition("Table", ColumnType.String, 32, primaryKey: false, nullable: false, ColumnCategory.Unknown), - new ColumnDefinition("PrimaryKeys", ColumnType.String, 0, primaryKey: false, nullable: false, ColumnCategory.Unknown), - }, - unreal: true, - strongRowType: typeof(WixSimpleReferenceRow), - tupleIdIsPrimaryKey: false - ); - - public static readonly TableDefinition WixSuppressAction = new TableDefinition( - "WixSuppressAction", - TupleDefinitions.WixSuppressAction, - new[] - { - new ColumnDefinition("SequenceTable", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Unknown), - new ColumnDefinition("Action", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Unknown), - }, - unreal: true, - tupleIdIsPrimaryKey: false - ); - - public static readonly TableDefinition WixSuppressModularization = new TableDefinition( - "WixSuppressModularization", - TupleDefinitions.WixSuppressModularization, - new[] - { - new ColumnDefinition("WixSuppressModularization", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Unknown), - }, - unreal: true, - tupleIdIsPrimaryKey: true - ); - public static readonly TableDefinition WixPatchBaseline = new TableDefinition( "WixPatchBaseline", TupleDefinitions.WixPatchBaseline, @@ -2286,7 +2189,6 @@ namespace WixToolset.Data.WindowsInstaller ExternalFiles, WixAction, WixBBControl, - WixComplexReference, WixComponentGroup, WixControl, WixDirectory, @@ -2294,7 +2196,6 @@ namespace WixToolset.Data.WindowsInstaller WixFeatureGroup, WixPatchFamilyGroup, WixGroup, - WixFeatureModules, WixFile, WixBindUpdatedFiles, WixBuildInfo, @@ -2302,14 +2203,9 @@ namespace WixToolset.Data.WindowsInstaller WixInstanceComponent, WixInstanceTransforms, WixMediaTemplate, - WixMerge, WixOrdering, WixDeltaPatchFile, WixDeltaPatchSymbolPaths, - WixProperty, - WixSimpleReference, - WixSuppressAction, - WixSuppressModularization, WixPatchBaseline, WixPatchRef, WixPatchId, -- cgit v1.2.3-55-g6feb