Always use WiX table definitions when decompiling standard tables.
Sean Hall committed
Nov 25, 2019 at 14:44 UTC
6cef9ded3d5e246285abc993950ef9964072d9e2
2 files changed
+9
-10
src/WixToolset.Core.WindowsInstaller/Unbind/UnbindDatabaseCommand.cs
+8
-9
@@ -294,6 +294,13 @@ namespace WixToolset.Core.WindowsInstaller.Unbind
294
295
private TableDefinition GetTableDefinition(string tableName, View tableView, View validationView)
296
{
297
+ // Use our table definitions whenever possible since they will be used when compiling the source code anyway.
298
+ // This also allows us to take advantage of WiX concepts like localizable columns which current code assumes.
299
+ if (this.TableDefinitions.Contains(tableName))
300
+ {
301
+ return this.TableDefinitions[tableName];
302
+ }
303
+
304
ColumnDefinition[] columns;
305
using (Record columnNameRecord = tableView.GetColumnInfo(MsiInterop.MSICOLINFONAMES),
306
columnTypeRecord = tableView.GetColumnInfo(MsiInterop.MSICOLINFOTYPES))
@@ -431,15 +438,7 @@ namespace WixToolset.Core.WindowsInstaller.Unbind
438
}
439
}
440
434
- var tableDefinition = new TableDefinition(tableName, columns, false);
435
-
436
- // use our table definitions if core properties are the same; this allows us to take advantage
437
- // of wix concepts like localizable columns which current code assumes
438
- if (this.TableDefinitions.Contains(tableName) && 0 == tableDefinition.CompareTo(this.TableDefinitions[tableName]))
439
- {
440
- tableDefinition = this.TableDefinitions[tableName];
441
- }
442
- return tableDefinition;
441
+ return new TableDefinition(tableName, columns, false);
442
}
443
444
/// <summary>
src/test/WixToolsetTest.CoreIntegration/DecompileFixture.cs
+1
-1
@@ -94,7 +94,7 @@ namespace WixToolsetTest.CoreIntegration
94
}
95
}
96
97
- [Fact(Skip = "Test demonstrates failure")]
97
+ [Fact]
98
public void CanDecompileOldClassTableDefinition()
99
{
100
// The input MSI was not created using standard methods, it is an example of a real world database that needs to be decompiled.