From 2d6d903defea5625da52831c2a2a7a958b1ab325 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Thu, 23 Jan 2020 18:29:13 -0500 Subject: Load custom table definitions from extensions during binding. --- src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs | 9 +++++++++ .../ExtensibilityServices/WindowsInstallerBackendHelper.cs | 5 +++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs index a783ebaa..175203ce 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs @@ -109,12 +109,21 @@ namespace WixToolset.Core.WindowsInstaller.Bind // If there are any fields to resolve later, create the cache to populate during bind. var variableCache = this.DelayedFields.Any() ? new Dictionary(StringComparer.InvariantCultureIgnoreCase) : null; + // Load standard tables, authored custom tables, and extension custom tables. TableDefinitionCollection tableDefinitions; { var command = new LoadTableDefinitionsCommand(section); command.Execute(); tableDefinitions = command.TableDefinitions; + + foreach (var backendExtension in this.BackendExtensions) + { + foreach (var tableDefinition in backendExtension.TableDefinitions) + { + tableDefinitions.Add(tableDefinition); + } + } } // Process the summary information table before the other tables. diff --git a/src/WixToolset.Core/ExtensibilityServices/WindowsInstallerBackendHelper.cs b/src/WixToolset.Core/ExtensibilityServices/WindowsInstallerBackendHelper.cs index 6b535756..4887d995 100644 --- a/src/WixToolset.Core/ExtensibilityServices/WindowsInstallerBackendHelper.cs +++ b/src/WixToolset.Core/ExtensibilityServices/WindowsInstallerBackendHelper.cs @@ -2,6 +2,7 @@ namespace WixToolset.Core.ExtensibilityServices { + using System.Collections.Generic; using System.Linq; using WixToolset.Data; using WixToolset.Data.WindowsInstaller; @@ -9,9 +10,9 @@ namespace WixToolset.Core.ExtensibilityServices internal class WindowsInstallerBackendHelper : IWindowsInstallerBackendHelper { - public bool TryAddTupleToOutputMatchingTableDefinitions(IntermediateTuple tuple, WindowsInstallerData output, TableDefinition[] tableDefinitions) => this.TryAddTupleToOutputMatchingTableDefinitions(tuple, output, tableDefinitions, false); + public bool TryAddTupleToOutputMatchingTableDefinitions(IntermediateTuple tuple, WindowsInstallerData output, IEnumerable tableDefinitions) => this.TryAddTupleToOutputMatchingTableDefinitions(tuple, output, tableDefinitions, false); - public bool TryAddTupleToOutputMatchingTableDefinitions(IntermediateTuple tuple, WindowsInstallerData output, TableDefinition[] tableDefinitions, bool columnZeroIsId) + public bool TryAddTupleToOutputMatchingTableDefinitions(IntermediateTuple tuple, WindowsInstallerData output, IEnumerable tableDefinitions, bool columnZeroIsId) { var tableDefinition = tableDefinitions.FirstOrDefault(t => t.Name == tuple.Definition.Name); -- cgit v1.2.3-55-g6feb