aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2017-12-07 14:19:05 -0800
committerRob Mensching <rob@firegiant.com>2017-12-07 14:19:05 -0800
commit49f1209035aac1fcfad5dbbe25f7b2306d3be86c (patch)
tree6ce5921493eb751b6d89c3faf0ebdf64110cbb65 /src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs
parentb1e662bd480241ea914f0f3d6bd174d9ffd03f5f (diff)
downloadwix-49f1209035aac1fcfad5dbbe25f7b2306d3be86c.tar.gz
wix-49f1209035aac1fcfad5dbbe25f7b2306d3be86c.tar.bz2
wix-49f1209035aac1fcfad5dbbe25f7b2306d3be86c.zip
Support MSI backends creating custom tables and remove WixToolset.Data.WindowsInstaller
Diffstat (limited to 'src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs')
-rw-r--r--src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs25
1 files changed, 23 insertions, 2 deletions
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 @@
3namespace WixToolset.Core.WindowsInstaller.Bind 3namespace WixToolset.Core.WindowsInstaller.Bind
4{ 4{
5 using System; 5 using System;
6 using System.Collections.Generic;
6 using System.Linq; 7 using System.Linq;
7 using WixToolset.Core.Native; 8 using WixToolset.Core.Native;
8 using WixToolset.Data; 9 using WixToolset.Data;
9 using WixToolset.Data.Rows;
10 using WixToolset.Data.Tuples; 10 using WixToolset.Data.Tuples;
11 using WixToolset.Data.WindowsInstaller;
12 using WixToolset.Data.WindowsInstaller.Rows;
13 using WixToolset.Extensibility;
11 14
12 internal class CreateOutputFromIRCommand 15 internal class CreateOutputFromIRCommand
13 { 16 {
14 public CreateOutputFromIRCommand(IntermediateSection section, TableDefinitionCollection tableDefinitions) 17 public CreateOutputFromIRCommand(IntermediateSection section, TableDefinitionCollection tableDefinitions, IEnumerable<IWindowsInstallerBackendExtension> backendExtensions)
15 { 18 {
16 this.Section = section; 19 this.Section = section;
17 this.TableDefinitions = tableDefinitions; 20 this.TableDefinitions = tableDefinitions;
21 this.BackendExtensions = backendExtensions;
18 } 22 }
19 23
24 private IEnumerable<IWindowsInstallerBackendExtension> BackendExtensions { get; }
25
20 private TableDefinitionCollection TableDefinitions { get; } 26 private TableDefinitionCollection TableDefinitions { get; }
21 27
22 private IntermediateSection Section { get; } 28 private IntermediateSection Section { get; }
@@ -60,6 +66,10 @@ namespace WixToolset.Core.WindowsInstaller.Bind
60 // Ignored. 66 // Ignored.
61 break; 67 break;
62 68
69 case TupleDefinitionType.MustBeFromAnExtension:
70 this.AddTupleFromExtension(tuple, output);
71 break;
72
63 default: 73 default:
64 this.AddTupleDefaultly(tuple, output); 74 this.AddTupleDefaultly(tuple, output);
65 break; 75 break;
@@ -206,6 +216,17 @@ namespace WixToolset.Core.WindowsInstaller.Bind
206 } 216 }
207 } 217 }
208 218
219 private void AddTupleFromExtension(IntermediateTuple tuple, Output output)
220 {
221 foreach (var extension in this.BackendExtensions)
222 {
223 if (extension.TryAddTupleToOutput(tuple, output))
224 {
225 break;
226 }
227 }
228 }
229
209 private void AddTupleDefaultly(IntermediateTuple tuple, Output output) 230 private void AddTupleDefaultly(IntermediateTuple tuple, Output output)
210 { 231 {
211 if (!this.TableDefinitions.TryGet(tuple.Definition.Name, out var tableDefinition)) 232 if (!this.TableDefinitions.TryGet(tuple.Definition.Name, out var tableDefinition))