diff options
Diffstat (limited to 'src')
5 files changed, 49 insertions, 3 deletions
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 | |||
| 4 | { | 4 | { |
| 5 | using System; | 5 | using System; |
| 6 | using System.Collections.Generic; | 6 | using System.Collections.Generic; |
| 7 | using System.Diagnostics; | ||
| 8 | using System.Globalization; | 7 | using System.Globalization; |
| 9 | using System.Linq; | 8 | using System.Linq; |
| 10 | using WixToolset.Data; | 9 | using WixToolset.Data; |
| @@ -979,7 +978,6 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 979 | 978 | ||
| 980 | if (customTableDefinition.Unreal) | 979 | if (customTableDefinition.Unreal) |
| 981 | { | 980 | { |
| 982 | Debug.Assert(false, "CustomTableDefinition should never be unreal."); | ||
| 983 | continue; | 981 | continue; |
| 984 | } | 982 | } |
| 985 | 983 | ||
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 | |||
| 208 | columns.Add(columnDefinition); | 208 | columns.Add(columnDefinition); |
| 209 | } | 209 | } |
| 210 | 210 | ||
| 211 | var customTable = new TableDefinition(tuple.Id.Id, null, columns); | 211 | var customTable = new TableDefinition(tuple.Id.Id, null, columns, tuple.Unreal); |
| 212 | return customTable; | 212 | return customTable; |
| 213 | } | 213 | } |
| 214 | } | 214 | } |
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 | |||
| 3668 | { | 3668 | { |
| 3669 | var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); | 3669 | var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); |
| 3670 | string tableId = null; | 3670 | string tableId = null; |
| 3671 | var unreal = false; | ||
| 3671 | var columns = new List<WixCustomTableColumnTuple>(); | 3672 | var columns = new List<WixCustomTableColumnTuple>(); |
| 3672 | 3673 | ||
| 3673 | foreach (var attrib in node.Attributes()) | 3674 | foreach (var attrib in node.Attributes()) |
| @@ -3679,6 +3680,9 @@ namespace WixToolset.Core | |||
| 3679 | case "Id": | 3680 | case "Id": |
| 3680 | tableId = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 3681 | tableId = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); |
| 3681 | break; | 3682 | break; |
| 3683 | case "Unreal": | ||
| 3684 | unreal = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | ||
| 3685 | break; | ||
| 3682 | default: | 3686 | default: |
| 3683 | this.Core.UnexpectedAttribute(node, attrib); | 3687 | this.Core.UnexpectedAttribute(node, attrib); |
| 3684 | break; | 3688 | break; |
| @@ -3741,6 +3745,7 @@ namespace WixToolset.Core | |||
| 3741 | this.Core.AddTuple(new WixCustomTableTuple(sourceLineNumbers, new Identifier(AccessModifier.Public, tableId)) | 3745 | this.Core.AddTuple(new WixCustomTableTuple(sourceLineNumbers, new Identifier(AccessModifier.Public, tableId)) |
| 3742 | { | 3746 | { |
| 3743 | ColumnNames = columnNames, | 3747 | ColumnNames = columnNames, |
| 3748 | Unreal = unreal, | ||
| 3744 | }); | 3749 | }); |
| 3745 | } | 3750 | } |
| 3746 | } | 3751 | } |
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 | |||
| @@ -159,6 +159,36 @@ namespace WixToolsetTest.CoreIntegration | |||
| 159 | } | 159 | } |
| 160 | 160 | ||
| 161 | [Fact] | 161 | [Fact] |
| 162 | public void UnrealCustomTableIsNotPresentInMsi() | ||
| 163 | { | ||
| 164 | var folder = TestData.Get(@"TestData"); | ||
| 165 | |||
| 166 | using (var fs = new DisposableFileSystem()) | ||
| 167 | { | ||
| 168 | var baseFolder = fs.GetFolder(); | ||
| 169 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
| 170 | var msiPath = Path.Combine(baseFolder, @"bin\test.msi"); | ||
| 171 | |||
| 172 | var result = WixRunner.Execute(new[] | ||
| 173 | { | ||
| 174 | "build", | ||
| 175 | Path.Combine(folder, "CustomTable", "CustomTable.wxs"), | ||
| 176 | Path.Combine(folder, "ProductWithComponentGroupRef", "MinimalComponentGroup.wxs"), | ||
| 177 | Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"), | ||
| 178 | "-bindpath", Path.Combine(folder, "SingleFile", "data"), | ||
| 179 | "-intermediateFolder", intermediateFolder, | ||
| 180 | "-o", msiPath | ||
| 181 | }); | ||
| 182 | |||
| 183 | result.AssertSuccess(); | ||
| 184 | |||
| 185 | Assert.True(File.Exists(msiPath)); | ||
| 186 | var results = Query.QueryDatabase(msiPath, new[] { "CustomTable2" }); | ||
| 187 | Assert.Empty(results); | ||
| 188 | } | ||
| 189 | } | ||
| 190 | |||
| 191 | [Fact] | ||
| 162 | public void CanCompileAndDecompile() | 192 | public void CanCompileAndDecompile() |
| 163 | { | 193 | { |
| 164 | var folder = TestData.Get(@"TestData"); | 194 | var folder = TestData.Get(@"TestData"); |
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 @@ | |||
| 17 | <Data Column="Component_">test.txt</Data> | 17 | <Data Column="Component_">test.txt</Data> |
| 18 | </Row> | 18 | </Row> |
| 19 | </CustomTable> | 19 | </CustomTable> |
| 20 | |||
| 21 | <CustomTable Id="CustomTable2" Unreal="yes"> | ||
| 22 | <Column Id="ColumnA" Type="string" PrimaryKey="yes" /> | ||
| 23 | <Column Id="Component_" Type="string" Width="72" KeyTable="Component" KeyColumn="1" /> | ||
| 24 | <Row> | ||
| 25 | <Data Column="ColumnA">RowA</Data> | ||
| 26 | <Data Column="Component_">test.txt</Data> | ||
| 27 | </Row> | ||
| 28 | <Row> | ||
| 29 | <Data Column="ColumnA">RowB</Data> | ||
| 30 | <Data Column="Component_">test.txt</Data> | ||
| 31 | </Row> | ||
| 32 | </CustomTable> | ||
| 20 | </Fragment> | 33 | </Fragment> |
| 21 | </Wix> | 34 | </Wix> |
