//-------------------------------------------------------------------------------------------------
// <copyright file="UtilExtension.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// The use and distribution terms for this software are covered by the
// Common Public License 1.0 (http://opensource.org/licenses/cpl.php)
// which can be found in the file CPL.TXT at the root of this distribution.
// By using this software in any fashion, you are agreeing to be bound by
// the terms of this license.
//
// You must not remove this notice, or any other, from this software.
// </copyright>
//
// <summary>
// The Windows Installer XML Toolset Utility Extension.
// </summary>
//-------------------------------------------------------------------------------------------------
namespace Microsoft.Tools.WindowsInstallerXml.Extensions{
using System;
using System.Reflection;
/// <summary>
/// The Windows Installer XML Toolset Utility Extension.
/// </summary>
public sealed class UtilExtension : WixExtension
{
internal static readonly string[] FilePermissions = { "Read", "Write", "Append", "ReadExtendedAttributes", "WriteExtendedAttributes", "Execute", null, "ReadAttributes", "WriteAttributes" };
internal static readonly string[] FolderPermissions = { "Read", "CreateFile", "CreateChild", "ReadExtendedAttributes", "WriteExtendedAttributes", "Traverse", "DeleteChild", "ReadAttributes", "WriteAttributes" };
internal static readonly string[] GenericPermissions = { "GenericAll", "GenericExecute", "GenericWrite", "GenericRead" };
internal static readonly string[] RegistryPermissions = { "Read", "Write", "CreateSubkeys", "EnumerateSubkeys", "Notify", "CreateLink" };
internal static readonly string[] ServicePermissions = { "ServiceQueryConfig", "ServiceChangeConfig", "ServiceQueryStatus", "ServiceEnumerateDependents", "ServiceStart", "ServiceStop", "ServicePauseContinue", "ServiceInterrogate", "ServiceUserDefinedControl" };
internal static readonly string[] StandardPermissions = { "Delete", "ReadPermission", "ChangePermission", "TakeOwnership", "Synchronize" };
private Library library;
private UtilCompiler compilerExtension;
private UtilDecompiler decompilerExtension;
private TableDefinitionCollection tableDefinitions;
/// <summary>
/// Gets the optional compiler extension.
/// </summary>
/// <value>The optional compiler extension.</value>
public override CompilerExtension CompilerExtension
{
get
{
if (null == this.compilerExtension)
{
this.compilerExtension = new UtilCompiler();
}
return this.compilerExtension;
}
}
/// <summary>
/// Gets the optional decompiler extension.
/// </summary>
/// <value>The optional decompiler extension.</value>
public override DecompilerExtension DecompilerExtension
{
get
{
if (null == this.decompilerExtension)
{
this.decompilerExtension = new UtilDecompiler();
}
return this.decompilerExtension;
}
}
/// <summary>
/// Gets the optional table definitions for this extension.
/// </summary>
/// <value>The optional table definitions for this extension.</value>
public override TableDefinitionCollection TableDefinitions
{
get
{
if (null == this.tableDefinitions)
{
this.tableDefinitions = LoadTableDefinitionHelper(Assembly.GetExecutingAssembly(), "Microsoft.Tools.WindowsInstallerXml.Extensions.Data.tables.xml");
}
return this.tableDefinitions;
}
}
/// <summary>
/// Gets the library associated with this extension.
/// </summary>
/// <param name="tableDefinitions">The table definitions to use while loading the library.</param>
/// <returns>The library for this extension.</returns>
public override Library GetLibrary(TableDefinitionCollection tableDefinitions)
{
if (null == this.library)
{
this.library = LoadLibraryHelper(Assembly.GetExecutingAssembly(), "Microsoft.Tools.WindowsInstallerXml.Extensions.Data.util.wixlib", tableDefinitions);
}
return this.library;
}
/// <summary>
/// Gets the default culture.
/// </summary>
/// <value>The default culture.</value>
public override string DefaultCulture
{
get { return "en-us"; }
}
}
}
|