From c8f39be3f8b70b36a8b89b6ccdd4ebb94290b6b3 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Sat, 30 Dec 2017 01:56:55 -0800 Subject: [PATCH] Initial code commit --- Util.wixext.sln | 73 + appveyor.cmd | 13 + appveyor.yml | 29 + nuget.config | 15 + src/Cpp.Build.props | 101 + src/Directory.Build.props | 22 + src/FindLocalWix.props | 8 + src/ca/dllmain.cpp | 26 + src/ca/packages.config | 6 + src/ca/precomp.h | 13 + src/ca/utilca.cpp | 3 + src/ca/utilca.def | 7 + src/ca/utilca.vcxproj | 69 + .../TestData/UsingFileShare/Package.en-us.wxl | 11 + .../TestData/UsingFileShare/Package.wxs | 22 + .../UsingFileShare/PackageComponents.wxs | 16 + .../TestData/UsingFileShare/example.txt | 1 + .../UtilExtensionFixture.cs | 34 + .../WixToolsetTest.Util.csproj | 40 + src/wixext/PerformanceCounterType.cs | 192 + src/wixext/Tuples/EventManifestTuple.cs | 55 + .../Tuples/FileSharePermissionsTuple.cs | 63 + src/wixext/Tuples/FileShareTuple.cs | 95 + src/wixext/Tuples/GroupTuple.cs | 71 + src/wixext/Tuples/PerfmonManifestTuple.cs | 63 + src/wixext/Tuples/PerfmonTuple.cs | 63 + src/wixext/Tuples/PerformanceCategoryTuple.cs | 79 + src/wixext/Tuples/SecureObjectsTuple.cs | 87 + src/wixext/Tuples/ServiceConfigTuple.cs | 119 + src/wixext/Tuples/UserGroupTuple.cs | 55 + src/wixext/Tuples/UserTuple.cs | 87 + src/wixext/Tuples/UtilTupleDefinitions.cs | 111 + src/wixext/Tuples/WixCloseApplicationTuple.cs | 111 + src/wixext/Tuples/WixFormatFilesTuple.cs | 55 + src/wixext/Tuples/WixInternetShortcutTuple.cs | 103 + src/wixext/Tuples/WixRemoveFolderExTuple.cs | 71 + src/wixext/Tuples/WixRestartResourceTuple.cs | 71 + src/wixext/Tuples/WixTouchFileTuple.cs | 71 + src/wixext/Tuples/XmlConfigTuple.cs | 111 + src/wixext/Tuples/XmlFileTuple.cs | 103 + src/wixext/UtilBinder.cs | 347 + src/wixext/UtilCompiler.cs | 3911 ++++++ src/wixext/UtilConstants.cs | 17 + src/wixext/UtilDecompiler.cs | 1543 +++ src/wixext/UtilErrors.cs | 109 + src/wixext/UtilExtensionData.cs | 21 + src/wixext/UtilExtensionFactory.cs | 18 + src/wixext/UtilWarnings.cs | 72 + .../UtilWindowsInstallerBackendExtension.cs | 26 + src/wixext/WixToolset.Util.wixext.csproj | 34 + src/wixext/WixToolset.Util.wixext.targets | 8 + src/wixext/tables.xml | 242 + src/wixext/util.cs | 11461 ++++++++++++++++ src/wixext/util.xsd | 1692 +++ src/wixlib/UtilExtension.wxs | 430 + src/wixlib/UtilExtension_Platform.wxi | 224 + src/wixlib/UtilExtension_x64.wxs | 8 + src/wixlib/UtilExtension_x86.wxs | 8 + src/wixlib/caSuffix.wxi | 28 + src/wixlib/caerr.wxi | 96 + src/wixlib/de-de.wxl | 33 + src/wixlib/en-us.wxl | 33 + src/wixlib/es-es.wxl | 32 + src/wixlib/fr-fr.wxl | 32 + src/wixlib/it-it.wxl | 33 + src/wixlib/ja-jp.wxl | 33 + src/wixlib/packages.config | 5 + src/wixlib/pt-br.wxl | 27 + src/wixlib/util.wixproj | 52 + version.json | 11 + 70 files changed, 22931 insertions(+) create mode 100644 Util.wixext.sln create mode 100644 appveyor.cmd create mode 100644 appveyor.yml create mode 100644 nuget.config create mode 100644 src/Cpp.Build.props create mode 100644 src/Directory.Build.props create mode 100644 src/FindLocalWix.props create mode 100644 src/ca/dllmain.cpp create mode 100644 src/ca/packages.config create mode 100644 src/ca/precomp.h create mode 100644 src/ca/utilca.cpp create mode 100644 src/ca/utilca.def create mode 100644 src/ca/utilca.vcxproj create mode 100644 src/test/WixToolsetTest.Util/TestData/UsingFileShare/Package.en-us.wxl create mode 100644 src/test/WixToolsetTest.Util/TestData/UsingFileShare/Package.wxs create mode 100644 src/test/WixToolsetTest.Util/TestData/UsingFileShare/PackageComponents.wxs create mode 100644 src/test/WixToolsetTest.Util/TestData/UsingFileShare/example.txt create mode 100644 src/test/WixToolsetTest.Util/UtilExtensionFixture.cs create mode 100644 src/test/WixToolsetTest.Util/WixToolsetTest.Util.csproj create mode 100644 src/wixext/PerformanceCounterType.cs create mode 100644 src/wixext/Tuples/EventManifestTuple.cs create mode 100644 src/wixext/Tuples/FileSharePermissionsTuple.cs create mode 100644 src/wixext/Tuples/FileShareTuple.cs create mode 100644 src/wixext/Tuples/GroupTuple.cs create mode 100644 src/wixext/Tuples/PerfmonManifestTuple.cs create mode 100644 src/wixext/Tuples/PerfmonTuple.cs create mode 100644 src/wixext/Tuples/PerformanceCategoryTuple.cs create mode 100644 src/wixext/Tuples/SecureObjectsTuple.cs create mode 100644 src/wixext/Tuples/ServiceConfigTuple.cs create mode 100644 src/wixext/Tuples/UserGroupTuple.cs create mode 100644 src/wixext/Tuples/UserTuple.cs create mode 100644 src/wixext/Tuples/UtilTupleDefinitions.cs create mode 100644 src/wixext/Tuples/WixCloseApplicationTuple.cs create mode 100644 src/wixext/Tuples/WixFormatFilesTuple.cs create mode 100644 src/wixext/Tuples/WixInternetShortcutTuple.cs create mode 100644 src/wixext/Tuples/WixRemoveFolderExTuple.cs create mode 100644 src/wixext/Tuples/WixRestartResourceTuple.cs create mode 100644 src/wixext/Tuples/WixTouchFileTuple.cs create mode 100644 src/wixext/Tuples/XmlConfigTuple.cs create mode 100644 src/wixext/Tuples/XmlFileTuple.cs create mode 100644 src/wixext/UtilBinder.cs create mode 100644 src/wixext/UtilCompiler.cs create mode 100644 src/wixext/UtilConstants.cs create mode 100644 src/wixext/UtilDecompiler.cs create mode 100644 src/wixext/UtilErrors.cs create mode 100644 src/wixext/UtilExtensionData.cs create mode 100644 src/wixext/UtilExtensionFactory.cs create mode 100644 src/wixext/UtilWarnings.cs create mode 100644 src/wixext/UtilWindowsInstallerBackendExtension.cs create mode 100644 src/wixext/WixToolset.Util.wixext.csproj create mode 100644 src/wixext/WixToolset.Util.wixext.targets create mode 100644 src/wixext/tables.xml create mode 100644 src/wixext/util.cs create mode 100644 src/wixext/util.xsd create mode 100644 src/wixlib/UtilExtension.wxs create mode 100644 src/wixlib/UtilExtension_Platform.wxi create mode 100644 src/wixlib/UtilExtension_x64.wxs create mode 100644 src/wixlib/UtilExtension_x86.wxs create mode 100644 src/wixlib/caSuffix.wxi create mode 100644 src/wixlib/caerr.wxi create mode 100644 src/wixlib/de-de.wxl create mode 100644 src/wixlib/en-us.wxl create mode 100644 src/wixlib/es-es.wxl create mode 100644 src/wixlib/fr-fr.wxl create mode 100644 src/wixlib/it-it.wxl create mode 100644 src/wixlib/ja-jp.wxl create mode 100644 src/wixlib/packages.config create mode 100644 src/wixlib/pt-br.wxl create mode 100644 src/wixlib/util.wixproj create mode 100644 version.json diff --git a/Util.wixext.sln b/Util.wixext.sln new file mode 100644 index 0000000..e25aa4f --- /dev/null +++ b/Util.wixext.sln @@ -0,0 +1,73 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27130.2003 +MinimumVisualStudioVersion = 15.0.26124.0 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "utilca", "src\ca\utilca.vcxproj", "{076018F7-19BD-423A-ABBF-229273DA08D8}" +EndProject +Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "util", "src\wixlib\util.wixproj", "{1ACFFEFD-505A-41A5-ACBF-A02B7B473AA2}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolset.Util.wixext", "src\wixext\WixToolset.Util.wixext.csproj", "{6CF033EB-0A39-4AC6-9D41-9BD506352045}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolsetTest.Util", "src\test\WixToolsetTest.Util\WixToolsetTest.Util.csproj", "{D5D34EC4-AF91-4B11-AC0A-FA5242AE924B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {076018F7-19BD-423A-ABBF-229273DA08D8}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {076018F7-19BD-423A-ABBF-229273DA08D8}.Debug|x64.ActiveCfg = Debug|Win32 + {076018F7-19BD-423A-ABBF-229273DA08D8}.Debug|x86.ActiveCfg = Debug|Win32 + {076018F7-19BD-423A-ABBF-229273DA08D8}.Debug|x86.Build.0 = Debug|Win32 + {076018F7-19BD-423A-ABBF-229273DA08D8}.Release|Any CPU.ActiveCfg = Release|Win32 + {076018F7-19BD-423A-ABBF-229273DA08D8}.Release|x64.ActiveCfg = Release|Win32 + {076018F7-19BD-423A-ABBF-229273DA08D8}.Release|x86.ActiveCfg = Release|Win32 + {076018F7-19BD-423A-ABBF-229273DA08D8}.Release|x86.Build.0 = Release|Win32 + {1ACFFEFD-505A-41A5-ACBF-A02B7B473AA2}.Debug|Any CPU.ActiveCfg = Debug|x86 + {1ACFFEFD-505A-41A5-ACBF-A02B7B473AA2}.Debug|x64.ActiveCfg = Debug|x64 + {1ACFFEFD-505A-41A5-ACBF-A02B7B473AA2}.Debug|x64.Build.0 = Debug|x64 + {1ACFFEFD-505A-41A5-ACBF-A02B7B473AA2}.Debug|x86.ActiveCfg = Debug|x86 + {1ACFFEFD-505A-41A5-ACBF-A02B7B473AA2}.Debug|x86.Build.0 = Debug|x86 + {1ACFFEFD-505A-41A5-ACBF-A02B7B473AA2}.Release|Any CPU.ActiveCfg = Release|x86 + {1ACFFEFD-505A-41A5-ACBF-A02B7B473AA2}.Release|x64.ActiveCfg = Release|x64 + {1ACFFEFD-505A-41A5-ACBF-A02B7B473AA2}.Release|x64.Build.0 = Release|x64 + {1ACFFEFD-505A-41A5-ACBF-A02B7B473AA2}.Release|x86.ActiveCfg = Release|x86 + {1ACFFEFD-505A-41A5-ACBF-A02B7B473AA2}.Release|x86.Build.0 = Release|x86 + {6CF033EB-0A39-4AC6-9D41-9BD506352045}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6CF033EB-0A39-4AC6-9D41-9BD506352045}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6CF033EB-0A39-4AC6-9D41-9BD506352045}.Debug|x64.ActiveCfg = Debug|Any CPU + {6CF033EB-0A39-4AC6-9D41-9BD506352045}.Debug|x64.Build.0 = Debug|Any CPU + {6CF033EB-0A39-4AC6-9D41-9BD506352045}.Debug|x86.ActiveCfg = Debug|Any CPU + {6CF033EB-0A39-4AC6-9D41-9BD506352045}.Debug|x86.Build.0 = Debug|Any CPU + {6CF033EB-0A39-4AC6-9D41-9BD506352045}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6CF033EB-0A39-4AC6-9D41-9BD506352045}.Release|Any CPU.Build.0 = Release|Any CPU + {6CF033EB-0A39-4AC6-9D41-9BD506352045}.Release|x64.ActiveCfg = Release|Any CPU + {6CF033EB-0A39-4AC6-9D41-9BD506352045}.Release|x64.Build.0 = Release|Any CPU + {6CF033EB-0A39-4AC6-9D41-9BD506352045}.Release|x86.ActiveCfg = Release|Any CPU + {6CF033EB-0A39-4AC6-9D41-9BD506352045}.Release|x86.Build.0 = Release|Any CPU + {D5D34EC4-AF91-4B11-AC0A-FA5242AE924B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D5D34EC4-AF91-4B11-AC0A-FA5242AE924B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D5D34EC4-AF91-4B11-AC0A-FA5242AE924B}.Debug|x64.ActiveCfg = Debug|Any CPU + {D5D34EC4-AF91-4B11-AC0A-FA5242AE924B}.Debug|x64.Build.0 = Debug|Any CPU + {D5D34EC4-AF91-4B11-AC0A-FA5242AE924B}.Debug|x86.ActiveCfg = Debug|Any CPU + {D5D34EC4-AF91-4B11-AC0A-FA5242AE924B}.Debug|x86.Build.0 = Debug|Any CPU + {D5D34EC4-AF91-4B11-AC0A-FA5242AE924B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D5D34EC4-AF91-4B11-AC0A-FA5242AE924B}.Release|Any CPU.Build.0 = Release|Any CPU + {D5D34EC4-AF91-4B11-AC0A-FA5242AE924B}.Release|x64.ActiveCfg = Release|Any CPU + {D5D34EC4-AF91-4B11-AC0A-FA5242AE924B}.Release|x64.Build.0 = Release|Any CPU + {D5D34EC4-AF91-4B11-AC0A-FA5242AE924B}.Release|x86.ActiveCfg = Release|Any CPU + {D5D34EC4-AF91-4B11-AC0A-FA5242AE924B}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {E4566A6B-47D0-4EA0-989A-D763AC39105D} + EndGlobalSection +EndGlobal diff --git a/appveyor.cmd b/appveyor.cmd new file mode 100644 index 0000000..3493d58 --- /dev/null +++ b/appveyor.cmd @@ -0,0 +1,13 @@ +@setlocal +@pushd %~dp0 + +nuget restore + +msbuild -p:Configuration=Release -t:Restore + +msbuild -p:Configuration=Release src\test\WixToolsetTest.Util\WixToolsetTest.Util.csproj + +msbuild -p:Configuration=Release -t:Pack src\wixext\WixToolset.Util.wixext.csproj + +@popd +@endlocal \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..0c74d54 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,29 @@ +image: Visual Studio 2017 + +version: 0.0.0.{build} +configuration: Release + +environment: + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + NUGET_XMLDOC_MODE: skip + +build_script: + - appveyor.cmd + +pull_requests: + do_not_increment_build_number: true + +nuget: + disable_publish_on_pr: true + +skip_tags: true + +artifacts: +- path: build\Release\**\*.nupkg + name: nuget + +notifications: +- provider: Slack + incoming_webhook: + secure: p5xuu+4x2JHfwGDMDe5KcG1k7gZxqYc4jWVwvyNZv5cvkubPD2waJs5yXMAXZNN7Z63/3PWHb7q4KoY/99AjauYa1nZ4c5qYqRPFRBKTHfA= diff --git a/nuget.config b/nuget.config new file mode 100644 index 0000000..bb8de14 --- /dev/null +++ b/nuget.config @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Cpp.Build.props b/src/Cpp.Build.props new file mode 100644 index 0000000..453aa44 --- /dev/null +++ b/src/Cpp.Build.props @@ -0,0 +1,101 @@ + + + + + + Win32 + $(OutputPath) + $(BaseIntermediateOutputPath)$(Platform)\ + $(OutputPath)$(Platform)\ + + + + + $(DisableSpecificCompilerWarnings) + Level4 + $(ProjectDir)inc;$(MSBuildProjectDirectory);$(IntDir);$(SqlCESdkIncludePath);$(ProjectAdditionalIncludeDirectories);%(AdditionalIncludeDirectories) + WIN32;_WINDOWS;_WIN32_MSI=500;_WIN32_WINNT=0x0501;$(ArmPreprocessorDefinitions);$(UnicodePreprocessorDefinitions);_CRT_STDIO_LEGACY_WIDE_SPECIFIERS;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions) + Use + precomp.h + StdCall + true + false + -YlprecompDefine + /Zc:threadSafeInit- %(AdditionalOptions) + true + + + $(ArmPreprocessorDefinitions);%(PreprocessorDefinitions) + $(ProjectAdditionalResourceIncludeDirectories);%(AdditionalIncludeDirectories) + + + $(OutDir);$(AdditionalMultiTargetLibraryPath);$(ProjectAdditionalLibraryDirectories);%(AdditionalLibraryDirectories) + + + $(ProjectSubSystem) + $(ProjectModuleDefinitionFile) + $(ResourceOnlyDll) + true + $(ProjectAdditionalLinkLibraries);advapi32.lib;comdlg32.lib;user32.lib;oleaut32.lib;gdi32.lib;shell32.lib;ole32.lib;version.lib;%(AdditionalDependencies) + $(OutDir);$(AdditionalMultiTargetLibraryPath);$(ArmLibraryDirectories);$(ProjectAdditionalLinkLibraryDirectories);%(AdditionalLibraryDirectories) + /IGNORE:4099 %(AdditionalOptions) + + + + + + NoExtensions + + + + + CDecl + + + + + OldStyle + true + true + + + + + Disabled + EnableFastChecks + _DEBUG;DEBUG;%(PreprocessorDefinitions) + MultiThreadedDebug + + + + + + MultiThreadedDebugDll + + + + + MinSpace + NDEBUG;%(PreprocessorDefinitions) + true + true + MultiThreaded + + + true + true + + + + + + MultiThreadedDll + + + + + $(LinkKeyFile) + $(LinkDelaySign) + + + diff --git a/src/Directory.Build.props b/src/Directory.Build.props new file mode 100644 index 0000000..63ad5d6 --- /dev/null +++ b/src/Directory.Build.props @@ -0,0 +1,22 @@ + + + + + + Debug + AnyCPU + $(MSBuildThisFileDirectory)..\build\obj\$(MSBuildProjectName)\ + $(MSBuildThisFileDirectory)..\build\$(Configuration)\ + + WiX Toolset Team + WiX Toolset + Copyright (c) .NET Foundation and contributors. All rights reserved. + + + + $(MSBuildThisFileDirectory)..\..\ + + + + + diff --git a/src/FindLocalWix.props b/src/FindLocalWix.props new file mode 100644 index 0000000..016dac7 --- /dev/null +++ b/src/FindLocalWix.props @@ -0,0 +1,8 @@ + + + + + + $(MSBuildThisFileDirectory)..\..\Core\build\Release\publish\net461\wix.targets + + diff --git a/src/ca/dllmain.cpp b/src/ca/dllmain.cpp new file mode 100644 index 0000000..35ae6d1 --- /dev/null +++ b/src/ca/dllmain.cpp @@ -0,0 +1,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. + +#include "precomp.h" + +/******************************************************************** +DllMain - standard entry point for all WiX custom actions + +********************************************************************/ +extern "C" BOOL WINAPI DllMain( + IN HINSTANCE hInst, + IN ULONG ulReason, + IN LPVOID) +{ + switch(ulReason) + { + case DLL_PROCESS_ATTACH: + WcaGlobalInitialize(hInst); + break; + + case DLL_PROCESS_DETACH: + WcaGlobalFinalize(); + break; + } + + return TRUE; +} diff --git a/src/ca/packages.config b/src/ca/packages.config new file mode 100644 index 0000000..b74ff5d --- /dev/null +++ b/src/ca/packages.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/ca/precomp.h b/src/ca/precomp.h new file mode 100644 index 0000000..3edad7e --- /dev/null +++ b/src/ca/precomp.h @@ -0,0 +1,13 @@ +#pragma once +// 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. + + +#include +#include + +#define MAXUINT USHRT_MAX +#include + +#include "wcautil.h" +#include "fileutil.h" +#include "strutil.h" diff --git a/src/ca/utilca.cpp b/src/ca/utilca.cpp new file mode 100644 index 0000000..37664a1 --- /dev/null +++ b/src/ca/utilca.cpp @@ -0,0 +1,3 @@ +// 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. + +#include "precomp.h" diff --git a/src/ca/utilca.def b/src/ca/utilca.def new file mode 100644 index 0000000..4b34b3a --- /dev/null +++ b/src/ca/utilca.def @@ -0,0 +1,7 @@ +; 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. + + +LIBRARY "utilca" + +EXPORTS + diff --git a/src/ca/utilca.vcxproj b/src/ca/utilca.vcxproj new file mode 100644 index 0000000..37b5c7d --- /dev/null +++ b/src/ca/utilca.vcxproj @@ -0,0 +1,69 @@ + + + + + + + + + + Debug + Win32 + + + Release + Win32 + + + + + {076018F7-19BD-423A-ABBF-229273DA08D8} + DynamicLibrary + utilca + v141 + Unicode + utilca.def + WiX Toolset Util CustomAction + + + + + + + + + + + + + + msi.lib + + + + + Create + + + + + + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + diff --git a/src/test/WixToolsetTest.Util/TestData/UsingFileShare/Package.en-us.wxl b/src/test/WixToolsetTest.Util/TestData/UsingFileShare/Package.en-us.wxl new file mode 100644 index 0000000..38c12ac --- /dev/null +++ b/src/test/WixToolsetTest.Util/TestData/UsingFileShare/Package.en-us.wxl @@ -0,0 +1,11 @@ + + + + + + A newer version of [ProductName] is already installed. + MsiPackage + + diff --git a/src/test/WixToolsetTest.Util/TestData/UsingFileShare/Package.wxs b/src/test/WixToolsetTest.Util/TestData/UsingFileShare/Package.wxs new file mode 100644 index 0000000..68ff98f --- /dev/null +++ b/src/test/WixToolsetTest.Util/TestData/UsingFileShare/Package.wxs @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.Util/TestData/UsingFileShare/PackageComponents.wxs b/src/test/WixToolsetTest.Util/TestData/UsingFileShare/PackageComponents.wxs new file mode 100644 index 0000000..c548bc1 --- /dev/null +++ b/src/test/WixToolsetTest.Util/TestData/UsingFileShare/PackageComponents.wxs @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.Util/TestData/UsingFileShare/example.txt b/src/test/WixToolsetTest.Util/TestData/UsingFileShare/example.txt new file mode 100644 index 0000000..1b4ffe8 --- /dev/null +++ b/src/test/WixToolsetTest.Util/TestData/UsingFileShare/example.txt @@ -0,0 +1 @@ +This is example.txt. \ No newline at end of file diff --git a/src/test/WixToolsetTest.Util/UtilExtensionFixture.cs b/src/test/WixToolsetTest.Util/UtilExtensionFixture.cs new file mode 100644 index 0000000..5ce9f5e --- /dev/null +++ b/src/test/WixToolsetTest.Util/UtilExtensionFixture.cs @@ -0,0 +1,34 @@ +// 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 WixToolsetTest.VisualStudio +{ + using System.Linq; + using WixBuildTools.TestSupport; + using WixToolset.Core.TestPackage; + using WixToolset.Util; + using Xunit; + + public class VisualStudioExtensionFixture + { + [Fact] + public void CanBuildUsingFileShare() + { + var folder = TestData.Get(@"TestData\UsingFileShare"); + var build = new Builder(folder, typeof(UtilExtensionFactory), new[] { folder }); + + var results = build.BuildAndQuery(Build, "FileShare", "FileSharePermissions"); + Assert.Equal(new[] + { + "FileShare:SetVS2010Vsix\t51\tVS_VSIX_INSTALLER_PATH\t[VS2010_VSIX_INSTALLER_PATH]\t0", + "FileSharePermissions:SetVS2012Vsix\t51\tVS_VSIX_INSTALLER_PATH\t[VS2012_VSIX_INSTALLER_PATH]\t0", + }, results.OrderBy(s => s).ToArray()); + } + + private static void Build(string[] args) + { + var result = WixRunner.Execute(args, out var messages); + Assert.Equal(0, result); + Assert.Empty(messages); + } + } +} diff --git a/src/test/WixToolsetTest.Util/WixToolsetTest.Util.csproj b/src/test/WixToolsetTest.Util/WixToolsetTest.Util.csproj new file mode 100644 index 0000000..9559059 --- /dev/null +++ b/src/test/WixToolsetTest.Util/WixToolsetTest.Util.csproj @@ -0,0 +1,40 @@ + + + + + + netcoreapp2.0 + false + + + + NU1701 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/wixext/PerformanceCounterType.cs b/src/wixext/PerformanceCounterType.cs new file mode 100644 index 0000000..1e06efd --- /dev/null +++ b/src/wixext/PerformanceCounterType.cs @@ -0,0 +1,192 @@ +// Captured from: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.dll + +namespace System.Diagnostics +{ + public enum PerformanceCounterType + { + // + // Summary: + // An instantaneous counter that shows the most recently observed value in hexadecimal + // format. Used, for example, to maintain a simple count of items or operations. + NumberOfItemsHEX32 = 0, + // + // Summary: + // An instantaneous counter that shows the most recently observed value. Used, for + // example, to maintain a simple count of a very large number of items or operations. + // It is the same as NumberOfItemsHEX32 except that it uses larger fields to accommodate + // larger values. + NumberOfItemsHEX64 = 256, + // + // Summary: + // An instantaneous counter that shows the most recently observed value. Used, for + // example, to maintain a simple count of items or operations. + NumberOfItems32 = 65536, + // + // Summary: + // An instantaneous counter that shows the most recently observed value. Used, for + // example, to maintain a simple count of a very large number of items or operations. + // It is the same as NumberOfItems32 except that it uses larger fields to accommodate + // larger values. + NumberOfItems64 = 65792, + // + // Summary: + // A difference counter that shows the change in the measured attribute between + // the two most recent sample intervals. + CounterDelta32 = 4195328, + // + // Summary: + // A difference counter that shows the change in the measured attribute between + // the two most recent sample intervals. It is the same as the CounterDelta32 counter + // type except that is uses larger fields to accomodate larger values. + CounterDelta64 = 4195584, + // + // Summary: + // An average counter that shows the average number of operations completed in one + // second. When a counter of this type samples the data, each sampling interrupt + // returns one or zero. The counter data is the number of ones that were sampled. + // It measures time in units of ticks of the system performance timer. + SampleCounter = 4260864, + // + // Summary: + // An average counter designed to monitor the average length of a queue to a resource + // over time. It shows the difference between the queue lengths observed during + // the last two sample intervals divided by the duration of the interval. This type + // of counter is typically used to track the number of items that are queued or + // waiting. + CountPerTimeInterval32 = 4523008, + // + // Summary: + // An average counter that monitors the average length of a queue to a resource + // over time. Counters of this type display the difference between the queue lengths + // observed during the last two sample intervals, divided by the duration of the + // interval. This counter type is the same as CountPerTimeInterval32 except that + // it uses larger fields to accommodate larger values. This type of counter is typically + // used to track a high-volume or very large number of items that are queued or + // waiting. + CountPerTimeInterval64 = 4523264, + // + // Summary: + // A difference counter that shows the average number of operations completed during + // each second of the sample interval. Counters of this type measure time in ticks + // of the system clock. + RateOfCountsPerSecond32 = 272696320, + // + // Summary: + // A difference counter that shows the average number of operations completed during + // each second of the sample interval. Counters of this type measure time in ticks + // of the system clock. This counter type is the same as the RateOfCountsPerSecond32 + // type, but it uses larger fields to accommodate larger values to track a high-volume + // number of items or operations per second, such as a byte-transmission rate. + RateOfCountsPerSecond64 = 272696576, + // + // Summary: + // An instantaneous percentage counter that shows the ratio of a subset to its set + // as a percentage. For example, it compares the number of bytes in use on a disk + // to the total number of bytes on the disk. Counters of this type display the current + // percentage only, not an average over time. + RawFraction = 537003008, + // + // Summary: + // A percentage counter that shows the average time that a component is active as + // a percentage of the total sample time. + CounterTimer = 541132032, + // + // Summary: + // A percentage counter that shows the active time of a component as a percentage + // of the total elapsed time of the sample interval. It measures time in units of + // 100 nanoseconds (ns). Counters of this type are designed to measure the activity + // of one component at a time. + Timer100Ns = 542180608, + // + // Summary: + // A percentage counter that shows the average ratio of hits to all operations during + // the last two sample intervals. + SampleFraction = 549585920, + // + // Summary: + // A percentage counter that displays the average percentage of active time observed + // during sample interval. The value of these counters is calculated by monitoring + // the percentage of time that the service was inactive and then subtracting that + // value from 100 percent. + CounterTimerInverse = 557909248, + // + // Summary: + // A percentage counter that shows the average percentage of active time observed + // during the sample interval. + Timer100NsInverse = 558957824, + // + // Summary: + // A percentage counter that displays the active time of one or more components + // as a percentage of the total time of the sample interval. Because the numerator + // records the active time of components operating simultaneously, the resulting + // percentage can exceed 100 percent. + CounterMultiTimer = 574686464, + // + // Summary: + // A percentage counter that shows the active time of one or more components as + // a percentage of the total time of the sample interval. It measures time in 100 + // nanosecond (ns) units. + CounterMultiTimer100Ns = 575735040, + // + // Summary: + // A percentage counter that shows the active time of one or more components as + // a percentage of the total time of the sample interval. It derives the active + // time by measuring the time that the components were not active and subtracting + // the result from 100 percent by the number of objects monitored. + CounterMultiTimerInverse = 591463680, + // + // Summary: + // A percentage counter that shows the active time of one or more components as + // a percentage of the total time of the sample interval. Counters of this type + // measure time in 100 nanosecond (ns) units. They derive the active time by measuring + // the time that the components were not active and subtracting the result from + // multiplying 100 percent by the number of objects monitored. + CounterMultiTimer100NsInverse = 592512256, + // + // Summary: + // An average counter that measures the time it takes, on average, to complete a + // process or operation. Counters of this type display a ratio of the total elapsed + // time of the sample interval to the number of processes or operations completed + // during that time. This counter type measures time in ticks of the system clock. + AverageTimer32 = 805438464, + // + // Summary: + // A difference timer that shows the total time between when the component or process + // started and the time when this value is calculated. + ElapsedTime = 807666944, + // + // Summary: + // An average counter that shows how many items are processed, on average, during + // an operation. Counters of this type display a ratio of the items processed to + // the number of operations completed. The ratio is calculated by comparing the + // number of items processed during the last interval to the number of operations + // completed during the last interval. + AverageCount64 = 1073874176, + // + // Summary: + // A base counter that stores the number of sampling interrupts taken and is used + // as a denominator in the sampling fraction. The sampling fraction is the number + // of samples that were 1 (or true) for a sample interrupt. Check that this value + // is greater than zero before using it as the denominator in a calculation of SampleFraction. + SampleBase = 1073939457, + // + // Summary: + // A base counter that is used in the calculation of time or count averages, such + // as AverageTimer32 and AverageCount64. Stores the denominator for calculating + // a counter to present "time per operation" or "count per operation". + AverageBase = 1073939458, + // + // Summary: + // A base counter that stores the denominator of a counter that presents a general + // arithmetic fraction. Check that this value is greater than zero before using + // it as the denominator in a RawFraction value calculation. + RawBase = 1073939459, + // + // Summary: + // A base counter that indicates the number of items sampled. It is used as the + // denominator in the calculations to get an average among the items sampled when + // taking timings of multiple, but similar items. Used with CounterMultiTimer, CounterMultiTimerInverse, + // CounterMultiTimer100Ns, and CounterMultiTimer100NsInverse. + CounterMultiBase = 1107494144 + } +} diff --git a/src/wixext/Tuples/EventManifestTuple.cs b/src/wixext/Tuples/EventManifestTuple.cs new file mode 100644 index 0000000..b74d2d5 --- /dev/null +++ b/src/wixext/Tuples/EventManifestTuple.cs @@ -0,0 +1,55 @@ +// 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 WixToolset.Data; + using WixToolset.Util.Tuples; + + public static partial class UtilTupleDefinitions + { + public static readonly IntermediateTupleDefinition EventManifest = new IntermediateTupleDefinition( + UtilTupleDefinitionType.EventManifest.ToString(), + new[] + { + new IntermediateFieldDefinition(nameof(EventManifestTupleFields.Component_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(EventManifestTupleFields.File), IntermediateFieldType.String), + }, + typeof(EventManifestTuple)); + } +} + +namespace WixToolset.Util.Tuples +{ + using WixToolset.Data; + + public enum EventManifestTupleFields + { + Component_, + File, + } + + public class EventManifestTuple : IntermediateTuple + { + public EventManifestTuple() : base(UtilTupleDefinitions.EventManifest, null, null) + { + } + + public EventManifestTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilTupleDefinitions.EventManifest, sourceLineNumber, id) + { + } + + public IntermediateField this[EventManifestTupleFields index] => this.Fields[(int)index]; + + public string Component_ + { + get => this.Fields[(int)EventManifestTupleFields.Component_].AsString(); + set => this.Set((int)EventManifestTupleFields.Component_, value); + } + + public string File + { + get => this.Fields[(int)EventManifestTupleFields.File].AsString(); + set => this.Set((int)EventManifestTupleFields.File, value); + } + } +} \ No newline at end of file diff --git a/src/wixext/Tuples/FileSharePermissionsTuple.cs b/src/wixext/Tuples/FileSharePermissionsTuple.cs new file mode 100644 index 0000000..3f037e0 --- /dev/null +++ b/src/wixext/Tuples/FileSharePermissionsTuple.cs @@ -0,0 +1,63 @@ +// 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 WixToolset.Data; + using WixToolset.Util.Tuples; + + public static partial class UtilTupleDefinitions + { + public static readonly IntermediateTupleDefinition FileSharePermissions = new IntermediateTupleDefinition( + UtilTupleDefinitionType.FileSharePermissions.ToString(), + new[] + { + new IntermediateFieldDefinition(nameof(FileSharePermissionsTupleFields.FileShare_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(FileSharePermissionsTupleFields.User_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(FileSharePermissionsTupleFields.Permissions), IntermediateFieldType.Number), + }, + typeof(FileSharePermissionsTuple)); + } +} + +namespace WixToolset.Util.Tuples +{ + using WixToolset.Data; + + public enum FileSharePermissionsTupleFields + { + FileShare_, + User_, + Permissions, + } + + public class FileSharePermissionsTuple : IntermediateTuple + { + public FileSharePermissionsTuple() : base(UtilTupleDefinitions.FileSharePermissions, null, null) + { + } + + public FileSharePermissionsTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilTupleDefinitions.FileSharePermissions, sourceLineNumber, id) + { + } + + public IntermediateField this[FileSharePermissionsTupleFields index] => this.Fields[(int)index]; + + public string FileShare_ + { + get => this.Fields[(int)FileSharePermissionsTupleFields.FileShare_].AsString(); + set => this.Set((int)FileSharePermissionsTupleFields.FileShare_, value); + } + + public string User_ + { + get => this.Fields[(int)FileSharePermissionsTupleFields.User_].AsString(); + set => this.Set((int)FileSharePermissionsTupleFields.User_, value); + } + + public int Permissions + { + get => this.Fields[(int)FileSharePermissionsTupleFields.Permissions].AsNumber(); + set => this.Set((int)FileSharePermissionsTupleFields.Permissions, value); + } + } +} \ No newline at end of file diff --git a/src/wixext/Tuples/FileShareTuple.cs b/src/wixext/Tuples/FileShareTuple.cs new file mode 100644 index 0000000..043f24b --- /dev/null +++ b/src/wixext/Tuples/FileShareTuple.cs @@ -0,0 +1,95 @@ +// 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 WixToolset.Data; + using WixToolset.Util.Tuples; + + public static partial class UtilTupleDefinitions + { + public static readonly IntermediateTupleDefinition FileShare = new IntermediateTupleDefinition( + UtilTupleDefinitionType.FileShare.ToString(), + new[] + { + new IntermediateFieldDefinition(nameof(FileShareTupleFields.FileShare), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(FileShareTupleFields.ShareName), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(FileShareTupleFields.Component_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(FileShareTupleFields.Description), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(FileShareTupleFields.Directory_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(FileShareTupleFields.User_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(FileShareTupleFields.Permissions), IntermediateFieldType.Number), + }, + typeof(FileShareTuple)); + } +} + +namespace WixToolset.Util.Tuples +{ + using WixToolset.Data; + + public enum FileShareTupleFields + { + FileShare, + ShareName, + Component_, + Description, + Directory_, + User_, + Permissions, + } + + public class FileShareTuple : IntermediateTuple + { + public FileShareTuple() : base(UtilTupleDefinitions.FileShare, null, null) + { + } + + public FileShareTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilTupleDefinitions.FileShare, sourceLineNumber, id) + { + } + + public IntermediateField this[FileShareTupleFields index] => this.Fields[(int)index]; + + public string FileShare + { + get => this.Fields[(int)FileShareTupleFields.FileShare].AsString(); + set => this.Set((int)FileShareTupleFields.FileShare, value); + } + + public string ShareName + { + get => this.Fields[(int)FileShareTupleFields.ShareName].AsString(); + set => this.Set((int)FileShareTupleFields.ShareName, value); + } + + public string Component_ + { + get => this.Fields[(int)FileShareTupleFields.Component_].AsString(); + set => this.Set((int)FileShareTupleFields.Component_, value); + } + + public string Description + { + get => this.Fields[(int)FileShareTupleFields.Description].AsString(); + set => this.Set((int)FileShareTupleFields.Description, value); + } + + public string Directory_ + { + get => this.Fields[(int)FileShareTupleFields.Directory_].AsString(); + set => this.Set((int)FileShareTupleFields.Directory_, value); + } + + public string User_ + { + get => this.Fields[(int)FileShareTupleFields.User_].AsString(); + set => this.Set((int)FileShareTupleFields.User_, value); + } + + public int Permissions + { + get => this.Fields[(int)FileShareTupleFields.Permissions].AsNumber(); + set => this.Set((int)FileShareTupleFields.Permissions, value); + } + } +} \ No newline at end of file diff --git a/src/wixext/Tuples/GroupTuple.cs b/src/wixext/Tuples/GroupTuple.cs new file mode 100644 index 0000000..9733571 --- /dev/null +++ b/src/wixext/Tuples/GroupTuple.cs @@ -0,0 +1,71 @@ +// 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 WixToolset.Data; + using WixToolset.Util.Tuples; + + public static partial class UtilTupleDefinitions + { + public static readonly IntermediateTupleDefinition Group = new IntermediateTupleDefinition( + UtilTupleDefinitionType.Group.ToString(), + new[] + { + new IntermediateFieldDefinition(nameof(GroupTupleFields.Group), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(GroupTupleFields.Component_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(GroupTupleFields.Name), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(GroupTupleFields.Domain), IntermediateFieldType.String), + }, + typeof(GroupTuple)); + } +} + +namespace WixToolset.Util.Tuples +{ + using WixToolset.Data; + + public enum GroupTupleFields + { + Group, + Component_, + Name, + Domain, + } + + public class GroupTuple : IntermediateTuple + { + public GroupTuple() : base(UtilTupleDefinitions.Group, null, null) + { + } + + public GroupTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilTupleDefinitions.Group, sourceLineNumber, id) + { + } + + public IntermediateField this[GroupTupleFields index] => this.Fields[(int)index]; + + public string Group + { + get => this.Fields[(int)GroupTupleFields.Group].AsString(); + set => this.Set((int)GroupTupleFields.Group, value); + } + + public string Component_ + { + get => this.Fields[(int)GroupTupleFields.Component_].AsString(); + set => this.Set((int)GroupTupleFields.Component_, value); + } + + public string Name + { + get => this.Fields[(int)GroupTupleFields.Name].AsString(); + set => this.Set((int)GroupTupleFields.Name, value); + } + + public string Domain + { + get => this.Fields[(int)GroupTupleFields.Domain].AsString(); + set => this.Set((int)GroupTupleFields.Domain, value); + } + } +} \ No newline at end of file diff --git a/src/wixext/Tuples/PerfmonManifestTuple.cs b/src/wixext/Tuples/PerfmonManifestTuple.cs new file mode 100644 index 0000000..3f6cb8c --- /dev/null +++ b/src/wixext/Tuples/PerfmonManifestTuple.cs @@ -0,0 +1,63 @@ +// 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 WixToolset.Data; + using WixToolset.Util.Tuples; + + public static partial class UtilTupleDefinitions + { + public static readonly IntermediateTupleDefinition PerfmonManifest = new IntermediateTupleDefinition( + UtilTupleDefinitionType.PerfmonManifest.ToString(), + new[] + { + new IntermediateFieldDefinition(nameof(PerfmonManifestTupleFields.Component_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(PerfmonManifestTupleFields.File), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(PerfmonManifestTupleFields.ResourceFileDirectory), IntermediateFieldType.String), + }, + typeof(PerfmonManifestTuple)); + } +} + +namespace WixToolset.Util.Tuples +{ + using WixToolset.Data; + + public enum PerfmonManifestTupleFields + { + Component_, + File, + ResourceFileDirectory, + } + + public class PerfmonManifestTuple : IntermediateTuple + { + public PerfmonManifestTuple() : base(UtilTupleDefinitions.PerfmonManifest, null, null) + { + } + + public PerfmonManifestTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilTupleDefinitions.PerfmonManifest, sourceLineNumber, id) + { + } + + public IntermediateField this[PerfmonManifestTupleFields index] => this.Fields[(int)index]; + + public string Component_ + { + get => this.Fields[(int)PerfmonManifestTupleFields.Component_].AsString(); + set => this.Set((int)PerfmonManifestTupleFields.Component_, value); + } + + public string File + { + get => this.Fields[(int)PerfmonManifestTupleFields.File].AsString(); + set => this.Set((int)PerfmonManifestTupleFields.File, value); + } + + public string ResourceFileDirectory + { + get => this.Fields[(int)PerfmonManifestTupleFields.ResourceFileDirectory].AsString(); + set => this.Set((int)PerfmonManifestTupleFields.ResourceFileDirectory, value); + } + } +} \ No newline at end of file diff --git a/src/wixext/Tuples/PerfmonTuple.cs b/src/wixext/Tuples/PerfmonTuple.cs new file mode 100644 index 0000000..00ea818 --- /dev/null +++ b/src/wixext/Tuples/PerfmonTuple.cs @@ -0,0 +1,63 @@ +// 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 WixToolset.Data; + using WixToolset.Util.Tuples; + + public static partial class UtilTupleDefinitions + { + public static readonly IntermediateTupleDefinition Perfmon = new IntermediateTupleDefinition( + UtilTupleDefinitionType.Perfmon.ToString(), + new[] + { + new IntermediateFieldDefinition(nameof(PerfmonTupleFields.Component_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(PerfmonTupleFields.File), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(PerfmonTupleFields.Name), IntermediateFieldType.String), + }, + typeof(PerfmonTuple)); + } +} + +namespace WixToolset.Util.Tuples +{ + using WixToolset.Data; + + public enum PerfmonTupleFields + { + Component_, + File, + Name, + } + + public class PerfmonTuple : IntermediateTuple + { + public PerfmonTuple() : base(UtilTupleDefinitions.Perfmon, null, null) + { + } + + public PerfmonTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilTupleDefinitions.Perfmon, sourceLineNumber, id) + { + } + + public IntermediateField this[PerfmonTupleFields index] => this.Fields[(int)index]; + + public string Component_ + { + get => this.Fields[(int)PerfmonTupleFields.Component_].AsString(); + set => this.Set((int)PerfmonTupleFields.Component_, value); + } + + public string File + { + get => this.Fields[(int)PerfmonTupleFields.File].AsString(); + set => this.Set((int)PerfmonTupleFields.File, value); + } + + public string Name + { + get => this.Fields[(int)PerfmonTupleFields.Name].AsString(); + set => this.Set((int)PerfmonTupleFields.Name, value); + } + } +} \ No newline at end of file diff --git a/src/wixext/Tuples/PerformanceCategoryTuple.cs b/src/wixext/Tuples/PerformanceCategoryTuple.cs new file mode 100644 index 0000000..ec2ba73 --- /dev/null +++ b/src/wixext/Tuples/PerformanceCategoryTuple.cs @@ -0,0 +1,79 @@ +// 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 WixToolset.Data; + using WixToolset.Util.Tuples; + + public static partial class UtilTupleDefinitions + { + public static readonly IntermediateTupleDefinition PerformanceCategory = new IntermediateTupleDefinition( + UtilTupleDefinitionType.PerformanceCategory.ToString(), + new[] + { + new IntermediateFieldDefinition(nameof(PerformanceCategoryTupleFields.PerformanceCategory), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(PerformanceCategoryTupleFields.Component_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(PerformanceCategoryTupleFields.Name), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(PerformanceCategoryTupleFields.IniData), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(PerformanceCategoryTupleFields.ConstantData), IntermediateFieldType.String), + }, + typeof(PerformanceCategoryTuple)); + } +} + +namespace WixToolset.Util.Tuples +{ + using WixToolset.Data; + + public enum PerformanceCategoryTupleFields + { + PerformanceCategory, + Component_, + Name, + IniData, + ConstantData, + } + + public class PerformanceCategoryTuple : IntermediateTuple + { + public PerformanceCategoryTuple() : base(UtilTupleDefinitions.PerformanceCategory, null, null) + { + } + + public PerformanceCategoryTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilTupleDefinitions.PerformanceCategory, sourceLineNumber, id) + { + } + + public IntermediateField this[PerformanceCategoryTupleFields index] => this.Fields[(int)index]; + + public string PerformanceCategory + { + get => this.Fields[(int)PerformanceCategoryTupleFields.PerformanceCategory].AsString(); + set => this.Set((int)PerformanceCategoryTupleFields.PerformanceCategory, value); + } + + public string Component_ + { + get => this.Fields[(int)PerformanceCategoryTupleFields.Component_].AsString(); + set => this.Set((int)PerformanceCategoryTupleFields.Component_, value); + } + + public string Name + { + get => this.Fields[(int)PerformanceCategoryTupleFields.Name].AsString(); + set => this.Set((int)PerformanceCategoryTupleFields.Name, value); + } + + public string IniData + { + get => this.Fields[(int)PerformanceCategoryTupleFields.IniData].AsString(); + set => this.Set((int)PerformanceCategoryTupleFields.IniData, value); + } + + public string ConstantData + { + get => this.Fields[(int)PerformanceCategoryTupleFields.ConstantData].AsString(); + set => this.Set((int)PerformanceCategoryTupleFields.ConstantData, value); + } + } +} \ No newline at end of file diff --git a/src/wixext/Tuples/SecureObjectsTuple.cs b/src/wixext/Tuples/SecureObjectsTuple.cs new file mode 100644 index 0000000..f54b23d --- /dev/null +++ b/src/wixext/Tuples/SecureObjectsTuple.cs @@ -0,0 +1,87 @@ +// 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 WixToolset.Data; + using WixToolset.Util.Tuples; + + public static partial class UtilTupleDefinitions + { + public static readonly IntermediateTupleDefinition SecureObjects = new IntermediateTupleDefinition( + UtilTupleDefinitionType.SecureObjects.ToString(), + new[] + { + new IntermediateFieldDefinition(nameof(SecureObjectsTupleFields.SecureObject), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(SecureObjectsTupleFields.Table), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(SecureObjectsTupleFields.Domain), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(SecureObjectsTupleFields.User), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(SecureObjectsTupleFields.Permission), IntermediateFieldType.Number), + new IntermediateFieldDefinition(nameof(SecureObjectsTupleFields.Component_), IntermediateFieldType.String), + }, + typeof(SecureObjectsTuple)); + } +} + +namespace WixToolset.Util.Tuples +{ + using WixToolset.Data; + + public enum SecureObjectsTupleFields + { + SecureObject, + Table, + Domain, + User, + Permission, + Component_, + } + + public class SecureObjectsTuple : IntermediateTuple + { + public SecureObjectsTuple() : base(UtilTupleDefinitions.SecureObjects, null, null) + { + } + + public SecureObjectsTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilTupleDefinitions.SecureObjects, sourceLineNumber, id) + { + } + + public IntermediateField this[SecureObjectsTupleFields index] => this.Fields[(int)index]; + + public string SecureObject + { + get => this.Fields[(int)SecureObjectsTupleFields.SecureObject].AsString(); + set => this.Set((int)SecureObjectsTupleFields.SecureObject, value); + } + + public string Table + { + get => this.Fields[(int)SecureObjectsTupleFields.Table].AsString(); + set => this.Set((int)SecureObjectsTupleFields.Table, value); + } + + public string Domain + { + get => this.Fields[(int)SecureObjectsTupleFields.Domain].AsString(); + set => this.Set((int)SecureObjectsTupleFields.Domain, value); + } + + public string User + { + get => this.Fields[(int)SecureObjectsTupleFields.User].AsString(); + set => this.Set((int)SecureObjectsTupleFields.User, value); + } + + public int Permission + { + get => this.Fields[(int)SecureObjectsTupleFields.Permission].AsNumber(); + set => this.Set((int)SecureObjectsTupleFields.Permission, value); + } + + public string Component_ + { + get => this.Fields[(int)SecureObjectsTupleFields.Component_].AsString(); + set => this.Set((int)SecureObjectsTupleFields.Component_, value); + } + } +} \ No newline at end of file diff --git a/src/wixext/Tuples/ServiceConfigTuple.cs b/src/wixext/Tuples/ServiceConfigTuple.cs new file mode 100644 index 0000000..74d96bc --- /dev/null +++ b/src/wixext/Tuples/ServiceConfigTuple.cs @@ -0,0 +1,119 @@ +// 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 WixToolset.Data; + using WixToolset.Util.Tuples; + + public static partial class UtilTupleDefinitions + { + public static readonly IntermediateTupleDefinition ServiceConfig = new IntermediateTupleDefinition( + UtilTupleDefinitionType.ServiceConfig.ToString(), + new[] + { + new IntermediateFieldDefinition(nameof(ServiceConfigTupleFields.ServiceName), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(ServiceConfigTupleFields.Component_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(ServiceConfigTupleFields.NewService), IntermediateFieldType.Number), + new IntermediateFieldDefinition(nameof(ServiceConfigTupleFields.FirstFailureActionType), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(ServiceConfigTupleFields.SecondFailureActionType), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(ServiceConfigTupleFields.ThirdFailureActionType), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(ServiceConfigTupleFields.ResetPeriodInDays), IntermediateFieldType.Number), + new IntermediateFieldDefinition(nameof(ServiceConfigTupleFields.RestartServiceDelayInSeconds), IntermediateFieldType.Number), + new IntermediateFieldDefinition(nameof(ServiceConfigTupleFields.ProgramCommandLine), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(ServiceConfigTupleFields.RebootMessage), IntermediateFieldType.String), + }, + typeof(ServiceConfigTuple)); + } +} + +namespace WixToolset.Util.Tuples +{ + using WixToolset.Data; + + public enum ServiceConfigTupleFields + { + ServiceName, + Component_, + NewService, + FirstFailureActionType, + SecondFailureActionType, + ThirdFailureActionType, + ResetPeriodInDays, + RestartServiceDelayInSeconds, + ProgramCommandLine, + RebootMessage, + } + + public class ServiceConfigTuple : IntermediateTuple + { + public ServiceConfigTuple() : base(UtilTupleDefinitions.ServiceConfig, null, null) + { + } + + public ServiceConfigTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilTupleDefinitions.ServiceConfig, sourceLineNumber, id) + { + } + + public IntermediateField this[ServiceConfigTupleFields index] => this.Fields[(int)index]; + + public string ServiceName + { + get => this.Fields[(int)ServiceConfigTupleFields.ServiceName].AsString(); + set => this.Set((int)ServiceConfigTupleFields.ServiceName, value); + } + + public string Component_ + { + get => this.Fields[(int)ServiceConfigTupleFields.Component_].AsString(); + set => this.Set((int)ServiceConfigTupleFields.Component_, value); + } + + public int NewService + { + get => this.Fields[(int)ServiceConfigTupleFields.NewService].AsNumber(); + set => this.Set((int)ServiceConfigTupleFields.NewService, value); + } + + public string FirstFailureActionType + { + get => this.Fields[(int)ServiceConfigTupleFields.FirstFailureActionType].AsString(); + set => this.Set((int)ServiceConfigTupleFields.FirstFailureActionType, value); + } + + public string SecondFailureActionType + { + get => this.Fields[(int)ServiceConfigTupleFields.SecondFailureActionType].AsString(); + set => this.Set((int)ServiceConfigTupleFields.SecondFailureActionType, value); + } + + public string ThirdFailureActionType + { + get => this.Fields[(int)ServiceConfigTupleFields.ThirdFailureActionType].AsString(); + set => this.Set((int)ServiceConfigTupleFields.ThirdFailureActionType, value); + } + + public int ResetPeriodInDays + { + get => this.Fields[(int)ServiceConfigTupleFields.ResetPeriodInDays].AsNumber(); + set => this.Set((int)ServiceConfigTupleFields.ResetPeriodInDays, value); + } + + public int RestartServiceDelayInSeconds + { + get => this.Fields[(int)ServiceConfigTupleFields.RestartServiceDelayInSeconds].AsNumber(); + set => this.Set((int)ServiceConfigTupleFields.RestartServiceDelayInSeconds, value); + } + + public string ProgramCommandLine + { + get => this.Fields[(int)ServiceConfigTupleFields.ProgramCommandLine].AsString(); + set => this.Set((int)ServiceConfigTupleFields.ProgramCommandLine, value); + } + + public string RebootMessage + { + get => this.Fields[(int)ServiceConfigTupleFields.RebootMessage].AsString(); + set => this.Set((int)ServiceConfigTupleFields.RebootMessage, value); + } + } +} \ No newline at end of file diff --git a/src/wixext/Tuples/UserGroupTuple.cs b/src/wixext/Tuples/UserGroupTuple.cs new file mode 100644 index 0000000..0386a26 --- /dev/null +++ b/src/wixext/Tuples/UserGroupTuple.cs @@ -0,0 +1,55 @@ +// 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 WixToolset.Data; + using WixToolset.Util.Tuples; + + public static partial class UtilTupleDefinitions + { + public static readonly IntermediateTupleDefinition UserGroup = new IntermediateTupleDefinition( + UtilTupleDefinitionType.UserGroup.ToString(), + new[] + { + new IntermediateFieldDefinition(nameof(UserGroupTupleFields.User_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(UserGroupTupleFields.Group_), IntermediateFieldType.String), + }, + typeof(UserGroupTuple)); + } +} + +namespace WixToolset.Util.Tuples +{ + using WixToolset.Data; + + public enum UserGroupTupleFields + { + User_, + Group_, + } + + public class UserGroupTuple : IntermediateTuple + { + public UserGroupTuple() : base(UtilTupleDefinitions.UserGroup, null, null) + { + } + + public UserGroupTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilTupleDefinitions.UserGroup, sourceLineNumber, id) + { + } + + public IntermediateField this[UserGroupTupleFields index] => this.Fields[(int)index]; + + public string User_ + { + get => this.Fields[(int)UserGroupTupleFields.User_].AsString(); + set => this.Set((int)UserGroupTupleFields.User_, value); + } + + public string Group_ + { + get => this.Fields[(int)UserGroupTupleFields.Group_].AsString(); + set => this.Set((int)UserGroupTupleFields.Group_, value); + } + } +} \ No newline at end of file diff --git a/src/wixext/Tuples/UserTuple.cs b/src/wixext/Tuples/UserTuple.cs new file mode 100644 index 0000000..e8c5315 --- /dev/null +++ b/src/wixext/Tuples/UserTuple.cs @@ -0,0 +1,87 @@ +// 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 WixToolset.Data; + using WixToolset.Util.Tuples; + + public static partial class UtilTupleDefinitions + { + public static readonly IntermediateTupleDefinition User = new IntermediateTupleDefinition( + UtilTupleDefinitionType.User.ToString(), + new[] + { + new IntermediateFieldDefinition(nameof(UserTupleFields.User), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(UserTupleFields.Component_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(UserTupleFields.Name), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(UserTupleFields.Domain), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(UserTupleFields.Password), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(UserTupleFields.Attributes), IntermediateFieldType.Number), + }, + typeof(UserTuple)); + } +} + +namespace WixToolset.Util.Tuples +{ + using WixToolset.Data; + + public enum UserTupleFields + { + User, + Component_, + Name, + Domain, + Password, + Attributes, + } + + public class UserTuple : IntermediateTuple + { + public UserTuple() : base(UtilTupleDefinitions.User, null, null) + { + } + + public UserTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilTupleDefinitions.User, sourceLineNumber, id) + { + } + + public IntermediateField this[UserTupleFields index] => this.Fields[(int)index]; + + public string User + { + get => this.Fields[(int)UserTupleFields.User].AsString(); + set => this.Set((int)UserTupleFields.User, value); + } + + public string Component_ + { + get => this.Fields[(int)UserTupleFields.Component_].AsString(); + set => this.Set((int)UserTupleFields.Component_, value); + } + + public string Name + { + get => this.Fields[(int)UserTupleFields.Name].AsString(); + set => this.Set((int)UserTupleFields.Name, value); + } + + public string Domain + { + get => this.Fields[(int)UserTupleFields.Domain].AsString(); + set => this.Set((int)UserTupleFields.Domain, value); + } + + public string Password + { + get => this.Fields[(int)UserTupleFields.Password].AsString(); + set => this.Set((int)UserTupleFields.Password, value); + } + + public int Attributes + { + get => this.Fields[(int)UserTupleFields.Attributes].AsNumber(); + set => this.Set((int)UserTupleFields.Attributes, value); + } + } +} \ No newline at end of file diff --git a/src/wixext/Tuples/UtilTupleDefinitions.cs b/src/wixext/Tuples/UtilTupleDefinitions.cs new file mode 100644 index 0000000..00c9833 --- /dev/null +++ b/src/wixext/Tuples/UtilTupleDefinitions.cs @@ -0,0 +1,111 @@ +// 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; + using WixToolset.Data; + + public enum UtilTupleDefinitionType + { + EventManifest, + FileShare, + FileSharePermissions, + Group, + Perfmon, + PerfmonManifest, + PerformanceCategory, + SecureObjects, + ServiceConfig, + User, + UserGroup, + WixCloseApplication, + WixFormatFiles, + WixInternetShortcut, + WixRemoveFolderEx, + WixRestartResource, + WixTouchFile, + XmlConfig, + XmlFile, + } + + public static partial class UtilTupleDefinitions + { + public static readonly Version Version = new Version("4.0.0"); + + public static IntermediateTupleDefinition ByName(string name) + { + if (!Enum.TryParse(name, out UtilTupleDefinitionType type)) + { + return null; + } + + return ByType(type); + } + + public static IntermediateTupleDefinition ByType(UtilTupleDefinitionType type) + { + switch (type) + { + case UtilTupleDefinitionType.EventManifest: + return UtilTupleDefinitions.EventManifest; + + case UtilTupleDefinitionType.FileShare: + return UtilTupleDefinitions.FileShare; + + case UtilTupleDefinitionType.FileSharePermissions: + return UtilTupleDefinitions.FileSharePermissions; + + case UtilTupleDefinitionType.Group: + return UtilTupleDefinitions.Group; + + case UtilTupleDefinitionType.Perfmon: + return UtilTupleDefinitions.Perfmon; + + case UtilTupleDefinitionType.PerfmonManifest: + return UtilTupleDefinitions.PerfmonManifest; + + case UtilTupleDefinitionType.PerformanceCategory: + return UtilTupleDefinitions.PerformanceCategory; + + case UtilTupleDefinitionType.SecureObjects: + return UtilTupleDefinitions.SecureObjects; + + case UtilTupleDefinitionType.ServiceConfig: + return UtilTupleDefinitions.ServiceConfig; + + case UtilTupleDefinitionType.User: + return UtilTupleDefinitions.User; + + case UtilTupleDefinitionType.UserGroup: + return UtilTupleDefinitions.UserGroup; + + case UtilTupleDefinitionType.WixCloseApplication: + return UtilTupleDefinitions.WixCloseApplication; + + case UtilTupleDefinitionType.WixFormatFiles: + return UtilTupleDefinitions.WixFormatFiles; + + case UtilTupleDefinitionType.WixInternetShortcut: + return UtilTupleDefinitions.WixInternetShortcut; + + case UtilTupleDefinitionType.WixRemoveFolderEx: + return UtilTupleDefinitions.WixRemoveFolderEx; + + case UtilTupleDefinitionType.WixRestartResource: + return UtilTupleDefinitions.WixRestartResource; + + case UtilTupleDefinitionType.WixTouchFile: + return UtilTupleDefinitions.WixTouchFile; + + case UtilTupleDefinitionType.XmlConfig: + return UtilTupleDefinitions.XmlConfig; + + case UtilTupleDefinitionType.XmlFile: + return UtilTupleDefinitions.XmlFile; + + default: + throw new ArgumentOutOfRangeException(nameof(type)); + } + } + } +} diff --git a/src/wixext/Tuples/WixCloseApplicationTuple.cs b/src/wixext/Tuples/WixCloseApplicationTuple.cs new file mode 100644 index 0000000..c2095d9 --- /dev/null +++ b/src/wixext/Tuples/WixCloseApplicationTuple.cs @@ -0,0 +1,111 @@ +// 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 WixToolset.Data; + using WixToolset.Util.Tuples; + + public static partial class UtilTupleDefinitions + { + public static readonly IntermediateTupleDefinition WixCloseApplication = new IntermediateTupleDefinition( + UtilTupleDefinitionType.WixCloseApplication.ToString(), + new[] + { + new IntermediateFieldDefinition(nameof(WixCloseApplicationTupleFields.WixCloseApplication), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixCloseApplicationTupleFields.Target), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixCloseApplicationTupleFields.Description), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixCloseApplicationTupleFields.Condition), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixCloseApplicationTupleFields.Attributes), IntermediateFieldType.Number), + new IntermediateFieldDefinition(nameof(WixCloseApplicationTupleFields.Sequence), IntermediateFieldType.Number), + new IntermediateFieldDefinition(nameof(WixCloseApplicationTupleFields.Property), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixCloseApplicationTupleFields.TerminateExitCode), IntermediateFieldType.Number), + new IntermediateFieldDefinition(nameof(WixCloseApplicationTupleFields.Timeout), IntermediateFieldType.Number), + }, + typeof(WixCloseApplicationTuple)); + } +} + +namespace WixToolset.Util.Tuples +{ + using WixToolset.Data; + + public enum WixCloseApplicationTupleFields + { + WixCloseApplication, + Target, + Description, + Condition, + Attributes, + Sequence, + Property, + TerminateExitCode, + Timeout, + } + + public class WixCloseApplicationTuple : IntermediateTuple + { + public WixCloseApplicationTuple() : base(UtilTupleDefinitions.WixCloseApplication, null, null) + { + } + + public WixCloseApplicationTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilTupleDefinitions.WixCloseApplication, sourceLineNumber, id) + { + } + + public IntermediateField this[WixCloseApplicationTupleFields index] => this.Fields[(int)index]; + + public string WixCloseApplication + { + get => this.Fields[(int)WixCloseApplicationTupleFields.WixCloseApplication].AsString(); + set => this.Set((int)WixCloseApplicationTupleFields.WixCloseApplication, value); + } + + public string Target + { + get => this.Fields[(int)WixCloseApplicationTupleFields.Target].AsString(); + set => this.Set((int)WixCloseApplicationTupleFields.Target, value); + } + + public string Description + { + get => this.Fields[(int)WixCloseApplicationTupleFields.Description].AsString(); + set => this.Set((int)WixCloseApplicationTupleFields.Description, value); + } + + public string Condition + { + get => this.Fields[(int)WixCloseApplicationTupleFields.Condition].AsString(); + set => this.Set((int)WixCloseApplicationTupleFields.Condition, value); + } + + public int Attributes + { + get => this.Fields[(int)WixCloseApplicationTupleFields.Attributes].AsNumber(); + set => this.Set((int)WixCloseApplicationTupleFields.Attributes, value); + } + + public int Sequence + { + get => this.Fields[(int)WixCloseApplicationTupleFields.Sequence].AsNumber(); + set => this.Set((int)WixCloseApplicationTupleFields.Sequence, value); + } + + public string Property + { + get => this.Fields[(int)WixCloseApplicationTupleFields.Property].AsString(); + set => this.Set((int)WixCloseApplicationTupleFields.Property, value); + } + + public int TerminateExitCode + { + get => this.Fields[(int)WixCloseApplicationTupleFields.TerminateExitCode].AsNumber(); + set => this.Set((int)WixCloseApplicationTupleFields.TerminateExitCode, value); + } + + public int Timeout + { + get => this.Fields[(int)WixCloseApplicationTupleFields.Timeout].AsNumber(); + set => this.Set((int)WixCloseApplicationTupleFields.Timeout, value); + } + } +} \ No newline at end of file diff --git a/src/wixext/Tuples/WixFormatFilesTuple.cs b/src/wixext/Tuples/WixFormatFilesTuple.cs new file mode 100644 index 0000000..7fc092b --- /dev/null +++ b/src/wixext/Tuples/WixFormatFilesTuple.cs @@ -0,0 +1,55 @@ +// 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 WixToolset.Data; + using WixToolset.Util.Tuples; + + public static partial class UtilTupleDefinitions + { + public static readonly IntermediateTupleDefinition WixFormatFiles = new IntermediateTupleDefinition( + UtilTupleDefinitionType.WixFormatFiles.ToString(), + new[] + { + new IntermediateFieldDefinition(nameof(WixFormatFilesTupleFields.Binary_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixFormatFilesTupleFields.File_), IntermediateFieldType.String), + }, + typeof(WixFormatFilesTuple)); + } +} + +namespace WixToolset.Util.Tuples +{ + using WixToolset.Data; + + public enum WixFormatFilesTupleFields + { + Binary_, + File_, + } + + public class WixFormatFilesTuple : IntermediateTuple + { + public WixFormatFilesTuple() : base(UtilTupleDefinitions.WixFormatFiles, null, null) + { + } + + public WixFormatFilesTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilTupleDefinitions.WixFormatFiles, sourceLineNumber, id) + { + } + + public IntermediateField this[WixFormatFilesTupleFields index] => this.Fields[(int)index]; + + public string Binary_ + { + get => this.Fields[(int)WixFormatFilesTupleFields.Binary_].AsString(); + set => this.Set((int)WixFormatFilesTupleFields.Binary_, value); + } + + public string File_ + { + get => this.Fields[(int)WixFormatFilesTupleFields.File_].AsString(); + set => this.Set((int)WixFormatFilesTupleFields.File_, value); + } + } +} \ No newline at end of file diff --git a/src/wixext/Tuples/WixInternetShortcutTuple.cs b/src/wixext/Tuples/WixInternetShortcutTuple.cs new file mode 100644 index 0000000..5c29cda --- /dev/null +++ b/src/wixext/Tuples/WixInternetShortcutTuple.cs @@ -0,0 +1,103 @@ +// 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 WixToolset.Data; + using WixToolset.Util.Tuples; + + public static partial class UtilTupleDefinitions + { + public static readonly IntermediateTupleDefinition WixInternetShortcut = new IntermediateTupleDefinition( + UtilTupleDefinitionType.WixInternetShortcut.ToString(), + new[] + { + new IntermediateFieldDefinition(nameof(WixInternetShortcutTupleFields.WixInternetShortcut), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixInternetShortcutTupleFields.Component_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixInternetShortcutTupleFields.Directory_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixInternetShortcutTupleFields.Name), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixInternetShortcutTupleFields.Target), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixInternetShortcutTupleFields.Attributes), IntermediateFieldType.Number), + new IntermediateFieldDefinition(nameof(WixInternetShortcutTupleFields.IconFile), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixInternetShortcutTupleFields.IconIndex), IntermediateFieldType.Number), + }, + typeof(WixInternetShortcutTuple)); + } +} + +namespace WixToolset.Util.Tuples +{ + using WixToolset.Data; + + public enum WixInternetShortcutTupleFields + { + WixInternetShortcut, + Component_, + Directory_, + Name, + Target, + Attributes, + IconFile, + IconIndex, + } + + public class WixInternetShortcutTuple : IntermediateTuple + { + public WixInternetShortcutTuple() : base(UtilTupleDefinitions.WixInternetShortcut, null, null) + { + } + + public WixInternetShortcutTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilTupleDefinitions.WixInternetShortcut, sourceLineNumber, id) + { + } + + public IntermediateField this[WixInternetShortcutTupleFields index] => this.Fields[(int)index]; + + public string WixInternetShortcut + { + get => this.Fields[(int)WixInternetShortcutTupleFields.WixInternetShortcut].AsString(); + set => this.Set((int)WixInternetShortcutTupleFields.WixInternetShortcut, value); + } + + public string Component_ + { + get => this.Fields[(int)WixInternetShortcutTupleFields.Component_].AsString(); + set => this.Set((int)WixInternetShortcutTupleFields.Component_, value); + } + + public string Directory_ + { + get => this.Fields[(int)WixInternetShortcutTupleFields.Directory_].AsString(); + set => this.Set((int)WixInternetShortcutTupleFields.Directory_, value); + } + + public string Name + { + get => this.Fields[(int)WixInternetShortcutTupleFields.Name].AsString(); + set => this.Set((int)WixInternetShortcutTupleFields.Name, value); + } + + public string Target + { + get => this.Fields[(int)WixInternetShortcutTupleFields.Target].AsString(); + set => this.Set((int)WixInternetShortcutTupleFields.Target, value); + } + + public int Attributes + { + get => this.Fields[(int)WixInternetShortcutTupleFields.Attributes].AsNumber(); + set => this.Set((int)WixInternetShortcutTupleFields.Attributes, value); + } + + public string IconFile + { + get => this.Fields[(int)WixInternetShortcutTupleFields.IconFile].AsString(); + set => this.Set((int)WixInternetShortcutTupleFields.IconFile, value); + } + + public int IconIndex + { + get => this.Fields[(int)WixInternetShortcutTupleFields.IconIndex].AsNumber(); + set => this.Set((int)WixInternetShortcutTupleFields.IconIndex, value); + } + } +} \ No newline at end of file diff --git a/src/wixext/Tuples/WixRemoveFolderExTuple.cs b/src/wixext/Tuples/WixRemoveFolderExTuple.cs new file mode 100644 index 0000000..35e22e2 --- /dev/null +++ b/src/wixext/Tuples/WixRemoveFolderExTuple.cs @@ -0,0 +1,71 @@ +// 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 WixToolset.Data; + using WixToolset.Util.Tuples; + + public static partial class UtilTupleDefinitions + { + public static readonly IntermediateTupleDefinition WixRemoveFolderEx = new IntermediateTupleDefinition( + UtilTupleDefinitionType.WixRemoveFolderEx.ToString(), + new[] + { + new IntermediateFieldDefinition(nameof(WixRemoveFolderExTupleFields.WixRemoveFolderEx), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixRemoveFolderExTupleFields.Component_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixRemoveFolderExTupleFields.Property), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixRemoveFolderExTupleFields.InstallMode), IntermediateFieldType.Number), + }, + typeof(WixRemoveFolderExTuple)); + } +} + +namespace WixToolset.Util.Tuples +{ + using WixToolset.Data; + + public enum WixRemoveFolderExTupleFields + { + WixRemoveFolderEx, + Component_, + Property, + InstallMode, + } + + public class WixRemoveFolderExTuple : IntermediateTuple + { + public WixRemoveFolderExTuple() : base(UtilTupleDefinitions.WixRemoveFolderEx, null, null) + { + } + + public WixRemoveFolderExTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilTupleDefinitions.WixRemoveFolderEx, sourceLineNumber, id) + { + } + + public IntermediateField this[WixRemoveFolderExTupleFields index] => this.Fields[(int)index]; + + public string WixRemoveFolderEx + { + get => this.Fields[(int)WixRemoveFolderExTupleFields.WixRemoveFolderEx].AsString(); + set => this.Set((int)WixRemoveFolderExTupleFields.WixRemoveFolderEx, value); + } + + public string Component_ + { + get => this.Fields[(int)WixRemoveFolderExTupleFields.Component_].AsString(); + set => this.Set((int)WixRemoveFolderExTupleFields.Component_, value); + } + + public string Property + { + get => this.Fields[(int)WixRemoveFolderExTupleFields.Property].AsString(); + set => this.Set((int)WixRemoveFolderExTupleFields.Property, value); + } + + public int InstallMode + { + get => this.Fields[(int)WixRemoveFolderExTupleFields.InstallMode].AsNumber(); + set => this.Set((int)WixRemoveFolderExTupleFields.InstallMode, value); + } + } +} \ No newline at end of file diff --git a/src/wixext/Tuples/WixRestartResourceTuple.cs b/src/wixext/Tuples/WixRestartResourceTuple.cs new file mode 100644 index 0000000..828d9d1 --- /dev/null +++ b/src/wixext/Tuples/WixRestartResourceTuple.cs @@ -0,0 +1,71 @@ +// 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 WixToolset.Data; + using WixToolset.Util.Tuples; + + public static partial class UtilTupleDefinitions + { + public static readonly IntermediateTupleDefinition WixRestartResource = new IntermediateTupleDefinition( + UtilTupleDefinitionType.WixRestartResource.ToString(), + new[] + { + new IntermediateFieldDefinition(nameof(WixRestartResourceTupleFields.WixRestartResource), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixRestartResourceTupleFields.Component_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixRestartResourceTupleFields.Resource), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixRestartResourceTupleFields.Attributes), IntermediateFieldType.Number), + }, + typeof(WixRestartResourceTuple)); + } +} + +namespace WixToolset.Util.Tuples +{ + using WixToolset.Data; + + public enum WixRestartResourceTupleFields + { + WixRestartResource, + Component_, + Resource, + Attributes, + } + + public class WixRestartResourceTuple : IntermediateTuple + { + public WixRestartResourceTuple() : base(UtilTupleDefinitions.WixRestartResource, null, null) + { + } + + public WixRestartResourceTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilTupleDefinitions.WixRestartResource, sourceLineNumber, id) + { + } + + public IntermediateField this[WixRestartResourceTupleFields index] => this.Fields[(int)index]; + + public string WixRestartResource + { + get => this.Fields[(int)WixRestartResourceTupleFields.WixRestartResource].AsString(); + set => this.Set((int)WixRestartResourceTupleFields.WixRestartResource, value); + } + + public string Component_ + { + get => this.Fields[(int)WixRestartResourceTupleFields.Component_].AsString(); + set => this.Set((int)WixRestartResourceTupleFields.Component_, value); + } + + public string Resource + { + get => this.Fields[(int)WixRestartResourceTupleFields.Resource].AsString(); + set => this.Set((int)WixRestartResourceTupleFields.Resource, value); + } + + public int Attributes + { + get => this.Fields[(int)WixRestartResourceTupleFields.Attributes].AsNumber(); + set => this.Set((int)WixRestartResourceTupleFields.Attributes, value); + } + } +} \ No newline at end of file diff --git a/src/wixext/Tuples/WixTouchFileTuple.cs b/src/wixext/Tuples/WixTouchFileTuple.cs new file mode 100644 index 0000000..f87f396 --- /dev/null +++ b/src/wixext/Tuples/WixTouchFileTuple.cs @@ -0,0 +1,71 @@ +// 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 WixToolset.Data; + using WixToolset.Util.Tuples; + + public static partial class UtilTupleDefinitions + { + public static readonly IntermediateTupleDefinition WixTouchFile = new IntermediateTupleDefinition( + UtilTupleDefinitionType.WixTouchFile.ToString(), + new[] + { + new IntermediateFieldDefinition(nameof(WixTouchFileTupleFields.WixTouchFile), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixTouchFileTupleFields.Component_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixTouchFileTupleFields.Path), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixTouchFileTupleFields.Attributes), IntermediateFieldType.Number), + }, + typeof(WixTouchFileTuple)); + } +} + +namespace WixToolset.Util.Tuples +{ + using WixToolset.Data; + + public enum WixTouchFileTupleFields + { + WixTouchFile, + Component_, + Path, + Attributes, + } + + public class WixTouchFileTuple : IntermediateTuple + { + public WixTouchFileTuple() : base(UtilTupleDefinitions.WixTouchFile, null, null) + { + } + + public WixTouchFileTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilTupleDefinitions.WixTouchFile, sourceLineNumber, id) + { + } + + public IntermediateField this[WixTouchFileTupleFields index] => this.Fields[(int)index]; + + public string WixTouchFile + { + get => this.Fields[(int)WixTouchFileTupleFields.WixTouchFile].AsString(); + set => this.Set((int)WixTouchFileTupleFields.WixTouchFile, value); + } + + public string Component_ + { + get => this.Fields[(int)WixTouchFileTupleFields.Component_].AsString(); + set => this.Set((int)WixTouchFileTupleFields.Component_, value); + } + + public string Path + { + get => this.Fields[(int)WixTouchFileTupleFields.Path].AsString(); + set => this.Set((int)WixTouchFileTupleFields.Path, value); + } + + public int Attributes + { + get => this.Fields[(int)WixTouchFileTupleFields.Attributes].AsNumber(); + set => this.Set((int)WixTouchFileTupleFields.Attributes, value); + } + } +} \ No newline at end of file diff --git a/src/wixext/Tuples/XmlConfigTuple.cs b/src/wixext/Tuples/XmlConfigTuple.cs new file mode 100644 index 0000000..093299b --- /dev/null +++ b/src/wixext/Tuples/XmlConfigTuple.cs @@ -0,0 +1,111 @@ +// 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 WixToolset.Data; + using WixToolset.Util.Tuples; + + public static partial class UtilTupleDefinitions + { + public static readonly IntermediateTupleDefinition XmlConfig = new IntermediateTupleDefinition( + UtilTupleDefinitionType.XmlConfig.ToString(), + new[] + { + new IntermediateFieldDefinition(nameof(XmlConfigTupleFields.XmlConfig), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(XmlConfigTupleFields.File), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(XmlConfigTupleFields.ElementPath), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(XmlConfigTupleFields.VerifyPath), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(XmlConfigTupleFields.Name), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(XmlConfigTupleFields.Value), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(XmlConfigTupleFields.Flags), IntermediateFieldType.Number), + new IntermediateFieldDefinition(nameof(XmlConfigTupleFields.Component_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(XmlConfigTupleFields.Sequence), IntermediateFieldType.Number), + }, + typeof(XmlConfigTuple)); + } +} + +namespace WixToolset.Util.Tuples +{ + using WixToolset.Data; + + public enum XmlConfigTupleFields + { + XmlConfig, + File, + ElementPath, + VerifyPath, + Name, + Value, + Flags, + Component_, + Sequence, + } + + public class XmlConfigTuple : IntermediateTuple + { + public XmlConfigTuple() : base(UtilTupleDefinitions.XmlConfig, null, null) + { + } + + public XmlConfigTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilTupleDefinitions.XmlConfig, sourceLineNumber, id) + { + } + + public IntermediateField this[XmlConfigTupleFields index] => this.Fields[(int)index]; + + public string XmlConfig + { + get => this.Fields[(int)XmlConfigTupleFields.XmlConfig].AsString(); + set => this.Set((int)XmlConfigTupleFields.XmlConfig, value); + } + + public string File + { + get => this.Fields[(int)XmlConfigTupleFields.File].AsString(); + set => this.Set((int)XmlConfigTupleFields.File, value); + } + + public string ElementPath + { + get => this.Fields[(int)XmlConfigTupleFields.ElementPath].AsString(); + set => this.Set((int)XmlConfigTupleFields.ElementPath, value); + } + + public string VerifyPath + { + get => this.Fields[(int)XmlConfigTupleFields.VerifyPath].AsString(); + set => this.Set((int)XmlConfigTupleFields.VerifyPath, value); + } + + public string Name + { + get => this.Fields[(int)XmlConfigTupleFields.Name].AsString(); + set => this.Set((int)XmlConfigTupleFields.Name, value); + } + + public string Value + { + get => this.Fields[(int)XmlConfigTupleFields.Value].AsString(); + set => this.Set((int)XmlConfigTupleFields.Value, value); + } + + public int Flags + { + get => this.Fields[(int)XmlConfigTupleFields.Flags].AsNumber(); + set => this.Set((int)XmlConfigTupleFields.Flags, value); + } + + public string Component_ + { + get => this.Fields[(int)XmlConfigTupleFields.Component_].AsString(); + set => this.Set((int)XmlConfigTupleFields.Component_, value); + } + + public int Sequence + { + get => this.Fields[(int)XmlConfigTupleFields.Sequence].AsNumber(); + set => this.Set((int)XmlConfigTupleFields.Sequence, value); + } + } +} \ No newline at end of file diff --git a/src/wixext/Tuples/XmlFileTuple.cs b/src/wixext/Tuples/XmlFileTuple.cs new file mode 100644 index 0000000..27ea711 --- /dev/null +++ b/src/wixext/Tuples/XmlFileTuple.cs @@ -0,0 +1,103 @@ +// 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 WixToolset.Data; + using WixToolset.Util.Tuples; + + public static partial class UtilTupleDefinitions + { + public static readonly IntermediateTupleDefinition XmlFile = new IntermediateTupleDefinition( + UtilTupleDefinitionType.XmlFile.ToString(), + new[] + { + new IntermediateFieldDefinition(nameof(XmlFileTupleFields.XmlFile), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(XmlFileTupleFields.File), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(XmlFileTupleFields.ElementPath), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(XmlFileTupleFields.Name), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(XmlFileTupleFields.Value), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(XmlFileTupleFields.Flags), IntermediateFieldType.Number), + new IntermediateFieldDefinition(nameof(XmlFileTupleFields.Component_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(XmlFileTupleFields.Sequence), IntermediateFieldType.Number), + }, + typeof(XmlFileTuple)); + } +} + +namespace WixToolset.Util.Tuples +{ + using WixToolset.Data; + + public enum XmlFileTupleFields + { + XmlFile, + File, + ElementPath, + Name, + Value, + Flags, + Component_, + Sequence, + } + + public class XmlFileTuple : IntermediateTuple + { + public XmlFileTuple() : base(UtilTupleDefinitions.XmlFile, null, null) + { + } + + public XmlFileTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilTupleDefinitions.XmlFile, sourceLineNumber, id) + { + } + + public IntermediateField this[XmlFileTupleFields index] => this.Fields[(int)index]; + + public string XmlFile + { + get => this.Fields[(int)XmlFileTupleFields.XmlFile].AsString(); + set => this.Set((int)XmlFileTupleFields.XmlFile, value); + } + + public string File + { + get => this.Fields[(int)XmlFileTupleFields.File].AsString(); + set => this.Set((int)XmlFileTupleFields.File, value); + } + + public string ElementPath + { + get => this.Fields[(int)XmlFileTupleFields.ElementPath].AsString(); + set => this.Set((int)XmlFileTupleFields.ElementPath, value); + } + + public string Name + { + get => this.Fields[(int)XmlFileTupleFields.Name].AsString(); + set => this.Set((int)XmlFileTupleFields.Name, value); + } + + public string Value + { + get => this.Fields[(int)XmlFileTupleFields.Value].AsString(); + set => this.Set((int)XmlFileTupleFields.Value, value); + } + + public int Flags + { + get => this.Fields[(int)XmlFileTupleFields.Flags].AsNumber(); + set => this.Set((int)XmlFileTupleFields.Flags, value); + } + + public string Component_ + { + get => this.Fields[(int)XmlFileTupleFields.Component_].AsString(); + set => this.Set((int)XmlFileTupleFields.Component_, value); + } + + public int Sequence + { + get => this.Fields[(int)XmlFileTupleFields.Sequence].AsNumber(); + set => this.Set((int)XmlFileTupleFields.Sequence, value); + } + } +} \ No newline at end of file diff --git a/src/wixext/UtilBinder.cs b/src/wixext/UtilBinder.cs new file mode 100644 index 0000000..ef80a87 --- /dev/null +++ b/src/wixext/UtilBinder.cs @@ -0,0 +1,347 @@ +// 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.Extensions +{ +#if TODO_BRINGBACK_FOR_BUNDLES + using System; + using System.Collections.Generic; + using System.Globalization; + using WixToolset.Data; + using WixToolset.Extensibility; + + /// + /// The binder for the WiX Toolset Utility Extension. + /// + public sealed class UtilBinder : BinderExtension + { + // TODO: When WixSearch is supported in Product, etc, we may need to call + // ReorderWixSearch() from each of those initializers. + + // TODO: A general-purpose "reorder this table given these constraints" + // mechanism may end up being helpful. This could be declaratively stated + // in the table definitions, or exposed from the core Wix.dll and called + // as-needed by any extensions. + + /// + /// Called before bundle binding occurs. + /// + public override void Initialize(Output bundle) + { + if (OutputType.Bundle == bundle.Type) + { + this.ReorderWixSearch(bundle); + } + } + + /// + /// Reorders Any WixSearch items. + /// + /// Output containing the tables to process. + private void ReorderWixSearch(Output output) + { + Table wixSearchTable = output.Tables["WixSearch"]; + if (null == wixSearchTable || wixSearchTable.Rows.Count == 0) + { + // nothing to do! + return; + } + + RowDictionary rowDictionary = new RowDictionary(); + foreach (Row row in wixSearchTable.Rows) + { + rowDictionary.AddRow(row); + } + + Constraints constraints = new Constraints(); + Table wixSearchRelationTable = output.Tables["WixSearchRelation"]; + if (null != wixSearchRelationTable && wixSearchRelationTable.Rows.Count > 0) + { + // add relational info to our data... + foreach (Row row in wixSearchRelationTable.Rows) + { + constraints.AddConstraint((string)row[0], (string)row[1]); + } + } + + this.FindCircularReference(constraints); + + if (this.Core.EncounteredError) + { + return; + } + + this.FlattenDependentReferences(constraints); + + // Reorder by topographical sort (http://en.wikipedia.org/wiki/Topological_sorting) + // We use a variation of Kahn (1962) algorithm as described in + // Wikipedia, with the additional criteria that start nodes are sorted + // lexicographically at each step to ensure a deterministic ordering + // based on 'after' dependencies and ID. + TopologicalSort sorter = new TopologicalSort(); + List sortedIds = sorter.Sort(rowDictionary.Keys, constraints); + + // Now, re-write the table with the searches in order... + wixSearchTable.Rows.Clear(); + foreach (string id in sortedIds) + { + wixSearchTable.Rows.Add(rowDictionary[id]); + } + } + + /// + /// A dictionary of Row items, indexed by their first column. + /// + private class RowDictionary : Dictionary + { + public void AddRow(Row row) + { + this.Add((string)row[0], row); + } + + // TODO: Hide other Add methods? + } + + /// + /// A dictionary of constraints, mapping an id to a list of ids. + /// + private class Constraints : Dictionary> + { + public void AddConstraint(string id, string afterId) + { + if (!this.ContainsKey(id)) + { + this.Add(id, new List()); + } + + // TODO: Show warning if a constraint is seen twice? + if (!this[id].Contains(afterId)) + { + this[id].Add(afterId); + } + } + + // TODO: Hide other Add methods? + } + + /// + /// Finds circular references in the constraints. + /// + /// Constraints to check. + /// This is not particularly performant, but it works. + private void FindCircularReference(Constraints constraints) + { + foreach (string id in constraints.Keys) + { + List seenIds = new List(); + string chain = null; + if (FindCircularReference(constraints, id, id, seenIds, out chain)) + { + // We will show a separate message for every ID that's in + // the loop. We could bail after the first one, but then + // we wouldn't catch disjoint loops in a single run. + this.Core.OnMessage(UtilErrors.CircularSearchReference(chain)); + } + } + } + + /// + /// Recursive function that finds circular references in the constraints. + /// + /// Constraints to check. + /// The identifier currently being looking for. (Fixed across a given run.) + /// The idenifier curently being tested. + /// A list of identifiers seen, to ensure each identifier is only expanded once. + /// If a circular reference is found, will contain the chain of references. + /// True if a circular reference is found, false otherwise. + private bool FindCircularReference(Constraints constraints, string checkId, string currentId, List seenIds, out string chain) + { + chain = null; + List afterList = null; + if (constraints.TryGetValue(currentId, out afterList)) + { + foreach (string afterId in afterList) + { + if (afterId == checkId) + { + chain = String.Format(CultureInfo.InvariantCulture, "{0} -> {1}", currentId, afterId); + return true; + } + + if (!seenIds.Contains(afterId)) + { + seenIds.Add(afterId); + if (FindCircularReference(constraints, checkId, afterId, seenIds, out chain)) + { + chain = String.Format(CultureInfo.InvariantCulture, "{0} -> {1}", currentId, chain); + return true; + } + } + } + } + + return false; + } + + /// + /// Flattens any dependency chains to simplify reordering. + /// + /// + private void FlattenDependentReferences(Constraints constraints) + { + foreach (string id in constraints.Keys) + { + List flattenedIds = new List(); + AddDependentReferences(constraints, id, flattenedIds); + List constraintList = constraints[id]; + foreach (string flattenedId in flattenedIds) + { + if (!constraintList.Contains(flattenedId)) + { + constraintList.Add(flattenedId); + } + } + } + } + + /// + /// Adds dependent references to a list. + /// + /// + /// + /// + private void AddDependentReferences(Constraints constraints, string currentId, List seenIds) + { + List afterList = null; + if (constraints.TryGetValue(currentId, out afterList)) + { + foreach (string afterId in afterList) + { + if (!seenIds.Contains(afterId)) + { + seenIds.Add(afterId); + AddDependentReferences(constraints, afterId, seenIds); + } + } + } + } + + /// + /// Reorder by topological sort + /// + /// + /// We use a variation of Kahn (1962) algorithm as described in + /// Wikipedia (http://en.wikipedia.org/wiki/Topological_sorting), with + /// the additional criteria that start nodes are sorted lexicographically + /// at each step to ensure a deterministic ordering based on 'after' + /// dependencies and ID. + /// + private class TopologicalSort + { + private List startIds = new List(); + private Constraints constraints; + + /// + /// Reorder by topological sort + /// + /// The complete list of IDs. + /// Constraints to use. + /// The topologically sorted list of IDs. + internal List Sort(IEnumerable allIds, Constraints constraints) + { + this.startIds.Clear(); + this.CopyConstraints(constraints); + + this.FindInitialStartIds(allIds); + + // We always create a new sortedId list, because we return it + // to the caller and don't know what its lifetime may be. + List sortedIds = new List(); + + while (this.startIds.Count > 0) + { + this.SortStartIds(); + + string currentId = this.startIds[0]; + sortedIds.Add(currentId); + this.startIds.RemoveAt(0); + + this.ResolveConstraint(currentId); + } + + return sortedIds; + } + + /// + /// Copies a Constraints set (to prevent modifying the incoming data). + /// + /// Constraints to copy. + private void CopyConstraints(Constraints constraints) + { + this.constraints = new Constraints(); + foreach (string id in constraints.Keys) + { + foreach (string afterId in constraints[id]) + { + this.constraints.AddConstraint(id, afterId); + } + } + } + + /// + /// Finds initial start IDs. (Those with no constraints.) + /// + /// The complete list of IDs. + private void FindInitialStartIds(IEnumerable allIds) + { + foreach (string id in allIds) + { + if (!this.constraints.ContainsKey(id)) + { + this.startIds.Add(id); + } + } + } + + /// + /// Sorts start IDs. + /// + private void SortStartIds() + { + this.startIds.Sort(); + } + + /// + /// Removes the resolved constraint and updates the list of startIds + /// with any now-valid (all constraints resolved) IDs. + /// + /// The ID to resolve from the set of constraints. + private void ResolveConstraint(string resolvedId) + { + List newStartIds = new List(); + + foreach (string id in constraints.Keys) + { + if (this.constraints[id].Contains(resolvedId)) + { + this.constraints[id].Remove(resolvedId); + + // If we just removed the last constraint for this + // ID, it is now a valid start ID. + if (0 == this.constraints[id].Count) + { + newStartIds.Add(id); + } + } + } + + foreach (string id in newStartIds) + { + this.constraints.Remove(id); + } + + this.startIds.AddRange(newStartIds); + } + } + } +#endif +} diff --git a/src/wixext/UtilCompiler.cs b/src/wixext/UtilCompiler.cs new file mode 100644 index 0000000..da48e41 --- /dev/null +++ b/src/wixext/UtilCompiler.cs @@ -0,0 +1,3911 @@ +// 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; + using System.Collections; + using System.Collections.Generic; + using System.Globalization; + using System.Linq; + using System.Text; + using System.Text.RegularExpressions; + using System.Xml.Linq; + using WixToolset.Data; + using WixToolset.Extensibility; + + /// + /// The compiler for the WiX Toolset Utility Extension. + /// + public sealed class UtilCompiler : BaseCompilerExtension + { + // user creation attributes definitions (from sca.h) + internal const int UserDontExpirePasswrd = 0x00000001; + internal const int UserPasswdCantChange = 0x00000002; + internal const int UserPasswdChangeReqdOnLogin = 0x00000004; + internal const int UserDisableAccount = 0x00000008; + internal const int UserFailIfExists = 0x00000010; + internal const int UserUpdateIfExists = 0x00000020; + internal const int UserLogonAsService = 0x00000040; + internal const int UserLogonAsBatchJob = 0x00000080; + + internal const int UserDontRemoveOnUninstall = 0x00000100; + internal const int UserDontCreateUser = 0x00000200; + internal const int UserNonVital = 0x00000400; + + [Flags] + internal enum WixFileSearchAttributes + { + Default = 0x001, + MinVersionInclusive = 0x002, + MaxVersionInclusive = 0x004, + MinSizeInclusive = 0x008, + MaxSizeInclusive = 0x010, + MinDateInclusive = 0x020, + MaxDateInclusive = 0x040, + WantVersion = 0x080, + WantExists = 0x100, + IsDirectory = 0x200, + } + + internal enum WixRegistrySearchFormat + { + Raw, + Compatible, + } + + [Flags] + internal enum WixRegistrySearchAttributes + { + Raw = 0x01, + Compatible = 0x02, + ExpandEnvironmentVariables = 0x04, + WantValue = 0x08, + WantExists = 0x10, + Win64 = 0x20, + } + + internal enum WixComponentSearchAttributes + { + KeyPath = 0x1, + State = 0x2, + WantDirectory = 0x4, + } + + [Flags] + internal enum WixProductSearchAttributes + { + Version = 0x01, + Language = 0x02, + State = 0x04, + Assignment = 0x08, + UpgradeCode = 0x10, + } + + internal enum WixRestartResourceAttributes + { + Filename = 1, + ProcessName, + ServiceName, + TypeMask = 0xf, + } + + internal enum WixRemoveFolderExOn + { + Install = 1, + Uninstall = 2, + Both = 3, + } + + private static readonly Regex FindPropertyBrackets = new Regex(@"\[(?!\\|\])|(? "http://wixtoolset.org/schemas/v4/wxs/util"; + + /// + /// Types of Internet shortcuts. + /// + public enum InternetShortcutType + { + /// Create a .lnk file. + Link = 0, + + /// Create a .url file. + Url, + } + + /// + /// Types of permission setting methods. + /// + private enum PermissionType + { + /// LockPermissions (normal) type permission setting. + LockPermissions, + + /// FileSharePermissions type permission setting. + FileSharePermissions, + + /// SecureObjects type permission setting. + SecureObjects, + } + + /// + /// Processes an element for the Compiler. + /// + /// Parent element of element to process. + /// Element to process. + /// Extra information about the context in which this element is being parsed. + public override void ParseElement(Intermediate intermediate, IntermediateSection section, XElement parentElement, XElement element, IDictionary context) + { + this.ParsePossibleKeyPathElement(intermediate, section, parentElement, element, context); + } + + /// + /// Processes an element for the Compiler. + /// + /// Source line number for the parent element. + /// Parent element of element to process. + /// Element to process. + /// Extra information about the context in which this element is being parsed. + public override ComponentKeyPath ParsePossibleKeyPathElement(Intermediate intermediate, IntermediateSection section, XElement parentElement, XElement element, IDictionary context) + { + ComponentKeyPath possibleKeyPath = null; + + switch (parentElement.Name.LocalName) + { + case "CreateFolder": + string createFolderId = context["DirectoryId"]; + string createFolderComponentId = context["ComponentId"]; + + // If this doesn't parse successfully, something really odd is going on, so let the exception get thrown + bool createFolderWin64 = Boolean.Parse(context["Win64"]); + + switch (element.Name.LocalName) + { + case "PermissionEx": + this.ParsePermissionExElement(intermediate, section, element, createFolderId, createFolderComponentId, createFolderWin64, "CreateFolder"); + break; + default: + this.ParseHelper.UnexpectedElement(parentElement, element); + break; + } + break; + case "Component": + string componentId = context["ComponentId"]; + string directoryId = context["DirectoryId"]; + bool componentWin64 = Boolean.Parse(context["Win64"]); + + switch (element.Name.LocalName) + { + case "EventSource": + possibleKeyPath = this.ParseEventSourceElement(intermediate, section, element, componentId); + break; + case "FileShare": + this.ParseFileShareElement(intermediate, section, element, componentId, directoryId); + break; + case "InternetShortcut": + this.ParseInternetShortcutElement(intermediate, section, element, componentId, directoryId); + break; + case "PerformanceCategory": + this.ParsePerformanceCategoryElement(intermediate, section, element, componentId); + break; + case "RemoveFolderEx": + this.ParseRemoveFolderExElement(intermediate, section, element, componentId); + break; + case "RestartResource": + this.ParseRestartResourceElement(intermediate, section, element, componentId); + break; + case "ServiceConfig": + this.ParseServiceConfigElement(intermediate, section, element, componentId, "Component", null); + break; + case "TouchFile": + this.ParseTouchFileElement(intermediate, section, element, componentId, componentWin64); + break; + case "User": + this.ParseUserElement(intermediate, section, element, componentId); + break; + case "XmlFile": + this.ParseXmlFileElement(intermediate, section, element, componentId); + break; + case "XmlConfig": + this.ParseXmlConfigElement(intermediate, section, element, componentId, false); + break; + default: + this.ParseHelper.UnexpectedElement(parentElement, element); + break; + } + break; + case "File": + string fileId = context["FileId"]; + string fileComponentId = context["ComponentId"]; + + // If this doesn't parse successfully, something really odd is going on, so let the exception get thrown + bool fileWin64 = Boolean.Parse(context["Win64"]); + + switch (element.Name.LocalName) + { + case "PerfCounter": + this.ParsePerfCounterElement(intermediate, section, element, fileComponentId, fileId); + break; + case "PermissionEx": + this.ParsePermissionExElement(intermediate, section, element, fileId, fileComponentId, fileWin64, "File"); + break; + case "PerfCounterManifest": + this.ParsePerfCounterManifestElement(intermediate, section, element, fileComponentId, fileId); + break; + case "EventManifest": + this.ParseEventManifestElement(intermediate, section, element, fileComponentId, fileId); + break; + case "FormatFile": + this.ParseFormatFileElement(intermediate, section, element, fileId, fileWin64); + break; + default: + this.ParseHelper.UnexpectedElement(parentElement, element); + break; + } + break; + case "Bundle": + case "Fragment": + case "Module": + case "Product": + switch (element.Name.LocalName) + { + case "CloseApplication": + this.ParseCloseApplicationElement(intermediate, section, element); + break; + case "Group": + this.ParseGroupElement(intermediate, section, element, null); + break; + case "RestartResource": + // Currently not supported for Bundles. + if (parentElement.Name.LocalName != "Bundle") + { + this.ParseRestartResourceElement(intermediate, section, element, null); + } + else + { + this.ParseHelper.UnexpectedElement(parentElement, element); + } + break; + case "User": + this.ParseUserElement(intermediate, section, element, null); + break; + case "ComponentSearch": + case "ComponentSearchRef": + case "DirectorySearch": + case "DirectorySearchRef": + case "FileSearch": + case "FileSearchRef": + case "ProductSearch": + case "ProductSearchRef": + case "RegistrySearch": + case "RegistrySearchRef": + // These will eventually be supported under Module/Product, but are not yet. + if (parentElement.Name.LocalName == "Bundle" || parentElement.Name.LocalName == "Fragment") + { + // TODO: When these are supported by all section types, move + // these out of the nested switch and back into the surrounding one. + switch (element.Name.LocalName) + { + case "ComponentSearch": + this.ParseComponentSearchElement(intermediate, section, element); + break; + case "ComponentSearchRef": + this.ParseComponentSearchRefElement(intermediate, section, element); + break; + case "DirectorySearch": + this.ParseDirectorySearchElement(intermediate, section, element); + break; + case "DirectorySearchRef": + this.ParseWixSearchRefElement(intermediate, section, element); + break; + case "FileSearch": + this.ParseFileSearchElement(intermediate, section, element); + break; + case "FileSearchRef": + this.ParseWixSearchRefElement(intermediate, section, element); + break; + case "ProductSearch": + this.ParseProductSearchElement(intermediate, section, element); + break; + case "ProductSearchRef": + this.ParseWixSearchRefElement(intermediate, section, element); + break; + case "RegistrySearch": + this.ParseRegistrySearchElement(intermediate, section, element); + break; + case "RegistrySearchRef": + this.ParseWixSearchRefElement(intermediate, section, element); + break; + } + } + else + { + this.ParseHelper.UnexpectedElement(parentElement, element); + } + break; + default: + this.ParseHelper.UnexpectedElement(parentElement, element); + break; + } + break; + case "Registry": + case "RegistryKey": + case "RegistryValue": + string registryId = context["RegistryId"]; + string registryComponentId = context["ComponentId"]; + + // If this doesn't parse successfully, something really odd is going on, so let the exception get thrown + bool registryWin64 = Boolean.Parse(context["Win64"]); + + switch (element.Name.LocalName) + { + case "PermissionEx": + this.ParsePermissionExElement(intermediate, section, element, registryId, registryComponentId, registryWin64, "Registry"); + break; + default: + this.ParseHelper.UnexpectedElement(parentElement, element); + break; + } + break; + case "ServiceInstall": + string serviceInstallId = context["ServiceInstallId"]; + string serviceInstallName = context["ServiceInstallName"]; + string serviceInstallComponentId = context["ServiceInstallComponentId"]; + + // If this doesn't parse successfully, something really odd is going on, so let the exception get thrown + bool serviceInstallWin64 = Boolean.Parse(context["Win64"]); + + switch (element.Name.LocalName) + { + case "PermissionEx": + this.ParsePermissionExElement(intermediate, section, element, serviceInstallId, serviceInstallComponentId, serviceInstallWin64, "ServiceInstall"); + break; + case "ServiceConfig": + this.ParseServiceConfigElement(intermediate, section, element, serviceInstallComponentId, "ServiceInstall", serviceInstallName); + break; + default: + this.ParseHelper.UnexpectedElement(parentElement, element); + break; + } + break; + default: + this.ParseHelper.UnexpectedElement(parentElement, element); + break; + } + + return possibleKeyPath; + } + + /// + /// Parses the common search attributes shared across all searches. + /// + /// Source line number for the parent element. + /// Attribute to parse. + /// Value of the Id attribute. + /// Value of the Variable attribute. + /// Value of the Condition attribute. + /// Value of the After attribute. + private void ParseCommonSearchAttributes(SourceLineNumber sourceLineNumbers, XAttribute attrib, ref Identifier id, ref string variable, ref string condition, ref string after) + { + switch (attrib.Name.LocalName) + { + case "Id": + id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib); + break; + case "Variable": + variable = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + // TODO: handle standard bundle variables + break; + case "Condition": + condition = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "After": + after = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + default: + System.Diagnostics.Debug.Assert(false); + break; + } + } + + /// + /// Parses a ComponentSearch element. + /// + /// Element to parse. + private void ParseComponentSearchElement(Intermediate intermediate, IntermediateSection section, XElement element) + { + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); + Identifier id = null; + string variable = null; + string condition = null; + string after = null; + string guid = null; + string productCode = null; + Serialize.ComponentSearch.ResultType result = Serialize.ComponentSearch.ResultType.NotSet; + + foreach (XAttribute attrib in element.Attributes()) + { + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) + { + switch (attrib.Name.LocalName) + { + case "Id": + case "Variable": + case "Condition": + case "After": + this.ParseCommonSearchAttributes(sourceLineNumbers, attrib, ref id, ref variable, ref condition, ref after); + break; + case "Guid": + guid = this.ParseHelper.GetAttributeGuidValue(sourceLineNumbers, attrib); + break; + case "ProductCode": + productCode = this.ParseHelper.GetAttributeGuidValue(sourceLineNumbers, attrib); + break; + case "Result": + string resultValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + if (!Serialize.ComponentSearch.TryParseResultType(resultValue, out result)) + { + this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, attrib.Parent.Name.LocalName, attrib.Name.LocalName, + resultValue, + Serialize.ComponentSearch.ResultType.directory.ToString(), + Serialize.ComponentSearch.ResultType.state.ToString(), + Serialize.ComponentSearch.ResultType.keyPath.ToString())); + } + break; + default: + this.ParseHelper.UnexpectedAttribute(element, attrib); + break; + } + } + else + { + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib); + } + } + + if (null == variable) + { + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Variable")); + } + + if (null == guid) + { + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Guid")); + } + + if (null == id) + { + id = this.ParseHelper.CreateIdentifier("wcs", variable, condition, after, guid, productCode, result.ToString()); + } + + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); + + if (!this.Messaging.EncounteredError) + { + this.CreateWixSearchRow(section, sourceLineNumbers, id, variable, condition); + if (after != null) + { + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "WixSearch", after); + // TODO: We're currently defaulting to "always run after", which we will need to change... + this.CreateWixSearchRelationRow(section, sourceLineNumbers, id, after, 2); + } + + WixComponentSearchAttributes attributes = WixComponentSearchAttributes.KeyPath; + switch (result) + { + case Serialize.ComponentSearch.ResultType.directory: + attributes = WixComponentSearchAttributes.WantDirectory; + break; + case Serialize.ComponentSearch.ResultType.keyPath: + attributes = WixComponentSearchAttributes.KeyPath; + break; + case Serialize.ComponentSearch.ResultType.state: + attributes = WixComponentSearchAttributes.State; + break; + } + + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixComponentSearch", id); + row.Set(1, guid); + row.Set(2, productCode); + row.Set(3, (int)attributes); + } + } + + /// + /// Parses a ComponentSearchRef element + /// + /// Element to parse. + private void ParseComponentSearchRefElement(Intermediate intermediate, IntermediateSection section, XElement element) + { + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); + string refId = null; + + foreach (XAttribute attrib in element.Attributes()) + { + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) + { + switch (attrib.Name.LocalName) + { + case "Id": + refId = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "WixComponentSearch", refId); + break; + default: + this.ParseHelper.UnexpectedAttribute(element, attrib); + break; + } + } + else + { + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib); + } + } + + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); + } + + /// + /// Parses an event source element. + /// + /// Element to parse. + /// Identifier of parent component. + private ComponentKeyPath ParseEventSourceElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId) + { + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); + string sourceName = null; + string logName = null; + string categoryMessageFile = null; + int categoryCount = CompilerConstants.IntegerNotSet; + string eventMessageFile = null; + string parameterMessageFile = null; + int typesSupported = 0; + bool isKeyPath = false; + + foreach (XAttribute attrib in element.Attributes()) + { + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) + { + switch (attrib.Name.LocalName) + { + case "CategoryCount": + categoryCount = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, int.MaxValue); + break; + case "CategoryMessageFile": + categoryMessageFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "EventMessageFile": + eventMessageFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "KeyPath": + isKeyPath = YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib); + break; + case "Log": + logName = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + if ("Security" == logName) + { + this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName, logName, "Application", "System", "")); + } + break; + case "Name": + sourceName = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "ParameterMessageFile": + parameterMessageFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "SupportsErrors": + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + { + typesSupported |= 0x01; // EVENTLOG_ERROR_TYPE + } + break; + case "SupportsFailureAudits": + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + { + typesSupported |= 0x10; // EVENTLOG_AUDIT_FAILURE + } + break; + case "SupportsInformationals": + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + { + typesSupported |= 0x04; // EVENTLOG_INFORMATION_TYPE + } + break; + case "SupportsSuccessAudits": + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + { + typesSupported |= 0x08; // EVENTLOG_AUDIT_SUCCESS + } + break; + case "SupportsWarnings": + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + { + typesSupported |= 0x02; // EVENTLOG_WARNING_TYPE + } + break; + default: + this.ParseHelper.UnexpectedAttribute(element, attrib); + break; + } + } + else + { + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib); + } + } + + if (null == sourceName) + { + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Name")); + } + + if (null == logName) + { + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "EventLog")); + } + + if (null == eventMessageFile) + { + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "EventMessageFile")); + } + + if (null == categoryMessageFile && 0 < categoryCount) + { + this.Messaging.Write(ErrorMessages.IllegalAttributeWithoutOtherAttributes(sourceLineNumbers, element.Name.LocalName, "CategoryCount", "CategoryMessageFile")); + } + + if (null != categoryMessageFile && CompilerConstants.IntegerNotSet == categoryCount) + { + this.Messaging.Write(ErrorMessages.IllegalAttributeWithoutOtherAttributes(sourceLineNumbers, element.Name.LocalName, "CategoryMessageFile", "CategoryCount")); + } + + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); + + int registryRoot = 2; // MsiInterop.MsidbRegistryRootLocalMachine + string eventSourceKey = String.Format(@"SYSTEM\CurrentControlSet\Services\EventLog\{0}\{1}", logName, sourceName); + Identifier id = this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, registryRoot, eventSourceKey, "EventMessageFile", String.Concat("#%", eventMessageFile), componentId, false); + + if (null != categoryMessageFile) + { + this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, registryRoot, eventSourceKey, "CategoryMessageFile", String.Concat("#%", categoryMessageFile), componentId, false); + } + + if (CompilerConstants.IntegerNotSet != categoryCount) + { + this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, registryRoot, eventSourceKey, "CategoryCount", String.Concat("#", categoryCount), componentId, false); + } + + if (null != parameterMessageFile) + { + this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, registryRoot, eventSourceKey, "ParameterMessageFile", String.Concat("#%", parameterMessageFile), componentId, false); + } + + if (0 != typesSupported) + { + this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, registryRoot, eventSourceKey, "TypesSupported", String.Concat("#", typesSupported), componentId, false); + } + + return new ComponentKeyPath() { Id = id.Id, Explicit = isKeyPath, Type = ComponentKeyPathType.Registry }; + } + + /// + /// Parses a close application element. + /// + /// Element to parse. + private void ParseCloseApplicationElement(Intermediate intermediate, IntermediateSection section, XElement element) + { + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); + string condition = null; + string description = null; + string target = null; + string property = null; + Identifier id = null; + int attributes = 2; // default to CLOSEAPP_ATTRIBUTE_REBOOTPROMPT enabled + int sequence = CompilerConstants.IntegerNotSet; + int terminateExitCode = CompilerConstants.IntegerNotSet; + int timeout = CompilerConstants.IntegerNotSet; + + foreach (XAttribute attrib in element.Attributes()) + { + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) + { + switch (attrib.Name.LocalName) + { + case "Id": + id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib); + break; + case "Description": + description = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "Property": + property = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); + break; + case "Sequence": + sequence = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, int.MaxValue); + break; + case "Timeout": + timeout = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, int.MaxValue); + break; + case "Target": + target = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "CloseMessage": + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + { + attributes |= 1; // CLOSEAPP_ATTRIBUTE_CLOSEMESSAGE + } + else + { + attributes &= ~1; // CLOSEAPP_ATTRIBUTE_CLOSEMESSAGE + } + break; + case "EndSessionMessage": + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + { + attributes |= 8; // CLOSEAPP_ATTRIBUTE_ENDSESSIONMESSAGE + } + else + { + attributes &= ~8; // CLOSEAPP_ATTRIBUTE_ENDSESSIONMESSAGE + } + break; + case "PromptToContinue": + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + { + attributes |= 0x40; // CLOSEAPP_ATTRIBUTE_PROMPTTOCONTINUE + } + else + { + attributes &= ~0x40; // CLOSEAPP_ATTRIBUTE_PROMPTTOCONTINUE + } + break; + case "RebootPrompt": + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + { + attributes |= 2; // CLOSEAPP_ATTRIBUTE_REBOOTPROMPT + } + else + { + attributes &= ~2; // CLOSEAPP_ATTRIBUTE_REBOOTPROMPT + } + break; + case "ElevatedCloseMessage": + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + { + attributes |= 4; // CLOSEAPP_ATTRIBUTE_ELEVATEDCLOSEMESSAGE + } + else + { + attributes &= ~4; // CLOSEAPP_ATTRIBUTE_ELEVATEDCLOSEMESSAGE + } + break; + case "ElevatedEndSessionMessage": + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + { + attributes |= 0x10; // CLOSEAPP_ATTRIBUTE_ELEVATEDENDSESSIONMESSAGE + } + else + { + attributes &= ~0x10; // CLOSEAPP_ATTRIBUTE_ELEVATEDENDSESSIONMESSAGE + } + break; + case "TerminateProcess": + terminateExitCode = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, int.MaxValue); + attributes |= 0x20; // CLOSEAPP_ATTRIBUTE_TERMINATEPROCESS + break; + default: + this.ParseHelper.UnexpectedAttribute(element, attrib); + break; + } + } + else + { + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib); + } + } + + if (null == target) + { + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Target")); + } + else if (null == id) + { + id = this.ParseHelper.CreateIdentifier("ca", target); + } + + if (String.IsNullOrEmpty(description) && 0x40 == (attributes & 0x40)) + { + this.Messaging.Write(ErrorMessages.IllegalAttributeValueWithoutOtherAttribute(sourceLineNumbers, element.Name.LocalName, "PromptToContinue", "yes", "Description")); + } + + if (0x22 == (attributes & 0x22)) + { + this.Messaging.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, element.Name.LocalName, "TerminateProcess", "RebootPrompt", "yes")); + } + + // get the condition from the inner text of the element + condition = this.ParseHelper.GetConditionInnerText(element); + + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); + + // Reference CustomAction since nothing will happen without it + if (this.Context.Platform == Platform.ARM) + { + // Ensure ARM version of the CA is referenced + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixCloseApplications_ARM"); + } + else + { + // All other supported platforms use x86 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixCloseApplications"); + } + + if (!this.Messaging.EncounteredError) + { + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixCloseApplication", id); + row.Set(1, target); + row.Set(2, description); + row.Set(3, condition); + row.Set(4, attributes); + if (CompilerConstants.IntegerNotSet != sequence) + { + row.Set(5, sequence); + } + row.Set(6, property); + if (CompilerConstants.IntegerNotSet != terminateExitCode) + { + row.Set(7, terminateExitCode); + } + if (CompilerConstants.IntegerNotSet != timeout) + { + row.Set(8, timeout * 1000); // make the timeout milliseconds in the table. + } + } + } + + /// + /// Parses a DirectorySearch element. + /// + /// Element to parse. + private void ParseDirectorySearchElement(Intermediate intermediate, IntermediateSection section, XElement element) + { + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); + Identifier id = null; + string variable = null; + string condition = null; + string after = null; + string path = null; + Serialize.DirectorySearch.ResultType result = Serialize.DirectorySearch.ResultType.NotSet; + + foreach (XAttribute attrib in element.Attributes()) + { + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) + { + switch (attrib.Name.LocalName) + { + case "Id": + case "Variable": + case "Condition": + case "After": + this.ParseCommonSearchAttributes(sourceLineNumbers, attrib, ref id, ref variable, ref condition, ref after); + break; + case "Path": + path = this.ParseHelper.GetAttributeLongFilename(sourceLineNumbers, attrib, false, true); + break; + case "Result": + string resultValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + if (!Serialize.DirectorySearch.TryParseResultType(resultValue, out result)) + { + this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, attrib.Parent.Name.LocalName, attrib.Name.LocalName, + resultValue, Serialize.DirectorySearch.ResultType.exists.ToString())); + } + break; + default: + this.ParseHelper.UnexpectedAttribute(element, attrib); + break; + } + } + else + { + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib); + } + } + + if (null == variable) + { + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Variable")); + } + + if (null == path) + { + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Path")); + } + + if (null == id) + { + id = this.ParseHelper.CreateIdentifier("wds", variable, condition, after, path, result.ToString()); + } + + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); + + if (!this.Messaging.EncounteredError) + { + this.CreateWixSearchRow(section, sourceLineNumbers, id, variable, condition); + if (after != null) + { + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "WixSearch", after); + // TODO: We're currently defaulting to "always run after", which we will need to change... + this.CreateWixSearchRelationRow(section, sourceLineNumbers, id, after, 2); + } + + WixFileSearchAttributes attributes = WixFileSearchAttributes.IsDirectory; + switch (result) + { + case Serialize.DirectorySearch.ResultType.exists: + attributes |= WixFileSearchAttributes.WantExists; + break; + } + + this.CreateWixFileSearchRow(section, sourceLineNumbers, id, path, attributes); + } + } + + /// + /// Parses a DirectorySearchRef, FileSearchRef, ProductSearchRef, and RegistrySearchRef elements + /// + /// Element to parse. + private void ParseWixSearchRefElement(Intermediate intermediate, IntermediateSection section, XElement node) + { + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node); + string refId = null; + + foreach (XAttribute attrib in node.Attributes()) + { + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) + { + switch (attrib.Name.LocalName) + { + case "Id": + refId = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "WixSearch", refId); + break; + default: + this.ParseHelper.UnexpectedAttribute(node, attrib); + break; + } + } + else + { + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, node, attrib); + } + } + + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, node); + } + + /// + /// Parses a FileSearch element. + /// + /// Element to parse. + private void ParseFileSearchElement(Intermediate intermediate, IntermediateSection section, XElement node) + { + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node); + Identifier id = null; + string variable = null; + string condition = null; + string after = null; + string path = null; + Serialize.FileSearch.ResultType result = Serialize.FileSearch.ResultType.NotSet; + + foreach (XAttribute attrib in node.Attributes()) + { + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) + { + switch (attrib.Name.LocalName) + { + case "Id": + case "Variable": + case "Condition": + case "After": + this.ParseCommonSearchAttributes(sourceLineNumbers, attrib, ref id, ref variable, ref condition, ref after); + break; + case "Path": + path = this.ParseHelper.GetAttributeLongFilename(sourceLineNumbers, attrib, false, true); + break; + case "Result": + string resultValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + if (!Serialize.FileSearch.TryParseResultType(resultValue, out result)) + { + this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, attrib.Parent.Name.LocalName, attrib.Name.LocalName, + resultValue, + Serialize.FileSearch.ResultType.exists.ToString(), + Serialize.FileSearch.ResultType.version.ToString())); + } + break; + default: + this.ParseHelper.UnexpectedAttribute(node, attrib); + break; + } + } + else + { + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, node, attrib); + } + } + + if (null == variable) + { + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Variable")); + } + + if (null == path) + { + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Path")); + } + + if (null == id) + { + id = this.ParseHelper.CreateIdentifier("wfs", variable, condition, after, path, result.ToString()); + } + + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, node); + + if (!this.Messaging.EncounteredError) + { + this.CreateWixSearchRow(section, sourceLineNumbers, id, variable, condition); + if (after != null) + { + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "WixSearch", after); + // TODO: We're currently defaulting to "always run after", which we will need to change... + this.CreateWixSearchRelationRow(section, sourceLineNumbers, id, after, 2); + } + + WixFileSearchAttributes attributes = WixFileSearchAttributes.Default; + switch (result) + { + case Serialize.FileSearch.ResultType.exists: + attributes |= WixFileSearchAttributes.WantExists; + break; + case Serialize.FileSearch.ResultType.version: + attributes |= WixFileSearchAttributes.WantVersion; + break; + } + + this.CreateWixFileSearchRow(section, sourceLineNumbers, id, path, attributes); + } + } + + /// + /// Creates a row in the WixFileSearch table. + /// + /// Source line number for the parent element. + /// Identifier of the search (key into the WixSearch table) + /// File/directory path to search for. + /// + private void CreateWixFileSearchRow(IntermediateSection section, SourceLineNumber sourceLineNumbers, Identifier id, string path, WixFileSearchAttributes attributes) + { + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixFileSearch", id); + row.Set(1, path); + //row.Set(2, minVersion; + //row.Set(3, maxVersion; + //row.Set(4, minSize; + //row.Set(5, maxSize; + //row.Set(6, minDate; + //row.Set(7, maxDate; + //row.Set(8, languages; + row.Set(9, (int)attributes); + } + + /// + /// Creates a row in the WixSearch table. + /// + /// Source line number for the parent element. + /// Identifier of the search. + /// The Burn variable to store the result into. + /// A condition to test before evaluating the search. + private void CreateWixSearchRow(IntermediateSection section, SourceLineNumber sourceLineNumbers, Identifier id, string variable, string condition) + { + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixSearch", id); + row.Set(1, variable); + row.Set(2, condition); + } + + /// + /// + /// + /// Source line number for the parent element. + /// Identifier of the search (key into the WixSearch table) + /// Identifier of the search that comes before (key into the WixSearch table) + /// Further details about the relation between id and parentId. + private void CreateWixSearchRelationRow(IntermediateSection section, SourceLineNumber sourceLineNumbers, Identifier id, string parentId, int attributes) + { + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixSearchRelation", id); + row.Set(1, parentId); + row.Set(2, attributes); + } + + /// + /// Parses a file share element. + /// + /// Element to parse. + /// Identifier of parent component. + /// Identifier of referred to directory. + private void ParseFileShareElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, string directoryId) + { + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); + string description = null; + string name = null; + string id = null; + + foreach (XAttribute attrib in element.Attributes()) + { + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) + { + switch (attrib.Name.LocalName) + { + case "Id": + id = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); + break; + case "Name": + name = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "Description": + description = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + default: + this.ParseHelper.UnexpectedAttribute(element, attrib); + break; + } + } + else + { + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib); + } + } + + if (null == id) + { + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Id")); + } + + if (null == name) + { + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Name")); + } + + if (!element.Elements().Any()) + { + this.Messaging.Write(ErrorMessages.ExpectedElement(sourceLineNumbers, element.Name.LocalName, "FileSharePermission")); + } + + foreach (XElement child in element.Elements()) + { + if (this.Namespace == child.Name.Namespace) + { + switch (child.Name.LocalName) + { + case "FileSharePermission": + this.ParseFileSharePermissionElement(intermediate, section, child, id); + break; + default: + this.ParseHelper.UnexpectedElement(element, child); + break; + } + } + else + { + this.ParseHelper.ParseExtensionElement(this.Context.Extensions, intermediate, section, element, child); + } + } + + // Reference ConfigureSmbInstall and ConfigureSmbUninstall since nothing will happen without it + if (this.Context.Platform == Platform.ARM) + { + // Ensure ARM version of the CA is referenced + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigureSmbInstall_ARM"); + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigureSmbUninstall_ARM"); + } + else + { + // All other supported platforms use x86 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigureSmbInstall"); + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigureSmbUninstall"); + } + + if (!this.Messaging.EncounteredError) + { + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "FileShare"); + row.Set(0, id); + row.Set(1, name); + row.Set(2, componentId); + row.Set(3, description); + row.Set(4, directoryId); + } + } + + /// + /// Parses a FileSharePermission element. + /// + /// Element to parse. + /// The identifier of the parent FileShare element. + private void ParseFileSharePermissionElement(Intermediate intermediate, IntermediateSection section, XElement element, string fileShareId) + { + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); + BitArray bits = new BitArray(32); + int permission = 0; + string user = null; + + foreach (XAttribute attrib in element.Attributes()) + { + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) + { + switch (attrib.Name.LocalName) + { + case "User": + user = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "User", user); + break; + default: + YesNoType attribValue = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib); + if (!this.TrySetBitFromName(UtilConstants.StandardPermissions, attrib.Name.LocalName, attribValue, bits, 16)) + { + if (!this.TrySetBitFromName(UtilConstants.GenericPermissions, attrib.Name.LocalName, attribValue, bits, 28)) + { + if (!this.TrySetBitFromName(UtilConstants.FolderPermissions, attrib.Name.LocalName, attribValue, bits, 0)) + { + this.ParseHelper.UnexpectedAttribute(element, attrib); + break; + } + } + } + break; + } + } + else + { + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib); + } + } + + permission = this.CreateIntegerFromBitArray(bits); + + if (null == user) + { + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "User")); + } + + if (int.MinValue == permission) // just GENERIC_READ, which is MSI_NULL + { + this.Messaging.Write(ErrorMessages.GenericReadNotAllowed(sourceLineNumbers)); + } + + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); + + if (!this.Messaging.EncounteredError) + { + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "FileSharePermissions"); + row.Set(0, fileShareId); + row.Set(1, user); + row.Set(2, permission); + } + } + + /// + /// Parses a group element. + /// + /// Node to be parsed. + /// Component Id of the parent component of this element. + private void ParseGroupElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId) + { + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); + string id = null; + string domain = null; + string name = null; + + foreach (XAttribute attrib in element.Attributes()) + { + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) + { + switch (attrib.Name.LocalName) + { + case "Id": + id = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); + break; + case "Name": + name = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "Domain": + domain = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + default: + this.ParseHelper.UnexpectedAttribute(element, attrib); + break; + } + } + else + { + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib); + } + } + + if (null == id) + { + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Id")); + } + + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); + + if (!this.Messaging.EncounteredError) + { + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "Group"); + row.Set(0, id); + row.Set(1, componentId); + row.Set(2, name); + row.Set(3, domain); + } + } + + /// + /// Parses a GroupRef element + /// + /// Element to parse. + /// Required user id to be joined to the group. + private void ParseGroupRefElement(Intermediate intermediate, IntermediateSection section, XElement element, string userId) + { + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); + string groupId = null; + + foreach (XAttribute attrib in element.Attributes()) + { + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) + { + switch (attrib.Name.LocalName) + { + case "Id": + groupId = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "Group", groupId); + break; + default: + this.ParseHelper.UnexpectedAttribute(element, attrib); + break; + } + } + else + { + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib); + } + } + + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); + + if (!this.Messaging.EncounteredError) + { + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "UserGroup"); + row.Set(0, userId); + row.Set(1, groupId); + } + } + + /// + /// Parses an InternetShortcut element. + /// + /// Element to parse. + /// Identifier of parent component. + /// Default directory if none is specified on the InternetShortcut element. + private void ParseInternetShortcutElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, string defaultTarget) + { + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); + string id = null; + string name = null; + string target = null; + string directoryId = null; + string type = null; + string iconFile = null; + int iconIndex = 0; + + foreach (XAttribute attrib in element.Attributes()) + { + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) + { + switch (attrib.Name.LocalName) + { + case "Directory": + directoryId = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); + break; + case "Id": + id = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); + break; + case "Name": + name = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "Target": + target = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "Type": + type = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "IconFile": + iconFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "IconIndex": + iconIndex = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, int.MaxValue); + break; + default: + this.ParseHelper.UnexpectedAttribute(element, attrib); + break; + } + } + else + { + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib); + } + } + + // If there was no directoryId specified on the InternetShortcut element, default to the one on + // the parent component. + if (null == directoryId) + { + directoryId = defaultTarget; + } + + if (null == id) + { + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Id")); + } + + // In theory this can never be the case, since InternetShortcut can only be under + // a component element, and if the Directory wasn't specified the default will come + // from the component. However, better safe than sorry, so here's a check to make sure + // it didn't wind up being null after setting it to the defaultTarget. + if (null == directoryId) + { + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Directory")); + } + + if (null == name) + { + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Name")); + } + + if (null == target) + { + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Target")); + } + + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); + + InternetShortcutType shortcutType = InternetShortcutType.Link; + if (0 == String.Compare(type, "url", StringComparison.OrdinalIgnoreCase)) + { + shortcutType = InternetShortcutType.Url; + } + + if (!this.Messaging.EncounteredError) + { + CreateWixInternetShortcut(intermediate, section, sourceLineNumbers, componentId, directoryId, id, name, target, shortcutType, iconFile, iconIndex); + } + } + + /// + /// Creates the rows needed for WixInternetShortcut to work. + /// + /// The CompilerCore object used to create rows. + /// Source line information about the owner element. + /// Identifier of parent component. + /// Identifier of directory containing shortcut. + /// Identifier of shortcut. + /// Name of shortcut without extension. + /// Target URL of shortcut. + public void CreateWixInternetShortcut(Intermediate intermediate, IntermediateSection section, SourceLineNumber sourceLineNumbers, string componentId, string directoryId, string shortcutId, string name, string target, InternetShortcutType type, string iconFile, int iconIndex) + { + // add the appropriate extension based on type of shortcut + name = String.Concat(name, InternetShortcutType.Url == type ? ".url" : ".lnk"); + + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixInternetShortcut"); + row.Set(0, shortcutId); + row.Set(1, componentId); + row.Set(2, directoryId); + row.Set(3, name); + row.Set(4, target); + row.Set(5, (int)type); + row.Set(6, iconFile); + row.Set(7, iconIndex); + + // Reference custom action because nothing will happen without it + if (this.Context.Platform == Platform.ARM) + { + // Ensure ARM version of the CA is referenced + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixSchedInternetShortcuts_ARM"); + } + else + { + // All other supported platforms use x86 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixSchedInternetShortcuts"); + } + + // make sure we have a CreateFolder table so that the immediate CA can add temporary rows to handle installation and uninstallation + this.ParseHelper.EnsureTable(section, sourceLineNumbers, "CreateFolder"); + + // use built-in MSI functionality to remove the shortcuts rather than doing so via CA + row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "RemoveFile"); + row.Set(0, shortcutId); + row.Set(1, componentId); + row.Set(2, this.ParseHelper.IsValidShortFilename(name, false) ? name : String.Concat(this.ParseHelper.CreateShortName(name, true, false, directoryId, name), "|", name)); + row.Set(3, directoryId); + row.Set(4, 2); // msidbRemoveFileInstallModeOnRemove + } + + /// + /// Parses a performance category element. + /// + /// Element to parse. + /// Identifier of parent component. + private void ParsePerformanceCategoryElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId) + { + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); + string id = null; + string name = null; + string help = null; + YesNoType multiInstance = YesNoType.No; + int defaultLanguage = 0x09; // default to "english" + + ArrayList parsedPerformanceCounters = new ArrayList(); + + // default to managed performance counter + string library = "netfxperf.dll"; + string openEntryPoint = "OpenPerformanceData"; + string collectEntryPoint = "CollectPerformanceData"; + string closeEntryPoint = "ClosePerformanceData"; + + foreach (XAttribute attrib in element.Attributes()) + { + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) + { + switch (attrib.Name.LocalName) + { + case "Close": + closeEntryPoint = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "Collect": + collectEntryPoint = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "DefaultLanguage": + defaultLanguage = this.GetPerformanceCounterLanguage(sourceLineNumbers, attrib); + break; + case "Help": + help = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "Id": + id = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); + break; + case "Library": + library = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "MultiInstance": + multiInstance = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib); + break; + case "Name": + name = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "Open": + openEntryPoint = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + default: + this.ParseHelper.UnexpectedAttribute(element, attrib); + break; + } + } + else + { + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib); + } + } + + if (null == id) + { + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Id")); + } + + if (null == name) + { + name = id; + } + + // Process the child counter elements. + foreach (XElement child in element.Elements()) + { + if (this.Namespace == child.Name.Namespace) + { + switch (child.Name.LocalName) + { + case "PerformanceCounter": + ParsedPerformanceCounter counter = this.ParsePerformanceCounterElement(intermediate, section, child, defaultLanguage); + if (null != counter) + { + parsedPerformanceCounters.Add(counter); + } + break; + default: + this.ParseHelper.UnexpectedElement(element, child); + break; + } + } + else + { + this.ParseHelper.ParseExtensionElement(this.Context.Extensions, intermediate, section, element, child); + } + } + + + if (!this.Messaging.EncounteredError) + { + // Calculate the ini and h file content. + string objectName = "OBJECT_1"; + string objectLanguage = defaultLanguage.ToString("D3", CultureInfo.InvariantCulture); + + StringBuilder sbIniData = new StringBuilder(); + sbIniData.AppendFormat("[info]\r\ndrivername={0}\r\nsymbolfile=wixperf.h\r\n\r\n[objects]\r\n{1}_{2}_NAME=\r\n\r\n[languages]\r\n{2}=LANG{2}\r\n\r\n", name, objectName, objectLanguage); + sbIniData.AppendFormat("[text]\r\n{0}_{1}_NAME={2}\r\n", objectName, objectLanguage, name); + if (null != help) + { + sbIniData.AppendFormat("{0}_{1}_HELP={2}\r\n", objectName, objectLanguage, help); + } + + int symbolConstantsCounter = 0; + StringBuilder sbSymbolicConstants = new StringBuilder(); + sbSymbolicConstants.AppendFormat("#define {0} {1}\r\n", objectName, symbolConstantsCounter); + + StringBuilder sbCounterNames = new StringBuilder("[~]"); + StringBuilder sbCounterTypes = new StringBuilder("[~]"); + for (int i = 0; i < parsedPerformanceCounters.Count; ++i) + { + ParsedPerformanceCounter counter = (ParsedPerformanceCounter)parsedPerformanceCounters[i]; + string counterName = String.Concat("DEVICE_COUNTER_", i + 1); + + sbIniData.AppendFormat("{0}_{1}_NAME={2}\r\n", counterName, counter.Language, counter.Name); + if (null != counter.Help) + { + sbIniData.AppendFormat("{0}_{1}_HELP={2}\r\n", counterName, counter.Language, counter.Help); + } + + symbolConstantsCounter += 2; + sbSymbolicConstants.AppendFormat("#define {0} {1}\r\n", counterName, symbolConstantsCounter); + + sbCounterNames.Append(UtilCompiler.FindPropertyBrackets.Replace(counter.Name, this.EscapeProperties)); + sbCounterNames.Append("[~]"); + sbCounterTypes.Append(counter.Type); + sbCounterTypes.Append("[~]"); + } + + sbSymbolicConstants.AppendFormat("#define LAST_{0}_COUNTER_OFFSET {1}\r\n", objectName, symbolConstantsCounter); + + // Add the calculated INI and H strings to the PerformanceCategory table. + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "PerformanceCategory"); + row.Set(0, id); + row.Set(1, componentId); + row.Set(2, name); + row.Set(3, sbIniData.ToString()); + row.Set(4, sbSymbolicConstants.ToString()); + + // Set up the application's performance key. + int registryRoot = 2; // HKLM + string escapedName = UtilCompiler.FindPropertyBrackets.Replace(name, this.EscapeProperties); + string linkageKey = String.Format(@"SYSTEM\CurrentControlSet\Services\{0}\Linkage", escapedName); + string performanceKey = String.Format(@"SYSTEM\CurrentControlSet\Services\{0}\Performance", escapedName); + + this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, registryRoot, linkageKey, "Export", escapedName, componentId, false); + this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, registryRoot, performanceKey, "-", null, componentId, false); + this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, registryRoot, performanceKey, "Library", library, componentId, false); + this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, registryRoot, performanceKey, "Open", openEntryPoint, componentId, false); + this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, registryRoot, performanceKey, "Collect", collectEntryPoint, componentId, false); + this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, registryRoot, performanceKey, "Close", closeEntryPoint, componentId, false); + this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, registryRoot, performanceKey, "IsMultiInstance", YesNoType.Yes == multiInstance ? "#1" : "#0", componentId, false); + this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, registryRoot, performanceKey, "Counter Names", sbCounterNames.ToString(), componentId, false); + this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, registryRoot, performanceKey, "Counter Types", sbCounterTypes.ToString(), componentId, false); + } + + // Reference InstallPerfCounterData and UninstallPerfCounterData since nothing will happen without them + if (this.Context.Platform == Platform.ARM) + { + // Ensure ARM version of the CAs are referenced + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "InstallPerfCounterData_ARM"); + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "UninstallPerfCounterData_ARM"); + } + else + { + // All other supported platforms use x86 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "InstallPerfCounterData"); + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "UninstallPerfCounterData"); + } + } + + /// + /// Gets the performance counter language as a decimal number. + /// + /// Source line information about the owner element. + /// The attribute containing the value to get. + /// Numeric representation of the language as per WinNT.h. + private int GetPerformanceCounterLanguage(SourceLineNumber sourceLineNumbers, XAttribute attribute) + { + int language = 0; + if (String.Empty == attribute.Value) + { + this.Messaging.Write(ErrorMessages.IllegalEmptyAttributeValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName)); + } + else + { + switch (attribute.Value) + { + case "afrikaans": + language = 0x36; + break; + case "albanian": + language = 0x1c; + break; + case "arabic": + language = 0x01; + break; + case "armenian": + language = 0x2b; + break; + case "assamese": + language = 0x4d; + break; + case "azeri": + language = 0x2c; + break; + case "basque": + language = 0x2d; + break; + case "belarusian": + language = 0x23; + break; + case "bengali": + language = 0x45; + break; + case "bulgarian": + language = 0x02; + break; + case "catalan": + language = 0x03; + break; + case "chinese": + language = 0x04; + break; + case "croatian": + language = 0x1a; + break; + case "czech": + language = 0x05; + break; + case "danish": + language = 0x06; + break; + case "divehi": + language = 0x65; + break; + case "dutch": + language = 0x13; + break; + case "piglatin": + case "english": + language = 0x09; + break; + case "estonian": + language = 0x25; + break; + case "faeroese": + language = 0x38; + break; + case "farsi": + language = 0x29; + break; + case "finnish": + language = 0x0b; + break; + case "french": + language = 0x0c; + break; + case "galician": + language = 0x56; + break; + case "georgian": + language = 0x37; + break; + case "german": + language = 0x07; + break; + case "greek": + language = 0x08; + break; + case "gujarati": + language = 0x47; + break; + case "hebrew": + language = 0x0d; + break; + case "hindi": + language = 0x39; + break; + case "hungarian": + language = 0x0e; + break; + case "icelandic": + language = 0x0f; + break; + case "indonesian": + language = 0x21; + break; + case "italian": + language = 0x10; + break; + case "japanese": + language = 0x11; + break; + case "kannada": + language = 0x4b; + break; + case "kashmiri": + language = 0x60; + break; + case "kazak": + language = 0x3f; + break; + case "konkani": + language = 0x57; + break; + case "korean": + language = 0x12; + break; + case "kyrgyz": + language = 0x40; + break; + case "latvian": + language = 0x26; + break; + case "lithuanian": + language = 0x27; + break; + case "macedonian": + language = 0x2f; + break; + case "malay": + language = 0x3e; + break; + case "malayalam": + language = 0x4c; + break; + case "manipuri": + language = 0x58; + break; + case "marathi": + language = 0x4e; + break; + case "mongolian": + language = 0x50; + break; + case "nepali": + language = 0x61; + break; + case "norwegian": + language = 0x14; + break; + case "oriya": + language = 0x48; + break; + case "polish": + language = 0x15; + break; + case "portuguese": + language = 0x16; + break; + case "punjabi": + language = 0x46; + break; + case "romanian": + language = 0x18; + break; + case "russian": + language = 0x19; + break; + case "sanskrit": + language = 0x4f; + break; + case "serbian": + language = 0x1a; + break; + case "sindhi": + language = 0x59; + break; + case "slovak": + language = 0x1b; + break; + case "slovenian": + language = 0x24; + break; + case "spanish": + language = 0x0a; + break; + case "swahili": + language = 0x41; + break; + case "swedish": + language = 0x1d; + break; + case "syriac": + language = 0x5a; + break; + case "tamil": + language = 0x49; + break; + case "tatar": + language = 0x44; + break; + case "telugu": + language = 0x4a; + break; + case "thai": + language = 0x1e; + break; + case "turkish": + language = 0x1f; + break; + case "ukrainian": + language = 0x22; + break; + case "urdu": + language = 0x20; + break; + case "uzbek": + language = 0x43; + break; + case "vietnamese": + language = 0x2a; + break; + default: + this.Messaging.Write(ErrorMessages.IllegalEmptyAttributeValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName)); + break; + } + } + + return language; + } + + /// + /// Parses a performance counter element. + /// + /// Element to parse. + /// Default language for the performance counter. + private ParsedPerformanceCounter ParsePerformanceCounterElement(Intermediate intermediate, IntermediateSection section, XElement element, int defaultLanguage) + { + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); + ParsedPerformanceCounter parsedPerformanceCounter = null; + string name = null; + string help = null; + System.Diagnostics.PerformanceCounterType type = System.Diagnostics.PerformanceCounterType.NumberOfItems32; + int language = defaultLanguage; + + foreach (XAttribute attrib in element.Attributes()) + { + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) + { + switch (attrib.Name.LocalName) + { + case "Help": + help = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "Name": + name = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "Type": + type = this.GetPerformanceCounterType(sourceLineNumbers, attrib); + break; + case "Language": + language = this.GetPerformanceCounterLanguage(sourceLineNumbers, attrib); + break; + default: + this.ParseHelper.UnexpectedAttribute(element, attrib); + break; + } + } + else + { + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib); + } + } + + if (null == name) + { + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Name")); + } + + if (null == help) + { + this.Messaging.Write(UtilWarnings.RequiredAttributeForWindowsXP(sourceLineNumbers, element.Name.LocalName, "Help")); + } + + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); + + if (!this.Messaging.EncounteredError) + { + parsedPerformanceCounter = new ParsedPerformanceCounter(name, help, type, language); + } + + return parsedPerformanceCounter; + } + + /// + /// Gets the performance counter type. + /// + /// Source line information about the owner element. + /// The attribute containing the value to get. + /// Numeric representation of the language as per WinNT.h. + private System.Diagnostics.PerformanceCounterType GetPerformanceCounterType(SourceLineNumber sourceLineNumbers, XAttribute attribute) + { + System.Diagnostics.PerformanceCounterType type = System.Diagnostics.PerformanceCounterType.NumberOfItems32; + if (String.Empty == attribute.Value) + { + this.Messaging.Write(ErrorMessages.IllegalEmptyAttributeValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName)); + } + else + { + switch (attribute.Value) + { + case "averageBase": + type = System.Diagnostics.PerformanceCounterType.AverageBase; + break; + case "averageCount64": + type = System.Diagnostics.PerformanceCounterType.AverageCount64; + break; + case "averageTimer32": + type = System.Diagnostics.PerformanceCounterType.AverageTimer32; + break; + case "counterDelta32": + type = System.Diagnostics.PerformanceCounterType.CounterDelta32; + break; + case "counterTimerInverse": + type = System.Diagnostics.PerformanceCounterType.CounterTimerInverse; + break; + case "sampleFraction": + type = System.Diagnostics.PerformanceCounterType.SampleFraction; + break; + case "timer100Ns": + type = System.Diagnostics.PerformanceCounterType.Timer100Ns; + break; + case "counterTimer": + type = System.Diagnostics.PerformanceCounterType.CounterTimer; + break; + case "rawFraction": + type = System.Diagnostics.PerformanceCounterType.RawFraction; + break; + case "timer100NsInverse": + type = System.Diagnostics.PerformanceCounterType.Timer100NsInverse; + break; + case "counterMultiTimer": + type = System.Diagnostics.PerformanceCounterType.CounterMultiTimer; + break; + case "counterMultiTimer100Ns": + type = System.Diagnostics.PerformanceCounterType.CounterMultiTimer100Ns; + break; + case "counterMultiTimerInverse": + type = System.Diagnostics.PerformanceCounterType.CounterMultiTimerInverse; + break; + case "counterMultiTimer100NsInverse": + type = System.Diagnostics.PerformanceCounterType.CounterMultiTimer100NsInverse; + break; + case "elapsedTime": + type = System.Diagnostics.PerformanceCounterType.ElapsedTime; + break; + case "sampleBase": + type = System.Diagnostics.PerformanceCounterType.SampleBase; + break; + case "rawBase": + type = System.Diagnostics.PerformanceCounterType.RawBase; + break; + case "counterMultiBase": + type = System.Diagnostics.PerformanceCounterType.CounterMultiBase; + break; + case "rateOfCountsPerSecond64": + type = System.Diagnostics.PerformanceCounterType.RateOfCountsPerSecond64; + break; + case "rateOfCountsPerSecond32": + type = System.Diagnostics.PerformanceCounterType.RateOfCountsPerSecond32; + break; + case "countPerTimeInterval64": + type = System.Diagnostics.PerformanceCounterType.CountPerTimeInterval64; + break; + case "countPerTimeInterval32": + type = System.Diagnostics.PerformanceCounterType.CountPerTimeInterval32; + break; + case "sampleCounter": + type = System.Diagnostics.PerformanceCounterType.SampleCounter; + break; + case "counterDelta64": + type = System.Diagnostics.PerformanceCounterType.CounterDelta64; + break; + case "numberOfItems64": + type = System.Diagnostics.PerformanceCounterType.NumberOfItems64; + break; + case "numberOfItems32": + type = System.Diagnostics.PerformanceCounterType.NumberOfItems32; + break; + case "numberOfItemsHEX64": + type = System.Diagnostics.PerformanceCounterType.NumberOfItemsHEX64; + break; + case "numberOfItemsHEX32": + type = System.Diagnostics.PerformanceCounterType.NumberOfItemsHEX32; + break; + default: + this.Messaging.Write(ErrorMessages.IllegalEmptyAttributeValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName)); + break; + } + } + + return type; + } + + /// + /// Parses a perf counter element. + /// + /// Element to parse. + /// Identifier of parent component. + /// Identifier of referenced file. + private void ParsePerfCounterElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, string fileId) + { + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); + string name = null; + + this.Messaging.Write(UtilWarnings.DeprecatedPerfCounterElement(sourceLineNumbers)); + + foreach (XAttribute attrib in element.Attributes()) + { + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) + { + switch (attrib.Name.LocalName) + { + case "Name": + name = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + default: + this.ParseHelper.UnexpectedAttribute(element, attrib); + break; + } + } + else + { + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib); + } + } + + if (null == name) + { + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Name")); + } + + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); + + if (!this.Messaging.EncounteredError) + { + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "Perfmon"); + row.Set(0, componentId); + row.Set(1, $"[#{fileId}]"); + row.Set(2, name); + } + + // Reference ConfigurePerfmonInstall and ConfigurePerfmonUninstall since nothing will happen without them + if (this.Context.Platform == Platform.ARM) + { + // Ensure ARM version of the CAs are referenced + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigurePerfmonInstall_ARM"); + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigurePerfmonUninstall_ARM"); + } + else + { + // All other supported platforms use x86 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigurePerfmonInstall"); + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigurePerfmonUninstall"); + } + } + + + /// + /// Parses a perf manifest element. + /// + /// Element to parse. + /// Identifier of parent component. + /// Identifier of referenced file. + private void ParsePerfCounterManifestElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, string fileId) + { + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); + string resourceFileDirectory = null; + + foreach (XAttribute attrib in element.Attributes()) + { + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) + { + switch (attrib.Name.LocalName) + { + case "ResourceFileDirectory": + resourceFileDirectory = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + default: + this.ParseHelper.UnexpectedAttribute(element, attrib); + break; + } + } + else + { + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib); + } + } + + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); + + if (!this.Messaging.EncounteredError) + { + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "PerfmonManifest"); + row.Set(0, componentId); + row.Set(1, $"[#{fileId}]"); + row.Set(2, resourceFileDirectory); + } + + if (this.Context.Platform == Platform.ARM) + { + // Ensure ARM version of the CAs are referenced + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigurePerfmonManifestRegister_ARM"); + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigurePerfmonManifestUnregister_ARM"); + } + else + { + // All other supported platforms use x86 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigurePerfmonManifestRegister"); + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigurePerfmonManifestUnregister"); + } + } + + /// + /// Parses a format files element. + /// + /// Element to parse. + /// Identifier of referenced file. + /// Flag to determine whether the component is 64-bit. + private void ParseFormatFileElement(Intermediate intermediate, IntermediateSection section, XElement element, string fileId, bool win64) + { + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); + string binaryId = null; + + foreach (XAttribute attrib in element.Attributes()) + { + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) + { + switch (attrib.Name.LocalName) + { + case "BinaryKey": + binaryId = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + default: + this.ParseHelper.UnexpectedAttribute(element, attrib); + break; + } + } + else + { + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib); + } + } + + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); + + if (null == binaryId) + { + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "BinaryKey")); + } + + if (!this.Messaging.EncounteredError) + { + switch (this.Context.Platform) + { + case Platform.X86: + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixSchedFormatFiles"); + break; + case Platform.X64: + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixSchedFormatFiles_x64"); + break; + case Platform.IA64: + case Platform.ARM: + this.Messaging.Write(ErrorMessages.UnsupportedPlatformForElement(sourceLineNumbers, this.Context.Platform.ToString(), element.Name.LocalName)); + break; + } + + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixFormatFiles"); + row.Set(0, binaryId); + row.Set(1, fileId); + + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "Binary", binaryId); + } + } + + /// + /// Parses a event manifest element. + /// + /// Element to parse. + /// Identifier of parent component. + /// Identifier of referenced file. + private void ParseEventManifestElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, string fileId) + { + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); + string messageFile = null; + string resourceFile = null; + string parameterFile = null; + + foreach (XAttribute attrib in element.Attributes()) + { + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) + { + switch (attrib.Name.LocalName) + { + case "MessageFile": + messageFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "ResourceFile": + resourceFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "ParameterFile": + parameterFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + default: + this.ParseHelper.UnexpectedAttribute(element, attrib); + break; + } + } + else + { + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib); + } + } + + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); + + if (!this.Messaging.EncounteredError) + { + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "EventManifest"); + row.Set(0, componentId); + row.Set(1, $"[#{fileId}]"); + + if (null != messageFile) + { + var messageRow = this.ParseHelper.CreateRow(section, sourceLineNumbers, "XmlFile"); + messageRow.Set(0, String.Concat("Config_", fileId, "MessageFile")); + messageRow.Set(1, $"[#{fileId}]"); + messageRow.Set(2, "/*/*/*/*[\\[]@messageFileName[\\]]"); + messageRow.Set(3, "messageFileName"); + messageRow.Set(4, messageFile); + messageRow.Set(5, 4 | 0x00001000); //bulk write | preserve modified date + messageRow.Set(6, componentId); + } + if (null != parameterFile) + { + var resourceRow = this.ParseHelper.CreateRow(section, sourceLineNumbers, "XmlFile"); + resourceRow.Set(0, String.Concat("Config_", fileId, "ParameterFile")); + resourceRow.Set(1, $"[#{fileId}]"); + resourceRow.Set(2, "/*/*/*/*[\\[]@parameterFileName[\\]]"); + resourceRow.Set(3, "parameterFileName"); + resourceRow.Set(4, parameterFile); + resourceRow.Set(5, 4 | 0x00001000); //bulk write | preserve modified date + resourceRow.Set(6, componentId); + } + if (null != resourceFile) + { + var resourceRow = this.ParseHelper.CreateRow(section, sourceLineNumbers, "XmlFile"); + resourceRow.Set(0, String.Concat("Config_", fileId, "ResourceFile")); + resourceRow.Set(1, $"[#{fileId}]"); + resourceRow.Set(2, "/*/*/*/*[\\[]@resourceFileName[\\]]"); + resourceRow.Set(3, "resourceFileName"); + resourceRow.Set(4, resourceFile); + resourceRow.Set(5, 4 | 0x00001000); //bulk write | preserve modified date + resourceRow.Set(6, componentId); + } + + } + + if (this.Context.Platform == Platform.ARM) + { + // Ensure ARM version of the CA is referenced + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigureEventManifestRegister_ARM"); + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigureEventManifestUnregister_ARM"); + } + else + { + // All other supported platforms use x86 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigureEventManifestRegister"); + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigureEventManifestUnregister"); + } + + if (null != messageFile || null != parameterFile || null != resourceFile) + { + if (this.Context.Platform == Platform.ARM) + { + // Ensure ARM version of the CA is referenced + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedXmlFile_ARM"); + } + else + { + // All other supported platforms use x86 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedXmlFile"); + } + } + } + + /// + /// Parses a PermissionEx element. + /// + /// Element to parse. + /// Identifier of object to be secured. + /// Identifier of component, used to determine install state. + /// Flag to determine whether the component is 64-bit. + /// Name of table that contains objectId. + private void ParsePermissionExElement(Intermediate intermediate, IntermediateSection section, XElement element, string objectId, string componentId, bool win64, string tableName) + { + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); + BitArray bits = new BitArray(32); + string domain = null; + int permission = 0; + string[] specialPermissions = null; + string user = null; + + PermissionType permissionType = PermissionType.SecureObjects; + + switch (tableName) + { + case "CreateFolder": + specialPermissions = UtilConstants.FolderPermissions; + break; + case "File": + specialPermissions = UtilConstants.FilePermissions; + break; + case "Registry": + specialPermissions = UtilConstants.RegistryPermissions; + if (String.IsNullOrEmpty(objectId)) + { + this.Messaging.Write(UtilErrors.InvalidRegistryObject(sourceLineNumbers, element.Parent.Name.LocalName)); + } + break; + case "ServiceInstall": + specialPermissions = UtilConstants.ServicePermissions; + permissionType = PermissionType.SecureObjects; + break; + default: + this.ParseHelper.UnexpectedElement(element.Parent, element); + break; + } + + foreach (XAttribute attrib in element.Attributes()) + { + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) + { + switch (attrib.Name.LocalName) + { + case "Domain": + if (PermissionType.FileSharePermissions == permissionType) + { + this.Messaging.Write(ErrorMessages.IllegalAttributeWhenNested(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName, element.Parent.Name.LocalName)); + } + domain = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "User": + user = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + default: + YesNoType attribValue = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib); + if (!this.TrySetBitFromName(UtilConstants.StandardPermissions, attrib.Name.LocalName, attribValue, bits, 16)) + { + if (!this.TrySetBitFromName(UtilConstants.GenericPermissions, attrib.Name.LocalName, attribValue, bits, 28)) + { + if (!this.TrySetBitFromName(specialPermissions, attrib.Name.LocalName, attribValue, bits, 0)) + { + this.ParseHelper.UnexpectedAttribute(element, attrib); + break; + } + } + } + break; + } + } + else + { + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib); + } + } + + permission = this.CreateIntegerFromBitArray(bits); + + if (null == user) + { + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "User")); + } + + if (int.MinValue == permission) // just GENERIC_READ, which is MSI_NULL + { + this.Messaging.Write(ErrorMessages.GenericReadNotAllowed(sourceLineNumbers)); + } + + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); + + if (!this.Messaging.EncounteredError) + { + if (win64) + { + if (this.Context.Platform == Platform.IA64) + { + this.Messaging.Write(ErrorMessages.UnsupportedPlatformForElement(sourceLineNumbers, "ia64", element.Name.LocalName)); + } + else + { + // Ensure SchedSecureObjects (x64) is referenced + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedSecureObjects_x64"); + } + } + else if (this.Context.Platform == Platform.ARM) + { + // Ensure SchedSecureObjects (arm) is referenced + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedSecureObjects_ARM"); + } + else + { + // Ensure SchedSecureObjects (x86) is referenced, to handle this x86 component member + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedSecureObjects"); + } + + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "SecureObjects"); + row.Set(0, objectId); + row.Set(1, tableName); + row.Set(2, domain); + row.Set(3, user); + row.Set(4, permission); + row.Set(5, componentId); + } + } + + /// + /// Parses a ProductSearch element. + /// + /// Element to parse. + private void ParseProductSearchElement(Intermediate intermediate, IntermediateSection section, XElement element) + { + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); + Identifier id = null; + string variable = null; + string condition = null; + string after = null; + string productCode = null; + string upgradeCode = null; + + Serialize.ProductSearch.ResultType result = Serialize.ProductSearch.ResultType.NotSet; + + foreach (XAttribute attrib in element.Attributes()) + { + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) + { + switch (attrib.Name.LocalName) + { + case "Id": + case "Variable": + case "Condition": + case "After": + this.ParseCommonSearchAttributes(sourceLineNumbers, attrib, ref id, ref variable, ref condition, ref after); + break; + case "ProductCode": + productCode = this.ParseHelper.GetAttributeGuidValue(sourceLineNumbers, attrib, false); + break; + case "UpgradeCode": + upgradeCode = this.ParseHelper.GetAttributeGuidValue(sourceLineNumbers, attrib, false); + break; + case "Result": + string resultValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + if (!Serialize.ProductSearch.TryParseResultType(resultValue, out result)) + { + this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, attrib.Parent.Name.LocalName, attrib.Name.LocalName, + resultValue, + Serialize.ProductSearch.ResultType.version.ToString(), + Serialize.ProductSearch.ResultType.language.ToString(), + Serialize.ProductSearch.ResultType.state.ToString(), + Serialize.ProductSearch.ResultType.assignment.ToString())); + } + break; + default: + this.ParseHelper.UnexpectedAttribute(element, attrib); + break; + } + } + else + { + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib); + } + } + + if (null == variable) + { + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Variable")); + } + + if (null == upgradeCode && null == productCode) + { + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "ProductCode", "UpgradeCode", true)); + } + + if (null != upgradeCode && null != productCode) + { + this.Messaging.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, element.Name.LocalName, "UpgradeCode", "ProductCode")); + } + + if (null == id) + { + id = this.ParseHelper.CreateIdentifier("wps", variable, condition, after, (productCode == null ? upgradeCode : productCode), result.ToString()); + } + + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); + + if (!this.Messaging.EncounteredError) + { + this.CreateWixSearchRow(section, sourceLineNumbers, id, variable, condition); + if (after != null) + { + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "WixSearch", after); + // TODO: We're currently defaulting to "always run after", which we will need to change... + this.CreateWixSearchRelationRow(section, sourceLineNumbers, id, after, 2); + } + + WixProductSearchAttributes attributes = WixProductSearchAttributes.Version; + switch (result) + { + case Serialize.ProductSearch.ResultType.version: + attributes = WixProductSearchAttributes.Version; + break; + case Serialize.ProductSearch.ResultType.language: + attributes = WixProductSearchAttributes.Language; + break; + case Serialize.ProductSearch.ResultType.state: + attributes = WixProductSearchAttributes.State; + break; + case Serialize.ProductSearch.ResultType.assignment: + attributes = WixProductSearchAttributes.Assignment; + break; + } + + // set an additional flag if this is an upgrade code + if (null != upgradeCode) + { + attributes |= WixProductSearchAttributes.UpgradeCode; + } + + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixProductSearch"); + row.Set(0, id); + row.Set(1, productCode ?? upgradeCode); + row.Set(2, (int)attributes); + } + } + + /// + /// Parses a RegistrySearch element. + /// + /// Element to parse. + private void ParseRegistrySearchElement(Intermediate intermediate, IntermediateSection section, XElement element) + { + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); + Identifier id = null; + string variable = null; + string condition = null; + string after = null; + int root = CompilerConstants.IntegerNotSet; + string key = null; + string value = null; + YesNoType expand = YesNoType.NotSet; + YesNoType win64 = YesNoType.NotSet; + Serialize.RegistrySearch.ResultType result = Serialize.RegistrySearch.ResultType.NotSet; + Serialize.RegistrySearch.FormatType format = Serialize.RegistrySearch.FormatType.raw; + + foreach (XAttribute attrib in element.Attributes()) + { + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) + { + switch (attrib.Name.LocalName) + { + case "Id": + case "Variable": + case "Condition": + case "After": + this.ParseCommonSearchAttributes(sourceLineNumbers, attrib, ref id, ref variable, ref condition, ref after); + break; + case "Root": + root = this.ParseHelper.GetAttributeMsidbRegistryRootValue(sourceLineNumbers, attrib, false); + break; + case "Key": + key = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "Value": + value = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "ExpandEnvironmentVariables": + expand = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib); + break; + case "Format": + string formatValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + if (!String.IsNullOrEmpty(formatValue)) + { + if (!Serialize.RegistrySearch.TryParseFormatType(formatValue, out format)) + { + this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, attrib.Parent.Name.LocalName, attrib.Name.LocalName, + formatValue, Serialize.RegistrySearch.FormatType.raw.ToString(), Serialize.RegistrySearch.FormatType.compatible.ToString())); + } + } + break; + case "Result": + string resultValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + if (!Serialize.RegistrySearch.TryParseResultType(resultValue, out result)) + { + this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, attrib.Parent.Name.LocalName, attrib.Name.LocalName, + resultValue, Serialize.RegistrySearch.ResultType.exists.ToString(), Serialize.RegistrySearch.ResultType.value.ToString())); + } + break; + case "Win64": + win64 = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib); + break; + default: + this.ParseHelper.UnexpectedAttribute(element, attrib); + break; + } + } + else + { + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib); + } + } + + if (null == variable) + { + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Variable")); + } + + if (CompilerConstants.IntegerNotSet == root) + { + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Root")); + } + + if (null == key) + { + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Key")); + } + + if (Serialize.RegistrySearch.ResultType.NotSet == result) + { + result = Serialize.RegistrySearch.ResultType.value; + } + + if (null == id) + { + id = this.ParseHelper.CreateIdentifier("wrs", variable, condition, after, root.ToString(), key, value, result.ToString()); + } + + WixRegistrySearchAttributes attributes = WixRegistrySearchAttributes.Raw; + switch (format) + { + case Serialize.RegistrySearch.FormatType.raw: + attributes = WixRegistrySearchAttributes.Raw; + break; + case Serialize.RegistrySearch.FormatType.compatible: + attributes = WixRegistrySearchAttributes.Compatible; + break; + } + + switch (result) + { + case Serialize.RegistrySearch.ResultType.exists: + attributes |= WixRegistrySearchAttributes.WantExists; + break; + case Serialize.RegistrySearch.ResultType.value: + attributes |= WixRegistrySearchAttributes.WantValue; + break; + } + + if (expand == YesNoType.Yes) + { + if (0 != (attributes & WixRegistrySearchAttributes.WantExists)) + { + this.Messaging.Write(ErrorMessages.IllegalAttributeValueWithOtherAttribute(sourceLineNumbers, element.Name.LocalName, + "ExpandEnvironmentVariables", expand.ToString(), "Result", result.ToString())); + } + + attributes |= WixRegistrySearchAttributes.ExpandEnvironmentVariables; + } + + if (win64 == YesNoType.Yes) + { + attributes |= WixRegistrySearchAttributes.Win64; + } + + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); + + if (!this.Messaging.EncounteredError) + { + this.CreateWixSearchRow(section, sourceLineNumbers, id, variable, condition); + if (after != null) + { + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "WixSearch", after); + // TODO: We're currently defaulting to "always run after", which we will need to change... + this.CreateWixSearchRelationRow(section, sourceLineNumbers, id, after, 2); + } + + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixRegistrySearch", id); + row.Set(1, root); + row.Set(2, key); + row.Set(3, value); + row.Set(4, (int)attributes); + } + } + + /// + /// Parses a RemoveFolderEx element. + /// + /// Element to parse. + /// Identifier of parent component. + private void ParseRemoveFolderExElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId) + { + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); + Identifier id = null; + int on = (int)WixRemoveFolderExOn.Uninstall; + string property = null; + + foreach (XAttribute attrib in element.Attributes()) + { + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) + { + switch (attrib.Name.LocalName) + { + case "Id": + id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib); + break; + case "On": + string onValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + if (onValue.Length == 0) + { + on = CompilerConstants.IllegalInteger; + } + else + { + switch (onValue) + { + case "install": + on = (int)WixRemoveFolderExOn.Install; + break; + case "uninstall": + on = (int)WixRemoveFolderExOn.Uninstall; + break; + case "both": + on = (int)WixRemoveFolderExOn.Both; + break; + default: + this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, "On", onValue, "install", "uninstall", "both")); + on = CompilerConstants.IllegalInteger; + break; + } + } + break; + case "Property": + property = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + default: + this.ParseHelper.UnexpectedAttribute(element, attrib); + break; + } + } + else + { + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib); + } + } + + if (String.IsNullOrEmpty(property)) + { + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Property")); + } + + if (null == id) + { + id = this.ParseHelper.CreateIdentifier("wrf", componentId, property, on.ToString(CultureInfo.InvariantCulture.NumberFormat)); + } + + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); + + if (!this.Messaging.EncounteredError) + { + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixRemoveFolderEx", id); + row.Set(1, componentId); + row.Set(2, property); + row.Set(3, on); + + this.ParseHelper.EnsureTable(section, sourceLineNumbers, "RemoveFile"); + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixRemoveFoldersEx"); + } + } + + /// + /// Parses a RestartResource element. + /// + /// The element to parse. + /// The identity of the parent component. + private void ParseRestartResourceElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId) + { + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); + Identifier id = null; + string resource = null; + int attributes = CompilerConstants.IntegerNotSet; + + foreach (XAttribute attrib in element.Attributes()) + { + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) + { + switch (attrib.Name.LocalName) + { + case "Id": + id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib); + break; + + case "Path": + resource = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + attributes = (int)WixRestartResourceAttributes.Filename; + break; + + case "ProcessName": + resource = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + attributes = (int)WixRestartResourceAttributes.ProcessName; + break; + + case "ServiceName": + resource = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + attributes = (int)WixRestartResourceAttributes.ServiceName; + break; + + default: + this.ParseHelper.UnexpectedAttribute(element, attrib); + break; + } + } + else + { + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib); + } + } + + // Validate the attribute. + if (null == id) + { + id = this.ParseHelper.CreateIdentifier("wrr", componentId, resource, attributes.ToString()); + } + + if (String.IsNullOrEmpty(resource) || CompilerConstants.IntegerNotSet == attributes) + { + this.Messaging.Write(ErrorMessages.ExpectedAttributes(sourceLineNumbers, element.Name.LocalName, "Path", "ServiceName")); + } + + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); + + if (!this.Messaging.EncounteredError) + { + // Add a reference to the WixRegisterRestartResources custom action since nothing will happen without it. + if (this.Context.Platform == Platform.ARM) + { + // Ensure ARM version of the CA is referenced + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixRegisterRestartResources_ARM"); + } + else + { + // All other supported platforms use x86 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixRegisterRestartResources"); + } + + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixRestartResource", id); + row.Set(1, componentId); + row.Set(2, resource); + row.Set(3, attributes); + } + } + + /// + /// Parses a service configuration element. + /// + /// Element to parse. + /// Identifier of parent component. + /// Name of parent element. + /// Optional name of service + private void ParseServiceConfigElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, string parentTableName, string parentTableServiceName) + { + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); + string firstFailureActionType = null; + bool newService = false; + string programCommandLine = null; + string rebootMessage = null; + int resetPeriod = CompilerConstants.IntegerNotSet; + int restartServiceDelay = CompilerConstants.IntegerNotSet; + string secondFailureActionType = null; + string serviceName = null; + string thirdFailureActionType = null; + + foreach (XAttribute attrib in element.Attributes()) + { + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) + { + switch (attrib.Name.LocalName) + { + case "FirstFailureActionType": + firstFailureActionType = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "ProgramCommandLine": + programCommandLine = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "RebootMessage": + rebootMessage = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "ResetPeriodInDays": + resetPeriod = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, int.MaxValue); + break; + case "RestartServiceDelayInSeconds": + restartServiceDelay = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, int.MaxValue); + break; + case "SecondFailureActionType": + secondFailureActionType = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "ServiceName": + serviceName = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "ThirdFailureActionType": + thirdFailureActionType = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + default: + this.ParseHelper.UnexpectedAttribute(element, attrib); + break; + } + } + else + { + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib); + } + } + + // if this element is a child of ServiceInstall then ignore the service name provided. + if ("ServiceInstall" == parentTableName) + { + // TODO: the ServiceName attribute should not be allowed in this case (the overwriting behavior may confuse users) + serviceName = parentTableServiceName; + newService = true; + } + else + { + // not a child of ServiceInstall, so ServiceName must have been provided + if (null == serviceName) + { + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "ServiceName")); + } + } + + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); + + // Reference SchedServiceConfig since nothing will happen without it + if (this.Context.Platform == Platform.ARM) + { + // Ensure ARM version of the CA is referenced + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedServiceConfig_ARM"); + } + else + { + // All other supported platforms use x86 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedServiceConfig"); + } + + if (!this.Messaging.EncounteredError) + { + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "ServiceConfig"); + row.Set(0, serviceName); + row.Set(1, componentId); + row.Set(2, (newService ? 1 : 0)); + row.Set(3, firstFailureActionType); + row.Set(4, secondFailureActionType); + row.Set(5, thirdFailureActionType); + if (CompilerConstants.IntegerNotSet != resetPeriod) + { + row.Set(6, resetPeriod); + } + + if (CompilerConstants.IntegerNotSet != restartServiceDelay) + { + row.Set(7, restartServiceDelay); + } + row.Set(8, programCommandLine); + row.Set(9, rebootMessage); + } + } + + /// + /// Parses a touch file element. + /// + /// Element to parse. + /// Identifier of parent component. + /// Indicates whether the path is a 64-bit path. + private void ParseTouchFileElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, bool win64) + { + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); + Identifier id = null; + string path = null; + YesNoType onInstall = YesNoType.NotSet; + YesNoType onReinstall = YesNoType.NotSet; + YesNoType onUninstall = YesNoType.NotSet; + YesNoType nonvital = YesNoType.NotSet; + int attributes = 0; + + foreach (XAttribute attrib in element.Attributes()) + { + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) + { + switch (attrib.Name.LocalName) + { + case "Id": + id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib); + break; + case "Path": + path = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "OnInstall": + onInstall = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib); + break; + case "OnReinstall": + onReinstall = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib); + break; + case "OnUninstall": + onUninstall = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib); + break; + case "Nonvital": + nonvital = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib); + break; + default: + this.ParseHelper.UnexpectedAttribute(element, attrib); + break; + } + } + else + { + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib); + } + } + + if (null == path) + { + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Path")); + } + + // If none of the scheduling actions are set, default to touching on install and reinstall. + if (YesNoType.NotSet == onInstall && YesNoType.NotSet == onReinstall && YesNoType.NotSet == onUninstall) + { + onInstall = YesNoType.Yes; + onReinstall = YesNoType.Yes; + } + + attributes |= YesNoType.Yes == onInstall ? 0x1 : 0; + attributes |= YesNoType.Yes == onReinstall ? 0x2 : 0; + attributes |= YesNoType.Yes == onUninstall ? 0x4 : 0; + attributes |= win64 ? 0x10 : 0; + attributes |= YesNoType.Yes == nonvital ? 0 : 0x20; + + if (null == id) + { + id = this.ParseHelper.CreateIdentifier("tf", path, attributes.ToString()); + } + + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); + + if (!this.Messaging.EncounteredError) + { + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixTouchFile", id); + row.Set(1, componentId); + row.Set(2, path); + row.Set(3, attributes); + + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixTouchFileDuringInstall"); + } + } + + /// + /// Parses an user element. + /// + /// Element to parse. + /// Optional identifier of parent component. + private void ParseUserElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId) + { + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); + Identifier id = null; + int attributes = 0; + string domain = null; + string name = null; + string password = null; + + foreach (XAttribute attrib in element.Attributes()) + { + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) + { + switch (attrib.Name.LocalName) + { + case "Id": + id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib); + break; + case "CanNotChangePassword": + if (null == componentId) + { + this.Messaging.Write(UtilErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName)); + } + + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + { + attributes |= UserPasswdCantChange; + } + break; + case "CreateUser": + if (null == componentId) + { + this.Messaging.Write(UtilErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName)); + } + + if (YesNoType.No == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + { + attributes |= UserDontCreateUser; + } + break; + case "Disabled": + if (null == componentId) + { + this.Messaging.Write(UtilErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName)); + } + + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + { + attributes |= UserDisableAccount; + } + break; + case "Domain": + domain = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "FailIfExists": + if (null == componentId) + { + this.Messaging.Write(UtilErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName)); + } + + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + { + attributes |= UserFailIfExists; + } + break; + case "LogonAsService": + if (null == componentId) + { + this.Messaging.Write(UtilErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName)); + } + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + { + attributes |= UserLogonAsService; + } + break; + case "LogonAsBatchJob": + if (null == componentId) + { + this.Messaging.Write(UtilErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName)); + } + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + { + attributes |= UserLogonAsBatchJob; + } + break; + case "Name": + name = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "Password": + password = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "PasswordExpired": + if (null == componentId) + { + this.Messaging.Write(UtilErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName)); + } + + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + { + attributes |= UserPasswdChangeReqdOnLogin; + } + break; + case "PasswordNeverExpires": + if (null == componentId) + { + this.Messaging.Write(UtilErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName)); + } + + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + { + attributes |= UserDontExpirePasswrd; + } + break; + case "RemoveOnUninstall": + if (null == componentId) + { + this.Messaging.Write(UtilErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName)); + } + + if (YesNoType.No == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + { + attributes |= UserDontRemoveOnUninstall; + } + break; + case "UpdateIfExists": + if (null == componentId) + { + this.Messaging.Write(UtilErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName)); + } + + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + { + attributes |= UserUpdateIfExists; + } + break; + case "Vital": + if (null == componentId) + { + this.Messaging.Write(UtilErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName)); + } + + if (YesNoType.No == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + { + attributes |= UserNonVital; + } + break; + default: + this.ParseHelper.UnexpectedAttribute(element, attrib); + break; + } + } + else + { + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib); + } + } + + if (null == id) + { + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Id")); + } + + if (null == name) + { + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Name")); + } + + foreach (XElement child in element.Elements()) + { + if (this.Namespace == child.Name.Namespace) + { + switch (child.Name.LocalName) + { + case "GroupRef": + if (null == componentId) + { + SourceLineNumber childSourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(child); + this.Messaging.Write(UtilErrors.IllegalElementWithoutComponent(childSourceLineNumbers, child.Name.LocalName)); + } + + this.ParseGroupRefElement(intermediate, section, child, id.Id); + break; + default: + this.ParseHelper.UnexpectedElement(element, child); + break; + } + } + else + { + this.ParseHelper.ParseExtensionElement(this.Context.Extensions, intermediate, section, element, child); + } + } + + if (null != componentId) + { + // Reference ConfigureIIs since nothing will happen without it + if (this.Context.Platform == Platform.ARM) + { + // Ensure ARM version of the CA is referenced + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigureUsers_ARM"); + } + else + { + // All other supported platforms use x86 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigureUsers"); + } + } + + if (!this.Messaging.EncounteredError) + { + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "User", id); + row.Set(1, componentId); + row.Set(2, name); + row.Set(3, domain); + row.Set(4, password); + row.Set(5, attributes); + } + } + + /// + /// Parses a XmlFile element. + /// + /// Element to parse. + /// Identifier of parent component. + private void ParseXmlFileElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId) + { + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); + string id = null; + string file = null; + string elementPath = null; + string name = null; + string value = null; + int sequence = -1; + int flags = 0; + + foreach (XAttribute attrib in element.Attributes()) + { + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) + { + switch (attrib.Name.LocalName) + { + case "Action": + string actionValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + switch (actionValue) + { + case "createElement": + flags |= 0x00000001; // XMLFILE_CREATE_ELEMENT + break; + case "deleteValue": + flags |= 0x00000002; // XMLFILE_DELETE_VALUE + break; + case "bulkSetValue": + flags |= 0x00000004; // XMLFILE_BULKWRITE_VALUE + break; + case "setValue": + // no flag for set value since it's the default + break; + default: + this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, "Action", actionValue, "createElement", "deleteValue", "setValue", "bulkSetValue")); + break; + } + break; + case "SelectionLanguage": + string selectionLanguage = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + switch (selectionLanguage) + { + case "XPath": + flags |= 0x00000100; // XMLFILE_USE_XPATH + break; + case "XSLPattern": + // no flag for since it's the default + break; + default: + this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, "SelectionLanguage", selectionLanguage, "XPath", "XSLPattern")); + break; + } + break; + case "Id": + id = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); + break; + case "File": + file = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "ElementPath": + elementPath = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "Name": + name = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "Permanent": + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + { + flags |= 0x00010000; // XMLFILE_DONT_UNINSTALL + } + break; + case "Sequence": + sequence = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 1, short.MaxValue); + break; + case "Value": + value = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "PreserveModifiedDate": + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + { + flags |= 0x00001000; // XMLFILE_PRESERVE_MODIFIED + } + break; + default: + this.ParseHelper.UnexpectedAttribute(element, attrib); + break; + } + } + else + { + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib); + } + } + + if (null == id) + { + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Id")); + } + + if (null == file) + { + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "File")); + } + + if (null == elementPath) + { + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "ElementPath")); + } + + if ((0x00000001 /*XMLFILE_CREATE_ELEMENT*/ & flags) != 0 && null == name) + { + this.Messaging.Write(ErrorMessages.IllegalAttributeWithoutOtherAttributes(sourceLineNumbers, element.Name.LocalName, "Action", "Name")); + } + + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); + + if (!this.Messaging.EncounteredError) + { + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "XmlFile"); + row.Set(0, id); + row.Set(1, file); + row.Set(2, elementPath); + row.Set(3, name); + row.Set(4, value); + row.Set(5, flags); + row.Set(6, componentId); + if (-1 != sequence) + { + row.Set(7, sequence); + } + } + + // Reference SchedXmlFile since nothing will happen without it + if (this.Context.Platform == Platform.ARM) + { + // Ensure ARM version of the CA is referenced + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedXmlFile_ARM"); + } + else + { + // All other supported platforms use x86 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedXmlFile"); + } + } + + /// + /// Parses a XmlConfig element. + /// + /// Element to parse. + /// Identifier of parent component. + /// Whether or not the element is nested. + private void ParseXmlConfigElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, bool nested) + { + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); + string id = null; + string elementId = null; + string elementPath = null; + int flags = 0; + string file = null; + string name = null; + int sequence = CompilerConstants.IntegerNotSet; + string value = null; + string verifyPath = null; + + foreach (XAttribute attrib in element.Attributes()) + { + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) + { + switch (attrib.Name.LocalName) + { + case "Id": + id = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); + break; + case "Action": + if (nested) + { + this.Messaging.Write(ErrorMessages.IllegalAttributeWhenNested(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName, element.Parent.Name.LocalName)); + } + else + { + string actionValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + switch (actionValue) + { + case "create": + flags |= 0x10; // XMLCONFIG_CREATE + break; + case "delete": + flags |= 0x20; // XMLCONFIG_DELETE + break; + default: + this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName, actionValue, "create", "delete")); + break; + } + } + break; + case "ElementId": + elementId = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "ElementPath": + elementPath = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "File": + file = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "Name": + name = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "Node": + if (nested) + { + this.Messaging.Write(ErrorMessages.IllegalAttributeWhenNested(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName, element.Parent.Name.LocalName)); + } + else + { + string nodeValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + switch (nodeValue) + { + case "element": + flags |= 0x1; // XMLCONFIG_ELEMENT + break; + case "value": + flags |= 0x2; // XMLCONFIG_VALUE + break; + case "document": + flags |= 0x4; // XMLCONFIG_DOCUMENT + break; + default: + this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName, nodeValue, "element", "value", "document")); + break; + } + } + break; + case "On": + if (nested) + { + this.Messaging.Write(ErrorMessages.IllegalAttributeWhenNested(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName, element.Parent.Name.LocalName)); + } + else + { + string onValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + switch (onValue) + { + case "install": + flags |= 0x100; // XMLCONFIG_INSTALL + break; + case "uninstall": + flags |= 0x200; // XMLCONFIG_UNINSTALL + break; + default: + this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName, onValue, "install", "uninstall")); + break; + } + } + break; + case "PreserveModifiedDate": + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + { + flags |= 0x00001000; // XMLCONFIG_PRESERVE_MODIFIED + } + break; + case "Sequence": + sequence = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 1, short.MaxValue); + break; + case "Value": + value = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "VerifyPath": + verifyPath = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + default: + this.ParseHelper.UnexpectedAttribute(element, attrib); + break; + } + } + else + { + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib); + } + } + + if (null == id) + { + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Id")); + } + + if (null == file) + { + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "File")); + } + + if (null == elementId && null == elementPath) + { + this.Messaging.Write(ErrorMessages.ExpectedAttributes(sourceLineNumbers, element.Name.LocalName, "ElementId", "ElementPath")); + } + else if (null != elementId) + { + if (null != elementPath) + { + this.Messaging.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, element.Name.LocalName, "ElementId", "ElementPath")); + } + + if (0 != flags) + { + this.Messaging.Write(ErrorMessages.IllegalAttributeWithOtherAttributes(sourceLineNumbers, element.Name.LocalName, "ElementId", "Action", "Node", "On")); + } + + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "XmlConfig", elementId); + } + + string innerText = this.ParseHelper.GetTrimmedInnerText(element); + if (null != value) + { + // cannot specify both the value attribute and inner text + if (!String.IsNullOrEmpty(innerText)) + { + this.Messaging.Write(ErrorMessages.IllegalAttributeWithInnerText(sourceLineNumbers, element.Name.LocalName, "Value")); + } + } + else // value attribute not specified + { + if (!String.IsNullOrEmpty(innerText)) + { + value = innerText; + } + } + + // find unexpected child elements + foreach (XElement child in element.Elements()) + { + if (this.Namespace == child.Name.Namespace) + { + switch (child.Name.LocalName) + { + case "XmlConfig": + if (nested) + { + this.Messaging.Write(ErrorMessages.UnexpectedElement(sourceLineNumbers, element.Name.LocalName, child.Name.LocalName)); + } + else + { + this.ParseXmlConfigElement(intermediate, section, child, componentId, true); + } + break; + default: + this.ParseHelper.UnexpectedElement(element, child); + break; + } + } + else + { + this.ParseHelper.ParseExtensionElement(this.Context.Extensions, intermediate, section, element, child); + } + } + + if (!this.Messaging.EncounteredError) + { + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "XmlConfig"); + row.Set(0, id); + row.Set(1, file); + row.Set(2, elementId ?? elementPath); + row.Set(3, verifyPath); + row.Set(4, name); + row.Set(5, value); + row.Set(6, flags); + row.Set(7, componentId); + if (CompilerConstants.IntegerNotSet != sequence) + { + row.Set(8, sequence); + } + } + + // Reference SchedXmlConfig since nothing will happen without it + if (this.Context.Platform == Platform.ARM) + { + // Ensure ARM version of the CA is referenced + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedXmlConfig_ARM"); + } + else + { + // All other supported platforms use x86 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedXmlConfig"); + } + } + + /// + /// Match evaluator to escape properties in a string. + /// + private string EscapeProperties(Match match) + { + string escape = null; + switch (match.Value) + { + case "[": + escape = @"[\[]"; + break; + case "]": + escape = @"[\]]"; + break; + } + + return escape; + } + + private int CreateIntegerFromBitArray(BitArray bits) + { + if (32 != bits.Length) + { + throw new ArgumentException(String.Format("Can only convert a bit array with 32-bits to integer. Actual number of bits in array: {0}", bits.Length), "bits"); + } + + int[] intArray = new int[1]; + bits.CopyTo(intArray, 0); + + return intArray[0]; + } + + private bool TrySetBitFromName(string[] attributeNames, string attributeName, YesNoType attributeValue, BitArray bits, int offset) + { + for (int i = 0; i < attributeNames.Length; i++) + { + if (attributeName.Equals(attributeNames[i], StringComparison.Ordinal)) + { + bits.Set(i + offset, YesNoType.Yes == attributeValue); + return true; + } + } + + return false; + } + + /// + /// Private class that stores the data from a parsed PerformanceCounter element. + /// + private class ParsedPerformanceCounter + { + string name; + string help; + int type; + string language; + + internal ParsedPerformanceCounter(string name, string help, System.Diagnostics.PerformanceCounterType type, int language) + { + this.name = name; + this.help = help; + this.type = (int)type; + this.language = language.ToString("D3", CultureInfo.InvariantCulture); + } + + internal string Name + { + get { return this.name; } + } + + internal string Help + { + get { return this.help; } + } + + internal int Type + { + get { return this.type; } + } + + internal string Language + { + get { return this.language; } + } + } + } +} diff --git a/src/wixext/UtilConstants.cs b/src/wixext/UtilConstants.cs new file mode 100644 index 0000000..28ff368 --- /dev/null +++ b/src/wixext/UtilConstants.cs @@ -0,0 +1,17 @@ +// 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 +{ + /// + /// Constants used by Utility Extension. + /// + internal static class UtilConstants + { + 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" }; + } +} diff --git a/src/wixext/UtilDecompiler.cs b/src/wixext/UtilDecompiler.cs new file mode 100644 index 0000000..9ef3390 --- /dev/null +++ b/src/wixext/UtilDecompiler.cs @@ -0,0 +1,1543 @@ +// 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.Extensions +{ +#if TODO_CONSIDER_DECOMPILER + using System; + using System.IO; + using System.Text; + using System.Collections; + using System.Diagnostics; + using System.Globalization; + + using Util = WixToolset.Extensions.Serialize.Util; + using WixToolset.Data; + using WixToolset.Extensibility; + using Wix = WixToolset.Data.Serialize; + + /// + /// The decompiler for the WiX Toolset Utility Extension. + /// + public sealed class UtilDecompiler : DecompilerExtension + { + /// + /// Creates a decompiler for Utility Extension. + /// + public UtilDecompiler() + { + this.TableDefinitions = UtilExtensionData.GetExtensionTableDefinitions(); + } + + /// + /// Get the extensions library to be removed. + /// + /// Table definitions for library. + /// Library to remove from decompiled output. + public override Library GetLibraryToRemove(TableDefinitionCollection tableDefinitions) + { + return UtilExtensionData.GetExtensionLibrary(tableDefinitions); + } + + /// + /// Called at the beginning of the decompilation of a database. + /// + /// The collection of all tables. + public override void Initialize(TableIndexedCollection tables) + { + this.CleanupSecureCustomProperties(tables); + this.CleanupInternetShortcutRemoveFileTables(tables); + } + + /// + /// Decompile the SecureCustomProperties field to PropertyRefs for known extension properties. + /// + /// + /// If we've referenced any of the suite or directory properties, add + /// a PropertyRef to refer to the Property (and associated custom action) + /// from the extension's library. Then remove the property from + /// SecureCustomExtensions property so later decompilation won't create + /// new Property elements. + /// + /// The collection of all tables. + private void CleanupSecureCustomProperties(TableIndexedCollection tables) + { + Table propertyTable = tables["Property"]; + + if (null != propertyTable) + { + foreach (Row row in propertyTable.Rows) + { + if ("SecureCustomProperties" == row[0].ToString()) + { + StringBuilder remainingProperties = new StringBuilder(); + string[] secureCustomProperties = row[1].ToString().Split(';'); + foreach (string property in secureCustomProperties) + { + if (property.StartsWith("WIX_SUITE_", StringComparison.Ordinal) || property.StartsWith("WIX_DIR_", StringComparison.Ordinal) + || property.StartsWith("WIX_ACCOUNT_", StringComparison.Ordinal)) + { + Wix.PropertyRef propertyRef = new Wix.PropertyRef(); + propertyRef.Id = property; + this.Core.RootElement.AddChild(propertyRef); + } + else + { + if (0 < remainingProperties.Length) + { + remainingProperties.Append(";"); + } + remainingProperties.Append(property); + } + } + + row[1] = remainingProperties.ToString(); + break; + } + } + } + } + + /// + /// Remove RemoveFile rows that the InternetShortcut compiler extension adds for us. + /// + /// The collection of all tables. + private void CleanupInternetShortcutRemoveFileTables(TableIndexedCollection tables) + { + // index the WixInternetShortcut table + Table wixInternetShortcutTable = tables["WixInternetShortcut"]; + Hashtable wixInternetShortcuts = new Hashtable(); + if (null != wixInternetShortcutTable) + { + foreach (Row row in wixInternetShortcutTable.Rows) + { + wixInternetShortcuts.Add(row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), row); + } + } + + // remove the RemoveFile rows with primary keys that match the WixInternetShortcut table's + Table removeFileTable = tables["RemoveFile"]; + if (null != removeFileTable) + { + for (int i = removeFileTable.Rows.Count - 1; 0 <= i; i--) + { + if (null != wixInternetShortcuts[removeFileTable.Rows[i][0]]) + { + removeFileTable.Rows.RemoveAt(i); + } + } + } + } + + /// + /// Decompiles an extension table. + /// + /// The table to decompile. + public override void DecompileTable(Table table) + { + switch (table.Name) + { + case "WixCloseApplication": + this.DecompileWixCloseApplicationTable(table); + break; + case "WixRemoveFolderEx": + this.DecompileWixRemoveFolderExTable(table); + break; + case "WixRestartResource": + this.DecompileWixRestartResourceTable(table); + break; + case "FileShare": + this.DecompileFileShareTable(table); + break; + case "FileSharePermissions": + this.DecompileFileSharePermissionsTable(table); + break; + case "WixInternetShortcut": + this.DecompileWixInternetShortcutTable(table); + break; + case "Group": + this.DecompileGroupTable(table); + break; + case "Perfmon": + this.DecompilePerfmonTable(table); + break; + case "PerfmonManifest": + this.DecompilePerfmonManifestTable(table); + break; + case "EventManifest": + this.DecompileEventManifestTable(table); + break; + case "SecureObjects": + this.DecompileSecureObjectsTable(table); + break; + case "ServiceConfig": + this.DecompileServiceConfigTable(table); + break; + case "User": + this.DecompileUserTable(table); + break; + case "UserGroup": + this.DecompileUserGroupTable(table); + break; + case "XmlConfig": + this.DecompileXmlConfigTable(table); + break; + case "XmlFile": + // XmlFile decompilation has been moved to FinalizeXmlFileTable function + break; + default: + base.DecompileTable(table); + break; + } + } + + /// + /// Finalize decompilation. + /// + /// The collection of all tables. + public override void Finish(TableIndexedCollection tables) + { + this.FinalizePerfmonTable(tables); + this.FinalizePerfmonManifestTable(tables); + this.FinalizeSecureObjectsTable(tables); + this.FinalizeServiceConfigTable(tables); + this.FinalizeXmlConfigTable(tables); + this.FinalizeXmlFileTable(tables); + this.FinalizeEventManifestTable(tables); + } + + /// + /// Decompile the WixCloseApplication table. + /// + /// The table to decompile. + private void DecompileWixCloseApplicationTable(Table table) + { + foreach (Row row in table.Rows) + { + Util.CloseApplication closeApplication = new Util.CloseApplication(); + + closeApplication.Id = (string)row[0]; + + closeApplication.Target = (string)row[1]; + + if (null != row[2]) + { + closeApplication.Description = (string)row[2]; + } + + if (null != row[3]) + { + closeApplication.Content = (string)row[3]; + } + + // set defaults + closeApplication.CloseMessage = Util.YesNoType.no; + closeApplication.RebootPrompt = Util.YesNoType.yes; + closeApplication.ElevatedCloseMessage = Util.YesNoType.no; + + if (null != row[4]) + { + int attribute = (int)row[4]; + + closeApplication.CloseMessage = (0x1 == (attribute & 0x1)) ? Util.YesNoType.yes : Util.YesNoType.no; + closeApplication.RebootPrompt = (0x2 == (attribute & 0x2)) ? Util.YesNoType.yes : Util.YesNoType.no; + closeApplication.ElevatedCloseMessage = (0x4 == (attribute & 0x4)) ? Util.YesNoType.yes : Util.YesNoType.no; + } + + if (null != row[5]) + { + closeApplication.Sequence = (int)row[5]; + } + + if (null != row[6]) + { + closeApplication.Property = (string)row[6]; + } + + this.Core.RootElement.AddChild(closeApplication); + } + } + + /// + /// Decompile the WixRemoveFolderEx table. + /// + /// The table to decompile. + private void DecompileWixRemoveFolderExTable(Table table) + { + foreach (Row row in table.Rows) + { + // Set the Id even if auto-generated previously. + Util.RemoveFolderEx removeFolder = new Util.RemoveFolderEx(); + removeFolder.Id = (string)row[0]; + removeFolder.Property = (string)row[2]; + + int installMode = (int)row[3]; + switch ((UtilCompiler.WixRemoveFolderExOn)installMode) + { + case UtilCompiler.WixRemoveFolderExOn.Install: + removeFolder.On = Util.RemoveFolderEx.OnType.install; + break; + + case UtilCompiler.WixRemoveFolderExOn.Uninstall: + removeFolder.On = Util.RemoveFolderEx.OnType.uninstall; + break; + + case UtilCompiler.WixRemoveFolderExOn.Both: + removeFolder.On = Util.RemoveFolderEx.OnType.both; + break; + + default: + this.Core.OnMessage(WixWarnings.UnrepresentableColumnValue(row.SourceLineNumbers, table.Name, "InstallMode", installMode)); + break; + } + + // Add to the appropriate Component or section element. + string componentId = (string)row[1]; + Wix.Component component = (Wix.Component)this.Core.GetIndexedElement("Component", componentId); + if (null != component) + { + component.AddChild(removeFolder); + } + else + { + this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Component_", componentId, "Component")); + } + } + } + + /// + /// Decompile the WixRestartResource table. + /// + /// The table to decompile. + private void DecompileWixRestartResourceTable(Table table) + { + foreach (Row row in table.Rows) + { + // Set the Id even if auto-generated previously. + Util.RestartResource restartResource = new Util.RestartResource(); + restartResource.Id = (string)row[0]; + + // Determine the resource type and set accordingly. + string resource = (string)row[2]; + int attributes = (int)row[3]; + UtilCompiler.WixRestartResourceAttributes type = (UtilCompiler.WixRestartResourceAttributes)(attributes & (int)UtilCompiler.WixRestartResourceAttributes.TypeMask); + + switch (type) + { + case UtilCompiler.WixRestartResourceAttributes.Filename: + restartResource.Path = resource; + break; + + case UtilCompiler.WixRestartResourceAttributes.ProcessName: + restartResource.ProcessName = resource; + break; + + case UtilCompiler.WixRestartResourceAttributes.ServiceName: + restartResource.ServiceName = resource; + break; + + default: + this.Core.OnMessage(WixWarnings.UnrepresentableColumnValue(row.SourceLineNumbers, table.Name, "Attributes", attributes)); + break; + } + + // Add to the appropriate Component or section element. + string componentId = (string)row[1]; + if (!String.IsNullOrEmpty(componentId)) + { + Wix.Component component = (Wix.Component)this.Core.GetIndexedElement("Component", componentId); + if (null != component) + { + component.AddChild(restartResource); + } + else + { + this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Component_", componentId, "Component")); + } + } + else + { + this.Core.RootElement.AddChild(restartResource); + } + } + } + + /// + /// Decompile the FileShare table. + /// + /// The table to decompile. + private void DecompileFileShareTable(Table table) + { + foreach (Row row in table.Rows) + { + Util.FileShare fileShare = new Util.FileShare(); + + fileShare.Id = (string)row[0]; + + fileShare.Name = (string)row[1]; + + if (null != row[3]) + { + fileShare.Description = (string)row[3]; + } + + // the Directory_ column is set by the parent Component + + // the User_ and Permissions columns are deprecated + + Wix.Component component = (Wix.Component)this.Core.GetIndexedElement("Component", (string)row[2]); + if (null != component) + { + component.AddChild(fileShare); + } + else + { + this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Component_", (string)row[2], "Component")); + } + this.Core.IndexElement(row, fileShare); + } + } + + /// + /// Decompile the FileSharePermissions table. + /// + /// The table to decompile. + private void DecompileFileSharePermissionsTable(Table table) + { + foreach (Row row in table.Rows) + { + Util.FileSharePermission fileSharePermission = new Util.FileSharePermission(); + + fileSharePermission.User = (string)row[1]; + + string[] specialPermissions = UtilConstants.FolderPermissions; + int permissions = (int)row[2]; + for (int i = 0; i < 32; i++) + { + if (0 != ((permissions >> i) & 1)) + { + string name = null; + + if (16 > i && specialPermissions.Length > i) + { + name = specialPermissions[i]; + } + else if (28 > i && UtilConstants.StandardPermissions.Length > (i - 16)) + { + name = UtilConstants.StandardPermissions[i - 16]; + } + else if (0 <= (i - 28) && UtilConstants.GenericPermissions.Length > (i - 28)) + { + name = UtilConstants.GenericPermissions[i - 28]; + } + + if (null == name) + { + this.Core.OnMessage(WixWarnings.UnknownPermission(row.SourceLineNumbers, row.Table.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), i)); + } + else + { + switch (name) + { + case "ChangePermission": + fileSharePermission.ChangePermission = Util.YesNoType.yes; + break; + case "CreateChild": + fileSharePermission.CreateChild = Util.YesNoType.yes; + break; + case "CreateFile": + fileSharePermission.CreateFile = Util.YesNoType.yes; + break; + case "Delete": + fileSharePermission.Delete = Util.YesNoType.yes; + break; + case "DeleteChild": + fileSharePermission.DeleteChild = Util.YesNoType.yes; + break; + case "GenericAll": + fileSharePermission.GenericAll = Util.YesNoType.yes; + break; + case "GenericExecute": + fileSharePermission.GenericExecute = Util.YesNoType.yes; + break; + case "GenericRead": + fileSharePermission.GenericRead = Util.YesNoType.yes; + break; + case "GenericWrite": + fileSharePermission.GenericWrite = Util.YesNoType.yes; + break; + case "Read": + fileSharePermission.Read = Util.YesNoType.yes; + break; + case "ReadAttributes": + fileSharePermission.ReadAttributes = Util.YesNoType.yes; + break; + case "ReadExtendedAttributes": + fileSharePermission.ReadExtendedAttributes = Util.YesNoType.yes; + break; + case "ReadPermission": + fileSharePermission.ReadPermission = Util.YesNoType.yes; + break; + case "Synchronize": + fileSharePermission.Synchronize = Util.YesNoType.yes; + break; + case "TakeOwnership": + fileSharePermission.TakeOwnership = Util.YesNoType.yes; + break; + case "Traverse": + fileSharePermission.Traverse = Util.YesNoType.yes; + break; + case "WriteAttributes": + fileSharePermission.WriteAttributes = Util.YesNoType.yes; + break; + case "WriteExtendedAttributes": + fileSharePermission.WriteExtendedAttributes = Util.YesNoType.yes; + break; + default: + Debug.Fail(String.Format("Unknown permission '{0}'.", name)); + break; + } + } + } + } + + Util.FileShare fileShare = (Util.FileShare)this.Core.GetIndexedElement("FileShare", (string)row[0]); + if (null != fileShare) + { + fileShare.AddChild(fileSharePermission); + } + else + { + this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "FileShare_", (string)row[0], "FileShare")); + } + } + } + + /// + /// Decompile the Group table. + /// + /// The table to decompile. + private void DecompileGroupTable(Table table) + { + foreach (Row row in table.Rows) + { + Util.Group group = new Util.Group(); + + group.Id = (string)row[0]; + + if (null != row[1]) + { + this.Core.OnMessage(WixWarnings.UnrepresentableColumnValue(row.SourceLineNumbers, table.Name, "Component_", (string)row[1])); + } + + group.Name = (string)row[2]; + + if (null != row[3]) + { + group.Domain = (string)row[3]; + } + + this.Core.RootElement.AddChild(group); + } + } + + /// + /// Decompile the WixInternetShortcut table. + /// + /// The table to decompile. + private void DecompileWixInternetShortcutTable(Table table) + { + foreach (Row row in table.Rows) + { + Util.InternetShortcut internetShortcut = new Util.InternetShortcut(); + internetShortcut.Id = (string)row[0]; + internetShortcut.Directory = (string)row[2]; + // remove .lnk/.url extension because compiler extension adds it back for us + internetShortcut.Name = Path.ChangeExtension((string)row[3], null); + internetShortcut.Target = (string)row[4]; + internetShortcut.IconFile = (string)row[6]; + internetShortcut.IconIndex = (int)row[7]; + + UtilCompiler.InternetShortcutType shortcutType = (UtilCompiler.InternetShortcutType)row[5]; + switch (shortcutType) + { + case UtilCompiler.InternetShortcutType.Link: + internetShortcut.Type = Util.InternetShortcut.TypeType.link; + break; + case UtilCompiler.InternetShortcutType.Url: + internetShortcut.Type = Util.InternetShortcut.TypeType.url; + break; + } + + Wix.Component component = (Wix.Component)this.Core.GetIndexedElement("Component", (string)row[1]); + if (null != component) + { + component.AddChild(internetShortcut); + } + else + { + this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Component_", (string)row[1], "Component")); + } + + this.Core.IndexElement(row, internetShortcut); + } + } + + /// + /// Decompile the Perfmon table. + /// + /// The table to decompile. + private void DecompilePerfmonTable(Table table) + { + foreach (Row row in table.Rows) + { + Util.PerfCounter perfCounter = new Util.PerfCounter(); + + perfCounter.Name = (string)row[2]; + + this.Core.IndexElement(row, perfCounter); + } + } + + /// + /// Decompile the PerfmonManifest table. + /// + /// The table to decompile. + private void DecompilePerfmonManifestTable(Table table) + { + foreach (Row row in table.Rows) + { + Util.PerfCounterManifest perfCounterManifest = new Util.PerfCounterManifest(); + + perfCounterManifest.ResourceFileDirectory = (string)row[2]; + + this.Core.IndexElement(row, perfCounterManifest); + } + } + + /// + /// Decompile the EventManifest table. + /// + /// The table to decompile. + private void DecompileEventManifestTable(Table table) + { + foreach (Row row in table.Rows) + { + Util.EventManifest eventManifest = new Util.EventManifest(); + this.Core.IndexElement(row, eventManifest); + } + } + + /// + /// Decompile the SecureObjects table. + /// + /// The table to decompile. + private void DecompileSecureObjectsTable(Table table) + { + foreach (Row row in table.Rows) + { + Util.PermissionEx permissionEx = new Util.PermissionEx(); + + string[] specialPermissions; + switch ((string)row[1]) + { + case "CreateFolder": + specialPermissions = UtilConstants.FolderPermissions; + break; + case "File": + specialPermissions = UtilConstants.FilePermissions; + break; + case "Registry": + specialPermissions = UtilConstants.RegistryPermissions; + break; + case "ServiceInstall": + specialPermissions = UtilConstants.ServicePermissions; + break; + default: + this.Core.OnMessage(WixWarnings.IllegalColumnValue(row.SourceLineNumbers, row.Table.Name, row.Fields[1].Column.Name, row[1])); + return; + } + + int permissionBits = (int)row[4]; + for (int i = 0; i < 32; i++) + { + if (0 != ((permissionBits >> i) & 1)) + { + string name = null; + + if (16 > i && specialPermissions.Length > i) + { + name = specialPermissions[i]; + } + else if (28 > i && UtilConstants.StandardPermissions.Length > (i - 16)) + { + name = UtilConstants.StandardPermissions[i - 16]; + } + else if (0 <= (i - 28) && UtilConstants.GenericPermissions.Length > (i - 28)) + { + name = UtilConstants.GenericPermissions[i - 28]; + } + + if (null == name) + { + this.Core.OnMessage(WixWarnings.UnknownPermission(row.SourceLineNumbers, row.Table.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), i)); + } + else + { + switch (name) + { + case "Append": + permissionEx.Append = Util.YesNoType.yes; + break; + case "ChangePermission": + permissionEx.ChangePermission = Util.YesNoType.yes; + break; + case "CreateChild": + permissionEx.CreateChild = Util.YesNoType.yes; + break; + case "CreateFile": + permissionEx.CreateFile = Util.YesNoType.yes; + break; + case "CreateLink": + permissionEx.CreateLink = Util.YesNoType.yes; + break; + case "CreateSubkeys": + permissionEx.CreateSubkeys = Util.YesNoType.yes; + break; + case "Delete": + permissionEx.Delete = Util.YesNoType.yes; + break; + case "DeleteChild": + permissionEx.DeleteChild = Util.YesNoType.yes; + break; + case "EnumerateSubkeys": + permissionEx.EnumerateSubkeys = Util.YesNoType.yes; + break; + case "Execute": + permissionEx.Execute = Util.YesNoType.yes; + break; + case "GenericAll": + permissionEx.GenericAll = Util.YesNoType.yes; + break; + case "GenericExecute": + permissionEx.GenericExecute = Util.YesNoType.yes; + break; + case "GenericRead": + permissionEx.GenericRead = Util.YesNoType.yes; + break; + case "GenericWrite": + permissionEx.GenericWrite = Util.YesNoType.yes; + break; + case "Notify": + permissionEx.Notify = Util.YesNoType.yes; + break; + case "Read": + permissionEx.Read = Util.YesNoType.yes; + break; + case "ReadAttributes": + permissionEx.ReadAttributes = Util.YesNoType.yes; + break; + case "ReadExtendedAttributes": + permissionEx.ReadExtendedAttributes = Util.YesNoType.yes; + break; + case "ReadPermission": + permissionEx.ReadPermission = Util.YesNoType.yes; + break; + case "ServiceChangeConfig": + permissionEx.ServiceChangeConfig = Util.YesNoType.yes; + break; + case "ServiceEnumerateDependents": + permissionEx.ServiceEnumerateDependents = Util.YesNoType.yes; + break; + case "ServiceInterrogate": + permissionEx.ServiceInterrogate = Util.YesNoType.yes; + break; + case "ServicePauseContinue": + permissionEx.ServicePauseContinue = Util.YesNoType.yes; + break; + case "ServiceQueryConfig": + permissionEx.ServiceQueryConfig = Util.YesNoType.yes; + break; + case "ServiceQueryStatus": + permissionEx.ServiceQueryStatus = Util.YesNoType.yes; + break; + case "ServiceStart": + permissionEx.ServiceStart = Util.YesNoType.yes; + break; + case "ServiceStop": + permissionEx.ServiceStop = Util.YesNoType.yes; + break; + case "ServiceUserDefinedControl": + permissionEx.ServiceUserDefinedControl = Util.YesNoType.yes; + break; + case "Synchronize": + permissionEx.Synchronize = Util.YesNoType.yes; + break; + case "TakeOwnership": + permissionEx.TakeOwnership = Util.YesNoType.yes; + break; + case "Traverse": + permissionEx.Traverse = Util.YesNoType.yes; + break; + case "Write": + permissionEx.Write = Util.YesNoType.yes; + break; + case "WriteAttributes": + permissionEx.WriteAttributes = Util.YesNoType.yes; + break; + case "WriteExtendedAttributes": + permissionEx.WriteExtendedAttributes = Util.YesNoType.yes; + break; + default: + throw new InvalidOperationException(String.Format("Unknown permission attribute '{0}'.", name)); + } + } + } + } + + if (null != row[2]) + { + permissionEx.Domain = (string)row[2]; + } + + permissionEx.User = (string)row[3]; + + this.Core.IndexElement(row, permissionEx); + } + } + + /// + /// Decompile the ServiceConfig table. + /// + /// The table to decompile. + private void DecompileServiceConfigTable(Table table) + { + foreach (Row row in table.Rows) + { + Util.ServiceConfig serviceConfig = new Util.ServiceConfig(); + + serviceConfig.ServiceName = (string)row[0]; + + switch ((string)row[3]) + { + case "none": + serviceConfig.FirstFailureActionType = Util.ServiceConfig.FirstFailureActionTypeType.none; + break; + case "reboot": + serviceConfig.FirstFailureActionType = Util.ServiceConfig.FirstFailureActionTypeType.reboot; + break; + case "restart": + serviceConfig.FirstFailureActionType = Util.ServiceConfig.FirstFailureActionTypeType.restart; + break; + case "runCommand": + serviceConfig.FirstFailureActionType = Util.ServiceConfig.FirstFailureActionTypeType.runCommand; + break; + default: + this.Core.OnMessage(WixWarnings.IllegalColumnValue(row.SourceLineNumbers, table.Name, row.Fields[3].Column.Name, row[3])); + break; + } + + switch ((string)row[4]) + { + case "none": + serviceConfig.SecondFailureActionType = Util.ServiceConfig.SecondFailureActionTypeType.none; + break; + case "reboot": + serviceConfig.SecondFailureActionType = Util.ServiceConfig.SecondFailureActionTypeType.reboot; + break; + case "restart": + serviceConfig.SecondFailureActionType = Util.ServiceConfig.SecondFailureActionTypeType.restart; + break; + case "runCommand": + serviceConfig.SecondFailureActionType = Util.ServiceConfig.SecondFailureActionTypeType.runCommand; + break; + default: + this.Core.OnMessage(WixWarnings.IllegalColumnValue(row.SourceLineNumbers, table.Name, row.Fields[4].Column.Name, row[4])); + break; + } + + switch ((string)row[5]) + { + case "none": + serviceConfig.ThirdFailureActionType = Util.ServiceConfig.ThirdFailureActionTypeType.none; + break; + case "reboot": + serviceConfig.ThirdFailureActionType = Util.ServiceConfig.ThirdFailureActionTypeType.reboot; + break; + case "restart": + serviceConfig.ThirdFailureActionType = Util.ServiceConfig.ThirdFailureActionTypeType.restart; + break; + case "runCommand": + serviceConfig.ThirdFailureActionType = Util.ServiceConfig.ThirdFailureActionTypeType.runCommand; + break; + default: + this.Core.OnMessage(WixWarnings.IllegalColumnValue(row.SourceLineNumbers, table.Name, row.Fields[5].Column.Name, row[5])); + break; + } + + if (null != row[6]) + { + serviceConfig.ResetPeriodInDays = (int)row[6]; + } + + if (null != row[7]) + { + serviceConfig.RestartServiceDelayInSeconds = (int)row[7]; + } + + if (null != row[8]) + { + serviceConfig.ProgramCommandLine = (string)row[8]; + } + + if (null != row[9]) + { + serviceConfig.RebootMessage = (string)row[9]; + } + + this.Core.IndexElement(row, serviceConfig); + } + } + + /// + /// Decompile the User table. + /// + /// The table to decompile. + private void DecompileUserTable(Table table) + { + foreach (Row row in table.Rows) + { + Util.User user = new Util.User(); + + user.Id = (string)row[0]; + + user.Name = (string)row[2]; + + if (null != row[3]) + { + user.Domain = (string)row[3]; + } + + if (null != row[4]) + { + user.Password = (string)row[4]; + } + + if (null != row[5]) + { + int attributes = (int)row[5]; + + if (UtilCompiler.UserDontExpirePasswrd == (attributes & UtilCompiler.UserDontExpirePasswrd)) + { + user.PasswordNeverExpires = Util.YesNoType.yes; + } + + if (UtilCompiler.UserPasswdCantChange == (attributes & UtilCompiler.UserPasswdCantChange)) + { + user.CanNotChangePassword = Util.YesNoType.yes; + } + + if (UtilCompiler.UserPasswdChangeReqdOnLogin == (attributes & UtilCompiler.UserPasswdChangeReqdOnLogin)) + { + user.PasswordExpired = Util.YesNoType.yes; + } + + if (UtilCompiler.UserDisableAccount == (attributes & UtilCompiler.UserDisableAccount)) + { + user.Disabled = Util.YesNoType.yes; + } + + if (UtilCompiler.UserFailIfExists == (attributes & UtilCompiler.UserFailIfExists)) + { + user.FailIfExists = Util.YesNoType.yes; + } + + if (UtilCompiler.UserUpdateIfExists == (attributes & UtilCompiler.UserUpdateIfExists)) + { + user.UpdateIfExists = Util.YesNoType.yes; + } + + if (UtilCompiler.UserLogonAsService == (attributes & UtilCompiler.UserLogonAsService)) + { + user.LogonAsService = Util.YesNoType.yes; + } + + if (UtilCompiler.UserDontRemoveOnUninstall == (attributes & UtilCompiler.UserDontRemoveOnUninstall)) + { + user.RemoveOnUninstall = Util.YesNoType.no; + } + + if (UtilCompiler.UserDontCreateUser == (attributes & UtilCompiler.UserDontCreateUser)) + { + user.CreateUser = Util.YesNoType.no; + } + + if (UtilCompiler.UserNonVital == (attributes & UtilCompiler.UserNonVital)) + { + user.Vital = Util.YesNoType.no; + } + } + + if (null != row[1]) + { + Wix.Component component = (Wix.Component)this.Core.GetIndexedElement("Component", (string)row[1]); + + if (null != component) + { + component.AddChild(user); + } + else + { + this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Component_", (string)row[1], "Component")); + } + } + else + { + this.Core.RootElement.AddChild(user); + } + this.Core.IndexElement(row, user); + } + } + + /// + /// Decompile the UserGroup table. + /// + /// The table to decompile. + private void DecompileUserGroupTable(Table table) + { + foreach (Row row in table.Rows) + { + Util.User user = (Util.User)this.Core.GetIndexedElement("User", (string)row[0]); + + if (null != user) + { + Util.GroupRef groupRef = new Util.GroupRef(); + + groupRef.Id = (string)row[1]; + + user.AddChild(groupRef); + } + else + { + this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Group_", (string)row[0], "Group")); + } + } + } + + /// + /// Decompile the XmlConfig table. + /// + /// The table to decompile. + private void DecompileXmlConfigTable(Table table) + { + foreach (Row row in table.Rows) + { + Util.XmlConfig xmlConfig = new Util.XmlConfig(); + + xmlConfig.Id = (string)row[0]; + + xmlConfig.File = (string)row[1]; + + xmlConfig.ElementPath = (string)row[2]; + + if (null != row[3]) + { + xmlConfig.VerifyPath = (string)row[3]; + } + + if (null != row[4]) + { + xmlConfig.Name = (string)row[4]; + } + + if (null != row[5]) + { + xmlConfig.Value = (string)row[5]; + } + + int flags = (int)row[6]; + + if (0x1 == (flags & 0x1)) + { + xmlConfig.Node = Util.XmlConfig.NodeType.element; + } + else if (0x2 == (flags & 0x2)) + { + xmlConfig.Node = Util.XmlConfig.NodeType.value; + } + else if (0x4 == (flags & 0x4)) + { + xmlConfig.Node = Util.XmlConfig.NodeType.document; + } + + if (0x10 == (flags & 0x10)) + { + xmlConfig.Action = Util.XmlConfig.ActionType.create; + } + else if (0x20 == (flags & 0x20)) + { + xmlConfig.Action = Util.XmlConfig.ActionType.delete; + } + + if (0x100 == (flags & 0x100)) + { + xmlConfig.On = Util.XmlConfig.OnType.install; + } + else if (0x200 == (flags & 0x200)) + { + xmlConfig.On = Util.XmlConfig.OnType.uninstall; + } + + if (0x00001000 == (flags & 0x00001000)) + { + xmlConfig.PreserveModifiedDate = Util.YesNoType.yes; + } + + if (null != row[8]) + { + xmlConfig.Sequence = (int)row[8]; + } + + this.Core.IndexElement(row, xmlConfig); + } + } + + /// + /// Finalize the Perfmon table. + /// + /// The collection of all tables. + /// + /// Since the PerfCounter element nests under a File element, but + /// the Perfmon table does not have a foreign key relationship with + /// the File table (instead it has a formatted string that usually + /// refers to a file row - but doesn't have to), the nesting must + /// be inferred during finalization. + /// + private void FinalizePerfmonTable(TableIndexedCollection tables) + { + Table perfmonTable = tables["Perfmon"]; + + if (null != perfmonTable) + { + foreach (Row row in perfmonTable.Rows) + { + string formattedFile = (string)row[1]; + Util.PerfCounter perfCounter = (Util.PerfCounter)this.Core.GetIndexedElement(row); + + // try to "de-format" the File column's value to determine the proper parent File element + if ((formattedFile.StartsWith("[#", StringComparison.Ordinal) || formattedFile.StartsWith("[!", StringComparison.Ordinal)) + && formattedFile.EndsWith("]", StringComparison.Ordinal)) + { + string fileId = formattedFile.Substring(2, formattedFile.Length - 3); + + Wix.File file = (Wix.File)this.Core.GetIndexedElement("File", fileId); + if (null != file) + { + file.AddChild(perfCounter); + } + else + { + this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, perfmonTable.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "File", formattedFile, "File")); + } + } + else + { + this.Core.OnMessage(UtilErrors.IllegalFileValueInPerfmonOrManifest(formattedFile, "Perfmon")); + } + } + } + } + + /// + /// Finalize the PerfmonManifest table. + /// + /// The collection of all tables. + private void FinalizePerfmonManifestTable(TableIndexedCollection tables) + { + Table perfmonManifestTable = tables["PerfmonManifest"]; + + if (null != perfmonManifestTable) + { + foreach (Row row in perfmonManifestTable.Rows) + { + string formattedFile = (string)row[1]; + Util.PerfCounterManifest perfCounterManifest = (Util.PerfCounterManifest)this.Core.GetIndexedElement(row); + + // try to "de-format" the File column's value to determine the proper parent File element + if ((formattedFile.StartsWith("[#", StringComparison.Ordinal) || formattedFile.StartsWith("[!", StringComparison.Ordinal)) + && formattedFile.EndsWith("]", StringComparison.Ordinal)) + { + string fileId = formattedFile.Substring(2, formattedFile.Length - 3); + + Wix.File file = (Wix.File)this.Core.GetIndexedElement("File", fileId); + if (null != file) + { + file.AddChild(perfCounterManifest); + } + else + { + this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, perfCounterManifest.ResourceFileDirectory, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "File", formattedFile, "File")); + } + } + else + { + this.Core.OnMessage(UtilErrors.IllegalFileValueInPerfmonOrManifest(formattedFile, "PerfmonManifest")); + } + } + } + } + + /// + /// Finalize the SecureObjects table. + /// + /// The collection of all tables. + /// + /// Nests the PermissionEx elements below their parent elements. There are no declared foreign + /// keys for the parents of the SecureObjects table. + /// + private void FinalizeSecureObjectsTable(TableIndexedCollection tables) + { + Table createFolderTable = tables["CreateFolder"]; + Table secureObjectsTable = tables["SecureObjects"]; + + Hashtable createFolders = new Hashtable(); + + // index the CreateFolder table because the foreign key to this table from the + // LockPermissions table is only part of the primary key of this table + if (null != createFolderTable) + { + foreach (Row row in createFolderTable.Rows) + { + Wix.CreateFolder createFolder = (Wix.CreateFolder)this.Core.GetIndexedElement(row); + string directoryId = (string)row[0]; + + if (!createFolders.Contains(directoryId)) + { + createFolders.Add(directoryId, new ArrayList()); + } + ((ArrayList)createFolders[directoryId]).Add(createFolder); + } + } + + if (null != secureObjectsTable) + { + foreach (Row row in secureObjectsTable.Rows) + { + string id = (string)row[0]; + string table = (string)row[1]; + + Util.PermissionEx permissionEx = (Util.PermissionEx)this.Core.GetIndexedElement(row); + + if ("CreateFolder" == table) + { + ArrayList createFolderElements = (ArrayList)createFolders[id]; + + if (null != createFolderElements) + { + foreach (Wix.CreateFolder createFolder in createFolderElements) + { + createFolder.AddChild(permissionEx); + } + } + else + { + this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, "SecureObjects", row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "LockObject", id, table)); + } + } + else + { + Wix.IParentElement parentElement = (Wix.IParentElement)this.Core.GetIndexedElement(table, id); + + if (null != parentElement) + { + parentElement.AddChild(permissionEx); + } + else + { + this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, "SecureObjects", row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "LockObject", id, table)); + } + } + } + } + } + + /// + /// Finalize the ServiceConfig table. + /// + /// The collection of all tables. + /// + /// Since there is no foreign key from the ServiceName column to the + /// ServiceInstall table, this relationship must be handled late. + /// + private void FinalizeServiceConfigTable(TableIndexedCollection tables) + { + Table serviceConfigTable = tables["ServiceConfig"]; + Table serviceInstallTable = tables["ServiceInstall"]; + + Hashtable serviceInstalls = new Hashtable(); + + // index the ServiceInstall table because the foreign key used by the ServiceConfig + // table is actually the ServiceInstall.Name, not the ServiceInstall.ServiceInstall + // this is unfortunate because the service Name is not guaranteed to be unique, so + // decompiler must assume there could be multiple matches and add the ServiceConfig to each + // TODO: the Component column information should be taken into acount to accurately identify + // the correct column to use + if (null != serviceInstallTable) + { + foreach (Row row in serviceInstallTable.Rows) + { + string name = (string)row[1]; + Wix.ServiceInstall serviceInstall = (Wix.ServiceInstall)this.Core.GetIndexedElement(row); + + if (!serviceInstalls.Contains(name)) + { + serviceInstalls.Add(name, new ArrayList()); + } + + ((ArrayList)serviceInstalls[name]).Add(serviceInstall); + } + } + + if (null != serviceConfigTable) + { + foreach (Row row in serviceConfigTable.Rows) + { + Util.ServiceConfig serviceConfig = (Util.ServiceConfig)this.Core.GetIndexedElement(row); + + if (0 == (int)row[2]) + { + Wix.Component component = (Wix.Component)this.Core.GetIndexedElement("Component", (string)row[1]); + + if (null != component) + { + component.AddChild(serviceConfig); + } + else + { + this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, serviceConfigTable.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Component_", (string)row[1], "Component")); + } + } + else + { + ArrayList serviceInstallElements = (ArrayList)serviceInstalls[row[0]]; + + if (null != serviceInstallElements) + { + foreach (Wix.ServiceInstall serviceInstall in serviceInstallElements) + { + serviceInstall.AddChild(serviceConfig); + } + } + else + { + this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, serviceConfigTable.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "ServiceName", (string)row[0], "ServiceInstall")); + } + } + } + } + } + + /// + /// Finalize the XmlConfig table. + /// + /// Collection of all tables. + private void FinalizeXmlConfigTable(TableIndexedCollection tables) + { + Table xmlConfigTable = tables["XmlConfig"]; + + if (null != xmlConfigTable) + { + foreach (Row row in xmlConfigTable.Rows) + { + Util.XmlConfig xmlConfig = (Util.XmlConfig)this.Core.GetIndexedElement(row); + + if (null == row[6] || 0 == (int)row[6]) + { + Util.XmlConfig parentXmlConfig = (Util.XmlConfig)this.Core.GetIndexedElement("XmlConfig", (string)row[2]); + + if (null != parentXmlConfig) + { + parentXmlConfig.AddChild(xmlConfig); + } + else + { + this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, xmlConfigTable.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "ElementPath", (string)row[2], "XmlConfig")); + } + } + else + { + Wix.Component component = (Wix.Component)this.Core.GetIndexedElement("Component", (string)row[7]); + + if (null != component) + { + component.AddChild(xmlConfig); + } + else + { + this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, xmlConfigTable.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Component_", (string)row[7], "Component")); + } + } + } + } + } + + + /// + /// Finalize the XmlFile table. + /// + /// The collection of all tables. + /// + /// Some of the XmlFile table rows are compiler generated from util:EventManifest node + /// These rows should not be appended to component. + /// + private void FinalizeXmlFileTable(TableIndexedCollection tables) + { + Table xmlFileTable = tables["XmlFile"]; + Table eventManifestTable = tables["EventManifest"]; + + if (null != xmlFileTable) + { + foreach (Row row in xmlFileTable.Rows) + { + bool bManifestGenerated = false; + string xmlFileConfigId = (string)row[0]; + if (null != eventManifestTable) + { + foreach (Row emrow in eventManifestTable.Rows) + { + string formattedFile = (string)emrow[1]; + if ((formattedFile.StartsWith("[#", StringComparison.Ordinal) || formattedFile.StartsWith("[!", StringComparison.Ordinal)) + && formattedFile.EndsWith("]", StringComparison.Ordinal)) + { + string fileId = formattedFile.Substring(2, formattedFile.Length - 3); + if (String.Equals(String.Concat("Config_", fileId, "ResourceFile"), xmlFileConfigId)) + { + Util.EventManifest eventManifest = (Util.EventManifest)this.Core.GetIndexedElement(emrow); + if (null != eventManifest) + { + eventManifest.ResourceFile = (string)row[4]; + } + bManifestGenerated = true; + } + + else if (String.Equals(String.Concat("Config_", fileId, "MessageFile"), xmlFileConfigId)) + { + Util.EventManifest eventManifest = (Util.EventManifest)this.Core.GetIndexedElement(emrow); + if (null != eventManifest) + { + eventManifest.MessageFile = (string)row[4]; + } + bManifestGenerated = true; + } + } + } + } + + if (true == bManifestGenerated) + continue; + + Util.XmlFile xmlFile = new Util.XmlFile(); + + xmlFile.Id = (string)row[0]; + xmlFile.File = (string)row[1]; + xmlFile.ElementPath = (string)row[2]; + + if (null != row[3]) + { + xmlFile.Name = (string)row[3]; + } + + if (null != row[4]) + { + xmlFile.Value = (string)row[4]; + } + + int flags = (int)row[5]; + if (0x1 == (flags & 0x1) && 0x2 == (flags & 0x2)) + { + this.Core.OnMessage(WixWarnings.IllegalColumnValue(row.SourceLineNumbers, xmlFileTable.Name, row.Fields[5].Column.Name, row[5])); + } + else if (0x1 == (flags & 0x1)) + { + xmlFile.Action = Util.XmlFile.ActionType.createElement; + } + else if (0x2 == (flags & 0x2)) + { + xmlFile.Action = Util.XmlFile.ActionType.deleteValue; + } + else + { + xmlFile.Action = Util.XmlFile.ActionType.setValue; + } + + if (0x100 == (flags & 0x100)) + { + xmlFile.SelectionLanguage = Util.XmlFile.SelectionLanguageType.XPath; + } + + if (0x00001000 == (flags & 0x00001000)) + { + xmlFile.PreserveModifiedDate = Util.YesNoType.yes; + } + + if (0x00010000 == (flags & 0x00010000)) + { + xmlFile.Permanent = Util.YesNoType.yes; + } + + if (null != row[7]) + { + xmlFile.Sequence = (int)row[7]; + } + + Wix.Component component = (Wix.Component)this.Core.GetIndexedElement("Component", (string)row[6]); + + if (null != component) + { + component.AddChild(xmlFile); + } + else + { + this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, xmlFileTable.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Component_", (string)row[6], "Component")); + } + } + } + } + + /// + /// Finalize the eventManifest table. + /// This function must be called after FinalizeXmlFileTable + /// + /// The collection of all tables. + private void FinalizeEventManifestTable(TableIndexedCollection tables) + { + Table eventManifestTable = tables["EventManifest"]; + + if (null != eventManifestTable) + { + foreach (Row row in eventManifestTable.Rows) + { + string formattedFile = (string)row[1]; + Util.EventManifest eventManifest = (Util.EventManifest)this.Core.GetIndexedElement(row); + + // try to "de-format" the File column's value to determine the proper parent File element + if ((formattedFile.StartsWith("[#", StringComparison.Ordinal) || formattedFile.StartsWith("[!", StringComparison.Ordinal)) + && formattedFile.EndsWith("]", StringComparison.Ordinal)) + { + string fileId = formattedFile.Substring(2, formattedFile.Length - 3); + + Wix.File file = (Wix.File)this.Core.GetIndexedElement("File", fileId); + if (null != file) + { + file.AddChild(eventManifest); + } + } + else + { + this.Core.OnMessage(UtilErrors.IllegalFileValueInPerfmonOrManifest(formattedFile, "EventManifest")); + } + } + } + } + } +#endif +} diff --git a/src/wixext/UtilErrors.cs b/src/wixext/UtilErrors.cs new file mode 100644 index 0000000..988b832 --- /dev/null +++ b/src/wixext/UtilErrors.cs @@ -0,0 +1,109 @@ +// 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; + using System.Resources; + using WixToolset.Data; + + public static class UtilErrors + { + public static Message ArgumentRequiresValue(string argument) + { + return Message(null, Ids.ArgumentRequiresValue, "The argument '{0}' does not have a value specified and it is required.", argument); + } + + public static Message CircularSearchReference(string chain) + { + return Message(null, Ids.CircularSearchReference, "A circular reference of search ordering constraints was detected: {0}. Search ordering references must form a directed acyclic graph.", chain); + } + + public static Message DirectoryNotFound(string directory) + { + return Message(null, Ids.DirectoryNotFound, "The directory '{0}' could not be found.", directory); + } + + public static Message EmptyDirectory(string directory) + { + return Message(null, Ids.EmptyDirectory, "The directory '{0}' did not contain any files or sub-directories and since empty directories are not being kept, there was nothing to harvest.", directory); + } + + public static Message ErrorTransformingHarvestedWiX(string transform, string message) + { + return Message(null, Ids.ErrorTransformingHarvestedWiX, "Error applying transform {0} to harvested WiX: {1}", transform, message); + } + + public static Message FileNotFound(string file) + { + return Message(null, Ids.FileNotFound, "The file '{0}' cannot be found.", file); + } + + public static Message IllegalAttributeWithoutComponent(SourceLineNumber sourceLineNumbers, string elementName, string attributeName) + { + return Message(sourceLineNumbers, Ids.IllegalAttributeWithoutComponent, "The {0}/@{1} attribute cannot be specified unless the element has a Component as an ancestor. A {0} that does not have a Component ancestor is not installed.", elementName, attributeName); + } + + public static Message IllegalElementWithoutComponent(SourceLineNumber sourceLineNumbers, string elementName) + { + return Message(sourceLineNumbers, Ids.IllegalElementWithoutComponent, "The {0} element cannot be specified unless the element has a Component as an ancestor. A {0} that does not have a Component ancestor is not installed.", elementName); + } + + public static Message IllegalFileValueInPerfmonOrManifest(string file, string table) + { + return Message(null, Ids.IllegalFileValueInPerfmonOrManifest, "The value '{0}' in the File column, {1} table is invalid. It should be in the form of '[#file]' or '[!file]'.", file, table); + } + + public static Message InvalidRegistryObject(SourceLineNumber sourceLineNumbers, string registryElementName) + { + return Message(sourceLineNumbers, Ids.InvalidRegistryObject, "The {0} element has no id and cannot have its permissions set. If you want to set permissions on a 'placeholder' registry key, force its creation by setting the ForceCreateOnInstall attribute to yes.", registryElementName); + } + + public static Message PerformanceCategoryNotFound(string key) + { + return Message(null, Ids.PerformanceCategoryNotFound, "Performance category '{0}' not found.", key); + } + + public static Message SpacesNotAllowedInArgumentValue(string arg, string value) + { + return Message(null, Ids.SpacesNotAllowedInArgumentValue, "The switch '{0}' does not allow the spaces from the value. Please remove the spaces in from the value: {1}", arg, value); + } + + public static Message UnableToOpenRegistryKey(string key) + { + return Message(null, Ids.UnableToOpenRegistryKey, "Unable to open registry key '{0}'.", key); + } + + public static Message UnsupportedPerformanceCounterType(string key) + { + return Message(null, Ids.UnsupportedPerformanceCounterType, "Unsupported performance counter type '{0}'.", key); + } + + private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args) + { + return new Message(sourceLineNumber, MessageLevel.Error, (int)id, format, args); + } + + private static Message Message(SourceLineNumber sourceLineNumber, Ids id, ResourceManager resourceManager, string resourceName, params object[] args) + { + return new Message(sourceLineNumber, MessageLevel.Error, (int)id, resourceManager, resourceName, args); + } + + public enum Ids + { + IllegalAttributeWithoutComponent = 5050, + IllegalElementWithoutComponent = 5051, + DirectoryNotFound = 5052, + EmptyDirectory = 5053, + IllegalFileValueInPerfmonOrManifest = 5054, + ErrorTransformingHarvestedWiX = 5055, + UnableToOpenRegistryKey = 5056, + SpacesNotAllowedInArgumentValue = 5057, + ArgumentRequiresValue = 5058, + FileNotFound = 5059, + PerformanceCategoryNotFound = 5060, + UnsupportedPerformanceCounterType = 5061, + CircularSearchReference = 5062, + InvalidRegistryObject = 5063, + } + } +} diff --git a/src/wixext/UtilExtensionData.cs b/src/wixext/UtilExtensionData.cs new file mode 100644 index 0000000..7eefc23 --- /dev/null +++ b/src/wixext/UtilExtensionData.cs @@ -0,0 +1,21 @@ +// 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 WixToolset.Data; + using WixToolset.Extensibility; + + public sealed class UtilExtensionData : BaseExtensionData + { + public override bool TryGetTupleDefinitionByName(string name, out IntermediateTupleDefinition tupleDefinition) + { + tupleDefinition = UtilTupleDefinitions.ByName(name); + return tupleDefinition != null; + } + + public override Intermediate GetLibrary(ITupleDefinitionCreator tupleDefinitions) + { + return Intermediate.Load(typeof(UtilExtensionData).Assembly, "WixToolset.Util.util.wixlib", tupleDefinitions); + } + } +} diff --git a/src/wixext/UtilExtensionFactory.cs b/src/wixext/UtilExtensionFactory.cs new file mode 100644 index 0000000..07bfae8 --- /dev/null +++ b/src/wixext/UtilExtensionFactory.cs @@ -0,0 +1,18 @@ +// 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; + using System.Collections.Generic; + using WixToolset.Extensibility; + + public class UtilExtensionFactory : BaseExtensionFactory + { + protected override IEnumerable ExtensionTypes => new[] + { + typeof(UtilCompiler), + typeof(UtilExtensionData), + typeof(UtilWindowsInstallerBackendExtension), + }; + } +} diff --git a/src/wixext/UtilWarnings.cs b/src/wixext/UtilWarnings.cs new file mode 100644 index 0000000..13dcea4 --- /dev/null +++ b/src/wixext/UtilWarnings.cs @@ -0,0 +1,72 @@ +// 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; + using System.Resources; + using WixToolset.Data; + + public static class UtilWarnings + { + public static Message AssemblyHarvestFailed(string file, string message) + { + return Message(null, Ids.AssemblyHarvestFailed, "Could not harvest data from a file that was expected to be an assembly: {0}. If this file is not an assembly you can ignore this warning. Otherwise, this error detail may be helpful to diagnose the failure: {1}", file, message); + } + + public static Message DeprecatedPerfCounterElement(SourceLineNumber sourceLineNumbers) + { + return Message(sourceLineNumbers, Ids.DeprecatedPerfCounterElement, "The PerfCounter element has been deprecated. Please use the PerformanceCounter element instead."); + } + + public static Message DuplicateDllRegistryEntry(string registryKey, string componentId) + { + return Message(null, Ids.DuplicateDllRegistryEntry, "Ignoring the registry key '{0}', it has already been added to the component '{1}'.", registryKey, componentId); + } + + public static Message DuplicateDllRegistryEntry(string registryKey, string registryKeyValue, string componentId) + { + return Message(null, Ids.DuplicateDllRegistryEntry, "Ignoring the registry key '{0}', it has already been added to the component '{2}'. The registry key value '{1}' will not be harvested.", registryKey, registryKeyValue, componentId); + } + + public static Message RequiredAttributeForWindowsXP(SourceLineNumber sourceLineNumbers, string elementName, string attributeName) + { + return Message(sourceLineNumbers, Ids.RequiredAttributeForWindowsXP, "The {0}/@{1} attribute must be specified to successfully install on Windows XP. You can ignore this warning if this installation does not install on Windows XP.", elementName, attributeName); + } + + public static Message SelfRegHarvestFailed(string file, string message) + { + return Message(null, Ids.SelfRegHarvestFailed, "Could not harvest data from a file that was expected to be a SelfReg DLL: {0}. If this file does not support SelfReg you can ignore this warning. Otherwise, this error detail may be helpful to diagnose the failure: {1}", file, message); + } + + public static Message TypeLibLoadFailed(string file, string message) + { + return Message(null, Ids.TypeLibLoadFailed, "Could not load file that was expected to be a type library based off of file extension: {0}. If this file is not a type library you can ignore this warning. Otherwise, this error detail may be helpful to diagnose the load failure: {1}", file, message); + } + + public static Message UnsupportedRegistryType(string registryValue, int regFileLineNumber, string unsupportedType) + { + return Message(null, Ids.UnsupportedRegistryType, "Ignoring the registry value '{0}' found on line {1}, because it is of a type unsupported by Windows Installer ({2}).", registryValue, regFileLineNumber, unsupportedType); + } + + private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args) + { + return new Message(sourceLineNumber, MessageLevel.Warning, (int)id, format, args); + } + + private static Message Message(SourceLineNumber sourceLineNumber, Ids id, ResourceManager resourceManager, string resourceName, params object[] args) + { + return new Message(sourceLineNumber, MessageLevel.Warning, (int)id, resourceManager, resourceName, args); + } + + public enum Ids + { + SelfRegHarvestFailed = 5150, + AssemblyHarvestFailed = 5151, + TypeLibLoadFailed = 5152, + DeprecatedPerfCounterElement = 5153, + RequiredAttributeForWindowsXP = 5154, + DuplicateDllRegistryEntry = 5156, + UnsupportedRegistryType = 5157, + } + } +} diff --git a/src/wixext/UtilWindowsInstallerBackendExtension.cs b/src/wixext/UtilWindowsInstallerBackendExtension.cs new file mode 100644 index 0000000..00ac8d3 --- /dev/null +++ b/src/wixext/UtilWindowsInstallerBackendExtension.cs @@ -0,0 +1,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(); + } + } + } +} diff --git a/src/wixext/WixToolset.Util.wixext.csproj b/src/wixext/WixToolset.Util.wixext.csproj new file mode 100644 index 0000000..a06298a --- /dev/null +++ b/src/wixext/WixToolset.Util.wixext.csproj @@ -0,0 +1,34 @@ + + + + + + netstandard2.0 + WixToolset.Util + WiX Toolset Utility Extension + WiX Toolset Util Extension + true + build + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/wixext/WixToolset.Util.wixext.targets b/src/wixext/WixToolset.Util.wixext.targets new file mode 100644 index 0000000..3b43c25 --- /dev/null +++ b/src/wixext/WixToolset.Util.wixext.targets @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/wixext/tables.xml b/src/wixext/tables.xml new file mode 100644 index 0000000..190b040 --- /dev/null +++ b/src/wixext/tables.xml @@ -0,0 +1,242 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/wixext/util.cs b/src/wixext/util.cs new file mode 100644 index 0000000..9ebe89a --- /dev/null +++ b/src/wixext/util.cs @@ -0,0 +1,11461 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WixToolset.Util.Serialize +{ + using System; + using System.CodeDom.Compiler; + using System.Collections; + using System.Diagnostics.CodeAnalysis; + using System.Globalization; + using System.Xml; + using WixToolset.Data.Serialize; + + + /// + /// Values of this type will either be "yes" or "no". + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum YesNoType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + no, + + yes, + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public class Enums + { + + /// + /// Parses a YesNoType from a string. + /// + public static YesNoType ParseYesNoType(string value) + { + YesNoType parsedValue; + Enums.TryParseYesNoType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a YesNoType from a string. + /// + public static bool TryParseYesNoType(string value, out YesNoType parsedValue) + { + parsedValue = YesNoType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("no" == value)) + { + parsedValue = YesNoType.no; + } + else + { + if (("yes" == value)) + { + parsedValue = YesNoType.yes; + } + else + { + parsedValue = YesNoType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Parses a PerformanceCounterLanguageType from a string. + /// + public static PerformanceCounterLanguageType ParsePerformanceCounterLanguageType(string value) + { + PerformanceCounterLanguageType parsedValue; + Enums.TryParsePerformanceCounterLanguageType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a PerformanceCounterLanguageType from a string. + /// + public static bool TryParsePerformanceCounterLanguageType(string value, out PerformanceCounterLanguageType parsedValue) + { + parsedValue = PerformanceCounterLanguageType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("afrikaans" == value)) + { + parsedValue = PerformanceCounterLanguageType.afrikaans; + } + else + { + if (("albanian" == value)) + { + parsedValue = PerformanceCounterLanguageType.albanian; + } + else + { + if (("arabic" == value)) + { + parsedValue = PerformanceCounterLanguageType.arabic; + } + else + { + if (("armenian" == value)) + { + parsedValue = PerformanceCounterLanguageType.armenian; + } + else + { + if (("assamese" == value)) + { + parsedValue = PerformanceCounterLanguageType.assamese; + } + else + { + if (("azeri" == value)) + { + parsedValue = PerformanceCounterLanguageType.azeri; + } + else + { + if (("basque" == value)) + { + parsedValue = PerformanceCounterLanguageType.basque; + } + else + { + if (("belarusian" == value)) + { + parsedValue = PerformanceCounterLanguageType.belarusian; + } + else + { + if (("bengali" == value)) + { + parsedValue = PerformanceCounterLanguageType.bengali; + } + else + { + if (("bulgarian" == value)) + { + parsedValue = PerformanceCounterLanguageType.bulgarian; + } + else + { + if (("catalan" == value)) + { + parsedValue = PerformanceCounterLanguageType.catalan; + } + else + { + if (("chinese" == value)) + { + parsedValue = PerformanceCounterLanguageType.chinese; + } + else + { + if (("croatian" == value)) + { + parsedValue = PerformanceCounterLanguageType.croatian; + } + else + { + if (("czech" == value)) + { + parsedValue = PerformanceCounterLanguageType.czech; + } + else + { + if (("danish" == value)) + { + parsedValue = PerformanceCounterLanguageType.danish; + } + else + { + if (("divehi" == value)) + { + parsedValue = PerformanceCounterLanguageType.divehi; + } + else + { + if (("dutch" == value)) + { + parsedValue = PerformanceCounterLanguageType.dutch; + } + else + { + if (("english" == value)) + { + parsedValue = PerformanceCounterLanguageType.english; + } + else + { + if (("estonian" == value)) + { + parsedValue = PerformanceCounterLanguageType.estonian; + } + else + { + if (("faeroese" == value)) + { + parsedValue = PerformanceCounterLanguageType.faeroese; + } + else + { + if (("farsi" == value)) + { + parsedValue = PerformanceCounterLanguageType.farsi; + } + else + { + if (("finnish" == value)) + { + parsedValue = PerformanceCounterLanguageType.finnish; + } + else + { + if (("french" == value)) + { + parsedValue = PerformanceCounterLanguageType.french; + } + else + { + if (("galician" == value)) + { + parsedValue = PerformanceCounterLanguageType.galician; + } + else + { + if (("georgian" == value)) + { + parsedValue = PerformanceCounterLanguageType.georgian; + } + else + { + if (("german" == value)) + { + parsedValue = PerformanceCounterLanguageType.german; + } + else + { + if (("greek" == value)) + { + parsedValue = PerformanceCounterLanguageType.greek; + } + else + { + if (("gujarati" == value)) + { + parsedValue = PerformanceCounterLanguageType.gujarati; + } + else + { + if (("hebrew" == value)) + { + parsedValue = PerformanceCounterLanguageType.hebrew; + } + else + { + if (("hindi" == value)) + { + parsedValue = PerformanceCounterLanguageType.hindi; + } + else + { + if (("hungarian" == value)) + { + parsedValue = PerformanceCounterLanguageType.hungarian; + } + else + { + if (("icelandic" == value)) + { + parsedValue = PerformanceCounterLanguageType.icelandic; + } + else + { + if (("indonesian" == value)) + { + parsedValue = PerformanceCounterLanguageType.indonesian; + } + else + { + if (("italian" == value)) + { + parsedValue = PerformanceCounterLanguageType.italian; + } + else + { + if (("japanese" == value)) + { + parsedValue = PerformanceCounterLanguageType.japanese; + } + else + { + if (("kannada" == value)) + { + parsedValue = PerformanceCounterLanguageType.kannada; + } + else + { + if (("kashmiri" == value)) + { + parsedValue = PerformanceCounterLanguageType.kashmiri; + } + else + { + if (("kazak" == value)) + { + parsedValue = PerformanceCounterLanguageType.kazak; + } + else + { + if (("konkani" == value)) + { + parsedValue = PerformanceCounterLanguageType.konkani; + } + else + { + if (("korean" == value)) + { + parsedValue = PerformanceCounterLanguageType.korean; + } + else + { + if (("kyrgyz" == value)) + { + parsedValue = PerformanceCounterLanguageType.kyrgyz; + } + else + { + if (("latvian" == value)) + { + parsedValue = PerformanceCounterLanguageType.latvian; + } + else + { + if (("lithuanian" == value)) + { + parsedValue = PerformanceCounterLanguageType.lithuanian; + } + else + { + if (("macedonian" == value)) + { + parsedValue = PerformanceCounterLanguageType.macedonian; + } + else + { + if (("malay" == value)) + { + parsedValue = PerformanceCounterLanguageType.malay; + } + else + { + if (("malayalam" == value)) + { + parsedValue = PerformanceCounterLanguageType.malayalam; + } + else + { + if (("manipuri" == value)) + { + parsedValue = PerformanceCounterLanguageType.manipuri; + } + else + { + if (("marathi" == value)) + { + parsedValue = PerformanceCounterLanguageType.marathi; + } + else + { + if (("mongolian" == value)) + { + parsedValue = PerformanceCounterLanguageType.mongolian; + } + else + { + if (("nepali" == value)) + { + parsedValue = PerformanceCounterLanguageType.nepali; + } + else + { + if (("norwegian" == value)) + { + parsedValue = PerformanceCounterLanguageType.norwegian; + } + else + { + if (("oriya" == value)) + { + parsedValue = PerformanceCounterLanguageType.oriya; + } + else + { + if (("polish" == value)) + { + parsedValue = PerformanceCounterLanguageType.polish; + } + else + { + if (("portuguese" == value)) + { + parsedValue = PerformanceCounterLanguageType.portuguese; + } + else + { + if (("punjabi" == value)) + { + parsedValue = PerformanceCounterLanguageType.punjabi; + } + else + { + if (("romanian" == value)) + { + parsedValue = PerformanceCounterLanguageType.romanian; + } + else + { + if (("russian" == value)) + { + parsedValue = PerformanceCounterLanguageType.russian; + } + else + { + if (("sanskrit" == value)) + { + parsedValue = PerformanceCounterLanguageType.sanskrit; + } + else + { + if (("serbian" == value)) + { + parsedValue = PerformanceCounterLanguageType.serbian; + } + else + { + if (("sindhi" == value)) + { + parsedValue = PerformanceCounterLanguageType.sindhi; + } + else + { + if (("slovak" == value)) + { + parsedValue = PerformanceCounterLanguageType.slovak; + } + else + { + if (("slovenian" == value)) + { + parsedValue = PerformanceCounterLanguageType.slovenian; + } + else + { + if (("spanish" == value)) + { + parsedValue = PerformanceCounterLanguageType.spanish; + } + else + { + if (("swahili" == value)) + { + parsedValue = PerformanceCounterLanguageType.swahili; + } + else + { + if (("swedish" == value)) + { + parsedValue = PerformanceCounterLanguageType.swedish; + } + else + { + if (("syriac" == value)) + { + parsedValue = PerformanceCounterLanguageType.syriac; + } + else + { + if (("tamil" == value)) + { + parsedValue = PerformanceCounterLanguageType.tamil; + } + else + { + if (("tatar" == value)) + { + parsedValue = PerformanceCounterLanguageType.tatar; + } + else + { + if (("telugu" == value)) + { + parsedValue = PerformanceCounterLanguageType.telugu; + } + else + { + if (("thai" == value)) + { + parsedValue = PerformanceCounterLanguageType.thai; + } + else + { + if (("turkish" == value)) + { + parsedValue = PerformanceCounterLanguageType.turkish; + } + else + { + if (("ukrainian" == value)) + { + parsedValue = PerformanceCounterLanguageType.ukrainian; + } + else + { + if (("urdu" == value)) + { + parsedValue = PerformanceCounterLanguageType.urdu; + } + else + { + if (("uzbek" == value)) + { + parsedValue = PerformanceCounterLanguageType.uzbek; + } + else + { + if (("vietnamese" == value)) + { + parsedValue = PerformanceCounterLanguageType.vietnamese; + } + else + { + parsedValue = PerformanceCounterLanguageType.IllegalValue; + return false; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + return true; + } + + /// + /// Parses a PerformanceCounterTypesType from a string. + /// + public static PerformanceCounterTypesType ParsePerformanceCounterTypesType(string value) + { + PerformanceCounterTypesType parsedValue; + Enums.TryParsePerformanceCounterTypesType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a PerformanceCounterTypesType from a string. + /// + public static bool TryParsePerformanceCounterTypesType(string value, out PerformanceCounterTypesType parsedValue) + { + parsedValue = PerformanceCounterTypesType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("averageBase" == value)) + { + parsedValue = PerformanceCounterTypesType.averageBase; + } + else + { + if (("averageCount64" == value)) + { + parsedValue = PerformanceCounterTypesType.averageCount64; + } + else + { + if (("averageTimer32" == value)) + { + parsedValue = PerformanceCounterTypesType.averageTimer32; + } + else + { + if (("counterDelta32" == value)) + { + parsedValue = PerformanceCounterTypesType.counterDelta32; + } + else + { + if (("counterTimerInverse" == value)) + { + parsedValue = PerformanceCounterTypesType.counterTimerInverse; + } + else + { + if (("sampleFraction" == value)) + { + parsedValue = PerformanceCounterTypesType.sampleFraction; + } + else + { + if (("timer100Ns" == value)) + { + parsedValue = PerformanceCounterTypesType.timer100Ns; + } + else + { + if (("counterTimer" == value)) + { + parsedValue = PerformanceCounterTypesType.counterTimer; + } + else + { + if (("rawFraction" == value)) + { + parsedValue = PerformanceCounterTypesType.rawFraction; + } + else + { + if (("timer100NsInverse" == value)) + { + parsedValue = PerformanceCounterTypesType.timer100NsInverse; + } + else + { + if (("counterMultiTimer" == value)) + { + parsedValue = PerformanceCounterTypesType.counterMultiTimer; + } + else + { + if (("counterMultiTimer100Ns" == value)) + { + parsedValue = PerformanceCounterTypesType.counterMultiTimer100Ns; + } + else + { + if (("counterMultiTimerInverse" == value)) + { + parsedValue = PerformanceCounterTypesType.counterMultiTimerInverse; + } + else + { + if (("counterMultiTimer100NsInverse" == value)) + { + parsedValue = PerformanceCounterTypesType.counterMultiTimer100NsInverse; + } + else + { + if (("elapsedTime" == value)) + { + parsedValue = PerformanceCounterTypesType.elapsedTime; + } + else + { + if (("sampleBase" == value)) + { + parsedValue = PerformanceCounterTypesType.sampleBase; + } + else + { + if (("rawBase" == value)) + { + parsedValue = PerformanceCounterTypesType.rawBase; + } + else + { + if (("counterMultiBase" == value)) + { + parsedValue = PerformanceCounterTypesType.counterMultiBase; + } + else + { + if (("rateOfCountsPerSecond64" == value)) + { + parsedValue = PerformanceCounterTypesType.rateOfCountsPerSecond64; + } + else + { + if (("rateOfCountsPerSecond32" == value)) + { + parsedValue = PerformanceCounterTypesType.rateOfCountsPerSecond32; + } + else + { + if (("countPerTimeInterval64" == value)) + { + parsedValue = PerformanceCounterTypesType.countPerTimeInterval64; + } + else + { + if (("countPerTimeInterval32" == value)) + { + parsedValue = PerformanceCounterTypesType.countPerTimeInterval32; + } + else + { + if (("sampleCounter" == value)) + { + parsedValue = PerformanceCounterTypesType.sampleCounter; + } + else + { + if (("counterDelta64" == value)) + { + parsedValue = PerformanceCounterTypesType.counterDelta64; + } + else + { + if (("numberOfItems64" == value)) + { + parsedValue = PerformanceCounterTypesType.numberOfItems64; + } + else + { + if (("numberOfItems32" == value)) + { + parsedValue = PerformanceCounterTypesType.numberOfItems32; + } + else + { + if (("numberOfItemsHEX64" == value)) + { + parsedValue = PerformanceCounterTypesType.numberOfItemsHEX64; + } + else + { + if (("numberOfItemsHEX32" == value)) + { + parsedValue = PerformanceCounterTypesType.numberOfItemsHEX32; + } + else + { + parsedValue = PerformanceCounterTypesType.IllegalValue; + return false; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + return true; + } + } + + /// + /// Enumeration of valid languages for performance counters. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum PerformanceCounterLanguageType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + afrikaans, + + albanian, + + arabic, + + armenian, + + assamese, + + azeri, + + basque, + + belarusian, + + bengali, + + bulgarian, + + catalan, + + chinese, + + croatian, + + czech, + + danish, + + divehi, + + dutch, + + english, + + estonian, + + faeroese, + + farsi, + + finnish, + + french, + + galician, + + georgian, + + german, + + greek, + + gujarati, + + hebrew, + + hindi, + + hungarian, + + icelandic, + + indonesian, + + italian, + + japanese, + + kannada, + + kashmiri, + + kazak, + + konkani, + + korean, + + kyrgyz, + + latvian, + + lithuanian, + + macedonian, + + malay, + + malayalam, + + manipuri, + + marathi, + + mongolian, + + nepali, + + norwegian, + + oriya, + + polish, + + portuguese, + + punjabi, + + romanian, + + russian, + + sanskrit, + + serbian, + + sindhi, + + slovak, + + slovenian, + + spanish, + + swahili, + + swedish, + + syriac, + + tamil, + + tatar, + + telugu, + + thai, + + turkish, + + ukrainian, + + urdu, + + uzbek, + + vietnamese, + } + + /// + /// Enumeration of valid types for performance counters. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum PerformanceCounterTypesType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + averageBase, + + averageCount64, + + averageTimer32, + + counterDelta32, + + counterTimerInverse, + + sampleFraction, + + timer100Ns, + + counterTimer, + + rawFraction, + + timer100NsInverse, + + counterMultiTimer, + + counterMultiTimer100Ns, + + counterMultiTimerInverse, + + counterMultiTimer100NsInverse, + + elapsedTime, + + sampleBase, + + rawBase, + + counterMultiBase, + + rateOfCountsPerSecond64, + + rateOfCountsPerSecond32, + + countPerTimeInterval64, + + countPerTimeInterval32, + + sampleCounter, + + counterDelta64, + + numberOfItems64, + + numberOfItems32, + + numberOfItemsHEX64, + + numberOfItemsHEX32, + } + + /// + /// Closes applications or schedules a reboot if application cannot be closed. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class CloseApplication : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string targetField; + + private bool targetFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private int sequenceField; + + private bool sequenceFieldSet; + + private YesNoType closeMessageField; + + private bool closeMessageFieldSet; + + private YesNoType endSessionMessageField; + + private bool endSessionMessageFieldSet; + + private YesNoType elevatedCloseMessageField; + + private bool elevatedCloseMessageFieldSet; + + private YesNoType elevatedEndSessionMessageField; + + private bool elevatedEndSessionMessageFieldSet; + + private YesNoType rebootPromptField; + + private bool rebootPromptFieldSet; + + private YesNoType promptToContinueField; + + private bool promptToContinueFieldSet; + + private string propertyField; + + private bool propertyFieldSet; + + private int terminateProcessField; + + private bool terminateProcessFieldSet; + + private int timeoutField; + + private bool timeoutFieldSet; + + private string contentField; + + private bool contentFieldSet; + + private ISchemaElement parentElement; + + /// + /// Identifier for the close application (primary key). If the Id is not specified, one will be generated. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name of the exectuable to be closed. This should only be the file name. + /// + public string Target + { + get + { + return this.targetField; + } + set + { + this.targetFieldSet = true; + this.targetField = value; + } + } + + /// + /// Description to show if application is running and needs to be closed. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// Optionally orders the applications to be closed. + /// + public int Sequence + { + get + { + return this.sequenceField; + } + set + { + this.sequenceFieldSet = true; + this.sequenceField = value; + } + } + + /// + /// Optionally sends a close message to the application. Default is no. + /// + public YesNoType CloseMessage + { + get + { + return this.closeMessageField; + } + set + { + this.closeMessageFieldSet = true; + this.closeMessageField = value; + } + } + + /// + /// Sends WM_QUERYENDSESSION then WM_ENDSESSION messages to the application. Default is "no". + /// + public YesNoType EndSessionMessage + { + get + { + return this.endSessionMessageField; + } + set + { + this.endSessionMessageFieldSet = true; + this.endSessionMessageField = value; + } + } + + /// + /// Optionally sends a close message to the application from deffered action without impersonation. Default is no. + /// + public YesNoType ElevatedCloseMessage + { + get + { + return this.elevatedCloseMessageField; + } + set + { + this.elevatedCloseMessageFieldSet = true; + this.elevatedCloseMessageField = value; + } + } + + /// + /// Sends WM_QUERYENDSESSION then WM_ENDSESSION messages to the application from a deffered action without impersonation. Default is "no". + /// + public YesNoType ElevatedEndSessionMessage + { + get + { + return this.elevatedEndSessionMessageField; + } + set + { + this.elevatedEndSessionMessageFieldSet = true; + this.elevatedEndSessionMessageField = value; + } + } + + /// + /// Optionally prompts for reboot if application is still running. The default is "yes". The TerminateProcess attribute must be "no" or not specified if this attribute is "yes". + /// + public YesNoType RebootPrompt + { + get + { + return this.rebootPromptField; + } + set + { + this.rebootPromptFieldSet = true; + this.rebootPromptField = value; + } + } + + /// + /// When this attribute is set to "yes", the user will be prompted when the application is still running. The Description attribute must contain the message to + /// display in the prompt. The prompt occurs before executing any of the other options and gives the options to "Abort", "Retry", or "Ignore". Abort will cancel + /// the install. Retry will attempt the check again and if the application is still running, prompt again. "Ignore" will continue and execute any other options + /// set on the CloseApplication element. The default is "no". + /// + public YesNoType PromptToContinue + { + get + { + return this.promptToContinueField; + } + set + { + this.promptToContinueFieldSet = true; + this.promptToContinueField = value; + } + } + + /// + /// Property to be set if application is still running. Useful for launch conditions or to conditionalize custom UI to ask user to shut down apps. + /// + public string Property + { + get + { + return this.propertyField; + } + set + { + this.propertyFieldSet = true; + this.propertyField = value; + } + } + + /// + /// Attempts to terminates process and return the specified exit code if application is still running after sending any requested close and/or end session messages. + /// If this attribute is specified, the RebootPrompt attribute must be "no". The default is "no". + /// + public int TerminateProcess + { + get + { + return this.terminateProcessField; + } + set + { + this.terminateProcessFieldSet = true; + this.terminateProcessField = value; + } + } + + /// + /// Optional time in seconds to wait for the application to exit after the close and/or end session messages. If the application is still running after the timeout then + /// the RebootPrompt or TerminateProcess attributes will be considered. The default value is "5" seconds. + /// + public int Timeout + { + get + { + return this.timeoutField; + } + set + { + this.timeoutFieldSet = true; + this.timeoutField = value; + } + } + + /// + /// Condition that determines if the application should be closed. Must be blank or evaluate to true + /// for the application to be scheduled for closing. + /// + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("CloseApplication", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.targetFieldSet) + { + writer.WriteAttributeString("Target", this.targetField); + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.sequenceFieldSet) + { + writer.WriteAttributeString("Sequence", this.sequenceField.ToString(CultureInfo.InvariantCulture)); + } + if (this.closeMessageFieldSet) + { + if ((this.closeMessageField == YesNoType.no)) + { + writer.WriteAttributeString("CloseMessage", "no"); + } + if ((this.closeMessageField == YesNoType.yes)) + { + writer.WriteAttributeString("CloseMessage", "yes"); + } + } + if (this.endSessionMessageFieldSet) + { + if ((this.endSessionMessageField == YesNoType.no)) + { + writer.WriteAttributeString("EndSessionMessage", "no"); + } + if ((this.endSessionMessageField == YesNoType.yes)) + { + writer.WriteAttributeString("EndSessionMessage", "yes"); + } + } + if (this.elevatedCloseMessageFieldSet) + { + if ((this.elevatedCloseMessageField == YesNoType.no)) + { + writer.WriteAttributeString("ElevatedCloseMessage", "no"); + } + if ((this.elevatedCloseMessageField == YesNoType.yes)) + { + writer.WriteAttributeString("ElevatedCloseMessage", "yes"); + } + } + if (this.elevatedEndSessionMessageFieldSet) + { + if ((this.elevatedEndSessionMessageField == YesNoType.no)) + { + writer.WriteAttributeString("ElevatedEndSessionMessage", "no"); + } + if ((this.elevatedEndSessionMessageField == YesNoType.yes)) + { + writer.WriteAttributeString("ElevatedEndSessionMessage", "yes"); + } + } + if (this.rebootPromptFieldSet) + { + if ((this.rebootPromptField == YesNoType.no)) + { + writer.WriteAttributeString("RebootPrompt", "no"); + } + if ((this.rebootPromptField == YesNoType.yes)) + { + writer.WriteAttributeString("RebootPrompt", "yes"); + } + } + if (this.promptToContinueFieldSet) + { + if ((this.promptToContinueField == YesNoType.no)) + { + writer.WriteAttributeString("PromptToContinue", "no"); + } + if ((this.promptToContinueField == YesNoType.yes)) + { + writer.WriteAttributeString("PromptToContinue", "yes"); + } + } + if (this.propertyFieldSet) + { + writer.WriteAttributeString("Property", this.propertyField); + } + if (this.terminateProcessFieldSet) + { + writer.WriteAttributeString("TerminateProcess", this.terminateProcessField.ToString(CultureInfo.InvariantCulture)); + } + if (this.timeoutFieldSet) + { + writer.WriteAttributeString("Timeout", this.timeoutField.ToString(CultureInfo.InvariantCulture)); + } + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Target" == name)) + { + this.targetField = value; + this.targetFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("Sequence" == name)) + { + this.sequenceField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.sequenceFieldSet = true; + } + if (("CloseMessage" == name)) + { + this.closeMessageField = Enums.ParseYesNoType(value); + this.closeMessageFieldSet = true; + } + if (("EndSessionMessage" == name)) + { + this.endSessionMessageField = Enums.ParseYesNoType(value); + this.endSessionMessageFieldSet = true; + } + if (("ElevatedCloseMessage" == name)) + { + this.elevatedCloseMessageField = Enums.ParseYesNoType(value); + this.elevatedCloseMessageFieldSet = true; + } + if (("ElevatedEndSessionMessage" == name)) + { + this.elevatedEndSessionMessageField = Enums.ParseYesNoType(value); + this.elevatedEndSessionMessageFieldSet = true; + } + if (("RebootPrompt" == name)) + { + this.rebootPromptField = Enums.ParseYesNoType(value); + this.rebootPromptFieldSet = true; + } + if (("PromptToContinue" == name)) + { + this.promptToContinueField = Enums.ParseYesNoType(value); + this.promptToContinueFieldSet = true; + } + if (("Property" == name)) + { + this.propertyField = value; + this.propertyFieldSet = true; + } + if (("TerminateProcess" == name)) + { + this.terminateProcessField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.terminateProcessFieldSet = true; + } + if (("Timeout" == name)) + { + this.timeoutField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.timeoutFieldSet = true; + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + } + + /// + /// Describes a component search. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class ComponentSearch : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string variableField; + + private bool variableFieldSet; + + private string conditionField; + + private bool conditionFieldSet; + + private string afterField; + + private bool afterFieldSet; + + private string guidField; + + private bool guidFieldSet; + + private string productCodeField; + + private bool productCodeFieldSet; + + private ResultType resultField; + + private bool resultFieldSet; + + private ISchemaElement parentElement; + + /// + /// Id of the search for ordering and dependency. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name of the variable in which to place the result of the search. + /// + public string Variable + { + get + { + return this.variableField; + } + set + { + this.variableFieldSet = true; + this.variableField = value; + } + } + + /// + /// Condition for evaluating the search. If this evaluates to false, the search is not executed at all. + /// + public string Condition + { + get + { + return this.conditionField; + } + set + { + this.conditionFieldSet = true; + this.conditionField = value; + } + } + + /// + /// Id of the search that this one should come after. + /// + public string After + { + get + { + return this.afterField; + } + set + { + this.afterFieldSet = true; + this.afterField = value; + } + } + + /// + /// Component to search for. + /// + public string Guid + { + get + { + return this.guidField; + } + set + { + this.guidFieldSet = true; + this.guidField = value; + } + } + + /// + /// Optional ProductCode to determine if the component is installed. + /// + public string ProductCode + { + get + { + return this.productCodeField; + } + set + { + this.productCodeFieldSet = true; + this.productCodeField = value; + } + } + + /// + /// Rather than saving the matching key path into the variable, a ComponentSearch can save an attribute of the component instead. + /// + public ResultType Result + { + get + { + return this.resultField; + } + set + { + this.resultFieldSet = true; + this.resultField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a ResultType from a string. + /// + public static ResultType ParseResultType(string value) + { + ResultType parsedValue; + ComponentSearch.TryParseResultType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ResultType from a string. + /// + public static bool TryParseResultType(string value, out ResultType parsedValue) + { + parsedValue = ResultType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("directory" == value)) + { + parsedValue = ResultType.directory; + } + else + { + if (("state" == value)) + { + parsedValue = ResultType.state; + } + else + { + if (("keyPath" == value)) + { + parsedValue = ResultType.keyPath; + } + else + { + parsedValue = ResultType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ComponentSearch", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.variableFieldSet) + { + writer.WriteAttributeString("Variable", this.variableField); + } + if (this.conditionFieldSet) + { + writer.WriteAttributeString("Condition", this.conditionField); + } + if (this.afterFieldSet) + { + writer.WriteAttributeString("After", this.afterField); + } + if (this.guidFieldSet) + { + writer.WriteAttributeString("Guid", this.guidField); + } + if (this.productCodeFieldSet) + { + writer.WriteAttributeString("ProductCode", this.productCodeField); + } + if (this.resultFieldSet) + { + if ((this.resultField == ResultType.directory)) + { + writer.WriteAttributeString("Result", "directory"); + } + if ((this.resultField == ResultType.state)) + { + writer.WriteAttributeString("Result", "state"); + } + if ((this.resultField == ResultType.keyPath)) + { + writer.WriteAttributeString("Result", "keyPath"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Variable" == name)) + { + this.variableField = value; + this.variableFieldSet = true; + } + if (("Condition" == name)) + { + this.conditionField = value; + this.conditionFieldSet = true; + } + if (("After" == name)) + { + this.afterField = value; + this.afterFieldSet = true; + } + if (("Guid" == name)) + { + this.guidField = value; + this.guidFieldSet = true; + } + if (("ProductCode" == name)) + { + this.productCodeField = value; + this.productCodeFieldSet = true; + } + if (("Result" == name)) + { + this.resultField = ComponentSearch.ParseResultType(value); + this.resultFieldSet = true; + } + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum ResultType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Saves the parent directory for the component's file key path; other types of key path are returned unmodified. + /// + directory, + + /// + /// Saves the state of the component: absent (2), locally installed (3), will run from source (4), or installed in default location (either local or from source) (5) + /// + state, + + /// + /// Saves the key path of the component if installed. This is the default. + /// + keyPath, + } + } + + /// + /// References a ComponentSearch. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class ComponentSearchRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ComponentSearchRef", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Describes a directory search. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class DirectorySearch : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string variableField; + + private bool variableFieldSet; + + private string conditionField; + + private bool conditionFieldSet; + + private string afterField; + + private bool afterFieldSet; + + private string pathField; + + private bool pathFieldSet; + + private ResultType resultField; + + private bool resultFieldSet; + + private ISchemaElement parentElement; + + /// + /// Id of the search for ordering and dependency. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name of the variable in which to place the result of the search. + /// + public string Variable + { + get + { + return this.variableField; + } + set + { + this.variableFieldSet = true; + this.variableField = value; + } + } + + /// + /// Condition for evaluating the search. If this evaluates to false, the search is not executed at all. + /// + public string Condition + { + get + { + return this.conditionField; + } + set + { + this.conditionFieldSet = true; + this.conditionField = value; + } + } + + /// + /// Id of the search that this one should come after. + /// + public string After + { + get + { + return this.afterField; + } + set + { + this.afterFieldSet = true; + this.afterField = value; + } + } + + /// + /// Directory path to search for. + /// + public string Path + { + get + { + return this.pathField; + } + set + { + this.pathFieldSet = true; + this.pathField = value; + } + } + + /// + /// Rather than saving the matching directory path into the variable, a DirectorySearch can save an + /// attribute of the matching directory instead. + /// + public ResultType Result + { + get + { + return this.resultField; + } + set + { + this.resultFieldSet = true; + this.resultField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a ResultType from a string. + /// + public static ResultType ParseResultType(string value) + { + ResultType parsedValue; + DirectorySearch.TryParseResultType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ResultType from a string. + /// + public static bool TryParseResultType(string value, out ResultType parsedValue) + { + parsedValue = ResultType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("exists" == value)) + { + parsedValue = ResultType.exists; + } + else + { + parsedValue = ResultType.IllegalValue; + return false; + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("DirectorySearch", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.variableFieldSet) + { + writer.WriteAttributeString("Variable", this.variableField); + } + if (this.conditionFieldSet) + { + writer.WriteAttributeString("Condition", this.conditionField); + } + if (this.afterFieldSet) + { + writer.WriteAttributeString("After", this.afterField); + } + if (this.pathFieldSet) + { + writer.WriteAttributeString("Path", this.pathField); + } + if (this.resultFieldSet) + { + if ((this.resultField == ResultType.exists)) + { + writer.WriteAttributeString("Result", "exists"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Variable" == name)) + { + this.variableField = value; + this.variableFieldSet = true; + } + if (("Condition" == name)) + { + this.conditionField = value; + this.conditionFieldSet = true; + } + if (("After" == name)) + { + this.afterField = value; + this.afterFieldSet = true; + } + if (("Path" == name)) + { + this.pathField = value; + this.pathFieldSet = true; + } + if (("Result" == name)) + { + this.resultField = DirectorySearch.ParseResultType(value); + this.resultFieldSet = true; + } + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum ResultType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Saves true if a matching directory is found; false otherwise. + /// + exists, + } + } + + /// + /// References a DirectorySearch. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class DirectorySearchRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("DirectorySearchRef", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Creates an event source. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class EventSource : ISchemaElement, ISetAttributes + { + + private int categoryCountField; + + private bool categoryCountFieldSet; + + private string categoryMessageFileField; + + private bool categoryMessageFileFieldSet; + + private string eventMessageFileField; + + private bool eventMessageFileFieldSet; + + private YesNoType keyPathField; + + private bool keyPathFieldSet; + + private string logField; + + private bool logFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string parameterMessageFileField; + + private bool parameterMessageFileFieldSet; + + private YesNoType supportsErrorsField; + + private bool supportsErrorsFieldSet; + + private YesNoType supportsFailureAuditsField; + + private bool supportsFailureAuditsFieldSet; + + private YesNoType supportsInformationalsField; + + private bool supportsInformationalsFieldSet; + + private YesNoType supportsSuccessAuditsField; + + private bool supportsSuccessAuditsFieldSet; + + private YesNoType supportsWarningsField; + + private bool supportsWarningsFieldSet; + + private ISchemaElement parentElement; + + /// + /// The number of categories in CategoryMessageFile. CategoryMessageFile + /// must be specified too. + /// + public int CategoryCount + { + get + { + return this.categoryCountField; + } + set + { + this.categoryCountFieldSet = true; + this.categoryCountField = value; + } + } + + /// + /// Name of the category message file. CategoryCount must be specified too. + /// Note that this is a formatted field, so you can use [#fileId] syntax to + /// refer to a file being installed. It is also written as a REG_EXPAND_SZ + /// string, so you can use %environment_variable% syntax to refer to a file + /// already present on the user's machine. + /// + public string CategoryMessageFile + { + get + { + return this.categoryMessageFileField; + } + set + { + this.categoryMessageFileFieldSet = true; + this.categoryMessageFileField = value; + } + } + + /// + /// Name of the event message file. + /// Note that this is a formatted field, so you can use [#fileId] syntax to + /// refer to a file being installed. It is also written as a REG_EXPAND_SZ + /// string, so you can use %environment_variable% syntax to refer to a file + /// already present on the user's machine. + /// + public string EventMessageFile + { + get + { + return this.eventMessageFileField; + } + set + { + this.eventMessageFileFieldSet = true; + this.eventMessageFileField = value; + } + } + + /// + /// Marks the EventSource registry as the key path of the component it belongs to. + /// + public YesNoType KeyPath + { + get + { + return this.keyPathField; + } + set + { + this.keyPathFieldSet = true; + this.keyPathField = value; + } + } + + /// + /// Name of the event source's log. + /// + public string Log + { + get + { + return this.logField; + } + set + { + this.logFieldSet = true; + this.logField = value; + } + } + + /// + /// Name of the event source. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Name of the parameter message file. + /// Note that this is a formatted field, so you can use [#fileId] syntax to + /// refer to a file being installed. It is also written as a REG_EXPAND_SZ + /// string, so you can use %environment_variable% syntax to refer to a file + /// already present on the user's machine. + /// + public string ParameterMessageFile + { + get + { + return this.parameterMessageFileField; + } + set + { + this.parameterMessageFileFieldSet = true; + this.parameterMessageFileField = value; + } + } + + /// + /// Equivalent to EVENTLOG_ERROR_TYPE. + /// + public YesNoType SupportsErrors + { + get + { + return this.supportsErrorsField; + } + set + { + this.supportsErrorsFieldSet = true; + this.supportsErrorsField = value; + } + } + + /// + /// Equivalent to EVENTLOG_AUDIT_FAILURE. + /// + public YesNoType SupportsFailureAudits + { + get + { + return this.supportsFailureAuditsField; + } + set + { + this.supportsFailureAuditsFieldSet = true; + this.supportsFailureAuditsField = value; + } + } + + /// + /// Equivalent to EVENTLOG_INFORMATION_TYPE. + /// + public YesNoType SupportsInformationals + { + get + { + return this.supportsInformationalsField; + } + set + { + this.supportsInformationalsFieldSet = true; + this.supportsInformationalsField = value; + } + } + + /// + /// Equivalent to EVENTLOG_AUDIT_SUCCESS. + /// + public YesNoType SupportsSuccessAudits + { + get + { + return this.supportsSuccessAuditsField; + } + set + { + this.supportsSuccessAuditsFieldSet = true; + this.supportsSuccessAuditsField = value; + } + } + + /// + /// Equivalent to EVENTLOG_WARNING_TYPE. + /// + public YesNoType SupportsWarnings + { + get + { + return this.supportsWarningsField; + } + set + { + this.supportsWarningsFieldSet = true; + this.supportsWarningsField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("EventSource", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.categoryCountFieldSet) + { + writer.WriteAttributeString("CategoryCount", this.categoryCountField.ToString(CultureInfo.InvariantCulture)); + } + if (this.categoryMessageFileFieldSet) + { + writer.WriteAttributeString("CategoryMessageFile", this.categoryMessageFileField); + } + if (this.eventMessageFileFieldSet) + { + writer.WriteAttributeString("EventMessageFile", this.eventMessageFileField); + } + if (this.keyPathFieldSet) + { + if ((this.keyPathField == YesNoType.no)) + { + writer.WriteAttributeString("KeyPath", "no"); + } + if ((this.keyPathField == YesNoType.yes)) + { + writer.WriteAttributeString("KeyPath", "yes"); + } + } + if (this.logFieldSet) + { + writer.WriteAttributeString("Log", this.logField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.parameterMessageFileFieldSet) + { + writer.WriteAttributeString("ParameterMessageFile", this.parameterMessageFileField); + } + if (this.supportsErrorsFieldSet) + { + if ((this.supportsErrorsField == YesNoType.no)) + { + writer.WriteAttributeString("SupportsErrors", "no"); + } + if ((this.supportsErrorsField == YesNoType.yes)) + { + writer.WriteAttributeString("SupportsErrors", "yes"); + } + } + if (this.supportsFailureAuditsFieldSet) + { + if ((this.supportsFailureAuditsField == YesNoType.no)) + { + writer.WriteAttributeString("SupportsFailureAudits", "no"); + } + if ((this.supportsFailureAuditsField == YesNoType.yes)) + { + writer.WriteAttributeString("SupportsFailureAudits", "yes"); + } + } + if (this.supportsInformationalsFieldSet) + { + if ((this.supportsInformationalsField == YesNoType.no)) + { + writer.WriteAttributeString("SupportsInformationals", "no"); + } + if ((this.supportsInformationalsField == YesNoType.yes)) + { + writer.WriteAttributeString("SupportsInformationals", "yes"); + } + } + if (this.supportsSuccessAuditsFieldSet) + { + if ((this.supportsSuccessAuditsField == YesNoType.no)) + { + writer.WriteAttributeString("SupportsSuccessAudits", "no"); + } + if ((this.supportsSuccessAuditsField == YesNoType.yes)) + { + writer.WriteAttributeString("SupportsSuccessAudits", "yes"); + } + } + if (this.supportsWarningsFieldSet) + { + if ((this.supportsWarningsField == YesNoType.no)) + { + writer.WriteAttributeString("SupportsWarnings", "no"); + } + if ((this.supportsWarningsField == YesNoType.yes)) + { + writer.WriteAttributeString("SupportsWarnings", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("CategoryCount" == name)) + { + this.categoryCountField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.categoryCountFieldSet = true; + } + if (("CategoryMessageFile" == name)) + { + this.categoryMessageFileField = value; + this.categoryMessageFileFieldSet = true; + } + if (("EventMessageFile" == name)) + { + this.eventMessageFileField = value; + this.eventMessageFileFieldSet = true; + } + if (("KeyPath" == name)) + { + this.keyPathField = Enums.ParseYesNoType(value); + this.keyPathFieldSet = true; + } + if (("Log" == name)) + { + this.logField = value; + this.logFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("ParameterMessageFile" == name)) + { + this.parameterMessageFileField = value; + this.parameterMessageFileFieldSet = true; + } + if (("SupportsErrors" == name)) + { + this.supportsErrorsField = Enums.ParseYesNoType(value); + this.supportsErrorsFieldSet = true; + } + if (("SupportsFailureAudits" == name)) + { + this.supportsFailureAuditsField = Enums.ParseYesNoType(value); + this.supportsFailureAuditsFieldSet = true; + } + if (("SupportsInformationals" == name)) + { + this.supportsInformationalsField = Enums.ParseYesNoType(value); + this.supportsInformationalsFieldSet = true; + } + if (("SupportsSuccessAudits" == name)) + { + this.supportsSuccessAuditsField = Enums.ParseYesNoType(value); + this.supportsSuccessAuditsFieldSet = true; + } + if (("SupportsWarnings" == name)) + { + this.supportsWarningsField = Enums.ParseYesNoType(value); + this.supportsWarningsFieldSet = true; + } + } + } + + /// + /// Describes a file search. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class FileSearch : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string variableField; + + private bool variableFieldSet; + + private string conditionField; + + private bool conditionFieldSet; + + private string afterField; + + private bool afterFieldSet; + + private string pathField; + + private bool pathFieldSet; + + private ResultType resultField; + + private bool resultFieldSet; + + private ISchemaElement parentElement; + + /// + /// Id of the search for ordering and dependency. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name of the variable in which to place the result of the search. + /// + public string Variable + { + get + { + return this.variableField; + } + set + { + this.variableFieldSet = true; + this.variableField = value; + } + } + + /// + /// Condition for evaluating the search. If this evaluates to false, the search is not executed at all. + /// + public string Condition + { + get + { + return this.conditionField; + } + set + { + this.conditionFieldSet = true; + this.conditionField = value; + } + } + + /// + /// Id of the search that this one should come after. + /// + public string After + { + get + { + return this.afterField; + } + set + { + this.afterFieldSet = true; + this.afterField = value; + } + } + + /// + /// File path to search for. + /// + public string Path + { + get + { + return this.pathField; + } + set + { + this.pathFieldSet = true; + this.pathField = value; + } + } + + /// + /// Rather than saving the matching file path into the variable, a FileSearch can save an attribute of the matching file instead. + /// + public ResultType Result + { + get + { + return this.resultField; + } + set + { + this.resultFieldSet = true; + this.resultField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a ResultType from a string. + /// + public static ResultType ParseResultType(string value) + { + ResultType parsedValue; + FileSearch.TryParseResultType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ResultType from a string. + /// + public static bool TryParseResultType(string value, out ResultType parsedValue) + { + parsedValue = ResultType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("exists" == value)) + { + parsedValue = ResultType.exists; + } + else + { + if (("version" == value)) + { + parsedValue = ResultType.version; + } + else + { + parsedValue = ResultType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("FileSearch", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.variableFieldSet) + { + writer.WriteAttributeString("Variable", this.variableField); + } + if (this.conditionFieldSet) + { + writer.WriteAttributeString("Condition", this.conditionField); + } + if (this.afterFieldSet) + { + writer.WriteAttributeString("After", this.afterField); + } + if (this.pathFieldSet) + { + writer.WriteAttributeString("Path", this.pathField); + } + if (this.resultFieldSet) + { + if ((this.resultField == ResultType.exists)) + { + writer.WriteAttributeString("Result", "exists"); + } + if ((this.resultField == ResultType.version)) + { + writer.WriteAttributeString("Result", "version"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Variable" == name)) + { + this.variableField = value; + this.variableFieldSet = true; + } + if (("Condition" == name)) + { + this.conditionField = value; + this.conditionFieldSet = true; + } + if (("After" == name)) + { + this.afterField = value; + this.afterFieldSet = true; + } + if (("Path" == name)) + { + this.pathField = value; + this.pathFieldSet = true; + } + if (("Result" == name)) + { + this.resultField = FileSearch.ParseResultType(value); + this.resultFieldSet = true; + } + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum ResultType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Saves true if a matching file is found; false otherwise. + /// + exists, + + /// + /// Saves the version information for files that have it (.exe, .dll); zero-version (0.0.0.0) otherwise. + /// + version, + } + } + + /// + /// References a FileSearch. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class FileSearchRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("FileSearchRef", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Creates a file share out of the component's directory. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class FileShare : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private ISchemaElement parentElement; + + public FileShare() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(FileSharePermission))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Identifier for the file share (primary key). + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name of the file share. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Description of the file share. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("FileSharePermission" == childName)) + { + childValue = new FileSharePermission(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("FileShare", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + } + } + + /// + /// Sets ACLs on a FileShare. This element has no Id attribute. + /// The table and key are taken from the parent element. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class FileSharePermission : ISchemaElement, ISetAttributes + { + + private string userField; + + private bool userFieldSet; + + private YesNoType readField; + + private bool readFieldSet; + + private YesNoType deleteField; + + private bool deleteFieldSet; + + private YesNoType readPermissionField; + + private bool readPermissionFieldSet; + + private YesNoType changePermissionField; + + private bool changePermissionFieldSet; + + private YesNoType takeOwnershipField; + + private bool takeOwnershipFieldSet; + + private YesNoType readAttributesField; + + private bool readAttributesFieldSet; + + private YesNoType writeAttributesField; + + private bool writeAttributesFieldSet; + + private YesNoType readExtendedAttributesField; + + private bool readExtendedAttributesFieldSet; + + private YesNoType writeExtendedAttributesField; + + private bool writeExtendedAttributesFieldSet; + + private YesNoType synchronizeField; + + private bool synchronizeFieldSet; + + private YesNoType createFileField; + + private bool createFileFieldSet; + + private YesNoType createChildField; + + private bool createChildFieldSet; + + private YesNoType deleteChildField; + + private bool deleteChildFieldSet; + + private YesNoType traverseField; + + private bool traverseFieldSet; + + private YesNoType genericAllField; + + private bool genericAllFieldSet; + + private YesNoType genericExecuteField; + + private bool genericExecuteFieldSet; + + private YesNoType genericWriteField; + + private bool genericWriteFieldSet; + + private YesNoType genericReadField; + + private bool genericReadFieldSet; + + private ISchemaElement parentElement; + + public string User + { + get + { + return this.userField; + } + set + { + this.userFieldSet = true; + this.userField = value; + } + } + + public YesNoType Read + { + get + { + return this.readField; + } + set + { + this.readFieldSet = true; + this.readField = value; + } + } + + public YesNoType Delete + { + get + { + return this.deleteField; + } + set + { + this.deleteFieldSet = true; + this.deleteField = value; + } + } + + public YesNoType ReadPermission + { + get + { + return this.readPermissionField; + } + set + { + this.readPermissionFieldSet = true; + this.readPermissionField = value; + } + } + + public YesNoType ChangePermission + { + get + { + return this.changePermissionField; + } + set + { + this.changePermissionFieldSet = true; + this.changePermissionField = value; + } + } + + public YesNoType TakeOwnership + { + get + { + return this.takeOwnershipField; + } + set + { + this.takeOwnershipFieldSet = true; + this.takeOwnershipField = value; + } + } + + public YesNoType ReadAttributes + { + get + { + return this.readAttributesField; + } + set + { + this.readAttributesFieldSet = true; + this.readAttributesField = value; + } + } + + public YesNoType WriteAttributes + { + get + { + return this.writeAttributesField; + } + set + { + this.writeAttributesFieldSet = true; + this.writeAttributesField = value; + } + } + + public YesNoType ReadExtendedAttributes + { + get + { + return this.readExtendedAttributesField; + } + set + { + this.readExtendedAttributesFieldSet = true; + this.readExtendedAttributesField = value; + } + } + + public YesNoType WriteExtendedAttributes + { + get + { + return this.writeExtendedAttributesField; + } + set + { + this.writeExtendedAttributesFieldSet = true; + this.writeExtendedAttributesField = value; + } + } + + public YesNoType Synchronize + { + get + { + return this.synchronizeField; + } + set + { + this.synchronizeFieldSet = true; + this.synchronizeField = value; + } + } + + /// + /// For a directory, the right to create a file in the directory. Only valid under a 'CreateFolder' parent. + /// + public YesNoType CreateFile + { + get + { + return this.createFileField; + } + set + { + this.createFileFieldSet = true; + this.createFileField = value; + } + } + + /// + /// For a directory, the right to create a subdirectory. Only valid under a 'CreateFolder' parent. + /// + public YesNoType CreateChild + { + get + { + return this.createChildField; + } + set + { + this.createChildFieldSet = true; + this.createChildField = value; + } + } + + /// + /// For a directory, the right to delete a directory and all the files it contains, including read-only files. Only valid under a 'CreateFolder' parent. + /// + public YesNoType DeleteChild + { + get + { + return this.deleteChildField; + } + set + { + this.deleteChildFieldSet = true; + this.deleteChildField = value; + } + } + + /// + /// For a directory, the right to traverse the directory. By default, users are assigned the BYPASS_TRAVERSE_CHECKING privilege, which ignores the FILE_TRAVERSE access right. Only valid under a 'CreateFolder' parent. + /// + public YesNoType Traverse + { + get + { + return this.traverseField; + } + set + { + this.traverseFieldSet = true; + this.traverseField = value; + } + } + + public YesNoType GenericAll + { + get + { + return this.genericAllField; + } + set + { + this.genericAllFieldSet = true; + this.genericAllField = value; + } + } + + public YesNoType GenericExecute + { + get + { + return this.genericExecuteField; + } + set + { + this.genericExecuteFieldSet = true; + this.genericExecuteField = value; + } + } + + public YesNoType GenericWrite + { + get + { + return this.genericWriteField; + } + set + { + this.genericWriteFieldSet = true; + this.genericWriteField = value; + } + } + + /// + /// specifying this will fail to grant read access + /// + public YesNoType GenericRead + { + get + { + return this.genericReadField; + } + set + { + this.genericReadFieldSet = true; + this.genericReadField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("FileSharePermission", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.userFieldSet) + { + writer.WriteAttributeString("User", this.userField); + } + if (this.readFieldSet) + { + if ((this.readField == YesNoType.no)) + { + writer.WriteAttributeString("Read", "no"); + } + if ((this.readField == YesNoType.yes)) + { + writer.WriteAttributeString("Read", "yes"); + } + } + if (this.deleteFieldSet) + { + if ((this.deleteField == YesNoType.no)) + { + writer.WriteAttributeString("Delete", "no"); + } + if ((this.deleteField == YesNoType.yes)) + { + writer.WriteAttributeString("Delete", "yes"); + } + } + if (this.readPermissionFieldSet) + { + if ((this.readPermissionField == YesNoType.no)) + { + writer.WriteAttributeString("ReadPermission", "no"); + } + if ((this.readPermissionField == YesNoType.yes)) + { + writer.WriteAttributeString("ReadPermission", "yes"); + } + } + if (this.changePermissionFieldSet) + { + if ((this.changePermissionField == YesNoType.no)) + { + writer.WriteAttributeString("ChangePermission", "no"); + } + if ((this.changePermissionField == YesNoType.yes)) + { + writer.WriteAttributeString("ChangePermission", "yes"); + } + } + if (this.takeOwnershipFieldSet) + { + if ((this.takeOwnershipField == YesNoType.no)) + { + writer.WriteAttributeString("TakeOwnership", "no"); + } + if ((this.takeOwnershipField == YesNoType.yes)) + { + writer.WriteAttributeString("TakeOwnership", "yes"); + } + } + if (this.readAttributesFieldSet) + { + if ((this.readAttributesField == YesNoType.no)) + { + writer.WriteAttributeString("ReadAttributes", "no"); + } + if ((this.readAttributesField == YesNoType.yes)) + { + writer.WriteAttributeString("ReadAttributes", "yes"); + } + } + if (this.writeAttributesFieldSet) + { + if ((this.writeAttributesField == YesNoType.no)) + { + writer.WriteAttributeString("WriteAttributes", "no"); + } + if ((this.writeAttributesField == YesNoType.yes)) + { + writer.WriteAttributeString("WriteAttributes", "yes"); + } + } + if (this.readExtendedAttributesFieldSet) + { + if ((this.readExtendedAttributesField == YesNoType.no)) + { + writer.WriteAttributeString("ReadExtendedAttributes", "no"); + } + if ((this.readExtendedAttributesField == YesNoType.yes)) + { + writer.WriteAttributeString("ReadExtendedAttributes", "yes"); + } + } + if (this.writeExtendedAttributesFieldSet) + { + if ((this.writeExtendedAttributesField == YesNoType.no)) + { + writer.WriteAttributeString("WriteExtendedAttributes", "no"); + } + if ((this.writeExtendedAttributesField == YesNoType.yes)) + { + writer.WriteAttributeString("WriteExtendedAttributes", "yes"); + } + } + if (this.synchronizeFieldSet) + { + if ((this.synchronizeField == YesNoType.no)) + { + writer.WriteAttributeString("Synchronize", "no"); + } + if ((this.synchronizeField == YesNoType.yes)) + { + writer.WriteAttributeString("Synchronize", "yes"); + } + } + if (this.createFileFieldSet) + { + if ((this.createFileField == YesNoType.no)) + { + writer.WriteAttributeString("CreateFile", "no"); + } + if ((this.createFileField == YesNoType.yes)) + { + writer.WriteAttributeString("CreateFile", "yes"); + } + } + if (this.createChildFieldSet) + { + if ((this.createChildField == YesNoType.no)) + { + writer.WriteAttributeString("CreateChild", "no"); + } + if ((this.createChildField == YesNoType.yes)) + { + writer.WriteAttributeString("CreateChild", "yes"); + } + } + if (this.deleteChildFieldSet) + { + if ((this.deleteChildField == YesNoType.no)) + { + writer.WriteAttributeString("DeleteChild", "no"); + } + if ((this.deleteChildField == YesNoType.yes)) + { + writer.WriteAttributeString("DeleteChild", "yes"); + } + } + if (this.traverseFieldSet) + { + if ((this.traverseField == YesNoType.no)) + { + writer.WriteAttributeString("Traverse", "no"); + } + if ((this.traverseField == YesNoType.yes)) + { + writer.WriteAttributeString("Traverse", "yes"); + } + } + if (this.genericAllFieldSet) + { + if ((this.genericAllField == YesNoType.no)) + { + writer.WriteAttributeString("GenericAll", "no"); + } + if ((this.genericAllField == YesNoType.yes)) + { + writer.WriteAttributeString("GenericAll", "yes"); + } + } + if (this.genericExecuteFieldSet) + { + if ((this.genericExecuteField == YesNoType.no)) + { + writer.WriteAttributeString("GenericExecute", "no"); + } + if ((this.genericExecuteField == YesNoType.yes)) + { + writer.WriteAttributeString("GenericExecute", "yes"); + } + } + if (this.genericWriteFieldSet) + { + if ((this.genericWriteField == YesNoType.no)) + { + writer.WriteAttributeString("GenericWrite", "no"); + } + if ((this.genericWriteField == YesNoType.yes)) + { + writer.WriteAttributeString("GenericWrite", "yes"); + } + } + if (this.genericReadFieldSet) + { + if ((this.genericReadField == YesNoType.no)) + { + writer.WriteAttributeString("GenericRead", "no"); + } + if ((this.genericReadField == YesNoType.yes)) + { + writer.WriteAttributeString("GenericRead", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("User" == name)) + { + this.userField = value; + this.userFieldSet = true; + } + if (("Read" == name)) + { + this.readField = Enums.ParseYesNoType(value); + this.readFieldSet = true; + } + if (("Delete" == name)) + { + this.deleteField = Enums.ParseYesNoType(value); + this.deleteFieldSet = true; + } + if (("ReadPermission" == name)) + { + this.readPermissionField = Enums.ParseYesNoType(value); + this.readPermissionFieldSet = true; + } + if (("ChangePermission" == name)) + { + this.changePermissionField = Enums.ParseYesNoType(value); + this.changePermissionFieldSet = true; + } + if (("TakeOwnership" == name)) + { + this.takeOwnershipField = Enums.ParseYesNoType(value); + this.takeOwnershipFieldSet = true; + } + if (("ReadAttributes" == name)) + { + this.readAttributesField = Enums.ParseYesNoType(value); + this.readAttributesFieldSet = true; + } + if (("WriteAttributes" == name)) + { + this.writeAttributesField = Enums.ParseYesNoType(value); + this.writeAttributesFieldSet = true; + } + if (("ReadExtendedAttributes" == name)) + { + this.readExtendedAttributesField = Enums.ParseYesNoType(value); + this.readExtendedAttributesFieldSet = true; + } + if (("WriteExtendedAttributes" == name)) + { + this.writeExtendedAttributesField = Enums.ParseYesNoType(value); + this.writeExtendedAttributesFieldSet = true; + } + if (("Synchronize" == name)) + { + this.synchronizeField = Enums.ParseYesNoType(value); + this.synchronizeFieldSet = true; + } + if (("CreateFile" == name)) + { + this.createFileField = Enums.ParseYesNoType(value); + this.createFileFieldSet = true; + } + if (("CreateChild" == name)) + { + this.createChildField = Enums.ParseYesNoType(value); + this.createChildFieldSet = true; + } + if (("DeleteChild" == name)) + { + this.deleteChildField = Enums.ParseYesNoType(value); + this.deleteChildFieldSet = true; + } + if (("Traverse" == name)) + { + this.traverseField = Enums.ParseYesNoType(value); + this.traverseFieldSet = true; + } + if (("GenericAll" == name)) + { + this.genericAllField = Enums.ParseYesNoType(value); + this.genericAllFieldSet = true; + } + if (("GenericExecute" == name)) + { + this.genericExecuteField = Enums.ParseYesNoType(value); + this.genericExecuteFieldSet = true; + } + if (("GenericWrite" == name)) + { + this.genericWriteField = Enums.ParseYesNoType(value); + this.genericWriteFieldSet = true; + } + if (("GenericRead" == name)) + { + this.genericReadField = Enums.ParseYesNoType(value); + this.genericReadFieldSet = true; + } + } + } + + /// + /// Formats a file's contents at install time. The contents are formatted according to the rules of the + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class FormatFile : ISchemaElement, ISetAttributes + { + + private string binaryKeyField; + + private bool binaryKeyFieldSet; + + private ISchemaElement parentElement; + + /// + /// The id of a Binary row that contains a copy of the file. The file in the Binary table overwrites whatever + /// file is installed by the parent component. + /// + public string BinaryKey + { + get + { + return this.binaryKeyField; + } + set + { + this.binaryKeyFieldSet = true; + this.binaryKeyField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("FormatFile", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.binaryKeyFieldSet) + { + writer.WriteAttributeString("BinaryKey", this.binaryKeyField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("BinaryKey" == name)) + { + this.binaryKeyField = value; + this.binaryKeyFieldSet = true; + } + } + } + + /// + /// Finds user groups on the local machine or specified Active Directory domain. The local machine will be + /// searched for the group first then fallback to looking in Active Directory. This element is not capable + /// of creating new groups but can be used to add new or existing users to an existing group. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class Group : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string domainField; + + private bool domainFieldSet; + + private ISchemaElement parentElement; + + /// + /// Unique identifier in your installation package for this group. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// A + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// An optional + /// + public string Domain + { + get + { + return this.domainField; + } + set + { + this.domainFieldSet = true; + this.domainField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Group", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.domainFieldSet) + { + writer.WriteAttributeString("Domain", this.domainField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Domain" == name)) + { + this.domainField = value; + this.domainFieldSet = true; + } + } + } + + /// + /// Used to join a user to a group + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class GroupRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("GroupRef", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Creates a shortcut to a URL. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class InternetShortcut : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string directoryField; + + private bool directoryFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string targetField; + + private bool targetFieldSet; + + private TypeType typeField; + + private bool typeFieldSet; + + private string iconFileField; + + private bool iconFileFieldSet; + + private int iconIndexField; + + private bool iconIndexFieldSet; + + private ISchemaElement parentElement; + + /// + /// Unique identifier in your installation package for this Internet shortcut. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Identifier reference to Directory element where shortcut is to be created. This attribute's value defaults to the parent Component directory. + /// + public string Directory + { + get + { + return this.directoryField; + } + set + { + this.directoryFieldSet = true; + this.directoryField = value; + } + } + + /// + /// The name of the shortcut file, which is visible to the user. (The .lnk + /// extension is added automatically and by default, is not shown to the user.) + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// URL that should be opened when the user selects the shortcut. Windows + /// opens the URL in the appropriate handler for the protocol specified + /// in the URL. Note that this is a formatted field, so you can use + /// [#fileId] syntax to refer to a file being installed (using the file: + /// protocol). + /// + public string Target + { + get + { + return this.targetField; + } + set + { + this.targetFieldSet = true; + this.targetField = value; + } + } + + /// + /// Which type of shortcut should be created. + /// + public TypeType Type + { + get + { + return this.typeField; + } + set + { + this.typeFieldSet = true; + this.typeField = value; + } + } + + /// + /// Icon file that should be displayed. Note that this is a formatted field, so you can use + /// [#fileId] syntax to refer to a file being installed (using the file: + /// protocol). + /// + public string IconFile + { + get + { + return this.iconFileField; + } + set + { + this.iconFileFieldSet = true; + this.iconFileField = value; + } + } + + /// + /// Index of the icon being referenced + /// + public int IconIndex + { + get + { + return this.iconIndexField; + } + set + { + this.iconIndexFieldSet = true; + this.iconIndexField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a TypeType from a string. + /// + public static TypeType ParseTypeType(string value) + { + TypeType parsedValue; + InternetShortcut.TryParseTypeType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a TypeType from a string. + /// + public static bool TryParseTypeType(string value, out TypeType parsedValue) + { + parsedValue = TypeType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("url" == value)) + { + parsedValue = TypeType.url; + } + else + { + if (("link" == value)) + { + parsedValue = TypeType.link; + } + else + { + parsedValue = TypeType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("InternetShortcut", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.directoryFieldSet) + { + writer.WriteAttributeString("Directory", this.directoryField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.targetFieldSet) + { + writer.WriteAttributeString("Target", this.targetField); + } + if (this.typeFieldSet) + { + if ((this.typeField == TypeType.url)) + { + writer.WriteAttributeString("Type", "url"); + } + if ((this.typeField == TypeType.link)) + { + writer.WriteAttributeString("Type", "link"); + } + } + if (this.iconFileFieldSet) + { + writer.WriteAttributeString("IconFile", this.iconFileField); + } + if (this.iconIndexFieldSet) + { + writer.WriteAttributeString("IconIndex", this.iconIndexField.ToString(CultureInfo.InvariantCulture)); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Directory" == name)) + { + this.directoryField = value; + this.directoryFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Target" == name)) + { + this.targetField = value; + this.targetFieldSet = true; + } + if (("Type" == name)) + { + this.typeField = InternetShortcut.ParseTypeType(value); + this.typeFieldSet = true; + } + if (("IconFile" == name)) + { + this.iconFileField = value; + this.iconFileFieldSet = true; + } + if (("IconIndex" == name)) + { + this.iconIndexField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.iconIndexFieldSet = true; + } + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum TypeType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Creates .url files using IUniformResourceLocatorW. + /// + url, + + /// + /// Creates .lnk files using IShellLinkW (default). + /// + link, + } + } + + /// + /// Used to create performance categories and configure performance counters. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class PerformanceCategory : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string helpField; + + private bool helpFieldSet; + + private YesNoType multiInstanceField; + + private bool multiInstanceFieldSet; + + private string libraryField; + + private bool libraryFieldSet; + + private string openField; + + private bool openFieldSet; + + private string closeField; + + private bool closeFieldSet; + + private string collectField; + + private bool collectFieldSet; + + private PerformanceCounterLanguageType defaultLanguageField; + + private bool defaultLanguageFieldSet; + + private ISchemaElement parentElement; + + public PerformanceCategory() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(PerformanceCounter))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Unique identifier in your installation package for this performance counter category. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name for the performance counter category. If this attribute is not provided the Id attribute is used as the name of the performance counter category. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Optional help text for the performance counter category. + /// + public string Help + { + get + { + return this.helpField; + } + set + { + this.helpFieldSet = true; + this.helpField = value; + } + } + + /// + /// Flag that specifies whether the performance counter category is multi or single instanced. Default is single instance. + /// + public YesNoType MultiInstance + { + get + { + return this.multiInstanceField; + } + set + { + this.multiInstanceFieldSet = true; + this.multiInstanceField = value; + } + } + + /// + /// DLL that contains the performance counter. The default is "netfxperf.dll" which should be used for all managed code performance counters. + /// + public string Library + { + get + { + return this.libraryField; + } + set + { + this.libraryFieldSet = true; + this.libraryField = value; + } + } + + /// + /// Function entry point in to the Library DLL called when opening the performance counter. The default is "OpenPerformanceData" which should be used for all managed code performance counters. + /// + public string Open + { + get + { + return this.openField; + } + set + { + this.openFieldSet = true; + this.openField = value; + } + } + + /// + /// Function entry point in to the Library DLL called when closing the performance counter. The default is "ClosePerformanceData" which should be used for all managed code performance counters. + /// + public string Close + { + get + { + return this.closeField; + } + set + { + this.closeFieldSet = true; + this.closeField = value; + } + } + + /// + /// Function entry point in to the Library DLL called when collecting data from the performance counter. The default is "CollectPerformanceData" which should be used for all managed code performance counters. + /// + public string Collect + { + get + { + return this.collectField; + } + set + { + this.collectFieldSet = true; + this.collectField = value; + } + } + + /// + /// Default language for the performance category and contained counters' names and help text. + /// + public PerformanceCounterLanguageType DefaultLanguage + { + get + { + return this.defaultLanguageField; + } + set + { + this.defaultLanguageFieldSet = true; + this.defaultLanguageField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("PerformanceCounter" == childName)) + { + childValue = new PerformanceCounter(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PerformanceCategory", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.helpFieldSet) + { + writer.WriteAttributeString("Help", this.helpField); + } + if (this.multiInstanceFieldSet) + { + if ((this.multiInstanceField == YesNoType.no)) + { + writer.WriteAttributeString("MultiInstance", "no"); + } + if ((this.multiInstanceField == YesNoType.yes)) + { + writer.WriteAttributeString("MultiInstance", "yes"); + } + } + if (this.libraryFieldSet) + { + writer.WriteAttributeString("Library", this.libraryField); + } + if (this.openFieldSet) + { + writer.WriteAttributeString("Open", this.openField); + } + if (this.closeFieldSet) + { + writer.WriteAttributeString("Close", this.closeField); + } + if (this.collectFieldSet) + { + writer.WriteAttributeString("Collect", this.collectField); + } + if (this.defaultLanguageFieldSet) + { + if ((this.defaultLanguageField == PerformanceCounterLanguageType.afrikaans)) + { + writer.WriteAttributeString("DefaultLanguage", "afrikaans"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.albanian)) + { + writer.WriteAttributeString("DefaultLanguage", "albanian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.arabic)) + { + writer.WriteAttributeString("DefaultLanguage", "arabic"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.armenian)) + { + writer.WriteAttributeString("DefaultLanguage", "armenian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.assamese)) + { + writer.WriteAttributeString("DefaultLanguage", "assamese"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.azeri)) + { + writer.WriteAttributeString("DefaultLanguage", "azeri"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.basque)) + { + writer.WriteAttributeString("DefaultLanguage", "basque"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.belarusian)) + { + writer.WriteAttributeString("DefaultLanguage", "belarusian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.bengali)) + { + writer.WriteAttributeString("DefaultLanguage", "bengali"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.bulgarian)) + { + writer.WriteAttributeString("DefaultLanguage", "bulgarian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.catalan)) + { + writer.WriteAttributeString("DefaultLanguage", "catalan"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.chinese)) + { + writer.WriteAttributeString("DefaultLanguage", "chinese"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.croatian)) + { + writer.WriteAttributeString("DefaultLanguage", "croatian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.czech)) + { + writer.WriteAttributeString("DefaultLanguage", "czech"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.danish)) + { + writer.WriteAttributeString("DefaultLanguage", "danish"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.divehi)) + { + writer.WriteAttributeString("DefaultLanguage", "divehi"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.dutch)) + { + writer.WriteAttributeString("DefaultLanguage", "dutch"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.english)) + { + writer.WriteAttributeString("DefaultLanguage", "english"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.estonian)) + { + writer.WriteAttributeString("DefaultLanguage", "estonian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.faeroese)) + { + writer.WriteAttributeString("DefaultLanguage", "faeroese"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.farsi)) + { + writer.WriteAttributeString("DefaultLanguage", "farsi"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.finnish)) + { + writer.WriteAttributeString("DefaultLanguage", "finnish"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.french)) + { + writer.WriteAttributeString("DefaultLanguage", "french"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.galician)) + { + writer.WriteAttributeString("DefaultLanguage", "galician"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.georgian)) + { + writer.WriteAttributeString("DefaultLanguage", "georgian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.german)) + { + writer.WriteAttributeString("DefaultLanguage", "german"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.greek)) + { + writer.WriteAttributeString("DefaultLanguage", "greek"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.gujarati)) + { + writer.WriteAttributeString("DefaultLanguage", "gujarati"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.hebrew)) + { + writer.WriteAttributeString("DefaultLanguage", "hebrew"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.hindi)) + { + writer.WriteAttributeString("DefaultLanguage", "hindi"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.hungarian)) + { + writer.WriteAttributeString("DefaultLanguage", "hungarian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.icelandic)) + { + writer.WriteAttributeString("DefaultLanguage", "icelandic"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.indonesian)) + { + writer.WriteAttributeString("DefaultLanguage", "indonesian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.italian)) + { + writer.WriteAttributeString("DefaultLanguage", "italian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.japanese)) + { + writer.WriteAttributeString("DefaultLanguage", "japanese"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.kannada)) + { + writer.WriteAttributeString("DefaultLanguage", "kannada"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.kashmiri)) + { + writer.WriteAttributeString("DefaultLanguage", "kashmiri"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.kazak)) + { + writer.WriteAttributeString("DefaultLanguage", "kazak"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.konkani)) + { + writer.WriteAttributeString("DefaultLanguage", "konkani"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.korean)) + { + writer.WriteAttributeString("DefaultLanguage", "korean"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.kyrgyz)) + { + writer.WriteAttributeString("DefaultLanguage", "kyrgyz"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.latvian)) + { + writer.WriteAttributeString("DefaultLanguage", "latvian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.lithuanian)) + { + writer.WriteAttributeString("DefaultLanguage", "lithuanian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.macedonian)) + { + writer.WriteAttributeString("DefaultLanguage", "macedonian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.malay)) + { + writer.WriteAttributeString("DefaultLanguage", "malay"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.malayalam)) + { + writer.WriteAttributeString("DefaultLanguage", "malayalam"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.manipuri)) + { + writer.WriteAttributeString("DefaultLanguage", "manipuri"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.marathi)) + { + writer.WriteAttributeString("DefaultLanguage", "marathi"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.mongolian)) + { + writer.WriteAttributeString("DefaultLanguage", "mongolian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.nepali)) + { + writer.WriteAttributeString("DefaultLanguage", "nepali"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.norwegian)) + { + writer.WriteAttributeString("DefaultLanguage", "norwegian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.oriya)) + { + writer.WriteAttributeString("DefaultLanguage", "oriya"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.polish)) + { + writer.WriteAttributeString("DefaultLanguage", "polish"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.portuguese)) + { + writer.WriteAttributeString("DefaultLanguage", "portuguese"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.punjabi)) + { + writer.WriteAttributeString("DefaultLanguage", "punjabi"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.romanian)) + { + writer.WriteAttributeString("DefaultLanguage", "romanian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.russian)) + { + writer.WriteAttributeString("DefaultLanguage", "russian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.sanskrit)) + { + writer.WriteAttributeString("DefaultLanguage", "sanskrit"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.serbian)) + { + writer.WriteAttributeString("DefaultLanguage", "serbian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.sindhi)) + { + writer.WriteAttributeString("DefaultLanguage", "sindhi"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.slovak)) + { + writer.WriteAttributeString("DefaultLanguage", "slovak"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.slovenian)) + { + writer.WriteAttributeString("DefaultLanguage", "slovenian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.spanish)) + { + writer.WriteAttributeString("DefaultLanguage", "spanish"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.swahili)) + { + writer.WriteAttributeString("DefaultLanguage", "swahili"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.swedish)) + { + writer.WriteAttributeString("DefaultLanguage", "swedish"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.syriac)) + { + writer.WriteAttributeString("DefaultLanguage", "syriac"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.tamil)) + { + writer.WriteAttributeString("DefaultLanguage", "tamil"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.tatar)) + { + writer.WriteAttributeString("DefaultLanguage", "tatar"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.telugu)) + { + writer.WriteAttributeString("DefaultLanguage", "telugu"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.thai)) + { + writer.WriteAttributeString("DefaultLanguage", "thai"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.turkish)) + { + writer.WriteAttributeString("DefaultLanguage", "turkish"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.ukrainian)) + { + writer.WriteAttributeString("DefaultLanguage", "ukrainian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.urdu)) + { + writer.WriteAttributeString("DefaultLanguage", "urdu"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.uzbek)) + { + writer.WriteAttributeString("DefaultLanguage", "uzbek"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.vietnamese)) + { + writer.WriteAttributeString("DefaultLanguage", "vietnamese"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Help" == name)) + { + this.helpField = value; + this.helpFieldSet = true; + } + if (("MultiInstance" == name)) + { + this.multiInstanceField = Enums.ParseYesNoType(value); + this.multiInstanceFieldSet = true; + } + if (("Library" == name)) + { + this.libraryField = value; + this.libraryFieldSet = true; + } + if (("Open" == name)) + { + this.openField = value; + this.openFieldSet = true; + } + if (("Close" == name)) + { + this.closeField = value; + this.closeFieldSet = true; + } + if (("Collect" == name)) + { + this.collectField = value; + this.collectFieldSet = true; + } + if (("DefaultLanguage" == name)) + { + this.defaultLanguageField = Enums.ParsePerformanceCounterLanguageType(value); + this.defaultLanguageFieldSet = true; + } + } + } + + /// + /// Creates a performance counter in a performance category. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class PerformanceCounter : ISchemaElement, ISetAttributes + { + + private string nameField; + + private bool nameFieldSet; + + private string helpField; + + private bool helpFieldSet; + + private PerformanceCounterTypesType typeField; + + private bool typeFieldSet; + + private PerformanceCounterLanguageType languageField; + + private bool languageFieldSet; + + private ISchemaElement parentElement; + + /// + /// Name for the performance counter. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Optional help text for the performance counter. + /// + public string Help + { + get + { + return this.helpField; + } + set + { + this.helpFieldSet = true; + this.helpField = value; + } + } + + /// + /// Type of the performance counter. + /// + public PerformanceCounterTypesType Type + { + get + { + return this.typeField; + } + set + { + this.typeFieldSet = true; + this.typeField = value; + } + } + + /// + /// Language for the peformance counter name and help. The default is to use the parent PerformanceCategory element's DefaultLanguage attribute. + /// + public PerformanceCounterLanguageType Language + { + get + { + return this.languageField; + } + set + { + this.languageFieldSet = true; + this.languageField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PerformanceCounter", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.helpFieldSet) + { + writer.WriteAttributeString("Help", this.helpField); + } + if (this.typeFieldSet) + { + if ((this.typeField == PerformanceCounterTypesType.averageBase)) + { + writer.WriteAttributeString("Type", "averageBase"); + } + if ((this.typeField == PerformanceCounterTypesType.averageCount64)) + { + writer.WriteAttributeString("Type", "averageCount64"); + } + if ((this.typeField == PerformanceCounterTypesType.averageTimer32)) + { + writer.WriteAttributeString("Type", "averageTimer32"); + } + if ((this.typeField == PerformanceCounterTypesType.counterDelta32)) + { + writer.WriteAttributeString("Type", "counterDelta32"); + } + if ((this.typeField == PerformanceCounterTypesType.counterTimerInverse)) + { + writer.WriteAttributeString("Type", "counterTimerInverse"); + } + if ((this.typeField == PerformanceCounterTypesType.sampleFraction)) + { + writer.WriteAttributeString("Type", "sampleFraction"); + } + if ((this.typeField == PerformanceCounterTypesType.timer100Ns)) + { + writer.WriteAttributeString("Type", "timer100Ns"); + } + if ((this.typeField == PerformanceCounterTypesType.counterTimer)) + { + writer.WriteAttributeString("Type", "counterTimer"); + } + if ((this.typeField == PerformanceCounterTypesType.rawFraction)) + { + writer.WriteAttributeString("Type", "rawFraction"); + } + if ((this.typeField == PerformanceCounterTypesType.timer100NsInverse)) + { + writer.WriteAttributeString("Type", "timer100NsInverse"); + } + if ((this.typeField == PerformanceCounterTypesType.counterMultiTimer)) + { + writer.WriteAttributeString("Type", "counterMultiTimer"); + } + if ((this.typeField == PerformanceCounterTypesType.counterMultiTimer100Ns)) + { + writer.WriteAttributeString("Type", "counterMultiTimer100Ns"); + } + if ((this.typeField == PerformanceCounterTypesType.counterMultiTimerInverse)) + { + writer.WriteAttributeString("Type", "counterMultiTimerInverse"); + } + if ((this.typeField == PerformanceCounterTypesType.counterMultiTimer100NsInverse)) + { + writer.WriteAttributeString("Type", "counterMultiTimer100NsInverse"); + } + if ((this.typeField == PerformanceCounterTypesType.elapsedTime)) + { + writer.WriteAttributeString("Type", "elapsedTime"); + } + if ((this.typeField == PerformanceCounterTypesType.sampleBase)) + { + writer.WriteAttributeString("Type", "sampleBase"); + } + if ((this.typeField == PerformanceCounterTypesType.rawBase)) + { + writer.WriteAttributeString("Type", "rawBase"); + } + if ((this.typeField == PerformanceCounterTypesType.counterMultiBase)) + { + writer.WriteAttributeString("Type", "counterMultiBase"); + } + if ((this.typeField == PerformanceCounterTypesType.rateOfCountsPerSecond64)) + { + writer.WriteAttributeString("Type", "rateOfCountsPerSecond64"); + } + if ((this.typeField == PerformanceCounterTypesType.rateOfCountsPerSecond32)) + { + writer.WriteAttributeString("Type", "rateOfCountsPerSecond32"); + } + if ((this.typeField == PerformanceCounterTypesType.countPerTimeInterval64)) + { + writer.WriteAttributeString("Type", "countPerTimeInterval64"); + } + if ((this.typeField == PerformanceCounterTypesType.countPerTimeInterval32)) + { + writer.WriteAttributeString("Type", "countPerTimeInterval32"); + } + if ((this.typeField == PerformanceCounterTypesType.sampleCounter)) + { + writer.WriteAttributeString("Type", "sampleCounter"); + } + if ((this.typeField == PerformanceCounterTypesType.counterDelta64)) + { + writer.WriteAttributeString("Type", "counterDelta64"); + } + if ((this.typeField == PerformanceCounterTypesType.numberOfItems64)) + { + writer.WriteAttributeString("Type", "numberOfItems64"); + } + if ((this.typeField == PerformanceCounterTypesType.numberOfItems32)) + { + writer.WriteAttributeString("Type", "numberOfItems32"); + } + if ((this.typeField == PerformanceCounterTypesType.numberOfItemsHEX64)) + { + writer.WriteAttributeString("Type", "numberOfItemsHEX64"); + } + if ((this.typeField == PerformanceCounterTypesType.numberOfItemsHEX32)) + { + writer.WriteAttributeString("Type", "numberOfItemsHEX32"); + } + } + if (this.languageFieldSet) + { + if ((this.languageField == PerformanceCounterLanguageType.afrikaans)) + { + writer.WriteAttributeString("Language", "afrikaans"); + } + if ((this.languageField == PerformanceCounterLanguageType.albanian)) + { + writer.WriteAttributeString("Language", "albanian"); + } + if ((this.languageField == PerformanceCounterLanguageType.arabic)) + { + writer.WriteAttributeString("Language", "arabic"); + } + if ((this.languageField == PerformanceCounterLanguageType.armenian)) + { + writer.WriteAttributeString("Language", "armenian"); + } + if ((this.languageField == PerformanceCounterLanguageType.assamese)) + { + writer.WriteAttributeString("Language", "assamese"); + } + if ((this.languageField == PerformanceCounterLanguageType.azeri)) + { + writer.WriteAttributeString("Language", "azeri"); + } + if ((this.languageField == PerformanceCounterLanguageType.basque)) + { + writer.WriteAttributeString("Language", "basque"); + } + if ((this.languageField == PerformanceCounterLanguageType.belarusian)) + { + writer.WriteAttributeString("Language", "belarusian"); + } + if ((this.languageField == PerformanceCounterLanguageType.bengali)) + { + writer.WriteAttributeString("Language", "bengali"); + } + if ((this.languageField == PerformanceCounterLanguageType.bulgarian)) + { + writer.WriteAttributeString("Language", "bulgarian"); + } + if ((this.languageField == PerformanceCounterLanguageType.catalan)) + { + writer.WriteAttributeString("Language", "catalan"); + } + if ((this.languageField == PerformanceCounterLanguageType.chinese)) + { + writer.WriteAttributeString("Language", "chinese"); + } + if ((this.languageField == PerformanceCounterLanguageType.croatian)) + { + writer.WriteAttributeString("Language", "croatian"); + } + if ((this.languageField == PerformanceCounterLanguageType.czech)) + { + writer.WriteAttributeString("Language", "czech"); + } + if ((this.languageField == PerformanceCounterLanguageType.danish)) + { + writer.WriteAttributeString("Language", "danish"); + } + if ((this.languageField == PerformanceCounterLanguageType.divehi)) + { + writer.WriteAttributeString("Language", "divehi"); + } + if ((this.languageField == PerformanceCounterLanguageType.dutch)) + { + writer.WriteAttributeString("Language", "dutch"); + } + if ((this.languageField == PerformanceCounterLanguageType.english)) + { + writer.WriteAttributeString("Language", "english"); + } + if ((this.languageField == PerformanceCounterLanguageType.estonian)) + { + writer.WriteAttributeString("Language", "estonian"); + } + if ((this.languageField == PerformanceCounterLanguageType.faeroese)) + { + writer.WriteAttributeString("Language", "faeroese"); + } + if ((this.languageField == PerformanceCounterLanguageType.farsi)) + { + writer.WriteAttributeString("Language", "farsi"); + } + if ((this.languageField == PerformanceCounterLanguageType.finnish)) + { + writer.WriteAttributeString("Language", "finnish"); + } + if ((this.languageField == PerformanceCounterLanguageType.french)) + { + writer.WriteAttributeString("Language", "french"); + } + if ((this.languageField == PerformanceCounterLanguageType.galician)) + { + writer.WriteAttributeString("Language", "galician"); + } + if ((this.languageField == PerformanceCounterLanguageType.georgian)) + { + writer.WriteAttributeString("Language", "georgian"); + } + if ((this.languageField == PerformanceCounterLanguageType.german)) + { + writer.WriteAttributeString("Language", "german"); + } + if ((this.languageField == PerformanceCounterLanguageType.greek)) + { + writer.WriteAttributeString("Language", "greek"); + } + if ((this.languageField == PerformanceCounterLanguageType.gujarati)) + { + writer.WriteAttributeString("Language", "gujarati"); + } + if ((this.languageField == PerformanceCounterLanguageType.hebrew)) + { + writer.WriteAttributeString("Language", "hebrew"); + } + if ((this.languageField == PerformanceCounterLanguageType.hindi)) + { + writer.WriteAttributeString("Language", "hindi"); + } + if ((this.languageField == PerformanceCounterLanguageType.hungarian)) + { + writer.WriteAttributeString("Language", "hungarian"); + } + if ((this.languageField == PerformanceCounterLanguageType.icelandic)) + { + writer.WriteAttributeString("Language", "icelandic"); + } + if ((this.languageField == PerformanceCounterLanguageType.indonesian)) + { + writer.WriteAttributeString("Language", "indonesian"); + } + if ((this.languageField == PerformanceCounterLanguageType.italian)) + { + writer.WriteAttributeString("Language", "italian"); + } + if ((this.languageField == PerformanceCounterLanguageType.japanese)) + { + writer.WriteAttributeString("Language", "japanese"); + } + if ((this.languageField == PerformanceCounterLanguageType.kannada)) + { + writer.WriteAttributeString("Language", "kannada"); + } + if ((this.languageField == PerformanceCounterLanguageType.kashmiri)) + { + writer.WriteAttributeString("Language", "kashmiri"); + } + if ((this.languageField == PerformanceCounterLanguageType.kazak)) + { + writer.WriteAttributeString("Language", "kazak"); + } + if ((this.languageField == PerformanceCounterLanguageType.konkani)) + { + writer.WriteAttributeString("Language", "konkani"); + } + if ((this.languageField == PerformanceCounterLanguageType.korean)) + { + writer.WriteAttributeString("Language", "korean"); + } + if ((this.languageField == PerformanceCounterLanguageType.kyrgyz)) + { + writer.WriteAttributeString("Language", "kyrgyz"); + } + if ((this.languageField == PerformanceCounterLanguageType.latvian)) + { + writer.WriteAttributeString("Language", "latvian"); + } + if ((this.languageField == PerformanceCounterLanguageType.lithuanian)) + { + writer.WriteAttributeString("Language", "lithuanian"); + } + if ((this.languageField == PerformanceCounterLanguageType.macedonian)) + { + writer.WriteAttributeString("Language", "macedonian"); + } + if ((this.languageField == PerformanceCounterLanguageType.malay)) + { + writer.WriteAttributeString("Language", "malay"); + } + if ((this.languageField == PerformanceCounterLanguageType.malayalam)) + { + writer.WriteAttributeString("Language", "malayalam"); + } + if ((this.languageField == PerformanceCounterLanguageType.manipuri)) + { + writer.WriteAttributeString("Language", "manipuri"); + } + if ((this.languageField == PerformanceCounterLanguageType.marathi)) + { + writer.WriteAttributeString("Language", "marathi"); + } + if ((this.languageField == PerformanceCounterLanguageType.mongolian)) + { + writer.WriteAttributeString("Language", "mongolian"); + } + if ((this.languageField == PerformanceCounterLanguageType.nepali)) + { + writer.WriteAttributeString("Language", "nepali"); + } + if ((this.languageField == PerformanceCounterLanguageType.norwegian)) + { + writer.WriteAttributeString("Language", "norwegian"); + } + if ((this.languageField == PerformanceCounterLanguageType.oriya)) + { + writer.WriteAttributeString("Language", "oriya"); + } + if ((this.languageField == PerformanceCounterLanguageType.polish)) + { + writer.WriteAttributeString("Language", "polish"); + } + if ((this.languageField == PerformanceCounterLanguageType.portuguese)) + { + writer.WriteAttributeString("Language", "portuguese"); + } + if ((this.languageField == PerformanceCounterLanguageType.punjabi)) + { + writer.WriteAttributeString("Language", "punjabi"); + } + if ((this.languageField == PerformanceCounterLanguageType.romanian)) + { + writer.WriteAttributeString("Language", "romanian"); + } + if ((this.languageField == PerformanceCounterLanguageType.russian)) + { + writer.WriteAttributeString("Language", "russian"); + } + if ((this.languageField == PerformanceCounterLanguageType.sanskrit)) + { + writer.WriteAttributeString("Language", "sanskrit"); + } + if ((this.languageField == PerformanceCounterLanguageType.serbian)) + { + writer.WriteAttributeString("Language", "serbian"); + } + if ((this.languageField == PerformanceCounterLanguageType.sindhi)) + { + writer.WriteAttributeString("Language", "sindhi"); + } + if ((this.languageField == PerformanceCounterLanguageType.slovak)) + { + writer.WriteAttributeString("Language", "slovak"); + } + if ((this.languageField == PerformanceCounterLanguageType.slovenian)) + { + writer.WriteAttributeString("Language", "slovenian"); + } + if ((this.languageField == PerformanceCounterLanguageType.spanish)) + { + writer.WriteAttributeString("Language", "spanish"); + } + if ((this.languageField == PerformanceCounterLanguageType.swahili)) + { + writer.WriteAttributeString("Language", "swahili"); + } + if ((this.languageField == PerformanceCounterLanguageType.swedish)) + { + writer.WriteAttributeString("Language", "swedish"); + } + if ((this.languageField == PerformanceCounterLanguageType.syriac)) + { + writer.WriteAttributeString("Language", "syriac"); + } + if ((this.languageField == PerformanceCounterLanguageType.tamil)) + { + writer.WriteAttributeString("Language", "tamil"); + } + if ((this.languageField == PerformanceCounterLanguageType.tatar)) + { + writer.WriteAttributeString("Language", "tatar"); + } + if ((this.languageField == PerformanceCounterLanguageType.telugu)) + { + writer.WriteAttributeString("Language", "telugu"); + } + if ((this.languageField == PerformanceCounterLanguageType.thai)) + { + writer.WriteAttributeString("Language", "thai"); + } + if ((this.languageField == PerformanceCounterLanguageType.turkish)) + { + writer.WriteAttributeString("Language", "turkish"); + } + if ((this.languageField == PerformanceCounterLanguageType.ukrainian)) + { + writer.WriteAttributeString("Language", "ukrainian"); + } + if ((this.languageField == PerformanceCounterLanguageType.urdu)) + { + writer.WriteAttributeString("Language", "urdu"); + } + if ((this.languageField == PerformanceCounterLanguageType.uzbek)) + { + writer.WriteAttributeString("Language", "uzbek"); + } + if ((this.languageField == PerformanceCounterLanguageType.vietnamese)) + { + writer.WriteAttributeString("Language", "vietnamese"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Help" == name)) + { + this.helpField = value; + this.helpFieldSet = true; + } + if (("Type" == name)) + { + this.typeField = Enums.ParsePerformanceCounterTypesType(value); + this.typeFieldSet = true; + } + if (("Language" == name)) + { + this.languageField = Enums.ParsePerformanceCounterLanguageType(value); + this.languageFieldSet = true; + } + } + } + + /// + /// Used to install Perfmon counters. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class PerfCounter : ISchemaElement, ISetAttributes + { + + private string nameField; + + private bool nameFieldSet; + + private ISchemaElement parentElement; + + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PerfCounter", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + } + } + + /// + /// Used to install Perfmon Counter Manifests. + /// Note that this functionality cannot be used with major upgrades that are scheduled after the InstallExecute, + /// InstallExecuteAgain, or InstallFinalize actions. For more information on major upgrade scheduling, see + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class PerfCounterManifest : ISchemaElement, ISetAttributes + { + + private string resourceFileDirectoryField; + + private bool resourceFileDirectoryFieldSet; + + private ISchemaElement parentElement; + + /// + /// The directory that holds the resource file of the providers in the perfmon counter manifest. Often the resource file path cannot be determined until setup time. Put the directory here and during perfmon manifest registrtion the path will be updated in the registry. If not specified, Perfmon will look for the resource file in the same directory of the perfmon counter manifest file. + /// + public string ResourceFileDirectory + { + get + { + return this.resourceFileDirectoryField; + } + set + { + this.resourceFileDirectoryFieldSet = true; + this.resourceFileDirectoryField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PerfCounterManifest", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.resourceFileDirectoryFieldSet) + { + writer.WriteAttributeString("ResourceFileDirectory", this.resourceFileDirectoryField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("ResourceFileDirectory" == name)) + { + this.resourceFileDirectoryField = value; + this.resourceFileDirectoryFieldSet = true; + } + } + } + + /// + /// Used to install Event Manifests. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class EventManifest : ISchemaElement, ISetAttributes + { + + private string messageFileField; + + private bool messageFileFieldSet; + + private string parameterFileField; + + private bool parameterFileFieldSet; + + private string resourceFileField; + + private bool resourceFileFieldSet; + + private ISchemaElement parentElement; + + /// + /// The message file (including path) of all the providers in the event manifest. Often the message file path cannot be determined until setup time. Put your MessageFile here and the messageFileName attribute of the all the providers in the manifest will be updated with the path before it is registered. + /// + public string MessageFile + { + get + { + return this.messageFileField; + } + set + { + this.messageFileFieldSet = true; + this.messageFileField = value; + } + } + + /// + /// The parameter file (including path) of all the providers in the event manifest. Often the parameter file path cannot be determined until setup time. Put your ParameterFile here and the parameterFileName attribute of the all the providers in the manifest will be updated with the path before it is registered. + /// + public string ParameterFile + { + get + { + return this.parameterFileField; + } + set + { + this.parameterFileFieldSet = true; + this.parameterFileField = value; + } + } + + /// + /// The resource file (including path) of all the providers in the event manifest. Often the resource file path cannot be determined until setup time. Put your ResourceFile here and the resourceFileName attribute of the all the providers in the manifest will be updated with the path before it is registered. + /// + public string ResourceFile + { + get + { + return this.resourceFileField; + } + set + { + this.resourceFileFieldSet = true; + this.resourceFileField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("EventManifest", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.messageFileFieldSet) + { + writer.WriteAttributeString("MessageFile", this.messageFileField); + } + if (this.parameterFileFieldSet) + { + writer.WriteAttributeString("ParameterFile", this.parameterFileField); + } + if (this.resourceFileFieldSet) + { + writer.WriteAttributeString("ResourceFile", this.resourceFileField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("MessageFile" == name)) + { + this.messageFileField = value; + this.messageFileFieldSet = true; + } + if (("ParameterFile" == name)) + { + this.parameterFileField = value; + this.parameterFileFieldSet = true; + } + if (("ResourceFile" == name)) + { + this.resourceFileField = value; + this.resourceFileFieldSet = true; + } + } + } + + /// + /// Sets ACLs on File, Registry, CreateFolder, or ServiceInstall. When under a Registry element, this cannot be used + /// if the Action attribute's value is remove or removeKeyOnInstall. This element has no Id attribute. + /// The table and key are taken from the parent element. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class PermissionEx : ISchemaElement, ISetAttributes + { + + private string domainField; + + private bool domainFieldSet; + + private string userField; + + private bool userFieldSet; + + private YesNoType readField; + + private bool readFieldSet; + + private YesNoType deleteField; + + private bool deleteFieldSet; + + private YesNoType readPermissionField; + + private bool readPermissionFieldSet; + + private YesNoType changePermissionField; + + private bool changePermissionFieldSet; + + private YesNoType takeOwnershipField; + + private bool takeOwnershipFieldSet; + + private YesNoType readAttributesField; + + private bool readAttributesFieldSet; + + private YesNoType writeAttributesField; + + private bool writeAttributesFieldSet; + + private YesNoType readExtendedAttributesField; + + private bool readExtendedAttributesFieldSet; + + private YesNoType writeExtendedAttributesField; + + private bool writeExtendedAttributesFieldSet; + + private YesNoType synchronizeField; + + private bool synchronizeFieldSet; + + private YesNoType createFileField; + + private bool createFileFieldSet; + + private YesNoType createChildField; + + private bool createChildFieldSet; + + private YesNoType deleteChildField; + + private bool deleteChildFieldSet; + + private YesNoType traverseField; + + private bool traverseFieldSet; + + private YesNoType appendField; + + private bool appendFieldSet; + + private YesNoType executeField; + + private bool executeFieldSet; + + private YesNoType writeField; + + private bool writeFieldSet; + + private YesNoType createSubkeysField; + + private bool createSubkeysFieldSet; + + private YesNoType enumerateSubkeysField; + + private bool enumerateSubkeysFieldSet; + + private YesNoType notifyField; + + private bool notifyFieldSet; + + private YesNoType createLinkField; + + private bool createLinkFieldSet; + + private YesNoType genericAllField; + + private bool genericAllFieldSet; + + private YesNoType genericExecuteField; + + private bool genericExecuteFieldSet; + + private YesNoType genericWriteField; + + private bool genericWriteFieldSet; + + private YesNoType genericReadField; + + private bool genericReadFieldSet; + + private YesNoType serviceQueryConfigField; + + private bool serviceQueryConfigFieldSet; + + private YesNoType serviceChangeConfigField; + + private bool serviceChangeConfigFieldSet; + + private YesNoType serviceQueryStatusField; + + private bool serviceQueryStatusFieldSet; + + private YesNoType serviceEnumerateDependentsField; + + private bool serviceEnumerateDependentsFieldSet; + + private YesNoType serviceStartField; + + private bool serviceStartFieldSet; + + private YesNoType serviceStopField; + + private bool serviceStopFieldSet; + + private YesNoType servicePauseContinueField; + + private bool servicePauseContinueFieldSet; + + private YesNoType serviceInterrogateField; + + private bool serviceInterrogateFieldSet; + + private YesNoType serviceUserDefinedControlField; + + private bool serviceUserDefinedControlFieldSet; + + private ISchemaElement parentElement; + + public string Domain + { + get + { + return this.domainField; + } + set + { + this.domainFieldSet = true; + this.domainField = value; + } + } + + public string User + { + get + { + return this.userField; + } + set + { + this.userFieldSet = true; + this.userField = value; + } + } + + public YesNoType Read + { + get + { + return this.readField; + } + set + { + this.readFieldSet = true; + this.readField = value; + } + } + + public YesNoType Delete + { + get + { + return this.deleteField; + } + set + { + this.deleteFieldSet = true; + this.deleteField = value; + } + } + + public YesNoType ReadPermission + { + get + { + return this.readPermissionField; + } + set + { + this.readPermissionFieldSet = true; + this.readPermissionField = value; + } + } + + public YesNoType ChangePermission + { + get + { + return this.changePermissionField; + } + set + { + this.changePermissionFieldSet = true; + this.changePermissionField = value; + } + } + + public YesNoType TakeOwnership + { + get + { + return this.takeOwnershipField; + } + set + { + this.takeOwnershipFieldSet = true; + this.takeOwnershipField = value; + } + } + + public YesNoType ReadAttributes + { + get + { + return this.readAttributesField; + } + set + { + this.readAttributesFieldSet = true; + this.readAttributesField = value; + } + } + + public YesNoType WriteAttributes + { + get + { + return this.writeAttributesField; + } + set + { + this.writeAttributesFieldSet = true; + this.writeAttributesField = value; + } + } + + public YesNoType ReadExtendedAttributes + { + get + { + return this.readExtendedAttributesField; + } + set + { + this.readExtendedAttributesFieldSet = true; + this.readExtendedAttributesField = value; + } + } + + public YesNoType WriteExtendedAttributes + { + get + { + return this.writeExtendedAttributesField; + } + set + { + this.writeExtendedAttributesFieldSet = true; + this.writeExtendedAttributesField = value; + } + } + + public YesNoType Synchronize + { + get + { + return this.synchronizeField; + } + set + { + this.synchronizeFieldSet = true; + this.synchronizeField = value; + } + } + + /// + /// For a directory, the right to create a file in the directory. Only valid under a 'CreateFolder' parent. + /// + public YesNoType CreateFile + { + get + { + return this.createFileField; + } + set + { + this.createFileFieldSet = true; + this.createFileField = value; + } + } + + /// + /// For a directory, the right to create a subdirectory. Only valid under a 'CreateFolder' parent. + /// + public YesNoType CreateChild + { + get + { + return this.createChildField; + } + set + { + this.createChildFieldSet = true; + this.createChildField = value; + } + } + + /// + /// For a directory, the right to delete a directory and all the files it contains, including read-only files. Only valid under a 'CreateFolder' parent. + /// + public YesNoType DeleteChild + { + get + { + return this.deleteChildField; + } + set + { + this.deleteChildFieldSet = true; + this.deleteChildField = value; + } + } + + /// + /// For a directory, the right to traverse the directory. By default, users are assigned the BYPASS_TRAVERSE_CHECKING privilege, which ignores the FILE_TRAVERSE access right. Only valid under a 'CreateFolder' parent. + /// + public YesNoType Traverse + { + get + { + return this.traverseField; + } + set + { + this.traverseFieldSet = true; + this.traverseField = value; + } + } + + public YesNoType Append + { + get + { + return this.appendField; + } + set + { + this.appendFieldSet = true; + this.appendField = value; + } + } + + public YesNoType Execute + { + get + { + return this.executeField; + } + set + { + this.executeFieldSet = true; + this.executeField = value; + } + } + + public YesNoType Write + { + get + { + return this.writeField; + } + set + { + this.writeFieldSet = true; + this.writeField = value; + } + } + + public YesNoType CreateSubkeys + { + get + { + return this.createSubkeysField; + } + set + { + this.createSubkeysFieldSet = true; + this.createSubkeysField = value; + } + } + + public YesNoType EnumerateSubkeys + { + get + { + return this.enumerateSubkeysField; + } + set + { + this.enumerateSubkeysFieldSet = true; + this.enumerateSubkeysField = value; + } + } + + public YesNoType Notify + { + get + { + return this.notifyField; + } + set + { + this.notifyFieldSet = true; + this.notifyField = value; + } + } + + public YesNoType CreateLink + { + get + { + return this.createLinkField; + } + set + { + this.createLinkFieldSet = true; + this.createLinkField = value; + } + } + + public YesNoType GenericAll + { + get + { + return this.genericAllField; + } + set + { + this.genericAllFieldSet = true; + this.genericAllField = value; + } + } + + public YesNoType GenericExecute + { + get + { + return this.genericExecuteField; + } + set + { + this.genericExecuteFieldSet = true; + this.genericExecuteField = value; + } + } + + public YesNoType GenericWrite + { + get + { + return this.genericWriteField; + } + set + { + this.genericWriteFieldSet = true; + this.genericWriteField = value; + } + } + + /// + /// specifying this will fail to grant read access + /// + public YesNoType GenericRead + { + get + { + return this.genericReadField; + } + set + { + this.genericReadFieldSet = true; + this.genericReadField = value; + } + } + + /// + /// Required to call the QueryServiceConfig and QueryServiceConfig2 functions to query the service configuration. Only valid under a 'ServiceInstall' parent. + /// + public YesNoType ServiceQueryConfig + { + get + { + return this.serviceQueryConfigField; + } + set + { + this.serviceQueryConfigFieldSet = true; + this.serviceQueryConfigField = value; + } + } + + /// + /// Required to call the ChangeServiceConfig or ChangeServiceConfig2 function to change the service configuration. Only valid under a 'ServiceInstall' parent. + /// + public YesNoType ServiceChangeConfig + { + get + { + return this.serviceChangeConfigField; + } + set + { + this.serviceChangeConfigFieldSet = true; + this.serviceChangeConfigField = value; + } + } + + /// + /// Required to call the QueryServiceStatus function to ask the service control manager about the status of the service. Only valid under a 'ServiceInstall' parent. + /// + public YesNoType ServiceQueryStatus + { + get + { + return this.serviceQueryStatusField; + } + set + { + this.serviceQueryStatusFieldSet = true; + this.serviceQueryStatusField = value; + } + } + + /// + /// Required to call the EnumDependentServices function to enumerate all the services dependent on the service. Only valid under a 'ServiceInstall' parent. + /// + public YesNoType ServiceEnumerateDependents + { + get + { + return this.serviceEnumerateDependentsField; + } + set + { + this.serviceEnumerateDependentsFieldSet = true; + this.serviceEnumerateDependentsField = value; + } + } + + /// + /// Required to call the StartService function to start the service. Only valid under a 'ServiceInstall' parent. + /// + public YesNoType ServiceStart + { + get + { + return this.serviceStartField; + } + set + { + this.serviceStartFieldSet = true; + this.serviceStartField = value; + } + } + + /// + /// Required to call the ControlService function to stop the service. Only valid under a 'ServiceInstall' parent. + /// + public YesNoType ServiceStop + { + get + { + return this.serviceStopField; + } + set + { + this.serviceStopFieldSet = true; + this.serviceStopField = value; + } + } + + /// + /// Required to call the ControlService function to pause or continue the service. Only valid under a 'ServiceInstall' parent. + /// + public YesNoType ServicePauseContinue + { + get + { + return this.servicePauseContinueField; + } + set + { + this.servicePauseContinueFieldSet = true; + this.servicePauseContinueField = value; + } + } + + /// + /// Required to call the ControlService function to ask the service to report its status immediately. Only valid under a 'ServiceInstall' parent. + /// + public YesNoType ServiceInterrogate + { + get + { + return this.serviceInterrogateField; + } + set + { + this.serviceInterrogateFieldSet = true; + this.serviceInterrogateField = value; + } + } + + /// + /// Required to call the ControlService function to specify a user-defined control code. Only valid under a 'ServiceInstall' parent. + /// + public YesNoType ServiceUserDefinedControl + { + get + { + return this.serviceUserDefinedControlField; + } + set + { + this.serviceUserDefinedControlFieldSet = true; + this.serviceUserDefinedControlField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PermissionEx", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.domainFieldSet) + { + writer.WriteAttributeString("Domain", this.domainField); + } + if (this.userFieldSet) + { + writer.WriteAttributeString("User", this.userField); + } + if (this.readFieldSet) + { + if ((this.readField == YesNoType.no)) + { + writer.WriteAttributeString("Read", "no"); + } + if ((this.readField == YesNoType.yes)) + { + writer.WriteAttributeString("Read", "yes"); + } + } + if (this.deleteFieldSet) + { + if ((this.deleteField == YesNoType.no)) + { + writer.WriteAttributeString("Delete", "no"); + } + if ((this.deleteField == YesNoType.yes)) + { + writer.WriteAttributeString("Delete", "yes"); + } + } + if (this.readPermissionFieldSet) + { + if ((this.readPermissionField == YesNoType.no)) + { + writer.WriteAttributeString("ReadPermission", "no"); + } + if ((this.readPermissionField == YesNoType.yes)) + { + writer.WriteAttributeString("ReadPermission", "yes"); + } + } + if (this.changePermissionFieldSet) + { + if ((this.changePermissionField == YesNoType.no)) + { + writer.WriteAttributeString("ChangePermission", "no"); + } + if ((this.changePermissionField == YesNoType.yes)) + { + writer.WriteAttributeString("ChangePermission", "yes"); + } + } + if (this.takeOwnershipFieldSet) + { + if ((this.takeOwnershipField == YesNoType.no)) + { + writer.WriteAttributeString("TakeOwnership", "no"); + } + if ((this.takeOwnershipField == YesNoType.yes)) + { + writer.WriteAttributeString("TakeOwnership", "yes"); + } + } + if (this.readAttributesFieldSet) + { + if ((this.readAttributesField == YesNoType.no)) + { + writer.WriteAttributeString("ReadAttributes", "no"); + } + if ((this.readAttributesField == YesNoType.yes)) + { + writer.WriteAttributeString("ReadAttributes", "yes"); + } + } + if (this.writeAttributesFieldSet) + { + if ((this.writeAttributesField == YesNoType.no)) + { + writer.WriteAttributeString("WriteAttributes", "no"); + } + if ((this.writeAttributesField == YesNoType.yes)) + { + writer.WriteAttributeString("WriteAttributes", "yes"); + } + } + if (this.readExtendedAttributesFieldSet) + { + if ((this.readExtendedAttributesField == YesNoType.no)) + { + writer.WriteAttributeString("ReadExtendedAttributes", "no"); + } + if ((this.readExtendedAttributesField == YesNoType.yes)) + { + writer.WriteAttributeString("ReadExtendedAttributes", "yes"); + } + } + if (this.writeExtendedAttributesFieldSet) + { + if ((this.writeExtendedAttributesField == YesNoType.no)) + { + writer.WriteAttributeString("WriteExtendedAttributes", "no"); + } + if ((this.writeExtendedAttributesField == YesNoType.yes)) + { + writer.WriteAttributeString("WriteExtendedAttributes", "yes"); + } + } + if (this.synchronizeFieldSet) + { + if ((this.synchronizeField == YesNoType.no)) + { + writer.WriteAttributeString("Synchronize", "no"); + } + if ((this.synchronizeField == YesNoType.yes)) + { + writer.WriteAttributeString("Synchronize", "yes"); + } + } + if (this.createFileFieldSet) + { + if ((this.createFileField == YesNoType.no)) + { + writer.WriteAttributeString("CreateFile", "no"); + } + if ((this.createFileField == YesNoType.yes)) + { + writer.WriteAttributeString("CreateFile", "yes"); + } + } + if (this.createChildFieldSet) + { + if ((this.createChildField == YesNoType.no)) + { + writer.WriteAttributeString("CreateChild", "no"); + } + if ((this.createChildField == YesNoType.yes)) + { + writer.WriteAttributeString("CreateChild", "yes"); + } + } + if (this.deleteChildFieldSet) + { + if ((this.deleteChildField == YesNoType.no)) + { + writer.WriteAttributeString("DeleteChild", "no"); + } + if ((this.deleteChildField == YesNoType.yes)) + { + writer.WriteAttributeString("DeleteChild", "yes"); + } + } + if (this.traverseFieldSet) + { + if ((this.traverseField == YesNoType.no)) + { + writer.WriteAttributeString("Traverse", "no"); + } + if ((this.traverseField == YesNoType.yes)) + { + writer.WriteAttributeString("Traverse", "yes"); + } + } + if (this.appendFieldSet) + { + if ((this.appendField == YesNoType.no)) + { + writer.WriteAttributeString("Append", "no"); + } + if ((this.appendField == YesNoType.yes)) + { + writer.WriteAttributeString("Append", "yes"); + } + } + if (this.executeFieldSet) + { + if ((this.executeField == YesNoType.no)) + { + writer.WriteAttributeString("Execute", "no"); + } + if ((this.executeField == YesNoType.yes)) + { + writer.WriteAttributeString("Execute", "yes"); + } + } + if (this.writeFieldSet) + { + if ((this.writeField == YesNoType.no)) + { + writer.WriteAttributeString("Write", "no"); + } + if ((this.writeField == YesNoType.yes)) + { + writer.WriteAttributeString("Write", "yes"); + } + } + if (this.createSubkeysFieldSet) + { + if ((this.createSubkeysField == YesNoType.no)) + { + writer.WriteAttributeString("CreateSubkeys", "no"); + } + if ((this.createSubkeysField == YesNoType.yes)) + { + writer.WriteAttributeString("CreateSubkeys", "yes"); + } + } + if (this.enumerateSubkeysFieldSet) + { + if ((this.enumerateSubkeysField == YesNoType.no)) + { + writer.WriteAttributeString("EnumerateSubkeys", "no"); + } + if ((this.enumerateSubkeysField == YesNoType.yes)) + { + writer.WriteAttributeString("EnumerateSubkeys", "yes"); + } + } + if (this.notifyFieldSet) + { + if ((this.notifyField == YesNoType.no)) + { + writer.WriteAttributeString("Notify", "no"); + } + if ((this.notifyField == YesNoType.yes)) + { + writer.WriteAttributeString("Notify", "yes"); + } + } + if (this.createLinkFieldSet) + { + if ((this.createLinkField == YesNoType.no)) + { + writer.WriteAttributeString("CreateLink", "no"); + } + if ((this.createLinkField == YesNoType.yes)) + { + writer.WriteAttributeString("CreateLink", "yes"); + } + } + if (this.genericAllFieldSet) + { + if ((this.genericAllField == YesNoType.no)) + { + writer.WriteAttributeString("GenericAll", "no"); + } + if ((this.genericAllField == YesNoType.yes)) + { + writer.WriteAttributeString("GenericAll", "yes"); + } + } + if (this.genericExecuteFieldSet) + { + if ((this.genericExecuteField == YesNoType.no)) + { + writer.WriteAttributeString("GenericExecute", "no"); + } + if ((this.genericExecuteField == YesNoType.yes)) + { + writer.WriteAttributeString("GenericExecute", "yes"); + } + } + if (this.genericWriteFieldSet) + { + if ((this.genericWriteField == YesNoType.no)) + { + writer.WriteAttributeString("GenericWrite", "no"); + } + if ((this.genericWriteField == YesNoType.yes)) + { + writer.WriteAttributeString("GenericWrite", "yes"); + } + } + if (this.genericReadFieldSet) + { + if ((this.genericReadField == YesNoType.no)) + { + writer.WriteAttributeString("GenericRead", "no"); + } + if ((this.genericReadField == YesNoType.yes)) + { + writer.WriteAttributeString("GenericRead", "yes"); + } + } + if (this.serviceQueryConfigFieldSet) + { + if ((this.serviceQueryConfigField == YesNoType.no)) + { + writer.WriteAttributeString("ServiceQueryConfig", "no"); + } + if ((this.serviceQueryConfigField == YesNoType.yes)) + { + writer.WriteAttributeString("ServiceQueryConfig", "yes"); + } + } + if (this.serviceChangeConfigFieldSet) + { + if ((this.serviceChangeConfigField == YesNoType.no)) + { + writer.WriteAttributeString("ServiceChangeConfig", "no"); + } + if ((this.serviceChangeConfigField == YesNoType.yes)) + { + writer.WriteAttributeString("ServiceChangeConfig", "yes"); + } + } + if (this.serviceQueryStatusFieldSet) + { + if ((this.serviceQueryStatusField == YesNoType.no)) + { + writer.WriteAttributeString("ServiceQueryStatus", "no"); + } + if ((this.serviceQueryStatusField == YesNoType.yes)) + { + writer.WriteAttributeString("ServiceQueryStatus", "yes"); + } + } + if (this.serviceEnumerateDependentsFieldSet) + { + if ((this.serviceEnumerateDependentsField == YesNoType.no)) + { + writer.WriteAttributeString("ServiceEnumerateDependents", "no"); + } + if ((this.serviceEnumerateDependentsField == YesNoType.yes)) + { + writer.WriteAttributeString("ServiceEnumerateDependents", "yes"); + } + } + if (this.serviceStartFieldSet) + { + if ((this.serviceStartField == YesNoType.no)) + { + writer.WriteAttributeString("ServiceStart", "no"); + } + if ((this.serviceStartField == YesNoType.yes)) + { + writer.WriteAttributeString("ServiceStart", "yes"); + } + } + if (this.serviceStopFieldSet) + { + if ((this.serviceStopField == YesNoType.no)) + { + writer.WriteAttributeString("ServiceStop", "no"); + } + if ((this.serviceStopField == YesNoType.yes)) + { + writer.WriteAttributeString("ServiceStop", "yes"); + } + } + if (this.servicePauseContinueFieldSet) + { + if ((this.servicePauseContinueField == YesNoType.no)) + { + writer.WriteAttributeString("ServicePauseContinue", "no"); + } + if ((this.servicePauseContinueField == YesNoType.yes)) + { + writer.WriteAttributeString("ServicePauseContinue", "yes"); + } + } + if (this.serviceInterrogateFieldSet) + { + if ((this.serviceInterrogateField == YesNoType.no)) + { + writer.WriteAttributeString("ServiceInterrogate", "no"); + } + if ((this.serviceInterrogateField == YesNoType.yes)) + { + writer.WriteAttributeString("ServiceInterrogate", "yes"); + } + } + if (this.serviceUserDefinedControlFieldSet) + { + if ((this.serviceUserDefinedControlField == YesNoType.no)) + { + writer.WriteAttributeString("ServiceUserDefinedControl", "no"); + } + if ((this.serviceUserDefinedControlField == YesNoType.yes)) + { + writer.WriteAttributeString("ServiceUserDefinedControl", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Domain" == name)) + { + this.domainField = value; + this.domainFieldSet = true; + } + if (("User" == name)) + { + this.userField = value; + this.userFieldSet = true; + } + if (("Read" == name)) + { + this.readField = Enums.ParseYesNoType(value); + this.readFieldSet = true; + } + if (("Delete" == name)) + { + this.deleteField = Enums.ParseYesNoType(value); + this.deleteFieldSet = true; + } + if (("ReadPermission" == name)) + { + this.readPermissionField = Enums.ParseYesNoType(value); + this.readPermissionFieldSet = true; + } + if (("ChangePermission" == name)) + { + this.changePermissionField = Enums.ParseYesNoType(value); + this.changePermissionFieldSet = true; + } + if (("TakeOwnership" == name)) + { + this.takeOwnershipField = Enums.ParseYesNoType(value); + this.takeOwnershipFieldSet = true; + } + if (("ReadAttributes" == name)) + { + this.readAttributesField = Enums.ParseYesNoType(value); + this.readAttributesFieldSet = true; + } + if (("WriteAttributes" == name)) + { + this.writeAttributesField = Enums.ParseYesNoType(value); + this.writeAttributesFieldSet = true; + } + if (("ReadExtendedAttributes" == name)) + { + this.readExtendedAttributesField = Enums.ParseYesNoType(value); + this.readExtendedAttributesFieldSet = true; + } + if (("WriteExtendedAttributes" == name)) + { + this.writeExtendedAttributesField = Enums.ParseYesNoType(value); + this.writeExtendedAttributesFieldSet = true; + } + if (("Synchronize" == name)) + { + this.synchronizeField = Enums.ParseYesNoType(value); + this.synchronizeFieldSet = true; + } + if (("CreateFile" == name)) + { + this.createFileField = Enums.ParseYesNoType(value); + this.createFileFieldSet = true; + } + if (("CreateChild" == name)) + { + this.createChildField = Enums.ParseYesNoType(value); + this.createChildFieldSet = true; + } + if (("DeleteChild" == name)) + { + this.deleteChildField = Enums.ParseYesNoType(value); + this.deleteChildFieldSet = true; + } + if (("Traverse" == name)) + { + this.traverseField = Enums.ParseYesNoType(value); + this.traverseFieldSet = true; + } + if (("Append" == name)) + { + this.appendField = Enums.ParseYesNoType(value); + this.appendFieldSet = true; + } + if (("Execute" == name)) + { + this.executeField = Enums.ParseYesNoType(value); + this.executeFieldSet = true; + } + if (("Write" == name)) + { + this.writeField = Enums.ParseYesNoType(value); + this.writeFieldSet = true; + } + if (("CreateSubkeys" == name)) + { + this.createSubkeysField = Enums.ParseYesNoType(value); + this.createSubkeysFieldSet = true; + } + if (("EnumerateSubkeys" == name)) + { + this.enumerateSubkeysField = Enums.ParseYesNoType(value); + this.enumerateSubkeysFieldSet = true; + } + if (("Notify" == name)) + { + this.notifyField = Enums.ParseYesNoType(value); + this.notifyFieldSet = true; + } + if (("CreateLink" == name)) + { + this.createLinkField = Enums.ParseYesNoType(value); + this.createLinkFieldSet = true; + } + if (("GenericAll" == name)) + { + this.genericAllField = Enums.ParseYesNoType(value); + this.genericAllFieldSet = true; + } + if (("GenericExecute" == name)) + { + this.genericExecuteField = Enums.ParseYesNoType(value); + this.genericExecuteFieldSet = true; + } + if (("GenericWrite" == name)) + { + this.genericWriteField = Enums.ParseYesNoType(value); + this.genericWriteFieldSet = true; + } + if (("GenericRead" == name)) + { + this.genericReadField = Enums.ParseYesNoType(value); + this.genericReadFieldSet = true; + } + if (("ServiceQueryConfig" == name)) + { + this.serviceQueryConfigField = Enums.ParseYesNoType(value); + this.serviceQueryConfigFieldSet = true; + } + if (("ServiceChangeConfig" == name)) + { + this.serviceChangeConfigField = Enums.ParseYesNoType(value); + this.serviceChangeConfigFieldSet = true; + } + if (("ServiceQueryStatus" == name)) + { + this.serviceQueryStatusField = Enums.ParseYesNoType(value); + this.serviceQueryStatusFieldSet = true; + } + if (("ServiceEnumerateDependents" == name)) + { + this.serviceEnumerateDependentsField = Enums.ParseYesNoType(value); + this.serviceEnumerateDependentsFieldSet = true; + } + if (("ServiceStart" == name)) + { + this.serviceStartField = Enums.ParseYesNoType(value); + this.serviceStartFieldSet = true; + } + if (("ServiceStop" == name)) + { + this.serviceStopField = Enums.ParseYesNoType(value); + this.serviceStopFieldSet = true; + } + if (("ServicePauseContinue" == name)) + { + this.servicePauseContinueField = Enums.ParseYesNoType(value); + this.servicePauseContinueFieldSet = true; + } + if (("ServiceInterrogate" == name)) + { + this.serviceInterrogateField = Enums.ParseYesNoType(value); + this.serviceInterrogateFieldSet = true; + } + if (("ServiceUserDefinedControl" == name)) + { + this.serviceUserDefinedControlField = Enums.ParseYesNoType(value); + this.serviceUserDefinedControlFieldSet = true; + } + } + } + + /// + /// Describes a product search. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class ProductSearch : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string variableField; + + private bool variableFieldSet; + + private string conditionField; + + private bool conditionFieldSet; + + private string afterField; + + private bool afterFieldSet; + + private string guidField; + + private bool guidFieldSet; + + private string productCodeField; + + private bool productCodeFieldSet; + + private string upgradeCodeField; + + private bool upgradeCodeFieldSet; + + private ResultType resultField; + + private bool resultFieldSet; + + private ISchemaElement parentElement; + + /// + /// Id of the search for ordering and dependency. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name of the variable in which to place the result of the search. + /// + public string Variable + { + get + { + return this.variableField; + } + set + { + this.variableFieldSet = true; + this.variableField = value; + } + } + + /// + /// Condition for evaluating the search. If this evaluates to false, the search is not executed at all. + /// + public string Condition + { + get + { + return this.conditionField; + } + set + { + this.conditionFieldSet = true; + this.conditionField = value; + } + } + + /// + /// Id of the search that this one should come after. + /// + public string After + { + get + { + return this.afterField; + } + set + { + this.afterFieldSet = true; + this.afterField = value; + } + } + + /// + /// The Guid attribute has been deprecated; use the ProductCode or UpgradeCode attribute instead. If this attribute is used, it is assumed to be a ProductCode. + /// + public string Guid + { + get + { + return this.guidField; + } + set + { + this.guidFieldSet = true; + this.guidField = value; + } + } + + /// + /// The ProductCode to use for the search. This attribute must be omitted if UpgradeCode is specified. + /// + public string ProductCode + { + get + { + return this.productCodeField; + } + set + { + this.productCodeFieldSet = true; + this.productCodeField = value; + } + } + + /// + /// The UpgradeCode to use for the search. This attribute must be omitted if ProductCode is specified. Note that if multiple products are found, the highest versioned product will be used for the result. + /// + public string UpgradeCode + { + get + { + return this.upgradeCodeField; + } + set + { + this.upgradeCodeFieldSet = true; + this.upgradeCodeField = value; + } + } + + /// + /// Rather than saving the product version into the variable, a ProductSearch can save another attribute of the matching product instead. + /// + public ResultType Result + { + get + { + return this.resultField; + } + set + { + this.resultFieldSet = true; + this.resultField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a ResultType from a string. + /// + public static ResultType ParseResultType(string value) + { + ResultType parsedValue; + ProductSearch.TryParseResultType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ResultType from a string. + /// + public static bool TryParseResultType(string value, out ResultType parsedValue) + { + parsedValue = ResultType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("version" == value)) + { + parsedValue = ResultType.version; + } + else + { + if (("language" == value)) + { + parsedValue = ResultType.language; + } + else + { + if (("state" == value)) + { + parsedValue = ResultType.state; + } + else + { + if (("assignment" == value)) + { + parsedValue = ResultType.assignment; + } + else + { + parsedValue = ResultType.IllegalValue; + return false; + } + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ProductSearch", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.variableFieldSet) + { + writer.WriteAttributeString("Variable", this.variableField); + } + if (this.conditionFieldSet) + { + writer.WriteAttributeString("Condition", this.conditionField); + } + if (this.afterFieldSet) + { + writer.WriteAttributeString("After", this.afterField); + } + if (this.guidFieldSet) + { + writer.WriteAttributeString("Guid", this.guidField); + } + if (this.productCodeFieldSet) + { + writer.WriteAttributeString("ProductCode", this.productCodeField); + } + if (this.upgradeCodeFieldSet) + { + writer.WriteAttributeString("UpgradeCode", this.upgradeCodeField); + } + if (this.resultFieldSet) + { + if ((this.resultField == ResultType.version)) + { + writer.WriteAttributeString("Result", "version"); + } + if ((this.resultField == ResultType.language)) + { + writer.WriteAttributeString("Result", "language"); + } + if ((this.resultField == ResultType.state)) + { + writer.WriteAttributeString("Result", "state"); + } + if ((this.resultField == ResultType.assignment)) + { + writer.WriteAttributeString("Result", "assignment"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Variable" == name)) + { + this.variableField = value; + this.variableFieldSet = true; + } + if (("Condition" == name)) + { + this.conditionField = value; + this.conditionFieldSet = true; + } + if (("After" == name)) + { + this.afterField = value; + this.afterFieldSet = true; + } + if (("Guid" == name)) + { + this.guidField = value; + this.guidFieldSet = true; + } + if (("ProductCode" == name)) + { + this.productCodeField = value; + this.productCodeFieldSet = true; + } + if (("UpgradeCode" == name)) + { + this.upgradeCodeField = value; + this.upgradeCodeFieldSet = true; + } + if (("Result" == name)) + { + this.resultField = ProductSearch.ParseResultType(value); + this.resultFieldSet = true; + } + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum ResultType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Saves the version of a matching product if found; 0.0.0.0 otherwise. This is the default. + /// + version, + + /// + /// Saves the language of a matching product if found; empty otherwise. + /// + language, + + /// + /// Saves the state of the product: advertised (1), absent (2), or locally installed (5). + /// + state, + + /// + /// Saves the assignment type of the product: per-user (0), or per-machine (1). + /// + assignment, + } + } + + /// + /// References a ProductSearch. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class ProductSearchRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ProductSearchRef", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Remove a folder and all contained files and folders if the parent component is selected for installation or removal. + /// The folder must be specified in the Property attribute as the name of a property that will have a value that resolves + /// to the full path of the folder before the CostInitialize action. Note that Directory ids cannot be used. + /// For more details, see the Remarks. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class RemoveFolderEx : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string propertyField; + + private bool propertyFieldSet; + + private OnType onField; + + private bool onFieldSet; + + private ISchemaElement parentElement; + + /// + /// Primary key used to identify this particular entry. If this is not specified, a stable identifier + /// will be generated at compile time based on the other attributes. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The id of a property that resolves to the full path of the source directory. The property does not have + /// to exist in the installer database at creation time; it could be created at installation time by a custom + /// action, on the command line, etc. The property value can contain environment variables surrounded by + /// percent signs such as from a REG_EXPAND_SZ registry value; environment variables will be expanded before + /// being evaluated for a full path. + /// + public string Property + { + get + { + return this.propertyField; + } + set + { + this.propertyFieldSet = true; + this.propertyField = value; + } + } + + /// + /// This value determines when the folder may be removed. + /// + public OnType On + { + get + { + return this.onField; + } + set + { + this.onFieldSet = true; + this.onField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a OnType from a string. + /// + public static OnType ParseOnType(string value) + { + OnType parsedValue; + RemoveFolderEx.TryParseOnType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a OnType from a string. + /// + public static bool TryParseOnType(string value, out OnType parsedValue) + { + parsedValue = OnType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("install" == value)) + { + parsedValue = OnType.install; + } + else + { + if (("uninstall" == value)) + { + parsedValue = OnType.uninstall; + } + else + { + if (("both" == value)) + { + parsedValue = OnType.both; + } + else + { + parsedValue = OnType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RemoveFolderEx", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.propertyFieldSet) + { + writer.WriteAttributeString("Property", this.propertyField); + } + if (this.onFieldSet) + { + if ((this.onField == OnType.install)) + { + writer.WriteAttributeString("On", "install"); + } + if ((this.onField == OnType.uninstall)) + { + writer.WriteAttributeString("On", "uninstall"); + } + if ((this.onField == OnType.both)) + { + writer.WriteAttributeString("On", "both"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Property" == name)) + { + this.propertyField = value; + this.propertyFieldSet = true; + } + if (("On" == name)) + { + this.onField = RemoveFolderEx.ParseOnType(value); + this.onFieldSet = true; + } + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum OnType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Removes the folder only when the parent component is being installed (msiInstallStateLocal or msiInstallStateSource). + /// + install, + + /// + /// Default: Removes the folder only when the parent component is being removed (msiInstallStateAbsent). + /// + uninstall, + + /// + /// Removes the folder when the parent component is being installed or removed. + /// + both, + } + } + + /// + /// Registers a resource with the Restart Manager. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class RestartResource : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string pathField; + + private bool pathFieldSet; + + private string processNameField; + + private bool processNameFieldSet; + + private string serviceNameField; + + private bool serviceNameFieldSet; + + private ISchemaElement parentElement; + + /// + /// The unique identifier for this resource. A unique identifier will + /// be generated automatically if not specified. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The full path to the process module to register with the Restart Manager. + /// This can be a formatted value that resolves to a full path. + /// + public string Path + { + get + { + return this.pathField; + } + set + { + this.pathFieldSet = true; + this.pathField = value; + } + } + + /// + /// The name of a process to register with the Restart Manager. + /// This can be a formatted value that resolves to a process name. + /// + public string ProcessName + { + get + { + return this.processNameField; + } + set + { + this.processNameFieldSet = true; + this.processNameField = value; + } + } + + /// + /// The name of a Windows service to register with the Restart Manager. + /// This can be a formatted value that resolves to a service name. + /// + public string ServiceName + { + get + { + return this.serviceNameField; + } + set + { + this.serviceNameFieldSet = true; + this.serviceNameField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RestartResource", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.pathFieldSet) + { + writer.WriteAttributeString("Path", this.pathField); + } + if (this.processNameFieldSet) + { + writer.WriteAttributeString("ProcessName", this.processNameField); + } + if (this.serviceNameFieldSet) + { + writer.WriteAttributeString("ServiceName", this.serviceNameField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Path" == name)) + { + this.pathField = value; + this.pathFieldSet = true; + } + if (("ProcessName" == name)) + { + this.processNameField = value; + this.processNameFieldSet = true; + } + if (("ServiceName" == name)) + { + this.serviceNameField = value; + this.serviceNameFieldSet = true; + } + } + } + + /// + /// Describes a registry search. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class RegistrySearch : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string variableField; + + private bool variableFieldSet; + + private string conditionField; + + private bool conditionFieldSet; + + private string afterField; + + private bool afterFieldSet; + + private RootType rootField; + + private bool rootFieldSet; + + private string keyField; + + private bool keyFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private FormatType formatField; + + private bool formatFieldSet; + + private YesNoType expandEnvironmentVariablesField; + + private bool expandEnvironmentVariablesFieldSet; + + private ResultType resultField; + + private bool resultFieldSet; + + private YesNoType win64Field; + + private bool win64FieldSet; + + private ISchemaElement parentElement; + + /// + /// Id of the search for ordering and dependency. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name of the variable in which to place the result of the search. + /// + public string Variable + { + get + { + return this.variableField; + } + set + { + this.variableFieldSet = true; + this.variableField = value; + } + } + + /// + /// Condition for evaluating the search. If this evaluates to false, the search is not executed at all. + /// + public string Condition + { + get + { + return this.conditionField; + } + set + { + this.conditionFieldSet = true; + this.conditionField = value; + } + } + + /// + /// Id of the search that this one should come after. + /// + public string After + { + get + { + return this.afterField; + } + set + { + this.afterFieldSet = true; + this.afterField = value; + } + } + + /// + /// Registry root hive to search under. + /// + public RootType Root + { + get + { + return this.rootField; + } + set + { + this.rootFieldSet = true; + this.rootField = value; + } + } + + /// + /// Key to search for. + /// + public string Key + { + get + { + return this.keyField; + } + set + { + this.keyFieldSet = true; + this.keyField = value; + } + } + + /// + /// Optional value to search for under the given Key. + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + /// + /// What format to return the value in. + /// + public FormatType Format + { + get + { + return this.formatField; + } + set + { + this.formatFieldSet = true; + this.formatField = value; + } + } + + /// + /// Whether to expand any environment variables in REG_SZ, REG_EXPAND_SZ, or REG_MULTI_SZ values. + /// + public YesNoType ExpandEnvironmentVariables + { + get + { + return this.expandEnvironmentVariablesField; + } + set + { + this.expandEnvironmentVariablesFieldSet = true; + this.expandEnvironmentVariablesField = value; + } + } + + /// + /// Rather than saving the matching registry value into the variable, a RegistrySearch can save an attribute of the matching entry instead. + /// + public ResultType Result + { + get + { + return this.resultField; + } + set + { + this.resultFieldSet = true; + this.resultField = value; + } + } + + /// + /// Instructs the search to look in the 64-bit registry when the value is 'yes'. When the value is 'no', the search looks in the 32-bit registry. The default value is 'no'. + /// + public YesNoType Win64 + { + get + { + return this.win64Field; + } + set + { + this.win64FieldSet = true; + this.win64Field = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a RootType from a string. + /// + public static RootType ParseRootType(string value) + { + RootType parsedValue; + RegistrySearch.TryParseRootType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a RootType from a string. + /// + public static bool TryParseRootType(string value, out RootType parsedValue) + { + parsedValue = RootType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("HKLM" == value)) + { + parsedValue = RootType.HKLM; + } + else + { + if (("HKCU" == value)) + { + parsedValue = RootType.HKCU; + } + else + { + if (("HKCR" == value)) + { + parsedValue = RootType.HKCR; + } + else + { + if (("HKU" == value)) + { + parsedValue = RootType.HKU; + } + else + { + parsedValue = RootType.IllegalValue; + return false; + } + } + } + } + return true; + } + + /// + /// Parses a FormatType from a string. + /// + public static FormatType ParseFormatType(string value) + { + FormatType parsedValue; + RegistrySearch.TryParseFormatType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a FormatType from a string. + /// + public static bool TryParseFormatType(string value, out FormatType parsedValue) + { + parsedValue = FormatType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("raw" == value)) + { + parsedValue = FormatType.raw; + } + else + { + if (("compatible" == value)) + { + parsedValue = FormatType.compatible; + } + else + { + parsedValue = FormatType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Parses a ResultType from a string. + /// + public static ResultType ParseResultType(string value) + { + ResultType parsedValue; + RegistrySearch.TryParseResultType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ResultType from a string. + /// + public static bool TryParseResultType(string value, out ResultType parsedValue) + { + parsedValue = ResultType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("exists" == value)) + { + parsedValue = ResultType.exists; + } + else + { + if (("value" == value)) + { + parsedValue = ResultType.value; + } + else + { + parsedValue = ResultType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RegistrySearch", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.variableFieldSet) + { + writer.WriteAttributeString("Variable", this.variableField); + } + if (this.conditionFieldSet) + { + writer.WriteAttributeString("Condition", this.conditionField); + } + if (this.afterFieldSet) + { + writer.WriteAttributeString("After", this.afterField); + } + if (this.rootFieldSet) + { + if ((this.rootField == RootType.HKLM)) + { + writer.WriteAttributeString("Root", "HKLM"); + } + if ((this.rootField == RootType.HKCU)) + { + writer.WriteAttributeString("Root", "HKCU"); + } + if ((this.rootField == RootType.HKCR)) + { + writer.WriteAttributeString("Root", "HKCR"); + } + if ((this.rootField == RootType.HKU)) + { + writer.WriteAttributeString("Root", "HKU"); + } + } + if (this.keyFieldSet) + { + writer.WriteAttributeString("Key", this.keyField); + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + if (this.formatFieldSet) + { + if ((this.formatField == FormatType.raw)) + { + writer.WriteAttributeString("Format", "raw"); + } + if ((this.formatField == FormatType.compatible)) + { + writer.WriteAttributeString("Format", "compatible"); + } + } + if (this.expandEnvironmentVariablesFieldSet) + { + if ((this.expandEnvironmentVariablesField == YesNoType.no)) + { + writer.WriteAttributeString("ExpandEnvironmentVariables", "no"); + } + if ((this.expandEnvironmentVariablesField == YesNoType.yes)) + { + writer.WriteAttributeString("ExpandEnvironmentVariables", "yes"); + } + } + if (this.resultFieldSet) + { + if ((this.resultField == ResultType.exists)) + { + writer.WriteAttributeString("Result", "exists"); + } + if ((this.resultField == ResultType.value)) + { + writer.WriteAttributeString("Result", "value"); + } + } + if (this.win64FieldSet) + { + if ((this.win64Field == YesNoType.no)) + { + writer.WriteAttributeString("Win64", "no"); + } + if ((this.win64Field == YesNoType.yes)) + { + writer.WriteAttributeString("Win64", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Variable" == name)) + { + this.variableField = value; + this.variableFieldSet = true; + } + if (("Condition" == name)) + { + this.conditionField = value; + this.conditionFieldSet = true; + } + if (("After" == name)) + { + this.afterField = value; + this.afterFieldSet = true; + } + if (("Root" == name)) + { + this.rootField = RegistrySearch.ParseRootType(value); + this.rootFieldSet = true; + } + if (("Key" == name)) + { + this.keyField = value; + this.keyFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + if (("Format" == name)) + { + this.formatField = RegistrySearch.ParseFormatType(value); + this.formatFieldSet = true; + } + if (("ExpandEnvironmentVariables" == name)) + { + this.expandEnvironmentVariablesField = Enums.ParseYesNoType(value); + this.expandEnvironmentVariablesFieldSet = true; + } + if (("Result" == name)) + { + this.resultField = RegistrySearch.ParseResultType(value); + this.resultFieldSet = true; + } + if (("Win64" == name)) + { + this.win64Field = Enums.ParseYesNoType(value); + this.win64FieldSet = true; + } + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum RootType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// HKEY_LOCAL_MACHINE + /// + HKLM, + + /// + /// HKEY_CURRENT_USER + /// + HKCU, + + /// + /// HKEY_CLASSES_ROOT + /// + HKCR, + + /// + /// HKEY_USERS + /// + HKU, + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum FormatType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Returns the unformatted value directly from the registry. For example, a REG_DWORD value of '1' is returned as '1', not '#1'. + /// + raw, + + /// + /// Returns the value formatted as Windows Installer would. For example, a REG_DWORD value of '1' is returned as '#1', not '1'. + /// + compatible, + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum ResultType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Saves true if a matching registry entry is found; false otherwise. + /// + exists, + + /// + /// Saves the value of the registry key in the variable. This is the default. + /// + value, + } + } + + /// + /// References a RegistrySearch. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class RegistrySearchRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RegistrySearchRef", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Service configuration information for failure actions. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class ServiceConfig : ISchemaElement, ISetAttributes + { + + private string serviceNameField; + + private bool serviceNameFieldSet; + + private FirstFailureActionTypeType firstFailureActionTypeField; + + private bool firstFailureActionTypeFieldSet; + + private SecondFailureActionTypeType secondFailureActionTypeField; + + private bool secondFailureActionTypeFieldSet; + + private ThirdFailureActionTypeType thirdFailureActionTypeField; + + private bool thirdFailureActionTypeFieldSet; + + private int resetPeriodInDaysField; + + private bool resetPeriodInDaysFieldSet; + + private int restartServiceDelayInSecondsField; + + private bool restartServiceDelayInSecondsFieldSet; + + private string programCommandLineField; + + private bool programCommandLineFieldSet; + + private string rebootMessageField; + + private bool rebootMessageFieldSet; + + private ISchemaElement parentElement; + + /// + /// Required if not under a ServiceInstall element. + /// + public string ServiceName + { + get + { + return this.serviceNameField; + } + set + { + this.serviceNameFieldSet = true; + this.serviceNameField = value; + } + } + + /// + /// Action to take on the first failure of the service. + /// + public FirstFailureActionTypeType FirstFailureActionType + { + get + { + return this.firstFailureActionTypeField; + } + set + { + this.firstFailureActionTypeFieldSet = true; + this.firstFailureActionTypeField = value; + } + } + + /// + /// Action to take on the second failure of the service. + /// + public SecondFailureActionTypeType SecondFailureActionType + { + get + { + return this.secondFailureActionTypeField; + } + set + { + this.secondFailureActionTypeFieldSet = true; + this.secondFailureActionTypeField = value; + } + } + + /// + /// Action to take on the third failure of the service. + /// + public ThirdFailureActionTypeType ThirdFailureActionType + { + get + { + return this.thirdFailureActionTypeField; + } + set + { + this.thirdFailureActionTypeFieldSet = true; + this.thirdFailureActionTypeField = value; + } + } + + /// + /// Number of days after which to reset the failure count to zero if there are no failures. + /// + public int ResetPeriodInDays + { + get + { + return this.resetPeriodInDaysField; + } + set + { + this.resetPeriodInDaysFieldSet = true; + this.resetPeriodInDaysField = value; + } + } + + /// + /// If any of the three *ActionType attributes is "restart", this specifies the number of seconds to wait before doing so. + /// + public int RestartServiceDelayInSeconds + { + get + { + return this.restartServiceDelayInSecondsField; + } + set + { + this.restartServiceDelayInSecondsFieldSet = true; + this.restartServiceDelayInSecondsField = value; + } + } + + /// + /// If any of the three *ActionType attributes is "runCommand", this specifies the command to run when doing so. This value is formatted. + /// + public string ProgramCommandLine + { + get + { + return this.programCommandLineField; + } + set + { + this.programCommandLineFieldSet = true; + this.programCommandLineField = value; + } + } + + /// + /// If any of the three *ActionType attributes is "reboot", this specifies the message to broadcast to server users before doing so. + /// + public string RebootMessage + { + get + { + return this.rebootMessageField; + } + set + { + this.rebootMessageFieldSet = true; + this.rebootMessageField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a FirstFailureActionTypeType from a string. + /// + public static FirstFailureActionTypeType ParseFirstFailureActionTypeType(string value) + { + FirstFailureActionTypeType parsedValue; + ServiceConfig.TryParseFirstFailureActionTypeType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a FirstFailureActionTypeType from a string. + /// + public static bool TryParseFirstFailureActionTypeType(string value, out FirstFailureActionTypeType parsedValue) + { + parsedValue = FirstFailureActionTypeType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("none" == value)) + { + parsedValue = FirstFailureActionTypeType.none; + } + else + { + if (("reboot" == value)) + { + parsedValue = FirstFailureActionTypeType.reboot; + } + else + { + if (("restart" == value)) + { + parsedValue = FirstFailureActionTypeType.restart; + } + else + { + if (("runCommand" == value)) + { + parsedValue = FirstFailureActionTypeType.runCommand; + } + else + { + parsedValue = FirstFailureActionTypeType.IllegalValue; + return false; + } + } + } + } + return true; + } + + /// + /// Parses a SecondFailureActionTypeType from a string. + /// + public static SecondFailureActionTypeType ParseSecondFailureActionTypeType(string value) + { + SecondFailureActionTypeType parsedValue; + ServiceConfig.TryParseSecondFailureActionTypeType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a SecondFailureActionTypeType from a string. + /// + public static bool TryParseSecondFailureActionTypeType(string value, out SecondFailureActionTypeType parsedValue) + { + parsedValue = SecondFailureActionTypeType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("none" == value)) + { + parsedValue = SecondFailureActionTypeType.none; + } + else + { + if (("reboot" == value)) + { + parsedValue = SecondFailureActionTypeType.reboot; + } + else + { + if (("restart" == value)) + { + parsedValue = SecondFailureActionTypeType.restart; + } + else + { + if (("runCommand" == value)) + { + parsedValue = SecondFailureActionTypeType.runCommand; + } + else + { + parsedValue = SecondFailureActionTypeType.IllegalValue; + return false; + } + } + } + } + return true; + } + + /// + /// Parses a ThirdFailureActionTypeType from a string. + /// + public static ThirdFailureActionTypeType ParseThirdFailureActionTypeType(string value) + { + ThirdFailureActionTypeType parsedValue; + ServiceConfig.TryParseThirdFailureActionTypeType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ThirdFailureActionTypeType from a string. + /// + public static bool TryParseThirdFailureActionTypeType(string value, out ThirdFailureActionTypeType parsedValue) + { + parsedValue = ThirdFailureActionTypeType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("none" == value)) + { + parsedValue = ThirdFailureActionTypeType.none; + } + else + { + if (("reboot" == value)) + { + parsedValue = ThirdFailureActionTypeType.reboot; + } + else + { + if (("restart" == value)) + { + parsedValue = ThirdFailureActionTypeType.restart; + } + else + { + if (("runCommand" == value)) + { + parsedValue = ThirdFailureActionTypeType.runCommand; + } + else + { + parsedValue = ThirdFailureActionTypeType.IllegalValue; + return false; + } + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ServiceConfig", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.serviceNameFieldSet) + { + writer.WriteAttributeString("ServiceName", this.serviceNameField); + } + if (this.firstFailureActionTypeFieldSet) + { + if ((this.firstFailureActionTypeField == FirstFailureActionTypeType.none)) + { + writer.WriteAttributeString("FirstFailureActionType", "none"); + } + if ((this.firstFailureActionTypeField == FirstFailureActionTypeType.reboot)) + { + writer.WriteAttributeString("FirstFailureActionType", "reboot"); + } + if ((this.firstFailureActionTypeField == FirstFailureActionTypeType.restart)) + { + writer.WriteAttributeString("FirstFailureActionType", "restart"); + } + if ((this.firstFailureActionTypeField == FirstFailureActionTypeType.runCommand)) + { + writer.WriteAttributeString("FirstFailureActionType", "runCommand"); + } + } + if (this.secondFailureActionTypeFieldSet) + { + if ((this.secondFailureActionTypeField == SecondFailureActionTypeType.none)) + { + writer.WriteAttributeString("SecondFailureActionType", "none"); + } + if ((this.secondFailureActionTypeField == SecondFailureActionTypeType.reboot)) + { + writer.WriteAttributeString("SecondFailureActionType", "reboot"); + } + if ((this.secondFailureActionTypeField == SecondFailureActionTypeType.restart)) + { + writer.WriteAttributeString("SecondFailureActionType", "restart"); + } + if ((this.secondFailureActionTypeField == SecondFailureActionTypeType.runCommand)) + { + writer.WriteAttributeString("SecondFailureActionType", "runCommand"); + } + } + if (this.thirdFailureActionTypeFieldSet) + { + if ((this.thirdFailureActionTypeField == ThirdFailureActionTypeType.none)) + { + writer.WriteAttributeString("ThirdFailureActionType", "none"); + } + if ((this.thirdFailureActionTypeField == ThirdFailureActionTypeType.reboot)) + { + writer.WriteAttributeString("ThirdFailureActionType", "reboot"); + } + if ((this.thirdFailureActionTypeField == ThirdFailureActionTypeType.restart)) + { + writer.WriteAttributeString("ThirdFailureActionType", "restart"); + } + if ((this.thirdFailureActionTypeField == ThirdFailureActionTypeType.runCommand)) + { + writer.WriteAttributeString("ThirdFailureActionType", "runCommand"); + } + } + if (this.resetPeriodInDaysFieldSet) + { + writer.WriteAttributeString("ResetPeriodInDays", this.resetPeriodInDaysField.ToString(CultureInfo.InvariantCulture)); + } + if (this.restartServiceDelayInSecondsFieldSet) + { + writer.WriteAttributeString("RestartServiceDelayInSeconds", this.restartServiceDelayInSecondsField.ToString(CultureInfo.InvariantCulture)); + } + if (this.programCommandLineFieldSet) + { + writer.WriteAttributeString("ProgramCommandLine", this.programCommandLineField); + } + if (this.rebootMessageFieldSet) + { + writer.WriteAttributeString("RebootMessage", this.rebootMessageField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("ServiceName" == name)) + { + this.serviceNameField = value; + this.serviceNameFieldSet = true; + } + if (("FirstFailureActionType" == name)) + { + this.firstFailureActionTypeField = ServiceConfig.ParseFirstFailureActionTypeType(value); + this.firstFailureActionTypeFieldSet = true; + } + if (("SecondFailureActionType" == name)) + { + this.secondFailureActionTypeField = ServiceConfig.ParseSecondFailureActionTypeType(value); + this.secondFailureActionTypeFieldSet = true; + } + if (("ThirdFailureActionType" == name)) + { + this.thirdFailureActionTypeField = ServiceConfig.ParseThirdFailureActionTypeType(value); + this.thirdFailureActionTypeFieldSet = true; + } + if (("ResetPeriodInDays" == name)) + { + this.resetPeriodInDaysField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.resetPeriodInDaysFieldSet = true; + } + if (("RestartServiceDelayInSeconds" == name)) + { + this.restartServiceDelayInSecondsField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.restartServiceDelayInSecondsFieldSet = true; + } + if (("ProgramCommandLine" == name)) + { + this.programCommandLineField = value; + this.programCommandLineFieldSet = true; + } + if (("RebootMessage" == name)) + { + this.rebootMessageField = value; + this.rebootMessageFieldSet = true; + } + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum FirstFailureActionTypeType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + none, + + reboot, + + restart, + + runCommand, + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum SecondFailureActionTypeType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + none, + + reboot, + + restart, + + runCommand, + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum ThirdFailureActionTypeType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + none, + + reboot, + + restart, + + runCommand, + } + } + + /// + /// Updates the last modified date/time of a file. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class TouchFile : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string pathField; + + private bool pathFieldSet; + + private YesNoType onInstallField; + + private bool onInstallFieldSet; + + private YesNoType onReinstallField; + + private bool onReinstallFieldSet; + + private YesNoType onUninstallField; + + private bool onUninstallFieldSet; + + private YesNoType nonvitalField; + + private bool nonvitalFieldSet; + + private ISchemaElement parentElement; + + /// + /// Identifier for the touch file operation. If the identifier is not specified it will be generated. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Path of the file to update. This value is formatted. + /// + public string Path + { + get + { + return this.pathField; + } + set + { + this.pathFieldSet = true; + this.pathField = value; + } + } + + /// + /// Specifies whether or not the modified time of the file should be updated on install. If the OnInstall, OnReinstall and OnUninstall attributes are all absent the default is 'yes'. + /// + public YesNoType OnInstall + { + get + { + return this.onInstallField; + } + set + { + this.onInstallFieldSet = true; + this.onInstallField = value; + } + } + + /// + /// Specifies whether or not the modified time of the file should be updated on reinstall. If the OnInstall, OnReinstall and OnUninstall attributes are all absent the default is 'yes'. + /// + public YesNoType OnReinstall + { + get + { + return this.onReinstallField; + } + set + { + this.onReinstallFieldSet = true; + this.onReinstallField = value; + } + } + + /// + /// Specifies whether or not the modified time of the file should be updated on uninstall. If the OnInstall, OnReinstall and OnUninstall attributes are all absent the default is 'no'. + /// + public YesNoType OnUninstall + { + get + { + return this.onUninstallField; + } + set + { + this.onUninstallFieldSet = true; + this.onUninstallField = value; + } + } + + /// + /// Indicates the installation will succeed even if the modified time of the file cannot be updated. The default is 'no'. + /// + public YesNoType Nonvital + { + get + { + return this.nonvitalField; + } + set + { + this.nonvitalFieldSet = true; + this.nonvitalField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("TouchFile", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.pathFieldSet) + { + writer.WriteAttributeString("Path", this.pathField); + } + if (this.onInstallFieldSet) + { + if ((this.onInstallField == YesNoType.no)) + { + writer.WriteAttributeString("OnInstall", "no"); + } + if ((this.onInstallField == YesNoType.yes)) + { + writer.WriteAttributeString("OnInstall", "yes"); + } + } + if (this.onReinstallFieldSet) + { + if ((this.onReinstallField == YesNoType.no)) + { + writer.WriteAttributeString("OnReinstall", "no"); + } + if ((this.onReinstallField == YesNoType.yes)) + { + writer.WriteAttributeString("OnReinstall", "yes"); + } + } + if (this.onUninstallFieldSet) + { + if ((this.onUninstallField == YesNoType.no)) + { + writer.WriteAttributeString("OnUninstall", "no"); + } + if ((this.onUninstallField == YesNoType.yes)) + { + writer.WriteAttributeString("OnUninstall", "yes"); + } + } + if (this.nonvitalFieldSet) + { + if ((this.nonvitalField == YesNoType.no)) + { + writer.WriteAttributeString("Nonvital", "no"); + } + if ((this.nonvitalField == YesNoType.yes)) + { + writer.WriteAttributeString("Nonvital", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Path" == name)) + { + this.pathField = value; + this.pathFieldSet = true; + } + if (("OnInstall" == name)) + { + this.onInstallField = Enums.ParseYesNoType(value); + this.onInstallFieldSet = true; + } + if (("OnReinstall" == name)) + { + this.onReinstallField = Enums.ParseYesNoType(value); + this.onReinstallFieldSet = true; + } + if (("OnUninstall" == name)) + { + this.onUninstallField = Enums.ParseYesNoType(value); + this.onUninstallFieldSet = true; + } + if (("Nonvital" == name)) + { + this.nonvitalField = Enums.ParseYesNoType(value); + this.nonvitalFieldSet = true; + } + } + } + + /// + /// User for all kinds of things. When it is not nested under a component it is included in the MSI so it can be referenced by other elements such as the User attribute in the AppPool element. When it is nested under a Component element, the User will be created on install and can also be used for reference. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class User : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string domainField; + + private bool domainFieldSet; + + private string passwordField; + + private bool passwordFieldSet; + + private YesNoType passwordNeverExpiresField; + + private bool passwordNeverExpiresFieldSet; + + private YesNoType canNotChangePasswordField; + + private bool canNotChangePasswordFieldSet; + + private YesNoType removeOnUninstallField; + + private bool removeOnUninstallFieldSet; + + private YesNoType failIfExistsField; + + private bool failIfExistsFieldSet; + + private YesNoType logonAsServiceField; + + private bool logonAsServiceFieldSet; + + private YesNoType logonAsBatchJobField; + + private bool logonAsBatchJobFieldSet; + + private YesNoType updateIfExistsField; + + private bool updateIfExistsFieldSet; + + private YesNoType passwordExpiredField; + + private bool passwordExpiredFieldSet; + + private YesNoType disabledField; + + private bool disabledFieldSet; + + private YesNoType createUserField; + + private bool createUserFieldSet; + + private YesNoType vitalField; + + private bool vitalFieldSet; + + private ISchemaElement parentElement; + + public User() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(GroupRef))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// A + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// A + /// + public string Domain + { + get + { + return this.domainField; + } + set + { + this.domainFieldSet = true; + this.domainField = value; + } + } + + /// + /// Usually a Property that is passed in on the command-line to keep it more secure. + /// + public string Password + { + get + { + return this.passwordField; + } + set + { + this.passwordFieldSet = true; + this.passwordField = value; + } + } + + /// + /// The account's password never expires. Equivalent to UF_DONT_EXPIRE_PASSWD. + /// + public YesNoType PasswordNeverExpires + { + get + { + return this.passwordNeverExpiresField; + } + set + { + this.passwordNeverExpiresFieldSet = true; + this.passwordNeverExpiresField = value; + } + } + + /// + /// The user cannot change the account's password. Equivalent to UF_PASSWD_CANT_CHANGE. + /// + public YesNoType CanNotChangePassword + { + get + { + return this.canNotChangePasswordField; + } + set + { + this.canNotChangePasswordFieldSet = true; + this.canNotChangePasswordField = value; + } + } + + /// + /// Indicates whether the user account should be removed or left behind on uninstall. + /// + public YesNoType RemoveOnUninstall + { + get + { + return this.removeOnUninstallField; + } + set + { + this.removeOnUninstallFieldSet = true; + this.removeOnUninstallField = value; + } + } + + /// + /// Indicates if the install should fail if the user already exists. + /// + public YesNoType FailIfExists + { + get + { + return this.failIfExistsField; + } + set + { + this.failIfExistsFieldSet = true; + this.failIfExistsField = value; + } + } + + /// + /// Indicates whether or not the user can logon as a serivce. User creation can be skipped if all that is desired is to set this access right on the user. + /// + public YesNoType LogonAsService + { + get + { + return this.logonAsServiceField; + } + set + { + this.logonAsServiceFieldSet = true; + this.logonAsServiceField = value; + } + } + + /// + /// Indicates whether or not the user can logon as a batch job. User creation can be skipped if all that is desired is to set this access right on the user. + /// + public YesNoType LogonAsBatchJob + { + get + { + return this.logonAsBatchJobField; + } + set + { + this.logonAsBatchJobFieldSet = true; + this.logonAsBatchJobField = value; + } + } + + /// + /// Indicates if the user account properties should be updated if the user already exists. + /// + public YesNoType UpdateIfExists + { + get + { + return this.updateIfExistsField; + } + set + { + this.updateIfExistsFieldSet = true; + this.updateIfExistsField = value; + } + } + + /// + /// Indicates whether the user must change their password on their first login. + /// + public YesNoType PasswordExpired + { + get + { + return this.passwordExpiredField; + } + set + { + this.passwordExpiredFieldSet = true; + this.passwordExpiredField = value; + } + } + + /// + /// The account is disabled. Equivalent to UF_ACCOUNTDISABLE. + /// + public YesNoType Disabled + { + get + { + return this.disabledField; + } + set + { + this.disabledFieldSet = true; + this.disabledField = value; + } + } + + /// + /// Indicates whether or not to create the user. User creation can be skipped if all that is desired is to join a user to groups. + /// + public YesNoType CreateUser + { + get + { + return this.createUserField; + } + set + { + this.createUserFieldSet = true; + this.createUserField = value; + } + } + + /// + /// Indicates whether failure to create the user or add the user to a group fails the installation. The default value is "yes". + /// + public YesNoType Vital + { + get + { + return this.vitalField; + } + set + { + this.vitalFieldSet = true; + this.vitalField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("GroupRef" == childName)) + { + childValue = new GroupRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("User", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.domainFieldSet) + { + writer.WriteAttributeString("Domain", this.domainField); + } + if (this.passwordFieldSet) + { + writer.WriteAttributeString("Password", this.passwordField); + } + if (this.passwordNeverExpiresFieldSet) + { + if ((this.passwordNeverExpiresField == YesNoType.no)) + { + writer.WriteAttributeString("PasswordNeverExpires", "no"); + } + if ((this.passwordNeverExpiresField == YesNoType.yes)) + { + writer.WriteAttributeString("PasswordNeverExpires", "yes"); + } + } + if (this.canNotChangePasswordFieldSet) + { + if ((this.canNotChangePasswordField == YesNoType.no)) + { + writer.WriteAttributeString("CanNotChangePassword", "no"); + } + if ((this.canNotChangePasswordField == YesNoType.yes)) + { + writer.WriteAttributeString("CanNotChangePassword", "yes"); + } + } + if (this.removeOnUninstallFieldSet) + { + if ((this.removeOnUninstallField == YesNoType.no)) + { + writer.WriteAttributeString("RemoveOnUninstall", "no"); + } + if ((this.removeOnUninstallField == YesNoType.yes)) + { + writer.WriteAttributeString("RemoveOnUninstall", "yes"); + } + } + if (this.failIfExistsFieldSet) + { + if ((this.failIfExistsField == YesNoType.no)) + { + writer.WriteAttributeString("FailIfExists", "no"); + } + if ((this.failIfExistsField == YesNoType.yes)) + { + writer.WriteAttributeString("FailIfExists", "yes"); + } + } + if (this.logonAsServiceFieldSet) + { + if ((this.logonAsServiceField == YesNoType.no)) + { + writer.WriteAttributeString("LogonAsService", "no"); + } + if ((this.logonAsServiceField == YesNoType.yes)) + { + writer.WriteAttributeString("LogonAsService", "yes"); + } + } + if (this.logonAsBatchJobFieldSet) + { + if ((this.logonAsBatchJobField == YesNoType.no)) + { + writer.WriteAttributeString("LogonAsBatchJob", "no"); + } + if ((this.logonAsBatchJobField == YesNoType.yes)) + { + writer.WriteAttributeString("LogonAsBatchJob", "yes"); + } + } + if (this.updateIfExistsFieldSet) + { + if ((this.updateIfExistsField == YesNoType.no)) + { + writer.WriteAttributeString("UpdateIfExists", "no"); + } + if ((this.updateIfExistsField == YesNoType.yes)) + { + writer.WriteAttributeString("UpdateIfExists", "yes"); + } + } + if (this.passwordExpiredFieldSet) + { + if ((this.passwordExpiredField == YesNoType.no)) + { + writer.WriteAttributeString("PasswordExpired", "no"); + } + if ((this.passwordExpiredField == YesNoType.yes)) + { + writer.WriteAttributeString("PasswordExpired", "yes"); + } + } + if (this.disabledFieldSet) + { + if ((this.disabledField == YesNoType.no)) + { + writer.WriteAttributeString("Disabled", "no"); + } + if ((this.disabledField == YesNoType.yes)) + { + writer.WriteAttributeString("Disabled", "yes"); + } + } + if (this.createUserFieldSet) + { + if ((this.createUserField == YesNoType.no)) + { + writer.WriteAttributeString("CreateUser", "no"); + } + if ((this.createUserField == YesNoType.yes)) + { + writer.WriteAttributeString("CreateUser", "yes"); + } + } + if (this.vitalFieldSet) + { + if ((this.vitalField == YesNoType.no)) + { + writer.WriteAttributeString("Vital", "no"); + } + if ((this.vitalField == YesNoType.yes)) + { + writer.WriteAttributeString("Vital", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Domain" == name)) + { + this.domainField = value; + this.domainFieldSet = true; + } + if (("Password" == name)) + { + this.passwordField = value; + this.passwordFieldSet = true; + } + if (("PasswordNeverExpires" == name)) + { + this.passwordNeverExpiresField = Enums.ParseYesNoType(value); + this.passwordNeverExpiresFieldSet = true; + } + if (("CanNotChangePassword" == name)) + { + this.canNotChangePasswordField = Enums.ParseYesNoType(value); + this.canNotChangePasswordFieldSet = true; + } + if (("RemoveOnUninstall" == name)) + { + this.removeOnUninstallField = Enums.ParseYesNoType(value); + this.removeOnUninstallFieldSet = true; + } + if (("FailIfExists" == name)) + { + this.failIfExistsField = Enums.ParseYesNoType(value); + this.failIfExistsFieldSet = true; + } + if (("LogonAsService" == name)) + { + this.logonAsServiceField = Enums.ParseYesNoType(value); + this.logonAsServiceFieldSet = true; + } + if (("LogonAsBatchJob" == name)) + { + this.logonAsBatchJobField = Enums.ParseYesNoType(value); + this.logonAsBatchJobFieldSet = true; + } + if (("UpdateIfExists" == name)) + { + this.updateIfExistsField = Enums.ParseYesNoType(value); + this.updateIfExistsFieldSet = true; + } + if (("PasswordExpired" == name)) + { + this.passwordExpiredField = Enums.ParseYesNoType(value); + this.passwordExpiredFieldSet = true; + } + if (("Disabled" == name)) + { + this.disabledField = Enums.ParseYesNoType(value); + this.disabledFieldSet = true; + } + if (("CreateUser" == name)) + { + this.createUserField = Enums.ParseYesNoType(value); + this.createUserFieldSet = true; + } + if (("Vital" == name)) + { + this.vitalField = Enums.ParseYesNoType(value); + this.vitalFieldSet = true; + } + } + } + + /// + /// Adds or removes .xml file entries. If you use the XmlFile element you must reference WixUtilExtension.dll as it contains the XmlFile custom actions. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class XmlFile : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string elementPathField; + + private bool elementPathFieldSet; + + private string fileField; + + private bool fileFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private ActionType actionField; + + private bool actionFieldSet; + + private YesNoType permanentField; + + private bool permanentFieldSet; + + private YesNoType preserveModifiedDateField; + + private bool preserveModifiedDateFieldSet; + + private int sequenceField; + + private bool sequenceFieldSet; + + private SelectionLanguageType selectionLanguageField; + + private bool selectionLanguageFieldSet; + + private ISchemaElement parentElement; + + /// + /// Identifier for xml file modification. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The XPath of the element to be modified. Note that this is a formatted field and therefore, square brackets in the XPath must be escaped. In addition, XPaths allow backslashes to be used to escape characters, so if you intend to include literal backslashes, you must escape them as well by doubling them in this attribute. The string is formatted by MSI first, and the result is consumed as the XPath. + /// + public string ElementPath + { + get + { + return this.elementPathField; + } + set + { + this.elementPathFieldSet = true; + this.elementPathField = value; + } + } + + /// + /// Path of the .xml file to configure. + /// + public string File + { + get + { + return this.fileField; + } + set + { + this.fileFieldSet = true; + this.fileField = value; + } + } + + /// + /// Name of XML node to set/add to the specified element. Not setting this attribute causes the element's text value to be set. Otherwise this specified the attribute name that is set. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// The value to be written. See the + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + /// + /// The type of modification to be made to the XML file when the component is installed. + /// + public ActionType Action + { + get + { + return this.actionField; + } + set + { + this.actionFieldSet = true; + this.actionField = value; + } + } + + /// + /// Specifies whether or not the modification should be removed on uninstall. This has no effect on uninstall if the action was deleteValue. + /// + public YesNoType Permanent + { + get + { + return this.permanentField; + } + set + { + this.permanentFieldSet = true; + this.permanentField = value; + } + } + + /// + /// Specifies wheter or not the modification should preserve the modified date. Preserving the modified date will allow the file to be patched if no other modifications have been made. + /// + public YesNoType PreserveModifiedDate + { + get + { + return this.preserveModifiedDateField; + } + set + { + this.preserveModifiedDateFieldSet = true; + this.preserveModifiedDateField = value; + } + } + + /// + /// Specifies the order in which the modification is to be attempted on the XML file. It is important to ensure that new elements are created before you attempt to add an attribute to them. + /// + public int Sequence + { + get + { + return this.sequenceField; + } + set + { + this.sequenceFieldSet = true; + this.sequenceField = value; + } + } + + /// + /// Specify whether the DOM object should use XPath language or the old XSLPattern language (default) as the query language. + /// + public SelectionLanguageType SelectionLanguage + { + get + { + return this.selectionLanguageField; + } + set + { + this.selectionLanguageFieldSet = true; + this.selectionLanguageField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a ActionType from a string. + /// + public static ActionType ParseActionType(string value) + { + ActionType parsedValue; + XmlFile.TryParseActionType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ActionType from a string. + /// + public static bool TryParseActionType(string value, out ActionType parsedValue) + { + parsedValue = ActionType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("createElement" == value)) + { + parsedValue = ActionType.createElement; + } + else + { + if (("deleteValue" == value)) + { + parsedValue = ActionType.deleteValue; + } + else + { + if (("setValue" == value)) + { + parsedValue = ActionType.setValue; + } + else + { + if (("bulkSetValue" == value)) + { + parsedValue = ActionType.bulkSetValue; + } + else + { + parsedValue = ActionType.IllegalValue; + return false; + } + } + } + } + return true; + } + + /// + /// Parses a SelectionLanguageType from a string. + /// + public static SelectionLanguageType ParseSelectionLanguageType(string value) + { + SelectionLanguageType parsedValue; + XmlFile.TryParseSelectionLanguageType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a SelectionLanguageType from a string. + /// + public static bool TryParseSelectionLanguageType(string value, out SelectionLanguageType parsedValue) + { + parsedValue = SelectionLanguageType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("XPath" == value)) + { + parsedValue = SelectionLanguageType.XPath; + } + else + { + if (("XSLPattern" == value)) + { + parsedValue = SelectionLanguageType.XSLPattern; + } + else + { + parsedValue = SelectionLanguageType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("XmlFile", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.elementPathFieldSet) + { + writer.WriteAttributeString("ElementPath", this.elementPathField); + } + if (this.fileFieldSet) + { + writer.WriteAttributeString("File", this.fileField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + if (this.actionFieldSet) + { + if ((this.actionField == ActionType.createElement)) + { + writer.WriteAttributeString("Action", "createElement"); + } + if ((this.actionField == ActionType.deleteValue)) + { + writer.WriteAttributeString("Action", "deleteValue"); + } + if ((this.actionField == ActionType.setValue)) + { + writer.WriteAttributeString("Action", "setValue"); + } + if ((this.actionField == ActionType.bulkSetValue)) + { + writer.WriteAttributeString("Action", "bulkSetValue"); + } + } + if (this.permanentFieldSet) + { + if ((this.permanentField == YesNoType.no)) + { + writer.WriteAttributeString("Permanent", "no"); + } + if ((this.permanentField == YesNoType.yes)) + { + writer.WriteAttributeString("Permanent", "yes"); + } + } + if (this.preserveModifiedDateFieldSet) + { + if ((this.preserveModifiedDateField == YesNoType.no)) + { + writer.WriteAttributeString("PreserveModifiedDate", "no"); + } + if ((this.preserveModifiedDateField == YesNoType.yes)) + { + writer.WriteAttributeString("PreserveModifiedDate", "yes"); + } + } + if (this.sequenceFieldSet) + { + writer.WriteAttributeString("Sequence", this.sequenceField.ToString(CultureInfo.InvariantCulture)); + } + if (this.selectionLanguageFieldSet) + { + if ((this.selectionLanguageField == SelectionLanguageType.XPath)) + { + writer.WriteAttributeString("SelectionLanguage", "XPath"); + } + if ((this.selectionLanguageField == SelectionLanguageType.XSLPattern)) + { + writer.WriteAttributeString("SelectionLanguage", "XSLPattern"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("ElementPath" == name)) + { + this.elementPathField = value; + this.elementPathFieldSet = true; + } + if (("File" == name)) + { + this.fileField = value; + this.fileFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + if (("Action" == name)) + { + this.actionField = XmlFile.ParseActionType(value); + this.actionFieldSet = true; + } + if (("Permanent" == name)) + { + this.permanentField = Enums.ParseYesNoType(value); + this.permanentFieldSet = true; + } + if (("PreserveModifiedDate" == name)) + { + this.preserveModifiedDateField = Enums.ParseYesNoType(value); + this.preserveModifiedDateFieldSet = true; + } + if (("Sequence" == name)) + { + this.sequenceField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.sequenceFieldSet = true; + } + if (("SelectionLanguage" == name)) + { + this.selectionLanguageField = XmlFile.ParseSelectionLanguageType(value); + this.selectionLanguageFieldSet = true; + } + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum ActionType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Creates a new element under the element specified in ElementPath. The Name attribute is required in this case and specifies the name of the new element. The Value attribute is not necessary when createElement is specified as the action. If the Value attribute is set, it will cause the new element's text value to be set. + /// + createElement, + + /// + /// Deletes a value from the element specified in the ElementPath. If Name is specified, the attribute with that name is deleted. If Name is not specified, the text value of the element specified in the ElementPath is deleted. The Value attribute is ignored if deleteValue is the action specified. + /// + deleteValue, + + /// + /// Sets a value in the element specified in the ElementPath. If Name is specified, and attribute with that name is set to the value specified in Value. If Name is not specified, the text value of the element is set. Value is a required attribute if setValue is the action specified. + /// + setValue, + + /// + /// Sets all the values in the elements that match the ElementPath. If Name is specified, attributes with that name are set to the same value specified in Value. If Name is not specified, the text values of the elements are set. Value is a required attribute if setBulkValue is the action specified. + /// + bulkSetValue, + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum SelectionLanguageType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + XPath, + + XSLPattern, + } + } + + /// + /// Adds or removes .xml file entries. If you use the XmlConfig element you must reference WixUtilExtension.dll as it contains the XmlConfig custom actions. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class XmlConfig : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private ActionType actionField; + + private bool actionFieldSet; + + private string elementIdField; + + private bool elementIdFieldSet; + + private string elementPathField; + + private bool elementPathFieldSet; + + private string fileField; + + private bool fileFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private NodeType nodeField; + + private bool nodeFieldSet; + + private OnType onField; + + private bool onFieldSet; + + private YesNoType preserveModifiedDateField; + + private bool preserveModifiedDateFieldSet; + + private int sequenceField; + + private bool sequenceFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private string verifyPathField; + + private bool verifyPathFieldSet; + + private ISchemaElement parentElement; + + public XmlConfig() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(XmlConfig))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Identifier for xml file modification. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public ActionType Action + { + get + { + return this.actionField; + } + set + { + this.actionFieldSet = true; + this.actionField = value; + } + } + + /// + /// The Id of another XmlConfig to add attributes to. In this case, the 'ElementPath', 'Action', 'Node', and 'On' attributes must be omitted. + /// + public string ElementId + { + get + { + return this.elementIdField; + } + set + { + this.elementIdFieldSet = true; + this.elementIdField = value; + } + } + + /// + /// The XPath of the parent element being modified. Note that this is a formatted field and therefore, square brackets in the XPath must be escaped. In addition, XPaths allow backslashes to be used to escape characters, so if you intend to include literal backslashes, you must escape them as well by doubling them in this attribute. The string is formatted by MSI first, and the result is consumed as the XPath. + /// + public string ElementPath + { + get + { + return this.elementPathField; + } + set + { + this.elementPathFieldSet = true; + this.elementPathField = value; + } + } + + /// + /// Path of the .xml file to configure. + /// + public string File + { + get + { + return this.fileField; + } + set + { + this.fileFieldSet = true; + this.fileField = value; + } + } + + /// + /// Name of XML node to set/add to the specified element. Not setting this attribute causes the element's text value to be set. Otherwise this specified the attribute name that is set. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + public NodeType Node + { + get + { + return this.nodeField; + } + set + { + this.nodeFieldSet = true; + this.nodeField = value; + } + } + + public OnType On + { + get + { + return this.onField; + } + set + { + this.onFieldSet = true; + this.onField = value; + } + } + + /// + /// Specifies wheter or not the modification should preserve the modified date. Preserving the modified date will allow the file to be patched if no other modifications have been made. + /// + public YesNoType PreserveModifiedDate + { + get + { + return this.preserveModifiedDateField; + } + set + { + this.preserveModifiedDateFieldSet = true; + this.preserveModifiedDateField = value; + } + } + + /// + /// Specifies the order in which the modification is to be attempted on the XML file. It is important to ensure that new elements are created before you attempt to add an attribute to them. + /// + public int Sequence + { + get + { + return this.sequenceField; + } + set + { + this.sequenceFieldSet = true; + this.sequenceField = value; + } + } + + /// + /// The value to be written. See the + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + /// + /// The XPath to the element being modified. This is required for 'delete' actions. For 'create' actions, VerifyPath is used to decide if the element already exists. Note that this is a formatted field and therefore, square brackets in the XPath must be escaped. In addition, XPaths allow backslashes to be used to escape characters, so if you intend to include literal backslashes, you must escape them as well by doubling them in this attribute. The string is formatted by MSI first, and the result is consumed as the XPath. + /// + public string VerifyPath + { + get + { + return this.verifyPathField; + } + set + { + this.verifyPathFieldSet = true; + this.verifyPathField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("XmlConfig" == childName)) + { + childValue = new XmlConfig(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Parses a ActionType from a string. + /// + public static ActionType ParseActionType(string value) + { + ActionType parsedValue; + XmlConfig.TryParseActionType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ActionType from a string. + /// + public static bool TryParseActionType(string value, out ActionType parsedValue) + { + parsedValue = ActionType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("create" == value)) + { + parsedValue = ActionType.create; + } + else + { + if (("delete" == value)) + { + parsedValue = ActionType.delete; + } + else + { + parsedValue = ActionType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Parses a NodeType from a string. + /// + public static NodeType ParseNodeType(string value) + { + NodeType parsedValue; + XmlConfig.TryParseNodeType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a NodeType from a string. + /// + public static bool TryParseNodeType(string value, out NodeType parsedValue) + { + parsedValue = NodeType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("element" == value)) + { + parsedValue = NodeType.element; + } + else + { + if (("value" == value)) + { + parsedValue = NodeType.value; + } + else + { + if (("document" == value)) + { + parsedValue = NodeType.document; + } + else + { + parsedValue = NodeType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Parses a OnType from a string. + /// + public static OnType ParseOnType(string value) + { + OnType parsedValue; + XmlConfig.TryParseOnType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a OnType from a string. + /// + public static bool TryParseOnType(string value, out OnType parsedValue) + { + parsedValue = OnType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("install" == value)) + { + parsedValue = OnType.install; + } + else + { + if (("uninstall" == value)) + { + parsedValue = OnType.uninstall; + } + else + { + parsedValue = OnType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("XmlConfig", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.actionFieldSet) + { + if ((this.actionField == ActionType.create)) + { + writer.WriteAttributeString("Action", "create"); + } + if ((this.actionField == ActionType.delete)) + { + writer.WriteAttributeString("Action", "delete"); + } + } + if (this.elementIdFieldSet) + { + writer.WriteAttributeString("ElementId", this.elementIdField); + } + if (this.elementPathFieldSet) + { + writer.WriteAttributeString("ElementPath", this.elementPathField); + } + if (this.fileFieldSet) + { + writer.WriteAttributeString("File", this.fileField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.nodeFieldSet) + { + if ((this.nodeField == NodeType.element)) + { + writer.WriteAttributeString("Node", "element"); + } + if ((this.nodeField == NodeType.value)) + { + writer.WriteAttributeString("Node", "value"); + } + if ((this.nodeField == NodeType.document)) + { + writer.WriteAttributeString("Node", "document"); + } + } + if (this.onFieldSet) + { + if ((this.onField == OnType.install)) + { + writer.WriteAttributeString("On", "install"); + } + if ((this.onField == OnType.uninstall)) + { + writer.WriteAttributeString("On", "uninstall"); + } + } + if (this.preserveModifiedDateFieldSet) + { + if ((this.preserveModifiedDateField == YesNoType.no)) + { + writer.WriteAttributeString("PreserveModifiedDate", "no"); + } + if ((this.preserveModifiedDateField == YesNoType.yes)) + { + writer.WriteAttributeString("PreserveModifiedDate", "yes"); + } + } + if (this.sequenceFieldSet) + { + writer.WriteAttributeString("Sequence", this.sequenceField.ToString(CultureInfo.InvariantCulture)); + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + if (this.verifyPathFieldSet) + { + writer.WriteAttributeString("VerifyPath", this.verifyPathField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Action" == name)) + { + this.actionField = XmlConfig.ParseActionType(value); + this.actionFieldSet = true; + } + if (("ElementId" == name)) + { + this.elementIdField = value; + this.elementIdFieldSet = true; + } + if (("ElementPath" == name)) + { + this.elementPathField = value; + this.elementPathFieldSet = true; + } + if (("File" == name)) + { + this.fileField = value; + this.fileFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Node" == name)) + { + this.nodeField = XmlConfig.ParseNodeType(value); + this.nodeFieldSet = true; + } + if (("On" == name)) + { + this.onField = XmlConfig.ParseOnType(value); + this.onFieldSet = true; + } + if (("PreserveModifiedDate" == name)) + { + this.preserveModifiedDateField = Enums.ParseYesNoType(value); + this.preserveModifiedDateFieldSet = true; + } + if (("Sequence" == name)) + { + this.sequenceField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.sequenceFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + if (("VerifyPath" == name)) + { + this.verifyPathField = value; + this.verifyPathFieldSet = true; + } + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum ActionType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + create, + + delete, + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum NodeType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + element, + + value, + + document, + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum OnType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + install, + + uninstall, + } + } +} diff --git a/src/wixext/util.xsd b/src/wixext/util.xsd new file mode 100644 index 0000000..fb8d803 --- /dev/null +++ b/src/wixext/util.xsd @@ -0,0 +1,1692 @@ + + + + + + + + The source code schema for the WiX Toolset Utility Extension. + + + + + + + + + + + Closes applications or schedules a reboot if application cannot be closed. + + + + + + + Condition that determines if the application should be closed. Must be blank or evaluate to true + for the application to be scheduled for closing. + + + + + Identifier for the close application (primary key). If the Id is not specified, one will be generated. + + + + + Name of the exectuable to be closed. This should only be the file name. + + + + + Description to show if application is running and needs to be closed. + + + + + Optionally orders the applications to be closed. + + + + + Optionally sends a close message to the application. Default is no. + + + + + Sends WM_QUERYENDSESSION then WM_ENDSESSION messages to the application. Default is "no". + + + + + Optionally sends a close message to the application from deffered action without impersonation. Default is no. + + + + + Sends WM_QUERYENDSESSION then WM_ENDSESSION messages to the application from a deffered action without impersonation. Default is "no". + + + + + Optionally prompts for reboot if application is still running. The default is "yes". The TerminateProcess attribute must be "no" or not specified if this attribute is "yes". + + + + + + When this attribute is set to "yes", the user will be prompted when the application is still running. The Description attribute must contain the message to + display in the prompt. The prompt occurs before executing any of the other options and gives the options to "Abort", "Retry", or "Ignore". Abort will cancel + the install. Retry will attempt the check again and if the application is still running, prompt again. "Ignore" will continue and execute any other options + set on the CloseApplication element. The default is "no". + + + + + + Property to be set if application is still running. Useful for launch conditions or to conditionalize custom UI to ask user to shut down apps. + + + + + + Attempts to terminates process and return the specified exit code if application is still running after sending any requested close and/or end session messages. + If this attribute is specified, the RebootPrompt attribute must be "no". The default is "no". + + + + + + + Optional time in seconds to wait for the application to exit after the close and/or end session messages. If the application is still running after the timeout then + the RebootPrompt or TerminateProcess attributes will be considered. The default value is "5" seconds. + + + + + + + + + + Describes a component search. + + + + + + + + + + Component to search for. + + + + + Optional ProductCode to determine if the component is installed. + + + + + + Rather than saving the matching key path into the variable, a ComponentSearch can save an attribute of the component instead. + + + + + + + Saves the parent directory for the component's file key path; other types of key path are returned unmodified. + + + + + Saves the state of the component: absent (2), locally installed (3), will run from source (4), or installed in default location (either local or from source) (5) + + + + + Saves the key path of the component if installed. This is the default. + + + + + + + + + + References a ComponentSearch. + + + + + + + + + + + + Describes a directory search. + + + + + + + + + + Directory path to search for. + + + + + + Rather than saving the matching directory path into the variable, a DirectorySearch can save an + attribute of the matching directory instead. + + + + + + + Saves true if a matching directory is found; false otherwise. + + + + + + + + + + References a DirectorySearch. + + + + + + + + + + + + + + + Creates an event source. + + + + + + The number of categories in CategoryMessageFile. CategoryMessageFile + must be specified too. + + + + + + + Name of the category message file. CategoryCount must be specified too. + Note that this is a formatted field, so you can use [#fileId] syntax to + refer to a file being installed. It is also written as a REG_EXPAND_SZ + string, so you can use %environment_variable% syntax to refer to a file + already present on the user's machine. + + + + + + + Name of the event message file. + Note that this is a formatted field, so you can use [#fileId] syntax to + refer to a file being installed. It is also written as a REG_EXPAND_SZ + string, so you can use %environment_variable% syntax to refer to a file + already present on the user's machine. + + + + + + + Marks the EventSource registry as the key path of the component it belongs to. + + + + + + Name of the event source's log. + + + + + Name of the event source. + + + + + + Name of the parameter message file. + Note that this is a formatted field, so you can use [#fileId] syntax to + refer to a file being installed. It is also written as a REG_EXPAND_SZ + string, so you can use %environment_variable% syntax to refer to a file + already present on the user's machine. + + + + + + + Equivalent to EVENTLOG_ERROR_TYPE. + + + + + + + Equivalent to EVENTLOG_AUDIT_FAILURE. + + + + + + + Equivalent to EVENTLOG_INFORMATION_TYPE. + + + + + + + Equivalent to EVENTLOG_AUDIT_SUCCESS. + + + + + + + Equivalent to EVENTLOG_WARNING_TYPE. + + + + + + + + Describes a file search. + + + + + + + + + + File path to search for. + + + + + + Rather than saving the matching file path into the variable, a FileSearch can save an attribute of the matching file instead. + + + + + + + Saves true if a matching file is found; false otherwise. + + + + + Saves the version information for files that have it (.exe, .dll); zero-version (0.0.0.0) otherwise. + + + + + + + + + + References a FileSearch. + + + + + + + + + + + + + + + Creates a file share out of the component's directory. + + + + + + ACL permission + + + + + + Identifier for the file share (primary key). + + + + + Name of the file share. + + + + + Description of the file share. + + + + + + + + Sets ACLs on a FileShare. This element has no Id attribute. + The table and key are taken from the parent element. + + + + + + + + + + + + + + + + + + + + For a directory, the right to create a file in the directory. Only valid under a 'CreateFolder' parent. + + + + + For a directory, the right to create a subdirectory. Only valid under a 'CreateFolder' parent. + + + + + For a directory, the right to delete a directory and all the files it contains, including read-only files. Only valid under a 'CreateFolder' parent. + + + + + For a directory, the right to traverse the directory. By default, users are assigned the BYPASS_TRAVERSE_CHECKING privilege, which ignores the FILE_TRAVERSE access right. Only valid under a 'CreateFolder' parent. + + + + + + + + + specifying this will fail to grant read access + + + + + + + + + + + Formats a file's contents at install time. The contents are formatted according to the rules of the + Formatted data type. + + + + + + + The id of a Binary row that contains a copy of the file. The file in the Binary table overwrites whatever + file is installed by the parent component. + + + + + + + + + + + + + + Finds user groups on the local machine or specified Active Directory domain. The local machine will be + searched for the group first then fallback to looking in Active Directory. This element is not capable + of creating new groups but can be used to add new or existing users to an existing group. + + + + + + Unique identifier in your installation package for this group. + + + + + A Formatted string that contains the name of the group to be found. + + + + + An optional Formatted string that specifies the domain for the group. + + + + + + + Used to join a user to a group + + + + + + + + + + How To: Create a shortcut to a webpage + + Creates a shortcut to a URL. + + + + + Unique identifier in your installation package for this Internet shortcut. + + + + + Identifier reference to Directory element where shortcut is to be created. This attribute's value defaults to the parent Component directory. + + + + + + The name of the shortcut file, which is visible to the user. (The .lnk + extension is added automatically and by default, is not shown to the user.) + + + + + + + URL that should be opened when the user selects the shortcut. Windows + opens the URL in the appropriate handler for the protocol specified + in the URL. Note that this is a formatted field, so you can use + [#fileId] syntax to refer to a file being installed (using the file: + protocol). + + + + + + Which type of shortcut should be created. + + + + + + Creates .url files using IUniformResourceLocatorW. + + + + + Creates .lnk files using IShellLinkW (default). + + + + + + + + + Icon file that should be displayed. Note that this is a formatted field, so you can use + [#fileId] syntax to refer to a file being installed (using the file: + protocol). + + + + + + + Index of the icon being referenced + + + + + + + + + + + Used to create performance categories and configure performance counters. + + + + + + + + Unique identifier in your installation package for this performance counter category. + + + + + Name for the performance counter category. If this attribute is not provided the Id attribute is used as the name of the performance counter category. + + + + + Optional help text for the performance counter category. + + + + + Flag that specifies whether the performance counter category is multi or single instanced. Default is single instance. + + + + + DLL that contains the performance counter. The default is "netfxperf.dll" which should be used for all managed code performance counters. + + + + + Function entry point in to the Library DLL called when opening the performance counter. The default is "OpenPerformanceData" which should be used for all managed code performance counters. + + + + + Function entry point in to the Library DLL called when closing the performance counter. The default is "ClosePerformanceData" which should be used for all managed code performance counters. + + + + + Function entry point in to the Library DLL called when collecting data from the performance counter. The default is "CollectPerformanceData" which should be used for all managed code performance counters. + + + + + Default language for the performance category and contained counters' names and help text. + + + + + + + Creates a performance counter in a performance category. + + + + + Name for the performance counter. + + + + + Optional help text for the performance counter. + + + + + Type of the performance counter. + + + + + Language for the peformance counter name and help. The default is to use the parent PerformanceCategory element's DefaultLanguage attribute. + + + + + + + + + + + Used to install Perfmon counters. + + + + + + + + + + + + Used to install Perfmon Counter Manifests. + Note that this functionality cannot be used with major upgrades that are scheduled after the InstallExecute, + InstallExecuteAgain, or InstallFinalize actions. For more information on major upgrade scheduling, see + RemoveExistingProducts Action. + + + + + + The directory that holds the resource file of the providers in the perfmon counter manifest. Often the resource file path cannot be determined until setup time. Put the directory here and during perfmon manifest registrtion the path will be updated in the registry. If not specified, Perfmon will look for the resource file in the same directory of the perfmon counter manifest file. + + + + + + + + + + Used to install Event Manifests. + + + + + The message file (including path) of all the providers in the event manifest. Often the message file path cannot be determined until setup time. Put your MessageFile here and the messageFileName attribute of the all the providers in the manifest will be updated with the path before it is registered. + + + + + The parameter file (including path) of all the providers in the event manifest. Often the parameter file path cannot be determined until setup time. Put your ParameterFile here and the parameterFileName attribute of the all the providers in the manifest will be updated with the path before it is registered. + + + + + The resource file (including path) of all the providers in the event manifest. Often the resource file path cannot be determined until setup time. Put your ResourceFile here and the resourceFileName attribute of the all the providers in the manifest will be updated with the path before it is registered. + + + + + + + + Sets ACLs on File, Registry, CreateFolder, or ServiceInstall. When under a Registry element, this cannot be used + if the Action attribute's value is remove or removeKeyOnInstall. This element has no Id attribute. + The table and key are taken from the parent element. + + + + + + + + + + + + + + + + + + + + + + + + + + + + For a directory, the right to create a file in the directory. Only valid under a 'CreateFolder' parent. + + + + + For a directory, the right to create a subdirectory. Only valid under a 'CreateFolder' parent. + + + + + For a directory, the right to delete a directory and all the files it contains, including read-only files. Only valid under a 'CreateFolder' parent. + + + + + For a directory, the right to traverse the directory. By default, users are assigned the BYPASS_TRAVERSE_CHECKING privilege, which ignores the FILE_TRAVERSE access right. Only valid under a 'CreateFolder' parent. + + + + + + + + + + + + + + + + + + + specifying this will fail to grant read access + + + + + + Required to call the QueryServiceConfig and QueryServiceConfig2 functions to query the service configuration. Only valid under a 'ServiceInstall' parent. + + + + + Required to call the ChangeServiceConfig or ChangeServiceConfig2 function to change the service configuration. Only valid under a 'ServiceInstall' parent. + + + + + Required to call the QueryServiceStatus function to ask the service control manager about the status of the service. Only valid under a 'ServiceInstall' parent. + + + + + Required to call the EnumDependentServices function to enumerate all the services dependent on the service. Only valid under a 'ServiceInstall' parent. + + + + + Required to call the StartService function to start the service. Only valid under a 'ServiceInstall' parent. + + + + + Required to call the ControlService function to stop the service. Only valid under a 'ServiceInstall' parent. + + + + + Required to call the ControlService function to pause or continue the service. Only valid under a 'ServiceInstall' parent. + + + + + Required to call the ControlService function to ask the service to report its status immediately. Only valid under a 'ServiceInstall' parent. + + + + + Required to call the ControlService function to specify a user-defined control code. Only valid under a 'ServiceInstall' parent. + + + + + + + Describes a product search. + + + + + + + + + + The Guid attribute has been deprecated; use the ProductCode or UpgradeCode attribute instead. If this attribute is used, it is assumed to be a ProductCode. + + + + + The ProductCode to use for the search. This attribute must be omitted if UpgradeCode is specified. + + + + + The UpgradeCode to use for the search. This attribute must be omitted if ProductCode is specified. Note that if multiple products are found, the highest versioned product will be used for the result. + + + + + + Rather than saving the product version into the variable, a ProductSearch can save another attribute of the matching product instead. + + + + + + + Saves the version of a matching product if found; 0.0.0.0 otherwise. This is the default. + + + + + Saves the language of a matching product if found; empty otherwise. + + + + + Saves the state of the product: advertised (1), absent (2), or locally installed (5). + + + + + Saves the assignment type of the product: per-user (0), or per-machine (1). + + + + + + + + + + References a ProductSearch. + + + + + + + + + + + + + + + + The custom action that implements RemoveFolderEx does so by writing temporary rows to the RemoveFile table + for each subfolder of the root folder you specify. Because it might dramatically affect Windows Installer's + File Costing, + the temporary rows must be written before the CostInitialize standard action. Unfortunately, MSI doesn't + create properties for the Directory hierarchy in your package until later, in the CostFinalize action. + An easy workaround for a typical use case of removing a folder during uninstall is to write the directory + path to the registry and to load it during uninstall. See + The WiX toolset's "Remember Property" pattern + for an example. + If you use custom actions to set properties, ensure that they are scheduled before the WixRemoveFoldersEx custom action. + + + + Remove a folder and all contained files and folders if the parent component is selected for installation or removal. + The folder must be specified in the Property attribute as the name of a property that will have a value that resolves + to the full path of the folder before the CostInitialize action. Note that Directory ids cannot be used. + For more details, see the Remarks. + + + + + + Primary key used to identify this particular entry. If this is not specified, a stable identifier + will be generated at compile time based on the other attributes. + + + + + + The id of a property that resolves to the full path of the source directory. The property does not have + to exist in the installer database at creation time; it could be created at installation time by a custom + action, on the command line, etc. The property value can contain environment variables surrounded by + percent signs such as from a REG_EXPAND_SZ registry value; environment variables will be expanded before + being evaluated for a full path. + + + + + + + This value determines when the folder may be removed. + + + + + + + + Removes the folder only when the parent component is being installed (msiInstallStateLocal or msiInstallStateSource). + + + + + + + Default: Removes the folder only when the parent component is being removed (msiInstallStateAbsent). + + + + + + + Removes the folder when the parent component is being installed or removed. + + + + + + + + + + + Registers a resource with the Restart Manager. + + + + + + + + + + + The unique identifier for this resource. A unique identifier will + be generated automatically if not specified. + + + + + The full path to the process module to register with the Restart Manager. + This can be a formatted value that resolves to a full path. + + + + + The name of a process to register with the Restart Manager. + This can be a formatted value that resolves to a process name. + + + + + The name of a Windows service to register with the Restart Manager. + This can be a formatted value that resolves to a service name. + + + + + + + Describes a registry search. + + + + + + + + + + Registry root hive to search under. + + + + + + HKEY_LOCAL_MACHINE + + + + + HKEY_CURRENT_USER + + + + + HKEY_CLASSES_ROOT + + + + + HKEY_USERS + + + + + + + + Key to search for. + + + + + Optional value to search for under the given Key. + + + + + What format to return the value in. + + + + + + Returns the unformatted value directly from the registry. For example, a REG_DWORD value of '1' is returned as '1', not '#1'. + + + + + Returns the value formatted as Windows Installer would. For example, a REG_DWORD value of '1' is returned as '#1', not '1'. + + + + + + + + Whether to expand any environment variables in REG_SZ, REG_EXPAND_SZ, or REG_MULTI_SZ values. + + + + + + Rather than saving the matching registry value into the variable, a RegistrySearch can save an attribute of the matching entry instead. + + + + + + + Saves true if a matching registry entry is found; false otherwise. + + + + + Saves the value of the registry key in the variable. This is the default. + + + + + + + + Instructs the search to look in the 64-bit registry when the value is 'yes'. When the value is 'no', the search looks in the 32-bit registry. The default value is 'no'. + + + + + + + References a RegistrySearch. + + + + + + + + + + + + Service configuration information for failure actions. + + + + + + Nesting a ServiceConfig element under a ServiceInstall element will result in the service being installed to be configured. + Nesting a ServiceConfig element under a component element will result in an already installed service to be configured. If the service does not exist prior to the install of the MSI package, the install will fail. + + + + + + + + Required if not under a ServiceInstall element. + + + + + Action to take on the first failure of the service. + + + + + + + + + + + + + Action to take on the second failure of the service. + + + + + + + + + + + + + Action to take on the third failure of the service. + + + + + + + + + + + + + Number of days after which to reset the failure count to zero if there are no failures. + + + + + If any of the three *ActionType attributes is "restart", this specifies the number of seconds to wait before doing so. + + + + + If any of the three *ActionType attributes is "runCommand", this specifies the command to run when doing so. This value is formatted. + + + + + If any of the three *ActionType attributes is "reboot", this specifies the message to broadcast to server users before doing so. + + + + + + + Updates the last modified date/time of a file. + + + + + + + + Identifier for the touch file operation. If the identifier is not specified it will be generated. + + + + + Path of the file to update. This value is formatted. + + + + + Specifies whether or not the modified time of the file should be updated on install. If the OnInstall, OnReinstall and OnUninstall attributes are all absent the default is 'yes'. + + + + + Specifies whether or not the modified time of the file should be updated on reinstall. If the OnInstall, OnReinstall and OnUninstall attributes are all absent the default is 'yes'. + + + + + Specifies whether or not the modified time of the file should be updated on uninstall. If the OnInstall, OnReinstall and OnUninstall attributes are all absent the default is 'no'. + + + + + Indicates the installation will succeed even if the modified time of the file cannot be updated. The default is 'no'. + + + + + + + User for all kinds of things. When it is not nested under a component it is included in the MSI so it can be referenced by other elements such as the User attribute in the AppPool element. When it is nested under a Component element, the User will be created on install and can also be used for reference. + + + + + + + + + + + + + + + + + A Formatted string that contains the name of the user account. + + + + + A Formatted string that contains the local machine or Active Directory domain for the user. + + + + + Usually a Property that is passed in on the command-line to keep it more secure. + + + + + The account's password never expires. Equivalent to UF_DONT_EXPIRE_PASSWD. + + + + + The user cannot change the account's password. Equivalent to UF_PASSWD_CANT_CHANGE. + + + + + Indicates whether the user account should be removed or left behind on uninstall. + + + + + Indicates if the install should fail if the user already exists. + + + + + Indicates whether or not the user can logon as a serivce. User creation can be skipped if all that is desired is to set this access right on the user. + + + + + Indicates whether or not the user can logon as a batch job. User creation can be skipped if all that is desired is to set this access right on the user. + + + + + Indicates if the user account properties should be updated if the user already exists. + + + + + Indicates whether the user must change their password on their first login. + + + + + The account is disabled. Equivalent to UF_ACCOUNTDISABLE. + + + + + Indicates whether or not to create the user. User creation can be skipped if all that is desired is to join a user to groups. + + + + + Indicates whether failure to create the user or add the user to a group fails the installation. The default value is "yes". + + + + + + + + Adds or removes .xml file entries. If you use the XmlFile element you must reference WixUtilExtension.dll as it contains the XmlFile custom actions. + + + + + + + + + Identifier for xml file modification. + + + + + The XPath of the element to be modified. Note that this is a formatted field and therefore, square brackets in the XPath must be escaped. In addition, XPaths allow backslashes to be used to escape characters, so if you intend to include literal backslashes, you must escape them as well by doubling them in this attribute. The string is formatted by MSI first, and the result is consumed as the XPath. + + + + + Path of the .xml file to configure. + + + + + Name of XML node to set/add to the specified element. Not setting this attribute causes the element's text value to be set. Otherwise this specified the attribute name that is set. + + + + + + The value to be written. See the Formatted topic for information how to escape square brackets in the value. + + + + + + The type of modification to be made to the XML file when the component is installed. + + + + + + Creates a new element under the element specified in ElementPath. The Name attribute is required in this case and specifies the name of the new element. The Value attribute is not necessary when createElement is specified as the action. If the Value attribute is set, it will cause the new element's text value to be set. + + + + + Deletes a value from the element specified in the ElementPath. If Name is specified, the attribute with that name is deleted. If Name is not specified, the text value of the element specified in the ElementPath is deleted. The Value attribute is ignored if deleteValue is the action specified. + + + + + Sets a value in the element specified in the ElementPath. If Name is specified, and attribute with that name is set to the value specified in Value. If Name is not specified, the text value of the element is set. Value is a required attribute if setValue is the action specified. + + + + + Sets all the values in the elements that match the ElementPath. If Name is specified, attributes with that name are set to the same value specified in Value. If Name is not specified, the text values of the elements are set. Value is a required attribute if setBulkValue is the action specified. + + + + + + + + Specifies whether or not the modification should be removed on uninstall. This has no effect on uninstall if the action was deleteValue. + + + + + Specifies wheter or not the modification should preserve the modified date. Preserving the modified date will allow the file to be patched if no other modifications have been made. + + + + + Specifies the order in which the modification is to be attempted on the XML file. It is important to ensure that new elements are created before you attempt to add an attribute to them. + + + + + + Specify whether the DOM object should use XPath language or the old XSLPattern language (default) as the query language. + + + + + + + + + + + + + + + Adds or removes .xml file entries. If you use the XmlConfig element you must reference WixUtilExtension.dll as it contains the XmlConfig custom actions. + + + + + + + + + + + + Identifier for xml file modification. + + + + + + + + + + + + + The Id of another XmlConfig to add attributes to. In this case, the 'ElementPath', 'Action', 'Node', and 'On' attributes must be omitted. + + + + + The XPath of the parent element being modified. Note that this is a formatted field and therefore, square brackets in the XPath must be escaped. In addition, XPaths allow backslashes to be used to escape characters, so if you intend to include literal backslashes, you must escape them as well by doubling them in this attribute. The string is formatted by MSI first, and the result is consumed as the XPath. + + + + + Path of the .xml file to configure. + + + + + Name of XML node to set/add to the specified element. Not setting this attribute causes the element's text value to be set. Otherwise this specified the attribute name that is set. + + + + + + + + + + + + + + + + + + + + + + Specifies wheter or not the modification should preserve the modified date. Preserving the modified date will allow the file to be patched if no other modifications have been made. + + + + + Specifies the order in which the modification is to be attempted on the XML file. It is important to ensure that new elements are created before you attempt to add an attribute to them. + + + + + + The value to be written. See the Formatted topic for information how to escape square brackets in the value. + + + + + + The XPath to the element being modified. This is required for 'delete' actions. For 'create' actions, VerifyPath is used to decide if the element already exists. Note that this is a formatted field and therefore, square brackets in the XPath must be escaped. In addition, XPaths allow backslashes to be used to escape characters, so if you intend to include literal backslashes, you must escape them as well by doubling them in this attribute. The string is formatted by MSI first, and the result is consumed as the XPath. + + + + + + + + Id of the search for ordering and dependency. + + + + + Name of the variable in which to place the result of the search. + + + + + Condition for evaluating the search. If this evaluates to false, the search is not executed at all. + + + + + Id of the search that this one should come after. + + + + + + Values of this type will either be "yes" or "no". + + + + + + + + + Enumeration of valid languages for performance counters. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Enumeration of valid types for performance counters. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/wixlib/UtilExtension.wxs b/src/wixlib/UtilExtension.wxs new file mode 100644 index 0000000..ac11c78 --- /dev/null +++ b/src/wixlib/UtilExtension.wxs @@ -0,0 +1,430 @@ + + + + + + + + + + !(loc.msierrUSRFailedUserCreate) + !(loc.msierrUSRFailedUserCreatePswd) + !(loc.msierrUSRFailedUserGroupAdd) + Failed to grant 'logon as service' rights to user. ([2] [3] [4] [5]) + !(loc.msierrUSRFailedUserCreateExists) + + + + + + !(loc.msierrSMBFailedCreate) + !(loc.msierrSMBFailedDrop) + + + + + + !(loc.msierrInstallPerfCounterData) + !(loc.msierrUninstallPerfCounterData) + + + + + + !(loc.msierrPERFMONFailedRegisterDLL) + !(loc.msierrPERFMONFailedUnregisterDLL) + + + + + + !(loc.msierrSecureObjectsFailedCreateSD) + !(loc.msierrSecureObjectsFailedSet) + !(loc.msierrSecureObjectsUnknownType) + + + + + + !(loc.msierrXmlFileFailedRead) + !(loc.msierrXmlFileFailedOpen) + !(loc.msierrXmlFileFailedSelect) + !(loc.msierrXmlFileFailedSave) + + + + + + !(loc.msierrXmlConfigFailedRead) + !(loc.msierrXmlConfigFailedOpen) + !(loc.msierrXmlConfigFailedSelect) + !(loc.msierrXmlConfigFailedSave) + + + + + + + + WIXFAILWHENDEFERRED=1 AND VersionNT > 400 + + + + + + + + + + + + + + + + + + + + + + + + NEWERVERSIONDETECTED AND VersionNT > 400 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + VersionNT > 400 OR (VersionNT = 400 AND ServicePackLevel > 3) + + + + VersionNT > 400 OR (VersionNT = 400 AND ServicePackLevel > 3) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + VersionNT > 400 OR (VersionNT = 400 AND ServicePackLevel > 3) + + + + VersionNT > 400 OR (VersionNT = 400 AND ServicePackLevel > 3) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + VersionNT > 400 OR (VersionNT = 400 AND ServicePackLevel > 3) + + + + VersionNT > 400 OR (VersionNT = 400 AND ServicePackLevel > 3) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + VersionNT > 400 OR (VersionNT = 400 AND ServicePackLevel > 3) + + + + VersionNT > 400 OR (VersionNT = 400 AND ServicePackLevel > 3) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/wixlib/UtilExtension_Platform.wxi b/src/wixlib/UtilExtension_Platform.wxi new file mode 100644 index 0000000..8328577 --- /dev/null +++ b/src/wixlib/UtilExtension_Platform.wxi @@ -0,0 +1,224 @@ + + + + + + + + + + + + + + + + + NOT REMOVE~="ALL" AND VersionNT > 400 + + + + + + + + + + VersionNT > 400 + + + + + + + + + + + + + + + + + + + + + + VersionNT > 400 + + + + + + + + + + + + + + + VersionNT > 400 + VersionNT > 400 + + + + + + + + + + + + + + + VersionNT > 400 + VersionNT > 400 + + + + + + + + + + + + + + + VersionNT > 400 + VersionNT > 400 + + + + + + + + + + + + + VersionNT > 400 + VersionNT > 400 + + + + + + + + + + + + + VersionNT > 400 + VersionNT > 400 + + + + + + + + + + + NOT REMOVE~="ALL" AND VersionNT > 400 + + + + + + + + + + + + + + + + + + + + + + + + VersionNT > 400 + + + + + + + + + + + + VersionNT > 400 + + + + + + + + + + VersionNT > 400 + VersionNT > 400 + VersionNT > 400 + + + + + + + + + + + + + + + + + + NOT REMOVE~="ALL" AND VersionNT > 400 + VersionNT > 400 + + + + + + + + + + + + + + + + + diff --git a/src/wixlib/UtilExtension_x64.wxs b/src/wixlib/UtilExtension_x64.wxs new file mode 100644 index 0000000..e902f97 --- /dev/null +++ b/src/wixlib/UtilExtension_x64.wxs @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/wixlib/UtilExtension_x86.wxs b/src/wixlib/UtilExtension_x86.wxs new file mode 100644 index 0000000..ff4f08c --- /dev/null +++ b/src/wixlib/UtilExtension_x86.wxs @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/wixlib/caSuffix.wxi b/src/wixlib/caSuffix.wxi new file mode 100644 index 0000000..a56a239 --- /dev/null +++ b/src/wixlib/caSuffix.wxi @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/wixlib/caerr.wxi b/src/wixlib/caerr.wxi new file mode 100644 index 0000000..141942f --- /dev/null +++ b/src/wixlib/caerr.wxi @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/wixlib/de-de.wxl b/src/wixlib/de-de.wxl new file mode 100644 index 0000000..47bfaaa --- /dev/null +++ b/src/wixlib/de-de.wxl @@ -0,0 +1,33 @@ + + + + + + Konnte den Benutzer nicht anlegen. ([2] [3] [4] [5]) + Konnte den Benutzer auf Grund eines falschen Passwortes nicht anlegen. ([2] [3] [4] [5]) + Konnte Benutzer nicht zur Gruppe hinzufügen. ([2] [3] [4] [5]) + Konnte den Benutzer nicht anlegen, da er bereits existierte. ([2] [3] [4] [5]) + + Konnte Netzwerkfreigabe nicht anlegen. ([2] [3] [4] [5]) + Konnte Netzwerkfreigabe nicht entfernen. ([2] [3] [4] [5]) + + Konnte die DLL nicht für PerfMon registrieren. ([2] [3] [4] [5]) + Konnte die DLL nicht für PerfMon deregistrieren. ([2] [3] [4] [5]) + + Konnte die Daten der Leistungsüberwachung (performance counters) nicht installieren. ([2] [3] [4] [5]) + Konnte die Daten der Leistungsüberwachung (performance counters) nicht deinstallieren. ([2] [3] [4] [5]) + + Konnte keinen Security Descriptor für [3]\[4] erstellen, System Fehler: [2] + Konnte keinen Security Descriptor für das Objekt [3] erstellen, System Fehler: [2] + Unbekannter Objekt Typ [3], System Fehler: [2] + + Beim Lesen der XML Dateien trat ein Fehler auf. + Konnte XML Datei [3] nicht öffnen, System Fehler: [2] + Konnte Knoten [3] in der XML Datei [4] nicht finden, System Fehler: [2] + Beim Speichern der Änderungen an der XML Datei [3] trat ein Fehler auf, System Fehler: [2] + + Bei der Konfiguration der XML Dateien trat ein Fehler auf. + Konnte XML Datei [3] nicht öffnen, System Fehler: [2] + Konnte Knoten [3] in der XML Datei [4] nicht finden, System Fehler: [2] + Beim Speichern der Änderungen an der XML Datei [3] trat ein Fehler auf, System Fehler: [2] + diff --git a/src/wixlib/en-us.wxl b/src/wixlib/en-us.wxl new file mode 100644 index 0000000..25ac4d5 --- /dev/null +++ b/src/wixlib/en-us.wxl @@ -0,0 +1,33 @@ + + + + + + Failed to create user. ([2] [3] [4] [5]) + Failed to create user due to invalid password. ([2] [3] [4] [5]) + Failed to add user to group. ([2] [3] [4] [5]) + Failed to create user because it already exists. ([2] [3] [4] [5]) + + Failed to create network share. ([2] [3] [4] [5]) + Failed to drop network share. ([2] [3] [4] [5]) + + Failed to register DLL with PerfMon. ([2] [3] [4] [5]) + Failed to unregister DLL with PerfMon. ([2] [3] [4] [5]) + + Failed to install performance counters. ([2] [3] [4] [5]) + Failed to uninstall performance counters. ([2] [3] [4] [5]) + + Failed to create security descriptor for [3]\[4], system error: [2] + Failed to set security descriptor on object [3], system error: [2] + Unknown Object Type [3], system error: [2] + + There was a failure while configuring XML files. + Failed to open XML file [3], system error: [2] + Failed to find node: [3] in XML file: [4], system error: [2] + Failed to save changes to XML file [3], system error: [2] + + There was a failure while configuring XML files. + Failed to open XML file [3], system error: [2] + Failed to find node: [3] in XML file: [4], system error: [2] + Failed to save changes to XML file [3], system error: [2] + diff --git a/src/wixlib/es-es.wxl b/src/wixlib/es-es.wxl new file mode 100644 index 0000000..9001d52 --- /dev/null +++ b/src/wixlib/es-es.wxl @@ -0,0 +1,32 @@ + + + + + La creación del usuario ha fracasado. ([2] [3] [4] [5]) + La creación del usuario ha fracasado porque la contraseña es incorrecta. ([2] [3] [4] [5]) + El aditamento del usuario al grupo ha fracasado. ([2] [3] [4] [5]) + La creación del usuario ha fracasado porque ya existe. ([2] [3] [4] [5]) + + La creación de la red compartida ha fracasado. ([2] [3] [4] [5]) + La eliminación de la red compartida ha fracasado. ([2] [3] [4] [5]) + + La inscripción al registro de la DLL con PerfMon ha fracasado. ([2] [3] [4] [5]) + La cancelación de la inscripción al registro de la DLL con PerfMon ha fracasado. ([2] [3] [4] [5]) + + La instalación de los contadores de rendimiento ha fracasado. ([2] [3] [4] [5]) + La desinstalación de los contadores de rendimiento ha fracasado. ([2] [3] [4] [5]) + + La creación de los ACLs ha fracasado por [3]\[4], error del sistema : [2] + El posicionamiento de los ACLs por el objecto [3] ha fracasado, error del sistema: [2] + Tipo de objecto no conocido [3], error del sistema: [2] + + Un problema ha aparecido durante la configuración de los ficheros XML. + Fracaso de la apertura de los ficheros XML [3], error del sistema: [2] + Fracaso de la búsqueda del nodo: [3] en el fichero XML: [4], error del sistema: [2] + Fracaso durante la salvaguardia de las modificaciones en el fichero XML [3], error del sistema: [2] + + Un problema ha aparecido durante la configuración de los ficheros XML. + Fracaso de la apertura de los ficheros XML [3], error del sistema: [2] + Fracaso de la búsqueda del nodo: [3] en el fichero XML: [4], error del sistema: [2] + Fracaso durante la salvaguardia de las modificaciones en el fichero XML [3], error del sistema: [2] + \ No newline at end of file diff --git a/src/wixlib/fr-fr.wxl b/src/wixlib/fr-fr.wxl new file mode 100644 index 0000000..066e7f8 --- /dev/null +++ b/src/wixlib/fr-fr.wxl @@ -0,0 +1,32 @@ + + + + + La création de l'utilisateur a échoué. ([2] [3] [4] [5]) + La création de l'utilisateur a échoué car le mot de passe est invalide. ([2] [3] [4] [5]) + L'ajout de l'utilisateur au groupe a échoué. ([2] [3] [4] [5]) + La création de l'utilisateur a échoué car il existe dejà. ([2] [3] [4] [5]) + + La création du partage reseau a échoué. ([2] [3] [4] [5]) + La suppression du partage reseau a échoué. ([2] [3] [4] [5]) + + L'inscription au registre de la DLL avec PerfMon a échoué. ([2] [3] [4] [5]) + La desinscription au registre de la DLL avec PerfMon a échoué. ([2] [3] [4] [5]) + + L'installation des compteurs de performance a échoué. ([2] [3] [4] [5]) + La desinstallation des compteurs de performance a échoué. ([2] [3] [4] [5]) + + La création des ACLs a échoué pour [3]\[4], erreur systeme: [2] + Le positionnement des ACLs pour l'objet [3] a échoué, erreur systeme: [2] + Type d'objet inconnu [3], erreur systeme: [2] + + Un problème est survenu lors de la configuration des fichiers XML. + Echec de l'ouverture des fichiers XML [3], erreur systeme: [2] + Echec de la recherche du noeud: [3] dans le fichier XML: [4], erreur systeme: [2] + Echec lors de la sauvegarde des modifications dans le fichier XML [3], erreur systeme: [2] + + Un problème est survenu lors de la configuration des fichiers XML. + Echec de l'ouverture des fichiers XML [3], erreur systeme: [2] + Echec de la recherche du noeud: [3] dans le fichier XML: [4], erreur systeme: [2] + Echec lors de la sauvegarde des modifications dans le fichier XML [3], erreur systeme: [2] + \ No newline at end of file diff --git a/src/wixlib/it-it.wxl b/src/wixlib/it-it.wxl new file mode 100644 index 0000000..35c62fc --- /dev/null +++ b/src/wixlib/it-it.wxl @@ -0,0 +1,33 @@ + + + + + + Impossibile creare l'utente. ([2] [3] [4] [5]) + Impossibile creare l'utente perchè la password è errata. ([2] [3] [4] [5]) + Impossibile aggiungere l'utente al gruppo. ([2] [3] [4] [5]) + Impossibile creare l'utente perchè già esistente. ([2] [3] [4] [5]) + + Impossibile creare la risorsa di rete. ([2] [3] [4] [5]) + Impossibile eliminare la risorsa di rete. ([2] [3] [4] [5]) + + Impossibile registrare la DLL con PerfMon. ([2] [3] [4] [5]) + Impossibile rimuovere la registrazione della DLL con PerfMon. ([2] [3] [4] [5]) + + Impossibile installare i contatori delle prestazioni. ([2] [3] [4] [5]) + Impossibile rimuovere i contatori delle prestazioni. ([2] [3] [4] [5]) + + Impossibile creare i descrittori di sicurezza per [3]\[4], errore di sistema: [2] + Impossibile impostare i descrittori di sicurezza sull'oggetto [3], errore di sistema: [2] + Tipo di oggetto sconosciuto [3], errore di sistema: [2] + + Si è verificato un errore durante la configurazione dei file XML. + Impossibile aprire il file XML [3], errore di sistema: [2] + Impossibile trovare il nodo: [3] nel file XML: [4], errore di sistema: [2] + Impossible salvare le modifiche al file XML [3], errore di sistema: [2] + + Si è verificato un errore durante la configurazione dei file XML. + Impossibile aprire il file XML [3], errore di sistema: [2] + Impossibile trovare il nodo: [3] nel file XML: [4], errore di sistema: [2] + Impossibile salvare le modifiche al file XML [3], errore di sitema: [2] + diff --git a/src/wixlib/ja-jp.wxl b/src/wixlib/ja-jp.wxl new file mode 100644 index 0000000..6206da6 --- /dev/null +++ b/src/wixlib/ja-jp.wxl @@ -0,0 +1,33 @@ + + + + + + ユーザー作成に失敗しました。 ([2] [3] [4] [5]) + パスワードが無効のためユーザー作成に失敗しました。 ([2] [3] [4] [5]) + ユーザーをグループに追加でいませんでした。 ([2] [3] [4] [5]) + ユーザーが既に存在するため作成できませんでした。 ([2] [3] [4] [5]) + + ネットワーク共有の作成に失敗しました。 ([2] [3] [4] [5]) + ネットワーク共有の削除に失敗しました。 ([2] [3] [4] [5]) + + DLL を PerfMon に登録でいませんでした。 ([2] [3] [4] [5]) + DLL を PerfMon より登録解除できませんでした。 ([2] [3] [4] [5]) + + パフォーマンス カウンタをインストールできませんでした。 ([2] [3] [4] [5]) + パフォーマンス カウンタをアンインストールできませんでした。 ([2] [3] [4] [5]) + + [3]\[4] 用セキュリティ ディスクリプターを作成できませんでした、システム エラー: [2] + オブジェクト [3] 上のセキュリティ ディスクリプターを設定できませんでした、システム エラー: [2] + 不明なオブジェクト種別 [3]、システム エラー: [2] + + XML ファイル構成中に失敗しました。 + XML ファイル [3] を開けませんでした、システム エラー: [2] + XML ファイル [4] 内にノード [3] が見つかりませんでした、システム エラー: [2] + XML ファイル [3] へ変更を保存できませんでした、システム エラー: [2] + + XML ファイル構成中に失敗しました。 + XML ファイル [3] を開けませんでした、システム エラー: [2] + XML ファイル [4] 内にノード [3] が見つかりませんでした、システム エラー: [2] + XML ファイル [3] へ変更を保存できませんでした、システム エラー: [2] + diff --git a/src/wixlib/packages.config b/src/wixlib/packages.config new file mode 100644 index 0000000..89544f1 --- /dev/null +++ b/src/wixlib/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/wixlib/pt-br.wxl b/src/wixlib/pt-br.wxl new file mode 100644 index 0000000..b2af342 --- /dev/null +++ b/src/wixlib/pt-br.wxl @@ -0,0 +1,27 @@ + + + + + + Falha ao criar usuário. ([2] [3] [4] [5]) + Falha ao criar usuário devido a senha inválida. ([2] [3] [4] [5]) + Falha ao adicionar o usuário ao grupo. ([2] [3] [4] [5]) + Falha ao criar o usuário, porque ele já existe. ([2] [3] [4] [5]) + Falha ao criar o compartilhamento de rede. ([2] [3] [4] [5]) + Falha ao cair compartilhamento de rede. ([2] [3] [4] [5]) + Falha ao registrar DLL com PerfMon. ([2] [3] [4] [5]) + Falha ao cancelar o registro de DLL com PerfMon. ([2] [3] [4] [5]) + Falha ao instalar contadores de desempenho. ([2] [3] [4] [5]) + Falha ao desinstalar contadores de desempenho. ([2] [3] [4] [5]) + Falha ao criar o descritor de segurança [3] \ [4], erro do sistema: [2] + Falha ao definir o descritor de segurança sobre o objeto [3], erro do sistema: [2] + Objeto Desconhecido Tipo [3], erro do sistema: [2] + Houve uma falha ao configurar arquivos XML. + Falha ao abrir o arquivo XML [3], erro do sistema: [2] + Falha ao localizar nó: [3] no arquivo XML: [4], erro do sistema: [2] + Falha ao salvar as alterações para o arquivo XML [3], erro do sistema: [2] + Houve uma falha ao configurar arquivos XML. + Falha ao abrir o arquivo XML [3], erro do sistema: [2] + Falha ao localizar nó: [3] no arquivo XML: [4], erro do sistema: [2] + Falha ao salvar as alterações para o arquivo XML [3], erro do sistema: [2] + diff --git a/src/wixlib/util.wixproj b/src/wixlib/util.wixproj new file mode 100644 index 0000000..2fc8c58 --- /dev/null +++ b/src/wixlib/util.wixproj @@ -0,0 +1,52 @@ + + + + + + + {1ACFFEFD-505A-41A5-ACBF-A02B7B473AA2} + util + Library + true + true + + + + + + + + + + + + + + + + + + + utilca + {076018F7-19BD-423A-ABBF-229273DA08D8} + + + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + \ No newline at end of file diff --git a/version.json b/version.json new file mode 100644 index 0000000..5f85777 --- /dev/null +++ b/version.json @@ -0,0 +1,11 @@ +{ + "version": "4.0", + "publicReleaseRefSpec": [ + "^refs/heads/master$" + ], + "cloudBuild": { + "buildNumber": { + "enabled": true + } + } +}