@joebigelow / wix / commits / 2d6d903d

Load custom table definitions from extensions during binding.

Bob Arnson committed Jan 23, 2020 at 18:29 UTC 2d6d903defea5625da52831c2a2a7a958b1ab325
2 files changed +12 -2
src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs
+9
@@ -109,12 +109,21 @@ namespace WixToolset.Core.WindowsInstaller.Bind
109 // If there are any fields to resolve later, create the cache to populate during bind.
110 var variableCache = this.DelayedFields.Any() ? new Dictionary<string, string>(StringComparer.InvariantCultureIgnoreCase) : null;
111
112 + // Load standard tables, authored custom tables, and extension custom tables.
113 TableDefinitionCollection tableDefinitions;
114 {
115 var command = new LoadTableDefinitionsCommand(section);
116 command.Execute();
117
118 tableDefinitions = command.TableDefinitions;
119 +
120 + foreach (var backendExtension in this.BackendExtensions)
121 + {
122 + foreach (var tableDefinition in backendExtension.TableDefinitions)
123 + {
124 + tableDefinitions.Add(tableDefinition);
125 + }
126 + }
127 }
128
129 // Process the summary information table before the other tables.
src/WixToolset.Core/ExtensibilityServices/WindowsInstallerBackendHelper.cs
+3 -2
@@ -2,6 +2,7 @@
2
3 namespace WixToolset.Core.ExtensibilityServices
4 {
5 + using System.Collections.Generic;
6 using System.Linq;
7 using WixToolset.Data;
8 using WixToolset.Data.WindowsInstaller;
@@ -9,9 +10,9 @@ namespace WixToolset.Core.ExtensibilityServices
10
11 internal class WindowsInstallerBackendHelper : IWindowsInstallerBackendHelper
12 {
12 - public bool TryAddTupleToOutputMatchingTableDefinitions(IntermediateTuple tuple, WindowsInstallerData output, TableDefinition[] tableDefinitions) => this.TryAddTupleToOutputMatchingTableDefinitions(tuple, output, tableDefinitions, false);
13 + public bool TryAddTupleToOutputMatchingTableDefinitions(IntermediateTuple tuple, WindowsInstallerData output, IEnumerable<TableDefinition> tableDefinitions) => this.TryAddTupleToOutputMatchingTableDefinitions(tuple, output, tableDefinitions, false);
14
14 - public bool TryAddTupleToOutputMatchingTableDefinitions(IntermediateTuple tuple, WindowsInstallerData output, TableDefinition[] tableDefinitions, bool columnZeroIsId)
15 + public bool TryAddTupleToOutputMatchingTableDefinitions(IntermediateTuple tuple, WindowsInstallerData output, IEnumerable<TableDefinition> tableDefinitions, bool columnZeroIsId)
16 {
17 var tableDefinition = tableDefinitions.FirstOrDefault(t => t.Name == tuple.Definition.Name);
18