From 49f1209035aac1fcfad5dbbe25f7b2306d3be86c Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 7 Dec 2017 14:19:05 -0800 Subject: Support MSI backends creating custom tables and remove WixToolset.Data.WindowsInstaller --- .../Bind/CreateOutputFromIRCommand.cs | 25 ++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs') diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs index a19a53f1..4e053c12 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs @@ -3,20 +3,26 @@ namespace WixToolset.Core.WindowsInstaller.Bind { using System; + using System.Collections.Generic; using System.Linq; using WixToolset.Core.Native; using WixToolset.Data; - using WixToolset.Data.Rows; using WixToolset.Data.Tuples; + using WixToolset.Data.WindowsInstaller; + using WixToolset.Data.WindowsInstaller.Rows; + using WixToolset.Extensibility; internal class CreateOutputFromIRCommand { - public CreateOutputFromIRCommand(IntermediateSection section, TableDefinitionCollection tableDefinitions) + public CreateOutputFromIRCommand(IntermediateSection section, TableDefinitionCollection tableDefinitions, IEnumerable backendExtensions) { this.Section = section; this.TableDefinitions = tableDefinitions; + this.BackendExtensions = backendExtensions; } + private IEnumerable BackendExtensions { get; } + private TableDefinitionCollection TableDefinitions { get; } private IntermediateSection Section { get; } @@ -60,6 +66,10 @@ namespace WixToolset.Core.WindowsInstaller.Bind // Ignored. break; + case TupleDefinitionType.MustBeFromAnExtension: + this.AddTupleFromExtension(tuple, output); + break; + default: this.AddTupleDefaultly(tuple, output); break; @@ -206,6 +216,17 @@ namespace WixToolset.Core.WindowsInstaller.Bind } } + private void AddTupleFromExtension(IntermediateTuple tuple, Output output) + { + foreach (var extension in this.BackendExtensions) + { + if (extension.TryAddTupleToOutput(tuple, output)) + { + break; + } + } + } + private void AddTupleDefaultly(IntermediateTuple tuple, Output output) { if (!this.TableDefinitions.TryGet(tuple.Definition.Name, out var tableDefinition)) -- cgit v1.2.3-55-g6feb