aboutsummaryrefslogtreecommitdiff
path: root/src/test/TestData/Example.Extension/ExampleWindowsInstallerBackendExtension.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/test/TestData/Example.Extension/ExampleWindowsInstallerBackendExtension.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/test/TestData/Example.Extension/ExampleWindowsInstallerBackendExtension.cs')
-rw-r--r--src/test/TestData/Example.Extension/ExampleWindowsInstallerBackendExtension.cs32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/test/TestData/Example.Extension/ExampleWindowsInstallerBackendExtension.cs b/src/test/TestData/Example.Extension/ExampleWindowsInstallerBackendExtension.cs
new file mode 100644
index 00000000..f00a5102
--- /dev/null
+++ b/src/test/TestData/Example.Extension/ExampleWindowsInstallerBackendExtension.cs
@@ -0,0 +1,32 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3namespace Example.Extension
4{
5 using WixToolset.Data;
6 using WixToolset.Data.WindowsInstaller;
7 using WixToolset.Extensibility;
8
9 internal class ExampleWindowsInstallerBackendExtension : BaseWindowsInstallerBackendExtension
10 {
11 public override bool TryAddTupleToOutput(IntermediateTuple tuple, Output output)
12 {
13#if ALTERNATIVE_TO_USING_HELPER
14 switch (tuple.Definition.Name)
15 {
16 case TupleDefinitions.ExampleName:
17 {
18 var table = output.EnsureTable(ExampleTableDefinitions.ExampleTable);
19 var row = table.CreateRow(tuple.SourceLineNumbers);
20 row[0] = tuple[0].AsString();
21 row[1] = tuple[1].AsString();
22 }
23 return true;
24 }
25
26 return false;
27#else
28 return this.BackendHelper.TryAddTupleToOutputMatchingTableDefinitions(tuple, output, ExampleTableDefinitions.All);
29#endif
30 }
31 }
32}