From 2b001acb812edb523a072ac0bb4f49761616c080 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Wed, 5 Feb 2020 14:33:15 -0800 Subject: Add support for unreal columns --- .../WindowsInstaller/ColumnDefinition.cs | 20 ++++++++++++++++++-- .../WindowsInstaller/TableDefinition.cs | 6 ++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/WixToolset.Data/WindowsInstaller/ColumnDefinition.cs b/src/WixToolset.Data/WindowsInstaller/ColumnDefinition.cs index 1cbad230..de554fd8 100644 --- a/src/WixToolset.Data/WindowsInstaller/ColumnDefinition.cs +++ b/src/WixToolset.Data/WindowsInstaller/ColumnDefinition.cs @@ -29,7 +29,7 @@ namespace WixToolset.Data.WindowsInstaller /// Type of modularization for column /// If the column is localizable. /// If whitespace should be preserved in a CDATA node. - public ColumnDefinition(string name, ColumnType type, int length, bool primaryKey, bool nullable, ColumnCategory category, long? minValue = null, long? maxValue = null, string keyTable = null, int? keyColumn = null, string possibilities = null, string description = null, ColumnModularizeType? modularizeType = null, bool forceLocalizable = false, bool useCData = false) + public ColumnDefinition(string name, ColumnType type, int length, bool primaryKey, bool nullable, ColumnCategory category, long? minValue = null, long? maxValue = null, string keyTable = null, int? keyColumn = null, string possibilities = null, string description = null, ColumnModularizeType? modularizeType = null, bool forceLocalizable = false, bool useCData = false, bool unreal = false) { this.Name = name; this.Type = type; @@ -46,6 +46,7 @@ namespace WixToolset.Data.WindowsInstaller this.Possibilities = possibilities; this.Description = description; this.UseCData = useCData; + this.Unreal = unreal; } /// @@ -145,6 +146,12 @@ namespace WixToolset.Data.WindowsInstaller /// true if whitespace should be preserved in a CDATA node. public bool UseCData { get; } + /// + /// Gets if column is Unreal. + /// + /// true if column should not be included in idts. + public bool Unreal { get; } + /// /// Parses a column definition in a table definition. /// @@ -174,6 +181,7 @@ namespace WixToolset.Data.WindowsInstaller bool primaryKey = false; var type = ColumnType.Unknown; bool useCData = false; + bool unreal = false; // parse the attributes while (reader.MoveToNextAttribute()) @@ -370,6 +378,9 @@ namespace WixToolset.Data.WindowsInstaller case "useCData": useCData = reader.Value.Equals("yes"); break; + case "unreal": + unreal = reader.Value.Equals("yes"); + break; } } @@ -396,7 +407,7 @@ namespace WixToolset.Data.WindowsInstaller } } - ColumnDefinition columnDefinition = new ColumnDefinition(name, type, length, primaryKey, nullable, category, minValue, maxValue, keyTable, keyColumn, possibilities, description, modularize, localizable, useCData); + ColumnDefinition columnDefinition = new ColumnDefinition(name, type, length, primaryKey, nullable, category, minValue, maxValue, keyTable, keyColumn, possibilities, description, modularize, localizable, useCData, unreal); columnDefinition.Added = added; return columnDefinition; @@ -601,6 +612,11 @@ namespace WixToolset.Data.WindowsInstaller writer.WriteAttributeString("useCData", "yes"); } + if (this.Unreal) + { + writer.WriteAttributeString("unreal", "yes"); + } + writer.WriteEndElement(); } diff --git a/src/WixToolset.Data/WindowsInstaller/TableDefinition.cs b/src/WixToolset.Data/WindowsInstaller/TableDefinition.cs index ee8ab0c1..4738ac82 100644 --- a/src/WixToolset.Data/WindowsInstaller/TableDefinition.cs +++ b/src/WixToolset.Data/WindowsInstaller/TableDefinition.cs @@ -88,6 +88,12 @@ namespace WixToolset.Data.WindowsInstaller var thisColumnDef = this.Columns[i]; var updatedColumnDef = updated.Columns[i]; + // Igmore unreal columns when comparing table definitions. + if (thisColumnDef.Unreal || updatedColumnDef.Unreal) + { + continue; + } + ret = thisColumnDef.CompareTo(updatedColumnDef); } } -- cgit v1.2.3-55-g6feb