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 --- .../WindowsInstallerStandardInternal.cs | 64 ++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 src/WixToolset.Core.WindowsInstaller/WindowsInstallerStandardInternal.cs (limited to 'src/WixToolset.Core.WindowsInstaller/WindowsInstallerStandardInternal.cs') diff --git a/src/WixToolset.Core.WindowsInstaller/WindowsInstallerStandardInternal.cs b/src/WixToolset.Core.WindowsInstaller/WindowsInstallerStandardInternal.cs new file mode 100644 index 00000000..3b4721a6 --- /dev/null +++ b/src/WixToolset.Core.WindowsInstaller/WindowsInstallerStandardInternal.cs @@ -0,0 +1,64 @@ +// 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.Core.WindowsInstaller +{ + using System; + using System.Reflection; + using System.Xml; + using WixToolset.Core.WindowsInstaller.Rows; + using WixToolset.Data.WindowsInstaller; + + /// + /// Represents the Windows Installer standard objects. + /// + internal static class WindowsInstallerStandardInternal + { + private static readonly object lockObject = new object(); + + private static TableDefinitionCollection tableDefinitions; + private static WixActionRowCollection standardActions; + + /// + /// Gets the table definitions stored in this assembly. + /// + /// Table definition collection for tables stored in this assembly. + public static TableDefinitionCollection GetTableDefinitions() + { + lock (lockObject) + { + if (null == WindowsInstallerStandardInternal.tableDefinitions) + { + using (XmlReader reader = XmlReader.Create(Assembly.GetExecutingAssembly().GetManifestResourceStream("WixToolset.Core.WindowsInstaller.Data.tables.xml"))) + { + WindowsInstallerStandardInternal.tableDefinitions = TableDefinitionCollection.Load(reader); + } + } + } + + return WindowsInstallerStandardInternal.tableDefinitions; + } + + /// + /// Gets the standard actions stored in this assembly. + /// + /// Collection of standard actions in this assembly. + public static WixActionRowCollection GetStandardActionRows() + { +#if REVISIT_FOR_PATCHING + lock (lockObject) + { + if (null == WindowsInstallerStandardInternal.standardActions) + { + using (XmlReader reader = XmlReader.Create(Assembly.GetExecutingAssembly().GetManifestResourceStream("WixToolset.Core.WindowsInstaller.Data.actions.xml"))) + { + WindowsInstallerStandardInternal.standardActions = WixActionRowCollection.Load(reader); + } + } + } + + return WindowsInstallerStandardInternal.standardActions; +#endif + throw new NotImplementedException(); + } + } +} -- cgit v1.2.3-55-g6feb