diff options
author | Bob Arnson <bob@firegiant.com> | 2020-01-23 18:29:13 -0500 |
---|---|---|
committer | Bob Arnson <bob@firegiant.com> | 2020-01-23 18:33:33 -0500 |
commit | 2d6d903defea5625da52831c2a2a7a958b1ab325 (patch) | |
tree | 83281f909fd2ff1851dfbb015c675df2ecb320fd /src | |
parent | 54c6cf7e151b4e816cedc393e9c520eb818524de (diff) | |
download | wix-2d6d903defea5625da52831c2a2a7a958b1ab325.tar.gz wix-2d6d903defea5625da52831c2a2a7a958b1ab325.tar.bz2 wix-2d6d903defea5625da52831c2a2a7a958b1ab325.zip |
Load custom table definitions from extensions during binding.
Diffstat (limited to 'src')
-rw-r--r-- | src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs | 9 | ||||
-rw-r--r-- | src/WixToolset.Core/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 | |||
109 | // If there are any fields to resolve later, create the cache to populate during 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; | 110 | var variableCache = this.DelayedFields.Any() ? new Dictionary<string, string>(StringComparer.InvariantCultureIgnoreCase) : null; |
111 | 111 | ||
112 | // Load standard tables, authored custom tables, and extension custom tables. | ||
112 | TableDefinitionCollection tableDefinitions; | 113 | TableDefinitionCollection tableDefinitions; |
113 | { | 114 | { |
114 | var command = new LoadTableDefinitionsCommand(section); | 115 | var command = new LoadTableDefinitionsCommand(section); |
115 | command.Execute(); | 116 | command.Execute(); |
116 | 117 | ||
117 | tableDefinitions = command.TableDefinitions; | 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 | } | ||
118 | } | 127 | } |
119 | 128 | ||
120 | // Process the summary information table before the other tables. | 129 | // 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 @@ | |||
2 | 2 | ||
3 | namespace WixToolset.Core.ExtensibilityServices | 3 | namespace WixToolset.Core.ExtensibilityServices |
4 | { | 4 | { |
5 | using System.Collections.Generic; | ||
5 | using System.Linq; | 6 | using System.Linq; |
6 | using WixToolset.Data; | 7 | using WixToolset.Data; |
7 | using WixToolset.Data.WindowsInstaller; | 8 | using WixToolset.Data.WindowsInstaller; |
@@ -9,9 +10,9 @@ namespace WixToolset.Core.ExtensibilityServices | |||
9 | 10 | ||
10 | internal class WindowsInstallerBackendHelper : IWindowsInstallerBackendHelper | 11 | internal class WindowsInstallerBackendHelper : IWindowsInstallerBackendHelper |
11 | { | 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); |
13 | 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) |
15 | { | 16 | { |
16 | var tableDefinition = tableDefinitions.FirstOrDefault(t => t.Name == tuple.Definition.Name); | 17 | var tableDefinition = tableDefinitions.FirstOrDefault(t => t.Name == tuple.Definition.Name); |
17 | 18 | ||