aboutsummaryrefslogtreecommitdiff
path: root/src/wixext/UtilWindowsInstallerBackendExtension.cs
blob: 00ac8d3411968e433973004bbf3e754e3b6b67ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// 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.

namespace WixToolset.Util
{
    using System.Linq;
    using System.Xml;
    using WixToolset.Data.WindowsInstaller;
    using WixToolset.Extensibility;

    public class UtilWindowsInstallerBackendExtension : BaseWindowsInstallerBackendExtension
    {
        private static readonly TableDefinition[] Tables = LoadTables();

        protected override TableDefinition[] TableDefinitionsForTuples => Tables;

        private static TableDefinition[] LoadTables()
        {
            using (var resourceStream = typeof(UtilWindowsInstallerBackendExtension).Assembly.GetManifestResourceStream("WixToolset.Util.tables.xml"))
            using (var reader = XmlReader.Create(resourceStream))
            {
                var tables = TableDefinitionCollection.Load(reader);
                return tables.ToArray();
            }
        }
    }
}