From 89416eb8c4e7dc8ae4dd2aa27aa7c5930421f61a Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Fri, 19 Jun 2020 14:44:23 +1000 Subject: Restore Unreal to CustomTable. --- .../Bind/CreateOutputFromIRCommand.cs | 2 -- .../Bind/LoadTableDefinitionsCommand.cs | 2 +- src/WixToolset.Core/Compiler.cs | 5 ++++ .../CustomTableFixture.cs | 30 ++++++++++++++++++++++ .../TestData/CustomTable/CustomTable.wxs | 13 ++++++++++ 5 files changed, 49 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs index 553b470b..90d1c148 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs @@ -4,7 +4,6 @@ namespace WixToolset.Core.WindowsInstaller.Bind { using System; using System.Collections.Generic; - using System.Diagnostics; using System.Globalization; using System.Linq; using WixToolset.Data; @@ -979,7 +978,6 @@ namespace WixToolset.Core.WindowsInstaller.Bind if (customTableDefinition.Unreal) { - Debug.Assert(false, "CustomTableDefinition should never be unreal."); continue; } diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/LoadTableDefinitionsCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/LoadTableDefinitionsCommand.cs index cfb46ff9..0312ab44 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/LoadTableDefinitionsCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/LoadTableDefinitionsCommand.cs @@ -208,7 +208,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind columns.Add(columnDefinition); } - var customTable = new TableDefinition(tuple.Id.Id, null, columns); + var customTable = new TableDefinition(tuple.Id.Id, null, columns, tuple.Unreal); return customTable; } } diff --git a/src/WixToolset.Core/Compiler.cs b/src/WixToolset.Core/Compiler.cs index bbd6b292..cb85281d 100644 --- a/src/WixToolset.Core/Compiler.cs +++ b/src/WixToolset.Core/Compiler.cs @@ -3668,6 +3668,7 @@ namespace WixToolset.Core { var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); string tableId = null; + var unreal = false; var columns = new List(); foreach (var attrib in node.Attributes()) @@ -3679,6 +3680,9 @@ namespace WixToolset.Core case "Id": tableId = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); break; + case "Unreal": + unreal = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); + break; default: this.Core.UnexpectedAttribute(node, attrib); break; @@ -3741,6 +3745,7 @@ namespace WixToolset.Core this.Core.AddTuple(new WixCustomTableTuple(sourceLineNumbers, new Identifier(AccessModifier.Public, tableId)) { ColumnNames = columnNames, + Unreal = unreal, }); } } diff --git a/src/test/WixToolsetTest.CoreIntegration/CustomTableFixture.cs b/src/test/WixToolsetTest.CoreIntegration/CustomTableFixture.cs index afba1cbc..0a45c914 100644 --- a/src/test/WixToolsetTest.CoreIntegration/CustomTableFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/CustomTableFixture.cs @@ -158,6 +158,36 @@ namespace WixToolsetTest.CoreIntegration } } + [Fact] + public void UnrealCustomTableIsNotPresentInMsi() + { + var folder = TestData.Get(@"TestData"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var intermediateFolder = Path.Combine(baseFolder, "obj"); + var msiPath = Path.Combine(baseFolder, @"bin\test.msi"); + + var result = WixRunner.Execute(new[] + { + "build", + Path.Combine(folder, "CustomTable", "CustomTable.wxs"), + Path.Combine(folder, "ProductWithComponentGroupRef", "MinimalComponentGroup.wxs"), + Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"), + "-bindpath", Path.Combine(folder, "SingleFile", "data"), + "-intermediateFolder", intermediateFolder, + "-o", msiPath + }); + + result.AssertSuccess(); + + Assert.True(File.Exists(msiPath)); + var results = Query.QueryDatabase(msiPath, new[] { "CustomTable2" }); + Assert.Empty(results); + } + } + [Fact] public void CanCompileAndDecompile() { diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/CustomTable/CustomTable.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/CustomTable/CustomTable.wxs index d6a2521e..51aee5f2 100644 --- a/src/test/WixToolsetTest.CoreIntegration/TestData/CustomTable/CustomTable.wxs +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/CustomTable/CustomTable.wxs @@ -17,5 +17,18 @@ test.txt + + + + + + RowA + test.txt + + + RowB + test.txt + + -- cgit v1.2.3-55-g6feb