From 9f8cb5374481b6c8a06eb2739858332350f72666 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Sat, 11 Nov 2017 01:45:59 -0800 Subject: Additional IR updates --- .../Data/tables.xml | 2 +- .../RowDictionary.cs | 3 +- .../Rows/SymbolPathType.cs | 17 - .../Rows/WixActionRow.cs | 52 +-- .../Rows/WixActionRowCollection.cs | 1 + .../Rows/WixDeltaPatchSymbolPathsRow.cs | 2 + .../TableDefinitionCollection.cs | 11 + .../WindowsInstallerStandard.cs | 442 --------------------- .../WindowsInstallerStandardInternal.cs | 59 +++ 9 files changed, 103 insertions(+), 486 deletions(-) delete mode 100644 src/WixToolset.Data.WindowsInstaller/Rows/SymbolPathType.cs delete mode 100644 src/WixToolset.Data.WindowsInstaller/WindowsInstallerStandard.cs create mode 100644 src/WixToolset.Data.WindowsInstaller/WindowsInstallerStandardInternal.cs (limited to 'src/WixToolset.Data.WindowsInstaller') diff --git a/src/WixToolset.Data.WindowsInstaller/Data/tables.xml b/src/WixToolset.Data.WindowsInstaller/Data/tables.xml index 280d87a8..e4b5e954 100644 --- a/src/WixToolset.Data.WindowsInstaller/Data/tables.xml +++ b/src/WixToolset.Data.WindowsInstaller/Data/tables.xml @@ -1468,7 +1468,7 @@ - + diff --git a/src/WixToolset.Data.WindowsInstaller/RowDictionary.cs b/src/WixToolset.Data.WindowsInstaller/RowDictionary.cs index a0cc5302..5756db71 100644 --- a/src/WixToolset.Data.WindowsInstaller/RowDictionary.cs +++ b/src/WixToolset.Data.WindowsInstaller/RowDictionary.cs @@ -77,8 +77,7 @@ namespace WixToolset.Data /// Row or null if key is not found. public T Get(string key) { - T result; - return this.TryGetValue(key, out result) ? result : null; + return this.TryGetValue(key, out var result) ? result : null; } } } diff --git a/src/WixToolset.Data.WindowsInstaller/Rows/SymbolPathType.cs b/src/WixToolset.Data.WindowsInstaller/Rows/SymbolPathType.cs deleted file mode 100644 index 964e1caa..00000000 --- a/src/WixToolset.Data.WindowsInstaller/Rows/SymbolPathType.cs +++ /dev/null @@ -1,17 +0,0 @@ -// 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.Data.Rows -{ - /// - /// The types that the WixDeltaPatchSymbolPaths table can hold. - /// - /// The order of these values is important since WixDeltaPatchSymbolPaths are sorted by this type. - public enum SymbolPathType - { - File, - Component, - Directory, - Media, - Product - }; -} diff --git a/src/WixToolset.Data.WindowsInstaller/Rows/WixActionRow.cs b/src/WixToolset.Data.WindowsInstaller/Rows/WixActionRow.cs index 3009e59d..d1be706e 100644 --- a/src/WixToolset.Data.WindowsInstaller/Rows/WixActionRow.cs +++ b/src/WixToolset.Data.WindowsInstaller/Rows/WixActionRow.cs @@ -8,27 +8,28 @@ namespace WixToolset.Data.Rows using System.Globalization; using System.Xml; using System.Xml.Schema; + using WixToolset.Data.Tuples; /// /// The Sequence tables that actions may belong to. /// - public enum SequenceTable - { - /// AdminUISequence - AdminUISequence, + //public enum SequenceTable + //{ + // /// AdminUISequence + // AdminUISequence, - /// AdminExecuteSequence - AdminExecuteSequence, + // /// AdminExecuteSequence + // AdminExecuteSequence, - /// AdvtExecuteSequence - AdvtExecuteSequence, + // /// AdvtExecuteSequence + // AdvtExecuteSequence, - /// InstallUISequence - InstallUISequence, + // /// InstallUISequence + // InstallUISequence, - /// InstallExecuteSequence - InstallExecuteSequence - } + // /// InstallExecuteSequence + // InstallExecuteSequence + //} /// /// Specialization of a row for the sequence tables. @@ -55,15 +56,15 @@ namespace WixToolset.Data.Rows /// The name of the standard action. /// The condition of the standard action. /// The suggested sequence number of the standard action. - private WixActionRow(SequenceTable sequenceTable, string action, string condition, int sequence) : - base(null, WindowsInstallerStandard.GetTableDefinitions()["WixAction"]) - { - this.SequenceTable = sequenceTable; - this.Action = action; - this.Condition = condition; - this.Sequence = sequence; - this.Overridable = true; // all standard actions are overridable by default - } + //private WixActionRow(SequenceTable sequenceTable, string action, string condition, int sequence) : + // base(null, WindowsInstallerStandard.GetTableDefinitions()["WixAction"]) + //{ + // this.SequenceTable = sequenceTable; + // this.Action = action; + // this.Condition = condition; + // this.Sequence = sequence; + // this.Overridable = true; // all standard actions are overridable by default + //} /// /// Instantiates an ActionRow by copying data from another ActionRow. @@ -296,13 +297,15 @@ namespace WixToolset.Data.Rows WixActionRow[] actionRows = new WixActionRow[sequenceCount]; for (int i = 0; i < sequenceCount; i++) { - WixActionRow actionRow = new WixActionRow(sequenceTables[i], id, condition, sequence); - actionRows[i] = actionRow; + //WixActionRow actionRow = new WixActionRow(sequenceTables[i], id, condition, sequence); + //actionRows[i] = actionRow; + throw new NotImplementedException(); } return actionRows; } +#if DEAD_CODE /// /// Determines whether this ActionRow contains the specified ActionRow as a child in its dependency tree. /// @@ -370,5 +373,6 @@ namespace WixToolset.Data.Rows } } } +#endif } } diff --git a/src/WixToolset.Data.WindowsInstaller/Rows/WixActionRowCollection.cs b/src/WixToolset.Data.WindowsInstaller/Rows/WixActionRowCollection.cs index 513a104f..9fab6b5d 100644 --- a/src/WixToolset.Data.WindowsInstaller/Rows/WixActionRowCollection.cs +++ b/src/WixToolset.Data.WindowsInstaller/Rows/WixActionRowCollection.cs @@ -6,6 +6,7 @@ namespace WixToolset.Data.Rows using System.Collections; using System.Diagnostics; using System.Xml; + using WixToolset.Data.Tuples; /// /// A collection of action rows sorted by their sequence table and action name. diff --git a/src/WixToolset.Data.WindowsInstaller/Rows/WixDeltaPatchSymbolPathsRow.cs b/src/WixToolset.Data.WindowsInstaller/Rows/WixDeltaPatchSymbolPathsRow.cs index b6c0b840..3be5a56d 100644 --- a/src/WixToolset.Data.WindowsInstaller/Rows/WixDeltaPatchSymbolPathsRow.cs +++ b/src/WixToolset.Data.WindowsInstaller/Rows/WixDeltaPatchSymbolPathsRow.cs @@ -2,6 +2,8 @@ namespace WixToolset.Data.Rows { + using WixToolset.Data.Tuples; + /// /// Specialization of a row for the WixDeltaPatchSymbolPaths table. /// diff --git a/src/WixToolset.Data.WindowsInstaller/TableDefinitionCollection.cs b/src/WixToolset.Data.WindowsInstaller/TableDefinitionCollection.cs index 553f0eaa..26d56387 100644 --- a/src/WixToolset.Data.WindowsInstaller/TableDefinitionCollection.cs +++ b/src/WixToolset.Data.WindowsInstaller/TableDefinitionCollection.cs @@ -68,6 +68,17 @@ namespace WixToolset.Data } } + /// + /// Tries to get a table definition by name. + /// + /// Name of table to locate. + /// Table definition if found. + /// True if table definition was found otherwise false. + public bool TryGet(string tableName, out TableDefinition table) + { + return this.collection.TryGetValue(tableName, out table); + } + /// /// Load a table definition collection from an XmlReader. /// diff --git a/src/WixToolset.Data.WindowsInstaller/WindowsInstallerStandard.cs b/src/WixToolset.Data.WindowsInstaller/WindowsInstallerStandard.cs deleted file mode 100644 index ee4a5103..00000000 --- a/src/WixToolset.Data.WindowsInstaller/WindowsInstallerStandard.cs +++ /dev/null @@ -1,442 +0,0 @@ -// 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.Data -{ - using System.Collections.Generic; - using System.Reflection; - using System.Xml; - using WixToolset.Data.Rows; - - /// - /// Represents the Windows Installer standard objects. - /// - public static class WindowsInstallerStandard - { - private static readonly object lockObject = new object(); - - private static TableDefinitionCollection tableDefinitions; - private static WixActionRowCollection standardActions; - - private static HashSet standardActionNames; - private static HashSet standardDirectories; - private static HashSet standardProperties; - - /// - /// 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 == WindowsInstallerStandard.tableDefinitions) - { - using (XmlReader reader = XmlReader.Create(Assembly.GetExecutingAssembly().GetManifestResourceStream("WixToolset.Data.WindowsInstaller.Data.tables.xml"))) - { - tableDefinitions = TableDefinitionCollection.Load(reader); - } - } - } - - return WindowsInstallerStandard.tableDefinitions; - } - - /// - /// Gets the standard actions stored in this assembly. - /// - /// Collection of standard actions in this assembly. - public static WixActionRowCollection GetStandardActions() - { - lock (lockObject) - { - if (null == standardActions) - { - using (XmlReader reader = XmlReader.Create(Assembly.GetExecutingAssembly().GetManifestResourceStream("WixToolset.Data.WindowsInstaller.Data.actions.xml"))) - { - standardActions = WixActionRowCollection.Load(reader); - } - } - } - - return standardActions; - } - - /// - /// Gets (and loads if not yet loaded) the list of standard MSI directories. - /// - /// The list of standard MSI directories. - public static HashSet GetStandardDirectories() - { - lock (lockObject) - { - if (null == standardDirectories) - { - LoadStandardDirectories(); - } - } - - return standardDirectories; - } - - /// - /// Find out if an action is a standard action. - /// - /// Name of the action. - /// true if the action is standard, false otherwise. - public static bool IsStandardAction(string actionName) - { - lock (lockObject) - { - if (null == standardActionNames) - { - standardActionNames = new HashSet(); - standardActionNames.Add("AllocateRegistrySpace"); - standardActionNames.Add("AppSearch"); - standardActionNames.Add("BindImage"); - standardActionNames.Add("CCPSearch"); - standardActionNames.Add("CostFinalize"); - standardActionNames.Add("CostInitialize"); - standardActionNames.Add("CreateFolders"); - standardActionNames.Add("CreateShortcuts"); - standardActionNames.Add("DeleteServices"); - standardActionNames.Add("DisableRollback"); - standardActionNames.Add("DuplicateFiles"); - standardActionNames.Add("ExecuteAction"); - standardActionNames.Add("FileCost"); - standardActionNames.Add("FindRelatedProducts"); - standardActionNames.Add("ForceReboot"); - standardActionNames.Add("InstallAdminPackage"); - standardActionNames.Add("InstallExecute"); - standardActionNames.Add("InstallExecuteAgain"); - standardActionNames.Add("InstallFiles"); - standardActionNames.Add("InstallFinalize"); - standardActionNames.Add("InstallInitialize"); - standardActionNames.Add("InstallODBC"); - standardActionNames.Add("InstallServices"); - standardActionNames.Add("InstallSFPCatalogFile"); - standardActionNames.Add("InstallValidate"); - standardActionNames.Add("IsolateComponents"); - standardActionNames.Add("LaunchConditions"); - standardActionNames.Add("MigrateFeatureStates"); - standardActionNames.Add("MoveFiles"); - standardActionNames.Add("MsiConfigureServices"); - standardActionNames.Add("MsiPublishAssemblies"); - standardActionNames.Add("MsiUnpublishAssemblies"); - standardActionNames.Add("PatchFiles"); - standardActionNames.Add("ProcessComponents"); - standardActionNames.Add("PublishComponents"); - standardActionNames.Add("PublishFeatures"); - standardActionNames.Add("PublishProduct"); - standardActionNames.Add("RegisterClassInfo"); - standardActionNames.Add("RegisterComPlus"); - standardActionNames.Add("RegisterExtensionInfo"); - standardActionNames.Add("RegisterFonts"); - standardActionNames.Add("RegisterMIMEInfo"); - standardActionNames.Add("RegisterProduct"); - standardActionNames.Add("RegisterProgIdInfo"); - standardActionNames.Add("RegisterTypeLibraries"); - standardActionNames.Add("RegisterUser"); - standardActionNames.Add("RemoveDuplicateFiles"); - standardActionNames.Add("RemoveEnvironmentStrings"); - standardActionNames.Add("RemoveExistingProducts"); - standardActionNames.Add("RemoveFiles"); - standardActionNames.Add("RemoveFolders"); - standardActionNames.Add("RemoveIniValues"); - standardActionNames.Add("RemoveODBC"); - standardActionNames.Add("RemoveRegistryValues"); - standardActionNames.Add("RemoveShortcuts"); - standardActionNames.Add("ResolveSource"); - standardActionNames.Add("RMCCPSearch"); - standardActionNames.Add("ScheduleReboot"); - standardActionNames.Add("SelfRegModules"); - standardActionNames.Add("SelfUnregModules"); - standardActionNames.Add("SetODBCFolders"); - standardActionNames.Add("StartServices"); - standardActionNames.Add("StopServices"); - standardActionNames.Add("UnpublishComponents"); - standardActionNames.Add("UnpublishFeatures"); - standardActionNames.Add("UnregisterClassInfo"); - standardActionNames.Add("UnregisterComPlus"); - standardActionNames.Add("UnregisterExtensionInfo"); - standardActionNames.Add("UnregisterFonts"); - standardActionNames.Add("UnregisterMIMEInfo"); - standardActionNames.Add("UnregisterProgIdInfo"); - standardActionNames.Add("UnregisterTypeLibraries"); - standardActionNames.Add("ValidateProductID"); - standardActionNames.Add("WriteEnvironmentStrings"); - standardActionNames.Add("WriteIniValues"); - standardActionNames.Add("WriteRegistryValues"); - } - } - - return standardActionNames.Contains(actionName); - } - - /// - /// Find out if a directory is a standard directory. - /// - /// Name of the directory. - /// true if the directory is standard, false otherwise. - public static bool IsStandardDirectory(string directoryName) - { - lock (lockObject) - { - if (null == standardDirectories) - { - LoadStandardDirectories(); - } - } - - return standardDirectories.Contains(directoryName); - } - - /// - /// Find out if a property is a standard property. - /// References: - /// Title: Property Reference [Windows Installer]: - /// URL: http://msdn.microsoft.com/library/en-us/msi/setup/property_reference.asp - /// - /// Name of the property. - /// true if a property is standard, false otherwise. - public static bool IsStandardProperty(string propertyName) - { - lock (lockObject) - { - if (null == standardProperties) - { - standardProperties = new HashSet(); - standardProperties.Add("~"); // REG_MULTI_SZ/NULL marker - standardProperties.Add("ACTION"); - standardProperties.Add("ADDDEFAULT"); - standardProperties.Add("ADDLOCAL"); - standardProperties.Add("ADDDSOURCE"); - standardProperties.Add("AdminProperties"); - standardProperties.Add("AdminUser"); - standardProperties.Add("ADVERTISE"); - standardProperties.Add("AFTERREBOOT"); - standardProperties.Add("AllowProductCodeMismatches"); - standardProperties.Add("AllowProductVersionMajorMismatches"); - standardProperties.Add("ALLUSERS"); - standardProperties.Add("Alpha"); - standardProperties.Add("ApiPatchingSymbolFlags"); - standardProperties.Add("ARPAUTHORIZEDCDFPREFIX"); - standardProperties.Add("ARPCOMMENTS"); - standardProperties.Add("ARPCONTACT"); - standardProperties.Add("ARPHELPLINK"); - standardProperties.Add("ARPHELPTELEPHONE"); - standardProperties.Add("ARPINSTALLLOCATION"); - standardProperties.Add("ARPNOMODIFY"); - standardProperties.Add("ARPNOREMOVE"); - standardProperties.Add("ARPNOREPAIR"); - standardProperties.Add("ARPPRODUCTIONICON"); - standardProperties.Add("ARPREADME"); - standardProperties.Add("ARPSIZE"); - standardProperties.Add("ARPSYSTEMCOMPONENT"); - standardProperties.Add("ARPULRINFOABOUT"); - standardProperties.Add("ARPURLUPDATEINFO"); - standardProperties.Add("AVAILABLEFREEREG"); - standardProperties.Add("BorderSize"); - standardProperties.Add("BorderTop"); - standardProperties.Add("CaptionHeight"); - standardProperties.Add("CCP_DRIVE"); - standardProperties.Add("ColorBits"); - standardProperties.Add("COMPADDLOCAL"); - standardProperties.Add("COMPADDSOURCE"); - standardProperties.Add("COMPANYNAME"); - standardProperties.Add("ComputerName"); - standardProperties.Add("CostingComplete"); - standardProperties.Add("Date"); - standardProperties.Add("DefaultUIFont"); - standardProperties.Add("DISABLEADVTSHORTCUTS"); - standardProperties.Add("DISABLEMEDIA"); - standardProperties.Add("DISABLEROLLBACK"); - standardProperties.Add("DiskPrompt"); - standardProperties.Add("DontRemoveTempFolderWhenFinished"); - standardProperties.Add("EnableUserControl"); - standardProperties.Add("EXECUTEACTION"); - standardProperties.Add("EXECUTEMODE"); - standardProperties.Add("FASTOEM"); - standardProperties.Add("FILEADDDEFAULT"); - standardProperties.Add("FILEADDLOCAL"); - standardProperties.Add("FILEADDSOURCE"); - standardProperties.Add("IncludeWholeFilesOnly"); - standardProperties.Add("Installed"); - standardProperties.Add("INSTALLLEVEL"); - standardProperties.Add("Intel"); - standardProperties.Add("Intel64"); - standardProperties.Add("IsAdminPackage"); - standardProperties.Add("LeftUnit"); - standardProperties.Add("LIMITUI"); - standardProperties.Add("ListOfPatchGUIDsToReplace"); - standardProperties.Add("ListOfTargetProductCode"); - standardProperties.Add("LOGACTION"); - standardProperties.Add("LogonUser"); - standardProperties.Add("Manufacturer"); - standardProperties.Add("MEDIAPACKAGEPATH"); - standardProperties.Add("MediaSourceDir"); - standardProperties.Add("MinimumRequiredMsiVersion"); - standardProperties.Add("MsiAMD64"); - standardProperties.Add("MSIAPRSETTINGSIDENTIFIER"); - standardProperties.Add("MSICHECKCRCS"); - standardProperties.Add("MSIDISABLERMRESTART"); - standardProperties.Add("MSIENFORCEUPGRADECOMPONENTRULES"); - standardProperties.Add("MSIFASTINSTALL"); - standardProperties.Add("MsiFileToUseToCreatePatchTables"); - standardProperties.Add("MsiHiddenProperties"); - standardProperties.Add("MSIINSTALLPERUSER"); - standardProperties.Add("MSIINSTANCEGUID"); - standardProperties.Add("MsiLogFileLocation"); - standardProperties.Add("MsiLogging"); - standardProperties.Add("MsiNetAssemblySupport"); - standardProperties.Add("MSINEWINSTANCE"); - standardProperties.Add("MSINODISABLEMEDIA"); - standardProperties.Add("MsiNTProductType"); - standardProperties.Add("MsiNTSuiteBackOffice"); - standardProperties.Add("MsiNTSuiteDataCenter"); - standardProperties.Add("MsiNTSuiteEnterprise"); - standardProperties.Add("MsiNTSuiteSmallBusiness"); - standardProperties.Add("MsiNTSuiteSmallBusinessRestricted"); - standardProperties.Add("MsiNTSuiteWebServer"); - standardProperties.Add("MsiNTSuitePersonal"); - standardProperties.Add("MsiPatchRemovalList"); - standardProperties.Add("MSIPATCHREMOVE"); - standardProperties.Add("MSIRESTARTMANAGERCONTROL"); - standardProperties.Add("MsiRestartManagerSessionKey"); - standardProperties.Add("MSIRMSHUTDOWN"); - standardProperties.Add("MsiRunningElevated"); - standardProperties.Add("MsiUIHideCancel"); - standardProperties.Add("MsiUIProgressOnly"); - standardProperties.Add("MsiUISourceResOnly"); - standardProperties.Add("MsiSystemRebootPending"); - standardProperties.Add("MsiWin32AssemblySupport"); - standardProperties.Add("NOCOMPANYNAME"); - standardProperties.Add("NOUSERNAME"); - standardProperties.Add("OLEAdvtSupport"); - standardProperties.Add("OptimizePatchSizeForLargeFiles"); - standardProperties.Add("OriginalDatabase"); - standardProperties.Add("OutOfDiskSpace"); - standardProperties.Add("OutOfNoRbDiskSpace"); - standardProperties.Add("ParentOriginalDatabase"); - standardProperties.Add("ParentProductCode"); - standardProperties.Add("PATCH"); - standardProperties.Add("PATCH_CACHE_DIR"); - standardProperties.Add("PATCH_CACHE_ENABLED"); - standardProperties.Add("PatchGUID"); - standardProperties.Add("PATCHNEWPACKAGECODE"); - standardProperties.Add("PATCHNEWSUMMARYCOMMENTS"); - standardProperties.Add("PATCHNEWSUMMARYSUBJECT"); - standardProperties.Add("PatchOutputPath"); - standardProperties.Add("PatchSourceList"); - standardProperties.Add("PhysicalMemory"); - standardProperties.Add("PIDKEY"); - standardProperties.Add("PIDTemplate"); - standardProperties.Add("Preselected"); - standardProperties.Add("PRIMARYFOLDER"); - standardProperties.Add("PrimaryVolumePath"); - standardProperties.Add("PrimaryVolumeSpaceAvailable"); - standardProperties.Add("PrimaryVolumeSpaceRemaining"); - standardProperties.Add("PrimaryVolumeSpaceRequired"); - standardProperties.Add("Privileged"); - standardProperties.Add("ProductCode"); - standardProperties.Add("ProductID"); - standardProperties.Add("ProductLanguage"); - standardProperties.Add("ProductName"); - standardProperties.Add("ProductState"); - standardProperties.Add("ProductVersion"); - standardProperties.Add("PROMPTROLLBACKCOST"); - standardProperties.Add("REBOOT"); - standardProperties.Add("REBOOTPROMPT"); - standardProperties.Add("RedirectedDllSupport"); - standardProperties.Add("REINSTALL"); - standardProperties.Add("REINSTALLMODE"); - standardProperties.Add("RemoveAdminTS"); - standardProperties.Add("REMOVE"); - standardProperties.Add("ReplacedInUseFiles"); - standardProperties.Add("RestrictedUserControl"); - standardProperties.Add("RESUME"); - standardProperties.Add("RollbackDisabled"); - standardProperties.Add("ROOTDRIVE"); - standardProperties.Add("ScreenX"); - standardProperties.Add("ScreenY"); - standardProperties.Add("SecureCustomProperties"); - standardProperties.Add("ServicePackLevel"); - standardProperties.Add("ServicePackLevelMinor"); - standardProperties.Add("SEQUENCE"); - standardProperties.Add("SharedWindows"); - standardProperties.Add("ShellAdvtSupport"); - standardProperties.Add("SHORTFILENAMES"); - standardProperties.Add("SourceDir"); - standardProperties.Add("SOURCELIST"); - standardProperties.Add("SystemLanguageID"); - standardProperties.Add("TARGETDIR"); - standardProperties.Add("TerminalServer"); - standardProperties.Add("TextHeight"); - standardProperties.Add("Time"); - standardProperties.Add("TRANSFORMS"); - standardProperties.Add("TRANSFORMSATSOURCE"); - standardProperties.Add("TRANSFORMSSECURE"); - standardProperties.Add("TTCSupport"); - standardProperties.Add("UILevel"); - standardProperties.Add("UpdateStarted"); - standardProperties.Add("UpgradeCode"); - standardProperties.Add("UPGRADINGPRODUCTCODE"); - standardProperties.Add("UserLanguageID"); - standardProperties.Add("USERNAME"); - standardProperties.Add("UserSID"); - standardProperties.Add("Version9X"); - standardProperties.Add("VersionDatabase"); - standardProperties.Add("VersionMsi"); - standardProperties.Add("VersionNT"); - standardProperties.Add("VersionNT64"); - standardProperties.Add("VirtualMemory"); - standardProperties.Add("WindowsBuild"); - standardProperties.Add("WindowsVolume"); - } - } - - return standardProperties.Contains(propertyName); - } - - /// - /// Sets up a hashtable with the set of standard MSI directories - /// - private static void LoadStandardDirectories() - { - lock (lockObject) - { - if (null == standardDirectories) - { - standardDirectories = new HashSet(); - standardDirectories.Add("TARGETDIR"); - standardDirectories.Add("AdminToolsFolder"); - standardDirectories.Add("AppDataFolder"); - standardDirectories.Add("CommonAppDataFolder"); - standardDirectories.Add("CommonFilesFolder"); - standardDirectories.Add("DesktopFolder"); - standardDirectories.Add("FavoritesFolder"); - standardDirectories.Add("FontsFolder"); - standardDirectories.Add("LocalAppDataFolder"); - standardDirectories.Add("MyPicturesFolder"); - standardDirectories.Add("PersonalFolder"); - standardDirectories.Add("ProgramFilesFolder"); - standardDirectories.Add("ProgramMenuFolder"); - standardDirectories.Add("SendToFolder"); - standardDirectories.Add("StartMenuFolder"); - standardDirectories.Add("StartupFolder"); - standardDirectories.Add("System16Folder"); - standardDirectories.Add("SystemFolder"); - standardDirectories.Add("TempFolder"); - standardDirectories.Add("TemplateFolder"); - standardDirectories.Add("WindowsFolder"); - standardDirectories.Add("CommonFiles64Folder"); - standardDirectories.Add("ProgramFiles64Folder"); - standardDirectories.Add("System64Folder"); - standardDirectories.Add("NetHoodFolder"); - standardDirectories.Add("PrintHoodFolder"); - standardDirectories.Add("RecentFolder"); - standardDirectories.Add("WindowsVolume"); - } - } - } - } -} diff --git a/src/WixToolset.Data.WindowsInstaller/WindowsInstallerStandardInternal.cs b/src/WixToolset.Data.WindowsInstaller/WindowsInstallerStandardInternal.cs new file mode 100644 index 00000000..cc6754c3 --- /dev/null +++ b/src/WixToolset.Data.WindowsInstaller/WindowsInstallerStandardInternal.cs @@ -0,0 +1,59 @@ +// 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.Data +{ + using System.Reflection; + using System.Xml; + using WixToolset.Data.Rows; + + /// + /// Represents the Windows Installer standard objects. + /// + public 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.Data.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() + { + lock (lockObject) + { + if (null == WindowsInstallerStandardInternal.standardActions) + { + using (XmlReader reader = XmlReader.Create(Assembly.GetExecutingAssembly().GetManifestResourceStream("WixToolset.Data.WindowsInstaller.Data.actions.xml"))) + { + WindowsInstallerStandardInternal.standardActions = WixActionRowCollection.Load(reader); + } + } + } + + return WindowsInstallerStandardInternal.standardActions; + } + } +} -- cgit v1.2.3-55-g6feb