@joebigelow / wix-1 / commits / c8f39be3

Initial code commit

Rob Mensching committed Dec 30, 2017 at 01:56 UTC c8f39be3f8b70b36a8b89b6ccdd4ebb94290b6b3
70 files changed +22931
Util.wixext.sln new
+73
@@ -0,0 +1,73 @@
1 +
2 +Microsoft Visual Studio Solution File, Format Version 12.00
3 +# Visual Studio 15
4 +VisualStudioVersion = 15.0.27130.2003
5 +MinimumVisualStudioVersion = 15.0.26124.0
6 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "utilca", "src\ca\utilca.vcxproj", "{076018F7-19BD-423A-ABBF-229273DA08D8}"
7 +EndProject
8 +Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "util", "src\wixlib\util.wixproj", "{1ACFFEFD-505A-41A5-ACBF-A02B7B473AA2}"
9 +EndProject
10 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolset.Util.wixext", "src\wixext\WixToolset.Util.wixext.csproj", "{6CF033EB-0A39-4AC6-9D41-9BD506352045}"
11 +EndProject
12 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolsetTest.Util", "src\test\WixToolsetTest.Util\WixToolsetTest.Util.csproj", "{D5D34EC4-AF91-4B11-AC0A-FA5242AE924B}"
13 +EndProject
14 +Global
15 + GlobalSection(SolutionConfigurationPlatforms) = preSolution
16 + Debug|Any CPU = Debug|Any CPU
17 + Debug|x64 = Debug|x64
18 + Debug|x86 = Debug|x86
19 + Release|Any CPU = Release|Any CPU
20 + Release|x64 = Release|x64
21 + Release|x86 = Release|x86
22 + EndGlobalSection
23 + GlobalSection(ProjectConfigurationPlatforms) = postSolution
24 + {076018F7-19BD-423A-ABBF-229273DA08D8}.Debug|Any CPU.ActiveCfg = Debug|Win32
25 + {076018F7-19BD-423A-ABBF-229273DA08D8}.Debug|x64.ActiveCfg = Debug|Win32
26 + {076018F7-19BD-423A-ABBF-229273DA08D8}.Debug|x86.ActiveCfg = Debug|Win32
27 + {076018F7-19BD-423A-ABBF-229273DA08D8}.Debug|x86.Build.0 = Debug|Win32
28 + {076018F7-19BD-423A-ABBF-229273DA08D8}.Release|Any CPU.ActiveCfg = Release|Win32
29 + {076018F7-19BD-423A-ABBF-229273DA08D8}.Release|x64.ActiveCfg = Release|Win32
30 + {076018F7-19BD-423A-ABBF-229273DA08D8}.Release|x86.ActiveCfg = Release|Win32
31 + {076018F7-19BD-423A-ABBF-229273DA08D8}.Release|x86.Build.0 = Release|Win32
32 + {1ACFFEFD-505A-41A5-ACBF-A02B7B473AA2}.Debug|Any CPU.ActiveCfg = Debug|x86
33 + {1ACFFEFD-505A-41A5-ACBF-A02B7B473AA2}.Debug|x64.ActiveCfg = Debug|x64
34 + {1ACFFEFD-505A-41A5-ACBF-A02B7B473AA2}.Debug|x64.Build.0 = Debug|x64
35 + {1ACFFEFD-505A-41A5-ACBF-A02B7B473AA2}.Debug|x86.ActiveCfg = Debug|x86
36 + {1ACFFEFD-505A-41A5-ACBF-A02B7B473AA2}.Debug|x86.Build.0 = Debug|x86
37 + {1ACFFEFD-505A-41A5-ACBF-A02B7B473AA2}.Release|Any CPU.ActiveCfg = Release|x86
38 + {1ACFFEFD-505A-41A5-ACBF-A02B7B473AA2}.Release|x64.ActiveCfg = Release|x64
39 + {1ACFFEFD-505A-41A5-ACBF-A02B7B473AA2}.Release|x64.Build.0 = Release|x64
40 + {1ACFFEFD-505A-41A5-ACBF-A02B7B473AA2}.Release|x86.ActiveCfg = Release|x86
41 + {1ACFFEFD-505A-41A5-ACBF-A02B7B473AA2}.Release|x86.Build.0 = Release|x86
42 + {6CF033EB-0A39-4AC6-9D41-9BD506352045}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
43 + {6CF033EB-0A39-4AC6-9D41-9BD506352045}.Debug|Any CPU.Build.0 = Debug|Any CPU
44 + {6CF033EB-0A39-4AC6-9D41-9BD506352045}.Debug|x64.ActiveCfg = Debug|Any CPU
45 + {6CF033EB-0A39-4AC6-9D41-9BD506352045}.Debug|x64.Build.0 = Debug|Any CPU
46 + {6CF033EB-0A39-4AC6-9D41-9BD506352045}.Debug|x86.ActiveCfg = Debug|Any CPU
47 + {6CF033EB-0A39-4AC6-9D41-9BD506352045}.Debug|x86.Build.0 = Debug|Any CPU
48 + {6CF033EB-0A39-4AC6-9D41-9BD506352045}.Release|Any CPU.ActiveCfg = Release|Any CPU
49 + {6CF033EB-0A39-4AC6-9D41-9BD506352045}.Release|Any CPU.Build.0 = Release|Any CPU
50 + {6CF033EB-0A39-4AC6-9D41-9BD506352045}.Release|x64.ActiveCfg = Release|Any CPU
51 + {6CF033EB-0A39-4AC6-9D41-9BD506352045}.Release|x64.Build.0 = Release|Any CPU
52 + {6CF033EB-0A39-4AC6-9D41-9BD506352045}.Release|x86.ActiveCfg = Release|Any CPU
53 + {6CF033EB-0A39-4AC6-9D41-9BD506352045}.Release|x86.Build.0 = Release|Any CPU
54 + {D5D34EC4-AF91-4B11-AC0A-FA5242AE924B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
55 + {D5D34EC4-AF91-4B11-AC0A-FA5242AE924B}.Debug|Any CPU.Build.0 = Debug|Any CPU
56 + {D5D34EC4-AF91-4B11-AC0A-FA5242AE924B}.Debug|x64.ActiveCfg = Debug|Any CPU
57 + {D5D34EC4-AF91-4B11-AC0A-FA5242AE924B}.Debug|x64.Build.0 = Debug|Any CPU
58 + {D5D34EC4-AF91-4B11-AC0A-FA5242AE924B}.Debug|x86.ActiveCfg = Debug|Any CPU
59 + {D5D34EC4-AF91-4B11-AC0A-FA5242AE924B}.Debug|x86.Build.0 = Debug|Any CPU
60 + {D5D34EC4-AF91-4B11-AC0A-FA5242AE924B}.Release|Any CPU.ActiveCfg = Release|Any CPU
61 + {D5D34EC4-AF91-4B11-AC0A-FA5242AE924B}.Release|Any CPU.Build.0 = Release|Any CPU
62 + {D5D34EC4-AF91-4B11-AC0A-FA5242AE924B}.Release|x64.ActiveCfg = Release|Any CPU
63 + {D5D34EC4-AF91-4B11-AC0A-FA5242AE924B}.Release|x64.Build.0 = Release|Any CPU
64 + {D5D34EC4-AF91-4B11-AC0A-FA5242AE924B}.Release|x86.ActiveCfg = Release|Any CPU
65 + {D5D34EC4-AF91-4B11-AC0A-FA5242AE924B}.Release|x86.Build.0 = Release|Any CPU
66 + EndGlobalSection
67 + GlobalSection(SolutionProperties) = preSolution
68 + HideSolutionNode = FALSE
69 + EndGlobalSection
70 + GlobalSection(ExtensibilityGlobals) = postSolution
71 + SolutionGuid = {E4566A6B-47D0-4EA0-989A-D763AC39105D}
72 + EndGlobalSection
73 +EndGlobal
appveyor.cmd new
+13
@@ -0,0 +1,13 @@
1 +@setlocal
2 +@pushd %~dp0
3 +
4 +nuget restore
5 +
6 +msbuild -p:Configuration=Release -t:Restore
7 +
8 +msbuild -p:Configuration=Release src\test\WixToolsetTest.Util\WixToolsetTest.Util.csproj
9 +
10 +msbuild -p:Configuration=Release -t:Pack src\wixext\WixToolset.Util.wixext.csproj
11 +
12 +@popd
13 +@endlocal
\ No newline at end of file
appveyor.yml new
+29
@@ -0,0 +1,29 @@
1 +image: Visual Studio 2017
2 +
3 +version: 0.0.0.{build}
4 +configuration: Release
5 +
6 +environment:
7 + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
8 + DOTNET_CLI_TELEMETRY_OPTOUT: 1
9 + NUGET_XMLDOC_MODE: skip
10 +
11 +build_script:
12 + - appveyor.cmd
13 +
14 +pull_requests:
15 + do_not_increment_build_number: true
16 +
17 +nuget:
18 + disable_publish_on_pr: true
19 +
20 +skip_tags: true
21 +
22 +artifacts:
23 +- path: build\Release\**\*.nupkg
24 + name: nuget
25 +
26 +notifications:
27 +- provider: Slack
28 + incoming_webhook:
29 + secure: p5xuu+4x2JHfwGDMDe5KcG1k7gZxqYc4jWVwvyNZv5cvkubPD2waJs5yXMAXZNN7Z63/3PWHb7q4KoY/99AjauYa1nZ4c5qYqRPFRBKTHfA=
nuget.config new
+15
@@ -0,0 +1,15 @@
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<configuration>
3 + <packageSources>
4 + <clear />
5 + <add key="wixtoolset-data" value="https://ci.appveyor.com/nuget/wixtoolset-data" />
6 + <add key="wixtoolset-extensibility" value="https://ci.appveyor.com/nuget/wixtoolset-extensibility" />
7 + <add key="wixtoolset-core" value="https://ci.appveyor.com/nuget/wixtoolset-core" />
8 + <add key="wixtoolset-core-native" value="https://ci.appveyor.com/nuget/wixtoolset-core-native" />
9 + <add key="wixtoolset-dtf" value="https://ci.appveyor.com/nuget/wixtoolset-dtf" />
10 + <add key="wixtoolset-dutil" value="https://ci.appveyor.com/nuget/wixtoolset-dutil" />
11 + <add key="wixtoolset-wcautil" value="https://ci.appveyor.com/nuget/wixtoolset-wcautil" />
12 + <add key="wixbuildtools" value="https://ci.appveyor.com/nuget/wixbuildtools" />
13 + <add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
14 + </packageSources>
15 +</configuration>
\ No newline at end of file
src/Cpp.Build.props new
+101
@@ -0,0 +1,101 @@
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<!-- 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. -->
3 +
4 +<Project>
5 + <PropertyGroup>
6 + <Platform Condition=" '$(Platform)' == 'AnyCPU' ">Win32</Platform>
7 + <BaseOutputPath>$(OutputPath)</BaseOutputPath>
8 + <IntDir>$(BaseIntermediateOutputPath)$(Platform)\</IntDir>
9 + <OutDir>$(OutputPath)$(Platform)\</OutDir>
10 + </PropertyGroup>
11 +
12 + <ItemDefinitionGroup>
13 + <ClCompile>
14 + <DisableSpecificWarnings>$(DisableSpecificCompilerWarnings)</DisableSpecificWarnings>
15 + <WarningLevel>Level4</WarningLevel>
16 + <AdditionalIncludeDirectories>$(ProjectDir)inc;$(MSBuildProjectDirectory);$(IntDir);$(SqlCESdkIncludePath);$(ProjectAdditionalIncludeDirectories);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
17 + <PreprocessorDefinitions>WIN32;_WINDOWS;_WIN32_MSI=500;_WIN32_WINNT=0x0501;$(ArmPreprocessorDefinitions);$(UnicodePreprocessorDefinitions);_CRT_STDIO_LEGACY_WIDE_SPECIFIERS;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
18 + <PrecompiledHeader>Use</PrecompiledHeader>
19 + <PrecompiledHeaderFile>precomp.h</PrecompiledHeaderFile>
20 + <CallingConvention>StdCall</CallingConvention>
21 + <TreatWarningAsError>true</TreatWarningAsError>
22 + <ExceptionHandling>false</ExceptionHandling>
23 + <AdditionalOptions>-YlprecompDefine</AdditionalOptions>
24 + <AdditionalOptions Condition=" $(PlatformToolset.StartsWith('v14')) ">/Zc:threadSafeInit- %(AdditionalOptions)</AdditionalOptions>
25 + <MultiProcessorCompilation Condition=" $(NUMBER_OF_PROCESSORS) &gt; 4 ">true</MultiProcessorCompilation>
26 + </ClCompile>
27 + <ResourceCompile>
28 + <PreprocessorDefinitions>$(ArmPreprocessorDefinitions);%(PreprocessorDefinitions)</PreprocessorDefinitions>
29 + <AdditionalIncludeDirectories>$(ProjectAdditionalResourceIncludeDirectories);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
30 + </ResourceCompile>
31 + <Lib>
32 + <AdditionalLibraryDirectories>$(OutDir);$(AdditionalMultiTargetLibraryPath);$(ProjectAdditionalLibraryDirectories);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
33 + </Lib>
34 + <Link>
35 + <SubSystem>$(ProjectSubSystem)</SubSystem>
36 + <ModuleDefinitionFile>$(ProjectModuleDefinitionFile)</ModuleDefinitionFile>
37 + <NoEntryPoint>$(ResourceOnlyDll)</NoEntryPoint>
38 + <GenerateDebugInformation>true</GenerateDebugInformation>
39 + <AdditionalDependencies>$(ProjectAdditionalLinkLibraries);advapi32.lib;comdlg32.lib;user32.lib;oleaut32.lib;gdi32.lib;shell32.lib;ole32.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
40 + <AdditionalLibraryDirectories>$(OutDir);$(AdditionalMultiTargetLibraryPath);$(ArmLibraryDirectories);$(ProjectAdditionalLinkLibraryDirectories);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
41 + <AdditionalOptions Condition=" $(PlatformToolset.StartsWith('v14')) ">/IGNORE:4099 %(AdditionalOptions)</AdditionalOptions>
42 + </Link>
43 + </ItemDefinitionGroup>
44 +
45 + <ItemDefinitionGroup Condition=" '$(Platform)'=='Win32' and '$(PlatformToolset)'!='v100'">
46 + <ClCompile>
47 + <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
48 + </ClCompile>
49 + </ItemDefinitionGroup>
50 + <ItemDefinitionGroup Condition=" '$(Platform)'=='arm' ">
51 + <ClCompile>
52 + <CallingConvention>CDecl</CallingConvention>
53 + </ClCompile>
54 + </ItemDefinitionGroup>
55 + <ItemDefinitionGroup Condition=" '$(ConfigurationType)'=='StaticLibrary' ">
56 + <ClCompile>
57 + <DebugInformationFormat>OldStyle</DebugInformationFormat>
58 + <OmitDefaultLibName>true</OmitDefaultLibName>
59 + <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
60 + </ClCompile>
61 + </ItemDefinitionGroup>
62 + <ItemDefinitionGroup Condition=" '$(Configuration)'=='Debug' ">
63 + <ClCompile>
64 + <Optimization>Disabled</Optimization>
65 + <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
66 + <PreprocessorDefinitions>_DEBUG;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
67 + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
68 + </ClCompile>
69 + </ItemDefinitionGroup>
70 + <ItemDefinitionGroup Condition=" '$(Configuration)'=='Debug' and '$(CLRSupport)'=='true' ">
71 + <ClCompile>
72 + <BasicRuntimeChecks></BasicRuntimeChecks>
73 + <RuntimeLibrary>MultiThreadedDebugDll</RuntimeLibrary>
74 + </ClCompile>
75 + </ItemDefinitionGroup>
76 + <ItemDefinitionGroup Condition=" '$(Configuration)'=='Release' ">
77 + <ClCompile>
78 + <Optimization>MinSpace</Optimization>
79 + <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
80 + <FunctionLevelLinking>true</FunctionLevelLinking>
81 + <IntrinsicFunctions>true</IntrinsicFunctions>
82 + <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
83 + </ClCompile>
84 + <Link>
85 + <EnableCOMDATFolding>true</EnableCOMDATFolding>
86 + <OptimizeReferences>true</OptimizeReferences>
87 + </Link>
88 + </ItemDefinitionGroup>
89 + <ItemDefinitionGroup Condition=" '$(Configuration)'=='Release' and '$(CLRSupport)'=='true' ">
90 + <ClCompile>
91 + <BasicRuntimeChecks></BasicRuntimeChecks>
92 + <RuntimeLibrary>MultiThreadedDll</RuntimeLibrary>
93 + </ClCompile>
94 + </ItemDefinitionGroup>
95 + <ItemDefinitionGroup Condition=" '$(CLRSupport)'=='true' ">
96 + <Link>
97 + <KeyFile>$(LinkKeyFile)</KeyFile>
98 + <DelaySign>$(LinkDelaySign)</DelaySign>
99 + </Link>
100 + </ItemDefinitionGroup>
101 +</Project>
src/Directory.Build.props new
+22
@@ -0,0 +1,22 @@
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<!-- 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. -->
3 +
4 +<Project>
5 + <PropertyGroup>
6 + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
7 + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
8 + <BaseIntermediateOutputPath>$(MSBuildThisFileDirectory)..\build\obj\$(MSBuildProjectName)\</BaseIntermediateOutputPath>
9 + <OutputPath>$(MSBuildThisFileDirectory)..\build\$(Configuration)\</OutputPath>
10 +
11 + <Authors>WiX Toolset Team</Authors>
12 + <Company>WiX Toolset</Company>
13 + <Copyright>Copyright (c) .NET Foundation and contributors. All rights reserved.</Copyright>
14 + </PropertyGroup>
15 +
16 + <PropertyGroup>
17 + <WixToolsetRootFolder>$(MSBuildThisFileDirectory)..\..\</WixToolsetRootFolder>
18 + </PropertyGroup>
19 +
20 + <Import Project="Cpp.Build.props" Condition=" '$(MSBuildProjectExtension)'=='.vcxproj' " />
21 + <Import Project="Custom.Build.props" Condition=" Exists('Custom.Build.props') " />
22 +</Project>
src/FindLocalWix.props new
+8
@@ -0,0 +1,8 @@
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<!-- 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. -->
3 +
4 +<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
5 + <PropertyGroup>
6 + <WixTargetsPath Condition=" '$(Configuration)' != 'Release' And Exists('$(MSBuildThisFileDirectory)..\..\Core\build\Release\publish\net461\wix.targets') ">$(MSBuildThisFileDirectory)..\..\Core\build\Release\publish\net461\wix.targets</WixTargetsPath>
7 + </PropertyGroup>
8 +</Project>
src/ca/dllmain.cpp new
+26
@@ -0,0 +1,26 @@
1 +// 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.
2 +
3 +#include "precomp.h"
4 +
5 +/********************************************************************
6 +DllMain - standard entry point for all WiX custom actions
7 +
8 +********************************************************************/
9 +extern "C" BOOL WINAPI DllMain(
10 + IN HINSTANCE hInst,
11 + IN ULONG ulReason,
12 + IN LPVOID)
13 +{
14 + switch(ulReason)
15 + {
16 + case DLL_PROCESS_ATTACH:
17 + WcaGlobalInitialize(hInst);
18 + break;
19 +
20 + case DLL_PROCESS_DETACH:
21 + WcaGlobalFinalize();
22 + break;
23 + }
24 +
25 + return TRUE;
26 +}
src/ca/packages.config new
+6
@@ -0,0 +1,6 @@
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<packages>
3 + <package id="Microsoft.VisualStudio.Setup.Configuration.Native" version="1.14.114" targetFramework="native" developmentDependency="true" />
4 + <package id="WixToolset.DUtil" version="4.0.6" targetFramework="native" />
5 + <package id="WixToolset.WcaUtil" version="4.0.2" targetFramework="native" />
6 +</packages>
\ No newline at end of file
src/ca/precomp.h new
+13
@@ -0,0 +1,13 @@
1 +#pragma once
2 +// 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.
3 +
4 +
5 +#include <windows.h>
6 +#include <msiquery.h>
7 +
8 +#define MAXUINT USHRT_MAX
9 +#include <Setup.Configuration.h>
10 +
11 +#include "wcautil.h"
12 +#include "fileutil.h"
13 +#include "strutil.h"
src/ca/utilca.cpp new
+3
@@ -0,0 +1,3 @@
1 +// 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.
2 +
3 +#include "precomp.h"
src/ca/utilca.def new
+7
@@ -0,0 +1,7 @@
1 +; 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.
2 +
3 +
4 +LIBRARY "utilca"
5 +
6 +EXPORTS
7 +
src/ca/utilca.vcxproj new
+69
@@ -0,0 +1,69 @@
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<!-- 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. -->
3 +
4 +<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
5 + <Import Project="..\..\packages\WixToolset.DUtil.4.0.6\build\WixToolset.DUtil.props" Condition="Exists('..\..\packages\WixToolset.DUtil.4.0.6\build\WixToolset.DUtil.props')" />
6 + <Import Project="..\..\packages\WixToolset.WcaUtil.4.0.2\build\WixToolset.WcaUtil.props" Condition="Exists('..\..\packages\WixToolset.WcaUtil.4.0.2\build\WixToolset.WcaUtil.props')" />
7 +
8 + <ItemGroup Label="ProjectConfigurations">
9 + <ProjectConfiguration Include="Debug|Win32">
10 + <Configuration>Debug</Configuration>
11 + <Platform>Win32</Platform>
12 + </ProjectConfiguration>
13 + <ProjectConfiguration Include="Release|Win32">
14 + <Configuration>Release</Configuration>
15 + <Platform>Win32</Platform>
16 + </ProjectConfiguration>
17 + </ItemGroup>
18 +
19 + <PropertyGroup Label="Globals">
20 + <ProjectGuid>{076018F7-19BD-423A-ABBF-229273DA08D8}</ProjectGuid>
21 + <ConfigurationType>DynamicLibrary</ConfigurationType>
22 + <TargetName>utilca</TargetName>
23 + <PlatformToolset>v141</PlatformToolset>
24 + <CharacterSet>Unicode</CharacterSet>
25 + <ProjectModuleDefinitionFile>utilca.def</ProjectModuleDefinitionFile>
26 + <Description>WiX Toolset Util CustomAction</Description>
27 + </PropertyGroup>
28 +
29 + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
30 + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
31 +
32 + <ImportGroup Label="ExtensionSettings">
33 + </ImportGroup>
34 +
35 + <ImportGroup Label="Shared">
36 + <Import Project="..\..\packages\Microsoft.VisualStudio.Setup.Configuration.Native.1.14.114\build\native\Microsoft.VisualStudio.Setup.Configuration.Native.targets" Condition="Exists('..\..\packages\Microsoft.VisualStudio.Setup.Configuration.Native.1.14.114\build\native\Microsoft.VisualStudio.Setup.Configuration.Native.targets')" />
37 + </ImportGroup>
38 +
39 + <PropertyGroup>
40 + <ProjectAdditionalLinkLibraries>msi.lib</ProjectAdditionalLinkLibraries>
41 + </PropertyGroup>
42 +
43 + <ItemGroup>
44 + <ClCompile Include="dllmain.cpp">
45 + <PrecompiledHeader>Create</PrecompiledHeader>
46 + </ClCompile>
47 + <ClCompile Include="utilca.cpp" />
48 + </ItemGroup>
49 +
50 + <ItemGroup>
51 + <ClInclude Include="precomp.h" />
52 + </ItemGroup>
53 +
54 + <ItemGroup>
55 + <None Include="packages.config" />
56 + <None Include="utilca.def" />
57 + </ItemGroup>
58 +
59 + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
60 +
61 + <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
62 + <PropertyGroup>
63 + <ErrorText>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}.</ErrorText>
64 + </PropertyGroup>
65 + <Error Condition="!Exists('..\..\packages\Microsoft.VisualStudio.Setup.Configuration.Native.1.14.114\build\native\Microsoft.VisualStudio.Setup.Configuration.Native.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.VisualStudio.Setup.Configuration.Native.1.14.114\build\native\Microsoft.VisualStudio.Setup.Configuration.Native.targets'))" />
66 + <Error Condition="!Exists('..\..\packages\WixToolset.DUtil.4.0.6\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.DUtil.4.0.6\build\WixToolset.DUtil.props'))" />
67 + <Error Condition="!Exists('..\..\packages\WixToolset.WcaUtil.4.0.2\build\WixToolset.WcaUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.WcaUtil.4.0.2\build\WixToolset.WcaUtil.props'))" />
68 + </Target>
69 +</Project>
src/test/WixToolsetTest.Util/TestData/UsingFileShare/Package.en-us.wxl new
+11
@@ -0,0 +1,11 @@
1 +<?xml version="1.0" encoding="utf-8"?>
2 +
3 +<!--
4 +This file contains the declaration of all the localizable strings.
5 +-->
6 +<WixLocalization xmlns="http://wixtoolset.org/schemas/v4/wxl" Culture="en-US">
7 +
8 + <String Id="DowngradeError">A newer version of [ProductName] is already installed.</String>
9 + <String Id="FeatureTitle">MsiPackage</String>
10 +
11 +</WixLocalization>
src/test/WixToolsetTest.Util/TestData/UsingFileShare/Package.wxs new
+22
@@ -0,0 +1,22 @@
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
3 + <Product Id="*" Name="MsiPackage" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a">
4 + <Package InstallerVersion="200" Compressed="no" InstallScope="perMachine" />
5 +
6 + <MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" />
7 + <MediaTemplate />
8 +
9 + <Feature Id="ProductFeature" Title="!(loc.FeatureTitle)">
10 + <ComponentGroupRef Id="ProductComponents" />
11 + </Feature>
12 +
13 + </Product>
14 +
15 + <Fragment>
16 + <Directory Id="TARGETDIR" Name="SourceDir">
17 + <Directory Id="ProgramFilesFolder">
18 + <Directory Id="INSTALLFOLDER" Name="MsiPackage" />
19 + </Directory>
20 + </Directory>
21 + </Fragment>
22 +</Wix>
src/test/WixToolsetTest.Util/TestData/UsingFileShare/PackageComponents.wxs new
+16
@@ -0,0 +1,16 @@
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
3 + xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util">
4 + <Fragment>
5 + <util:User Id="Everyone" Name="Everyone" />
6 +
7 + <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
8 + <Component>
9 + <File Source="example.txt" />
10 + <util:FileShare Id="ExampleFileShare" Description="An example file share" Name="example">
11 + <util:FileSharePermission User="Everyone" Read="yes" />
12 + </util:FileShare>
13 + </Component>
14 + </ComponentGroup>
15 + </Fragment>
16 +</Wix>
src/test/WixToolsetTest.Util/TestData/UsingFileShare/example.txt new
+1
@@ -0,0 +1 @@
1 +This is example.txt.
\ No newline at end of file
src/test/WixToolsetTest.Util/UtilExtensionFixture.cs new
+34
@@ -0,0 +1,34 @@
1 +// 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.
2 +
3 +namespace WixToolsetTest.VisualStudio
4 +{
5 + using System.Linq;
6 + using WixBuildTools.TestSupport;
7 + using WixToolset.Core.TestPackage;
8 + using WixToolset.Util;
9 + using Xunit;
10 +
11 + public class VisualStudioExtensionFixture
12 + {
13 + [Fact]
14 + public void CanBuildUsingFileShare()
15 + {
16 + var folder = TestData.Get(@"TestData\UsingFileShare");
17 + var build = new Builder(folder, typeof(UtilExtensionFactory), new[] { folder });
18 +
19 + var results = build.BuildAndQuery(Build, "FileShare", "FileSharePermissions");
20 + Assert.Equal(new[]
21 + {
22 + "FileShare:SetVS2010Vsix\t51\tVS_VSIX_INSTALLER_PATH\t[VS2010_VSIX_INSTALLER_PATH]\t0",
23 + "FileSharePermissions:SetVS2012Vsix\t51\tVS_VSIX_INSTALLER_PATH\t[VS2012_VSIX_INSTALLER_PATH]\t0",
24 + }, results.OrderBy(s => s).ToArray());
25 + }
26 +
27 + private static void Build(string[] args)
28 + {
29 + var result = WixRunner.Execute(args, out var messages);
30 + Assert.Equal(0, result);
31 + Assert.Empty(messages);
32 + }
33 + }
34 +}
src/test/WixToolsetTest.Util/WixToolsetTest.Util.csproj new
+40
@@ -0,0 +1,40 @@
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<!-- 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. -->
3 +
4 +<Project Sdk="Microsoft.NET.Sdk">
5 + <PropertyGroup>
6 + <TargetFramework>netcoreapp2.0</TargetFramework>
7 + <IsPackable>false</IsPackable>
8 + </PropertyGroup>
9 +
10 + <PropertyGroup>
11 + <NoWarn>NU1701</NoWarn>
12 + </PropertyGroup>
13 +
14 + <ItemGroup>
15 + <Content Include="TestData\UsingFileShare\example.txt" CopyToOutputDirectory="PreserveNewest" />
16 + <Content Include="TestData\UsingFileShare\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" />
17 + <Content Include="TestData\UsingFileShare\Package.wxs" CopyToOutputDirectory="PreserveNewest" />
18 + <Content Include="TestData\UsingFileShare\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" />
19 + </ItemGroup>
20 +
21 + <ItemGroup>
22 + <ProjectReference Include="..\..\wixext\WixToolset.Util.wixext.csproj" />
23 + </ItemGroup>
24 +
25 + <ItemGroup>
26 + <ProjectReference Include="$(WixToolsetRootFolder)\Core\src\WixToolset.Core.TestPackage\WixToolset.Core.TestPackage.csproj" Condition=" '$(Configuration)' == 'Debug' And Exists('$(WixToolsetRootFolder)\Core\src\WixToolset.Core.TestPackage\WixToolset.Core.TestPackage.csproj') " />
27 + <ProjectReference Include="$(WixToolsetRootFolder)\Core\src\wix\wix.csproj" Condition=" '$(Configuration)' == 'Debug' And Exists('$(WixToolsetRootFolder)\Core\src\wix\wix.csproj') " />
28 + <PackageReference Include="WixToolset.Core.TestPackage" Version="4.0.*" Condition=" '$(Configuration)' == 'Release' Or !Exists('$(WixToolsetRootFolder)\Core\src\WixToolset.Core.TestPackage\WixToolset.Core.TestPackage.csproj') " PrivateAssets="all" />
29 + </ItemGroup>
30 +
31 + <ItemGroup>
32 + <PackageReference Include="WixBuildTools.TestSupport" Version="4.0.*" />
33 + </ItemGroup>
34 +
35 + <ItemGroup>
36 + <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0-preview-20170628-02" />
37 + <PackageReference Include="xunit" Version="2.2.0" />
38 + <PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
39 + </ItemGroup>
40 +</Project>
src/wixext/PerformanceCounterType.cs new
+192
@@ -0,0 +1,192 @@
1 +// Captured from: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.dll
2 +
3 +namespace System.Diagnostics
4 +{
5 + public enum PerformanceCounterType
6 + {
7 + //
8 + // Summary:
9 + // An instantaneous counter that shows the most recently observed value in hexadecimal
10 + // format. Used, for example, to maintain a simple count of items or operations.
11 + NumberOfItemsHEX32 = 0,
12 + //
13 + // Summary:
14 + // An instantaneous counter that shows the most recently observed value. Used, for
15 + // example, to maintain a simple count of a very large number of items or operations.
16 + // It is the same as NumberOfItemsHEX32 except that it uses larger fields to accommodate
17 + // larger values.
18 + NumberOfItemsHEX64 = 256,
19 + //
20 + // Summary:
21 + // An instantaneous counter that shows the most recently observed value. Used, for
22 + // example, to maintain a simple count of items or operations.
23 + NumberOfItems32 = 65536,
24 + //
25 + // Summary:
26 + // An instantaneous counter that shows the most recently observed value. Used, for
27 + // example, to maintain a simple count of a very large number of items or operations.
28 + // It is the same as NumberOfItems32 except that it uses larger fields to accommodate
29 + // larger values.
30 + NumberOfItems64 = 65792,
31 + //
32 + // Summary:
33 + // A difference counter that shows the change in the measured attribute between
34 + // the two most recent sample intervals.
35 + CounterDelta32 = 4195328,
36 + //
37 + // Summary:
38 + // A difference counter that shows the change in the measured attribute between
39 + // the two most recent sample intervals. It is the same as the CounterDelta32 counter
40 + // type except that is uses larger fields to accomodate larger values.
41 + CounterDelta64 = 4195584,
42 + //
43 + // Summary:
44 + // An average counter that shows the average number of operations completed in one
45 + // second. When a counter of this type samples the data, each sampling interrupt
46 + // returns one or zero. The counter data is the number of ones that were sampled.
47 + // It measures time in units of ticks of the system performance timer.
48 + SampleCounter = 4260864,
49 + //
50 + // Summary:
51 + // An average counter designed to monitor the average length of a queue to a resource
52 + // over time. It shows the difference between the queue lengths observed during
53 + // the last two sample intervals divided by the duration of the interval. This type
54 + // of counter is typically used to track the number of items that are queued or
55 + // waiting.
56 + CountPerTimeInterval32 = 4523008,
57 + //
58 + // Summary:
59 + // An average counter that monitors the average length of a queue to a resource
60 + // over time. Counters of this type display the difference between the queue lengths
61 + // observed during the last two sample intervals, divided by the duration of the
62 + // interval. This counter type is the same as CountPerTimeInterval32 except that
63 + // it uses larger fields to accommodate larger values. This type of counter is typically
64 + // used to track a high-volume or very large number of items that are queued or
65 + // waiting.
66 + CountPerTimeInterval64 = 4523264,
67 + //
68 + // Summary:
69 + // A difference counter that shows the average number of operations completed during
70 + // each second of the sample interval. Counters of this type measure time in ticks
71 + // of the system clock.
72 + RateOfCountsPerSecond32 = 272696320,
73 + //
74 + // Summary:
75 + // A difference counter that shows the average number of operations completed during
76 + // each second of the sample interval. Counters of this type measure time in ticks
77 + // of the system clock. This counter type is the same as the RateOfCountsPerSecond32
78 + // type, but it uses larger fields to accommodate larger values to track a high-volume
79 + // number of items or operations per second, such as a byte-transmission rate.
80 + RateOfCountsPerSecond64 = 272696576,
81 + //
82 + // Summary:
83 + // An instantaneous percentage counter that shows the ratio of a subset to its set
84 + // as a percentage. For example, it compares the number of bytes in use on a disk
85 + // to the total number of bytes on the disk. Counters of this type display the current
86 + // percentage only, not an average over time.
87 + RawFraction = 537003008,
88 + //
89 + // Summary:
90 + // A percentage counter that shows the average time that a component is active as
91 + // a percentage of the total sample time.
92 + CounterTimer = 541132032,
93 + //
94 + // Summary:
95 + // A percentage counter that shows the active time of a component as a percentage
96 + // of the total elapsed time of the sample interval. It measures time in units of
97 + // 100 nanoseconds (ns). Counters of this type are designed to measure the activity
98 + // of one component at a time.
99 + Timer100Ns = 542180608,
100 + //
101 + // Summary:
102 + // A percentage counter that shows the average ratio of hits to all operations during
103 + // the last two sample intervals.
104 + SampleFraction = 549585920,
105 + //
106 + // Summary:
107 + // A percentage counter that displays the average percentage of active time observed
108 + // during sample interval. The value of these counters is calculated by monitoring
109 + // the percentage of time that the service was inactive and then subtracting that
110 + // value from 100 percent.
111 + CounterTimerInverse = 557909248,
112 + //
113 + // Summary:
114 + // A percentage counter that shows the average percentage of active time observed
115 + // during the sample interval.
116 + Timer100NsInverse = 558957824,
117 + //
118 + // Summary:
119 + // A percentage counter that displays the active time of one or more components
120 + // as a percentage of the total time of the sample interval. Because the numerator
121 + // records the active time of components operating simultaneously, the resulting
122 + // percentage can exceed 100 percent.
123 + CounterMultiTimer = 574686464,
124 + //
125 + // Summary:
126 + // A percentage counter that shows the active time of one or more components as
127 + // a percentage of the total time of the sample interval. It measures time in 100
128 + // nanosecond (ns) units.
129 + CounterMultiTimer100Ns = 575735040,
130 + //
131 + // Summary:
132 + // A percentage counter that shows the active time of one or more components as
133 + // a percentage of the total time of the sample interval. It derives the active
134 + // time by measuring the time that the components were not active and subtracting
135 + // the result from 100 percent by the number of objects monitored.
136 + CounterMultiTimerInverse = 591463680,
137 + //
138 + // Summary:
139 + // A percentage counter that shows the active time of one or more components as
140 + // a percentage of the total time of the sample interval. Counters of this type
141 + // measure time in 100 nanosecond (ns) units. They derive the active time by measuring
142 + // the time that the components were not active and subtracting the result from
143 + // multiplying 100 percent by the number of objects monitored.
144 + CounterMultiTimer100NsInverse = 592512256,
145 + //
146 + // Summary:
147 + // An average counter that measures the time it takes, on average, to complete a
148 + // process or operation. Counters of this type display a ratio of the total elapsed
149 + // time of the sample interval to the number of processes or operations completed
150 + // during that time. This counter type measures time in ticks of the system clock.
151 + AverageTimer32 = 805438464,
152 + //
153 + // Summary:
154 + // A difference timer that shows the total time between when the component or process
155 + // started and the time when this value is calculated.
156 + ElapsedTime = 807666944,
157 + //
158 + // Summary:
159 + // An average counter that shows how many items are processed, on average, during
160 + // an operation. Counters of this type display a ratio of the items processed to
161 + // the number of operations completed. The ratio is calculated by comparing the
162 + // number of items processed during the last interval to the number of operations
163 + // completed during the last interval.
164 + AverageCount64 = 1073874176,
165 + //
166 + // Summary:
167 + // A base counter that stores the number of sampling interrupts taken and is used
168 + // as a denominator in the sampling fraction. The sampling fraction is the number
169 + // of samples that were 1 (or true) for a sample interrupt. Check that this value
170 + // is greater than zero before using it as the denominator in a calculation of SampleFraction.
171 + SampleBase = 1073939457,
172 + //
173 + // Summary:
174 + // A base counter that is used in the calculation of time or count averages, such
175 + // as AverageTimer32 and AverageCount64. Stores the denominator for calculating
176 + // a counter to present "time per operation" or "count per operation".
177 + AverageBase = 1073939458,
178 + //
179 + // Summary:
180 + // A base counter that stores the denominator of a counter that presents a general
181 + // arithmetic fraction. Check that this value is greater than zero before using
182 + // it as the denominator in a RawFraction value calculation.
183 + RawBase = 1073939459,
184 + //
185 + // Summary:
186 + // A base counter that indicates the number of items sampled. It is used as the
187 + // denominator in the calculations to get an average among the items sampled when
188 + // taking timings of multiple, but similar items. Used with CounterMultiTimer, CounterMultiTimerInverse,
189 + // CounterMultiTimer100Ns, and CounterMultiTimer100NsInverse.
190 + CounterMultiBase = 1107494144
191 + }
192 +}
src/wixext/Tuples/EventManifestTuple.cs new
+55
@@ -0,0 +1,55 @@
1 +// 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.
2 +
3 +namespace WixToolset.Util
4 +{
5 + using WixToolset.Data;
6 + using WixToolset.Util.Tuples;
7 +
8 + public static partial class UtilTupleDefinitions
9 + {
10 + public static readonly IntermediateTupleDefinition EventManifest = new IntermediateTupleDefinition(
11 + UtilTupleDefinitionType.EventManifest.ToString(),
12 + new[]
13 + {
14 + new IntermediateFieldDefinition(nameof(EventManifestTupleFields.Component_), IntermediateFieldType.String),
15 + new IntermediateFieldDefinition(nameof(EventManifestTupleFields.File), IntermediateFieldType.String),
16 + },
17 + typeof(EventManifestTuple));
18 + }
19 +}
20 +
21 +namespace WixToolset.Util.Tuples
22 +{
23 + using WixToolset.Data;
24 +
25 + public enum EventManifestTupleFields
26 + {
27 + Component_,
28 + File,
29 + }
30 +
31 + public class EventManifestTuple : IntermediateTuple
32 + {
33 + public EventManifestTuple() : base(UtilTupleDefinitions.EventManifest, null, null)
34 + {
35 + }
36 +
37 + public EventManifestTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilTupleDefinitions.EventManifest, sourceLineNumber, id)
38 + {
39 + }
40 +
41 + public IntermediateField this[EventManifestTupleFields index] => this.Fields[(int)index];
42 +
43 + public string Component_
44 + {
45 + get => this.Fields[(int)EventManifestTupleFields.Component_].AsString();
46 + set => this.Set((int)EventManifestTupleFields.Component_, value);
47 + }
48 +
49 + public string File
50 + {
51 + get => this.Fields[(int)EventManifestTupleFields.File].AsString();
52 + set => this.Set((int)EventManifestTupleFields.File, value);
53 + }
54 + }
55 +}
\ No newline at end of file
src/wixext/Tuples/FileSharePermissionsTuple.cs new
+63
@@ -0,0 +1,63 @@
1 +// 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.
2 +
3 +namespace WixToolset.Util
4 +{
5 + using WixToolset.Data;
6 + using WixToolset.Util.Tuples;
7 +
8 + public static partial class UtilTupleDefinitions
9 + {
10 + public static readonly IntermediateTupleDefinition FileSharePermissions = new IntermediateTupleDefinition(
11 + UtilTupleDefinitionType.FileSharePermissions.ToString(),
12 + new[]
13 + {
14 + new IntermediateFieldDefinition(nameof(FileSharePermissionsTupleFields.FileShare_), IntermediateFieldType.String),
15 + new IntermediateFieldDefinition(nameof(FileSharePermissionsTupleFields.User_), IntermediateFieldType.String),
16 + new IntermediateFieldDefinition(nameof(FileSharePermissionsTupleFields.Permissions), IntermediateFieldType.Number),
17 + },
18 + typeof(FileSharePermissionsTuple));
19 + }
20 +}
21 +
22 +namespace WixToolset.Util.Tuples
23 +{
24 + using WixToolset.Data;
25 +
26 + public enum FileSharePermissionsTupleFields
27 + {
28 + FileShare_,
29 + User_,
30 + Permissions,
31 + }
32 +
33 + public class FileSharePermissionsTuple : IntermediateTuple
34 + {
35 + public FileSharePermissionsTuple() : base(UtilTupleDefinitions.FileSharePermissions, null, null)
36 + {
37 + }
38 +
39 + public FileSharePermissionsTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilTupleDefinitions.FileSharePermissions, sourceLineNumber, id)
40 + {
41 + }
42 +
43 + public IntermediateField this[FileSharePermissionsTupleFields index] => this.Fields[(int)index];
44 +
45 + public string FileShare_
46 + {
47 + get => this.Fields[(int)FileSharePermissionsTupleFields.FileShare_].AsString();
48 + set => this.Set((int)FileSharePermissionsTupleFields.FileShare_, value);
49 + }
50 +
51 + public string User_
52 + {
53 + get => this.Fields[(int)FileSharePermissionsTupleFields.User_].AsString();
54 + set => this.Set((int)FileSharePermissionsTupleFields.User_, value);
55 + }
56 +
57 + public int Permissions
58 + {
59 + get => this.Fields[(int)FileSharePermissionsTupleFields.Permissions].AsNumber();
60 + set => this.Set((int)FileSharePermissionsTupleFields.Permissions, value);
61 + }
62 + }
63 +}
\ No newline at end of file
src/wixext/Tuples/FileShareTuple.cs new
+95
@@ -0,0 +1,95 @@
1 +// 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.
2 +
3 +namespace WixToolset.Util
4 +{
5 + using WixToolset.Data;
6 + using WixToolset.Util.Tuples;
7 +
8 + public static partial class UtilTupleDefinitions
9 + {
10 + public static readonly IntermediateTupleDefinition FileShare = new IntermediateTupleDefinition(
11 + UtilTupleDefinitionType.FileShare.ToString(),
12 + new[]
13 + {
14 + new IntermediateFieldDefinition(nameof(FileShareTupleFields.FileShare), IntermediateFieldType.String),
15 + new IntermediateFieldDefinition(nameof(FileShareTupleFields.ShareName), IntermediateFieldType.String),
16 + new IntermediateFieldDefinition(nameof(FileShareTupleFields.Component_), IntermediateFieldType.String),
17 + new IntermediateFieldDefinition(nameof(FileShareTupleFields.Description), IntermediateFieldType.String),
18 + new IntermediateFieldDefinition(nameof(FileShareTupleFields.Directory_), IntermediateFieldType.String),
19 + new IntermediateFieldDefinition(nameof(FileShareTupleFields.User_), IntermediateFieldType.String),
20 + new IntermediateFieldDefinition(nameof(FileShareTupleFields.Permissions), IntermediateFieldType.Number),
21 + },
22 + typeof(FileShareTuple));
23 + }
24 +}
25 +
26 +namespace WixToolset.Util.Tuples
27 +{
28 + using WixToolset.Data;
29 +
30 + public enum FileShareTupleFields
31 + {
32 + FileShare,
33 + ShareName,
34 + Component_,
35 + Description,
36 + Directory_,
37 + User_,
38 + Permissions,
39 + }
40 +
41 + public class FileShareTuple : IntermediateTuple
42 + {
43 + public FileShareTuple() : base(UtilTupleDefinitions.FileShare, null, null)
44 + {
45 + }
46 +
47 + public FileShareTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilTupleDefinitions.FileShare, sourceLineNumber, id)
48 + {
49 + }
50 +
51 + public IntermediateField this[FileShareTupleFields index] => this.Fields[(int)index];
52 +
53 + public string FileShare
54 + {
55 + get => this.Fields[(int)FileShareTupleFields.FileShare].AsString();
56 + set => this.Set((int)FileShareTupleFields.FileShare, value);
57 + }
58 +
59 + public string ShareName
60 + {
61 + get => this.Fields[(int)FileShareTupleFields.ShareName].AsString();
62 + set => this.Set((int)FileShareTupleFields.ShareName, value);
63 + }
64 +
65 + public string Component_
66 + {
67 + get => this.Fields[(int)FileShareTupleFields.Component_].AsString();
68 + set => this.Set((int)FileShareTupleFields.Component_, value);
69 + }
70 +
71 + public string Description
72 + {
73 + get => this.Fields[(int)FileShareTupleFields.Description].AsString();
74 + set => this.Set((int)FileShareTupleFields.Description, value);
75 + }
76 +
77 + public string Directory_
78 + {
79 + get => this.Fields[(int)FileShareTupleFields.Directory_].AsString();
80 + set => this.Set((int)FileShareTupleFields.Directory_, value);
81 + }
82 +
83 + public string User_
84 + {
85 + get => this.Fields[(int)FileShareTupleFields.User_].AsString();
86 + set => this.Set((int)FileShareTupleFields.User_, value);
87 + }
88 +
89 + public int Permissions
90 + {
91 + get => this.Fields[(int)FileShareTupleFields.Permissions].AsNumber();
92 + set => this.Set((int)FileShareTupleFields.Permissions, value);
93 + }
94 + }
95 +}
\ No newline at end of file
src/wixext/Tuples/GroupTuple.cs new
+71
@@ -0,0 +1,71 @@
1 +// 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.
2 +
3 +namespace WixToolset.Util
4 +{
5 + using WixToolset.Data;
6 + using WixToolset.Util.Tuples;
7 +
8 + public static partial class UtilTupleDefinitions
9 + {
10 + public static readonly IntermediateTupleDefinition Group = new IntermediateTupleDefinition(
11 + UtilTupleDefinitionType.Group.ToString(),
12 + new[]
13 + {
14 + new IntermediateFieldDefinition(nameof(GroupTupleFields.Group), IntermediateFieldType.String),
15 + new IntermediateFieldDefinition(nameof(GroupTupleFields.Component_), IntermediateFieldType.String),
16 + new IntermediateFieldDefinition(nameof(GroupTupleFields.Name), IntermediateFieldType.String),
17 + new IntermediateFieldDefinition(nameof(GroupTupleFields.Domain), IntermediateFieldType.String),
18 + },
19 + typeof(GroupTuple));
20 + }
21 +}
22 +
23 +namespace WixToolset.Util.Tuples
24 +{
25 + using WixToolset.Data;
26 +
27 + public enum GroupTupleFields
28 + {
29 + Group,
30 + Component_,
31 + Name,
32 + Domain,
33 + }
34 +
35 + public class GroupTuple : IntermediateTuple
36 + {
37 + public GroupTuple() : base(UtilTupleDefinitions.Group, null, null)
38 + {
39 + }
40 +
41 + public GroupTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilTupleDefinitions.Group, sourceLineNumber, id)
42 + {
43 + }
44 +
45 + public IntermediateField this[GroupTupleFields index] => this.Fields[(int)index];
46 +
47 + public string Group
48 + {
49 + get => this.Fields[(int)GroupTupleFields.Group].AsString();
50 + set => this.Set((int)GroupTupleFields.Group, value);
51 + }
52 +
53 + public string Component_
54 + {
55 + get => this.Fields[(int)GroupTupleFields.Component_].AsString();
56 + set => this.Set((int)GroupTupleFields.Component_, value);
57 + }
58 +
59 + public string Name
60 + {
61 + get => this.Fields[(int)GroupTupleFields.Name].AsString();
62 + set => this.Set((int)GroupTupleFields.Name, value);
63 + }
64 +
65 + public string Domain
66 + {
67 + get => this.Fields[(int)GroupTupleFields.Domain].AsString();
68 + set => this.Set((int)GroupTupleFields.Domain, value);
69 + }
70 + }
71 +}
\ No newline at end of file
src/wixext/Tuples/PerfmonManifestTuple.cs new
+63
@@ -0,0 +1,63 @@
1 +// 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.
2 +
3 +namespace WixToolset.Util
4 +{
5 + using WixToolset.Data;
6 + using WixToolset.Util.Tuples;
7 +
8 + public static partial class UtilTupleDefinitions
9 + {
10 + public static readonly IntermediateTupleDefinition PerfmonManifest = new IntermediateTupleDefinition(
11 + UtilTupleDefinitionType.PerfmonManifest.ToString(),
12 + new[]
13 + {
14 + new IntermediateFieldDefinition(nameof(PerfmonManifestTupleFields.Component_), IntermediateFieldType.String),
15 + new IntermediateFieldDefinition(nameof(PerfmonManifestTupleFields.File), IntermediateFieldType.String),
16 + new IntermediateFieldDefinition(nameof(PerfmonManifestTupleFields.ResourceFileDirectory), IntermediateFieldType.String),
17 + },
18 + typeof(PerfmonManifestTuple));
19 + }
20 +}
21 +
22 +namespace WixToolset.Util.Tuples
23 +{
24 + using WixToolset.Data;
25 +
26 + public enum PerfmonManifestTupleFields
27 + {
28 + Component_,
29 + File,
30 + ResourceFileDirectory,
31 + }
32 +
33 + public class PerfmonManifestTuple : IntermediateTuple
34 + {
35 + public PerfmonManifestTuple() : base(UtilTupleDefinitions.PerfmonManifest, null, null)
36 + {
37 + }
38 +
39 + public PerfmonManifestTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilTupleDefinitions.PerfmonManifest, sourceLineNumber, id)
40 + {
41 + }
42 +
43 + public IntermediateField this[PerfmonManifestTupleFields index] => this.Fields[(int)index];
44 +
45 + public string Component_
46 + {
47 + get => this.Fields[(int)PerfmonManifestTupleFields.Component_].AsString();
48 + set => this.Set((int)PerfmonManifestTupleFields.Component_, value);
49 + }
50 +
51 + public string File
52 + {
53 + get => this.Fields[(int)PerfmonManifestTupleFields.File].AsString();
54 + set => this.Set((int)PerfmonManifestTupleFields.File, value);
55 + }
56 +
57 + public string ResourceFileDirectory
58 + {
59 + get => this.Fields[(int)PerfmonManifestTupleFields.ResourceFileDirectory].AsString();
60 + set => this.Set((int)PerfmonManifestTupleFields.ResourceFileDirectory, value);
61 + }
62 + }
63 +}
\ No newline at end of file
src/wixext/Tuples/PerfmonTuple.cs new
+63
@@ -0,0 +1,63 @@
1 +// 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.
2 +
3 +namespace WixToolset.Util
4 +{
5 + using WixToolset.Data;
6 + using WixToolset.Util.Tuples;
7 +
8 + public static partial class UtilTupleDefinitions
9 + {
10 + public static readonly IntermediateTupleDefinition Perfmon = new IntermediateTupleDefinition(
11 + UtilTupleDefinitionType.Perfmon.ToString(),
12 + new[]
13 + {
14 + new IntermediateFieldDefinition(nameof(PerfmonTupleFields.Component_), IntermediateFieldType.String),
15 + new IntermediateFieldDefinition(nameof(PerfmonTupleFields.File), IntermediateFieldType.String),
16 + new IntermediateFieldDefinition(nameof(PerfmonTupleFields.Name), IntermediateFieldType.String),
17 + },
18 + typeof(PerfmonTuple));
19 + }
20 +}
21 +
22 +namespace WixToolset.Util.Tuples
23 +{
24 + using WixToolset.Data;
25 +
26 + public enum PerfmonTupleFields
27 + {
28 + Component_,
29 + File,
30 + Name,
31 + }
32 +
33 + public class PerfmonTuple : IntermediateTuple
34 + {
35 + public PerfmonTuple() : base(UtilTupleDefinitions.Perfmon, null, null)
36 + {
37 + }
38 +
39 + public PerfmonTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilTupleDefinitions.Perfmon, sourceLineNumber, id)
40 + {
41 + }
42 +
43 + public IntermediateField this[PerfmonTupleFields index] => this.Fields[(int)index];
44 +
45 + public string Component_
46 + {
47 + get => this.Fields[(int)PerfmonTupleFields.Component_].AsString();
48 + set => this.Set((int)PerfmonTupleFields.Component_, value);
49 + }
50 +
51 + public string File
52 + {
53 + get => this.Fields[(int)PerfmonTupleFields.File].AsString();
54 + set => this.Set((int)PerfmonTupleFields.File, value);
55 + }
56 +
57 + public string Name
58 + {
59 + get => this.Fields[(int)PerfmonTupleFields.Name].AsString();
60 + set => this.Set((int)PerfmonTupleFields.Name, value);
61 + }
62 + }
63 +}
\ No newline at end of file
src/wixext/Tuples/PerformanceCategoryTuple.cs new
+79
@@ -0,0 +1,79 @@
1 +// 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.
2 +
3 +namespace WixToolset.Util
4 +{
5 + using WixToolset.Data;
6 + using WixToolset.Util.Tuples;
7 +
8 + public static partial class UtilTupleDefinitions
9 + {
10 + public static readonly IntermediateTupleDefinition PerformanceCategory = new IntermediateTupleDefinition(
11 + UtilTupleDefinitionType.PerformanceCategory.ToString(),
12 + new[]
13 + {
14 + new IntermediateFieldDefinition(nameof(PerformanceCategoryTupleFields.PerformanceCategory), IntermediateFieldType.String),
15 + new IntermediateFieldDefinition(nameof(PerformanceCategoryTupleFields.Component_), IntermediateFieldType.String),
16 + new IntermediateFieldDefinition(nameof(PerformanceCategoryTupleFields.Name), IntermediateFieldType.String),
17 + new IntermediateFieldDefinition(nameof(PerformanceCategoryTupleFields.IniData), IntermediateFieldType.String),
18 + new IntermediateFieldDefinition(nameof(PerformanceCategoryTupleFields.ConstantData), IntermediateFieldType.String),
19 + },
20 + typeof(PerformanceCategoryTuple));
21 + }
22 +}
23 +
24 +namespace WixToolset.Util.Tuples
25 +{
26 + using WixToolset.Data;
27 +
28 + public enum PerformanceCategoryTupleFields
29 + {
30 + PerformanceCategory,
31 + Component_,
32 + Name,
33 + IniData,
34 + ConstantData,
35 + }
36 +
37 + public class PerformanceCategoryTuple : IntermediateTuple
38 + {
39 + public PerformanceCategoryTuple() : base(UtilTupleDefinitions.PerformanceCategory, null, null)
40 + {
41 + }
42 +
43 + public PerformanceCategoryTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilTupleDefinitions.PerformanceCategory, sourceLineNumber, id)
44 + {
45 + }
46 +
47 + public IntermediateField this[PerformanceCategoryTupleFields index] => this.Fields[(int)index];
48 +
49 + public string PerformanceCategory
50 + {
51 + get => this.Fields[(int)PerformanceCategoryTupleFields.PerformanceCategory].AsString();
52 + set => this.Set((int)PerformanceCategoryTupleFields.PerformanceCategory, value);
53 + }
54 +
55 + public string Component_
56 + {
57 + get => this.Fields[(int)PerformanceCategoryTupleFields.Component_].AsString();
58 + set => this.Set((int)PerformanceCategoryTupleFields.Component_, value);
59 + }
60 +
61 + public string Name
62 + {
63 + get => this.Fields[(int)PerformanceCategoryTupleFields.Name].AsString();
64 + set => this.Set((int)PerformanceCategoryTupleFields.Name, value);
65 + }
66 +
67 + public string IniData
68 + {
69 + get => this.Fields[(int)PerformanceCategoryTupleFields.IniData].AsString();
70 + set => this.Set((int)PerformanceCategoryTupleFields.IniData, value);
71 + }
72 +
73 + public string ConstantData
74 + {
75 + get => this.Fields[(int)PerformanceCategoryTupleFields.ConstantData].AsString();
76 + set => this.Set((int)PerformanceCategoryTupleFields.ConstantData, value);
77 + }
78 + }
79 +}
\ No newline at end of file
src/wixext/Tuples/SecureObjectsTuple.cs new
+87
@@ -0,0 +1,87 @@
1 +// 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.
2 +
3 +namespace WixToolset.Util
4 +{
5 + using WixToolset.Data;
6 + using WixToolset.Util.Tuples;
7 +
8 + public static partial class UtilTupleDefinitions
9 + {
10 + public static readonly IntermediateTupleDefinition SecureObjects = new IntermediateTupleDefinition(
11 + UtilTupleDefinitionType.SecureObjects.ToString(),
12 + new[]
13 + {
14 + new IntermediateFieldDefinition(nameof(SecureObjectsTupleFields.SecureObject), IntermediateFieldType.String),
15 + new IntermediateFieldDefinition(nameof(SecureObjectsTupleFields.Table), IntermediateFieldType.String),
16 + new IntermediateFieldDefinition(nameof(SecureObjectsTupleFields.Domain), IntermediateFieldType.String),
17 + new IntermediateFieldDefinition(nameof(SecureObjectsTupleFields.User), IntermediateFieldType.String),
18 + new IntermediateFieldDefinition(nameof(SecureObjectsTupleFields.Permission), IntermediateFieldType.Number),
19 + new IntermediateFieldDefinition(nameof(SecureObjectsTupleFields.Component_), IntermediateFieldType.String),
20 + },
21 + typeof(SecureObjectsTuple));
22 + }
23 +}
24 +
25 +namespace WixToolset.Util.Tuples
26 +{
27 + using WixToolset.Data;
28 +
29 + public enum SecureObjectsTupleFields
30 + {
31 + SecureObject,
32 + Table,
33 + Domain,
34 + User,
35 + Permission,
36 + Component_,
37 + }
38 +
39 + public class SecureObjectsTuple : IntermediateTuple
40 + {
41 + public SecureObjectsTuple() : base(UtilTupleDefinitions.SecureObjects, null, null)
42 + {
43 + }
44 +
45 + public SecureObjectsTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilTupleDefinitions.SecureObjects, sourceLineNumber, id)
46 + {
47 + }
48 +
49 + public IntermediateField this[SecureObjectsTupleFields index] => this.Fields[(int)index];
50 +
51 + public string SecureObject
52 + {
53 + get => this.Fields[(int)SecureObjectsTupleFields.SecureObject].AsString();
54 + set => this.Set((int)SecureObjectsTupleFields.SecureObject, value);
55 + }
56 +
57 + public string Table
58 + {
59 + get => this.Fields[(int)SecureObjectsTupleFields.Table].AsString();
60 + set => this.Set((int)SecureObjectsTupleFields.Table, value);
61 + }
62 +
63 + public string Domain
64 + {
65 + get => this.Fields[(int)SecureObjectsTupleFields.Domain].AsString();
66 + set => this.Set((int)SecureObjectsTupleFields.Domain, value);
67 + }
68 +
69 + public string User
70 + {
71 + get => this.Fields[(int)SecureObjectsTupleFields.User].AsString();
72 + set => this.Set((int)SecureObjectsTupleFields.User, value);
73 + }
74 +
75 + public int Permission
76 + {
77 + get => this.Fields[(int)SecureObjectsTupleFields.Permission].AsNumber();
78 + set => this.Set((int)SecureObjectsTupleFields.Permission, value);
79 + }
80 +
81 + public string Component_
82 + {
83 + get => this.Fields[(int)SecureObjectsTupleFields.Component_].AsString();
84 + set => this.Set((int)SecureObjectsTupleFields.Component_, value);
85 + }
86 + }
87 +}
\ No newline at end of file
src/wixext/Tuples/ServiceConfigTuple.cs new
+119
@@ -0,0 +1,119 @@
1 +// 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.
2 +
3 +namespace WixToolset.Util
4 +{
5 + using WixToolset.Data;
6 + using WixToolset.Util.Tuples;
7 +
8 + public static partial class UtilTupleDefinitions
9 + {
10 + public static readonly IntermediateTupleDefinition ServiceConfig = new IntermediateTupleDefinition(
11 + UtilTupleDefinitionType.ServiceConfig.ToString(),
12 + new[]
13 + {
14 + new IntermediateFieldDefinition(nameof(ServiceConfigTupleFields.ServiceName), IntermediateFieldType.String),
15 + new IntermediateFieldDefinition(nameof(ServiceConfigTupleFields.Component_), IntermediateFieldType.String),
16 + new IntermediateFieldDefinition(nameof(ServiceConfigTupleFields.NewService), IntermediateFieldType.Number),
17 + new IntermediateFieldDefinition(nameof(ServiceConfigTupleFields.FirstFailureActionType), IntermediateFieldType.String),
18 + new IntermediateFieldDefinition(nameof(ServiceConfigTupleFields.SecondFailureActionType), IntermediateFieldType.String),
19 + new IntermediateFieldDefinition(nameof(ServiceConfigTupleFields.ThirdFailureActionType), IntermediateFieldType.String),
20 + new IntermediateFieldDefinition(nameof(ServiceConfigTupleFields.ResetPeriodInDays), IntermediateFieldType.Number),
21 + new IntermediateFieldDefinition(nameof(ServiceConfigTupleFields.RestartServiceDelayInSeconds), IntermediateFieldType.Number),
22 + new IntermediateFieldDefinition(nameof(ServiceConfigTupleFields.ProgramCommandLine), IntermediateFieldType.String),
23 + new IntermediateFieldDefinition(nameof(ServiceConfigTupleFields.RebootMessage), IntermediateFieldType.String),
24 + },
25 + typeof(ServiceConfigTuple));
26 + }
27 +}
28 +
29 +namespace WixToolset.Util.Tuples
30 +{
31 + using WixToolset.Data;
32 +
33 + public enum ServiceConfigTupleFields
34 + {
35 + ServiceName,
36 + Component_,
37 + NewService,
38 + FirstFailureActionType,
39 + SecondFailureActionType,
40 + ThirdFailureActionType,
41 + ResetPeriodInDays,
42 + RestartServiceDelayInSeconds,
43 + ProgramCommandLine,
44 + RebootMessage,
45 + }
46 +
47 + public class ServiceConfigTuple : IntermediateTuple
48 + {
49 + public ServiceConfigTuple() : base(UtilTupleDefinitions.ServiceConfig, null, null)
50 + {
51 + }
52 +
53 + public ServiceConfigTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilTupleDefinitions.ServiceConfig, sourceLineNumber, id)
54 + {
55 + }
56 +
57 + public IntermediateField this[ServiceConfigTupleFields index] => this.Fields[(int)index];
58 +
59 + public string ServiceName
60 + {
61 + get => this.Fields[(int)ServiceConfigTupleFields.ServiceName].AsString();
62 + set => this.Set((int)ServiceConfigTupleFields.ServiceName, value);
63 + }
64 +
65 + public string Component_
66 + {
67 + get => this.Fields[(int)ServiceConfigTupleFields.Component_].AsString();
68 + set => this.Set((int)ServiceConfigTupleFields.Component_, value);
69 + }
70 +
71 + public int NewService
72 + {
73 + get => this.Fields[(int)ServiceConfigTupleFields.NewService].AsNumber();
74 + set => this.Set((int)ServiceConfigTupleFields.NewService, value);
75 + }
76 +
77 + public string FirstFailureActionType
78 + {
79 + get => this.Fields[(int)ServiceConfigTupleFields.FirstFailureActionType].AsString();
80 + set => this.Set((int)ServiceConfigTupleFields.FirstFailureActionType, value);
81 + }
82 +
83 + public string SecondFailureActionType
84 + {
85 + get => this.Fields[(int)ServiceConfigTupleFields.SecondFailureActionType].AsString();
86 + set => this.Set((int)ServiceConfigTupleFields.SecondFailureActionType, value);
87 + }
88 +
89 + public string ThirdFailureActionType
90 + {
91 + get => this.Fields[(int)ServiceConfigTupleFields.ThirdFailureActionType].AsString();
92 + set => this.Set((int)ServiceConfigTupleFields.ThirdFailureActionType, value);
93 + }
94 +
95 + public int ResetPeriodInDays
96 + {
97 + get => this.Fields[(int)ServiceConfigTupleFields.ResetPeriodInDays].AsNumber();
98 + set => this.Set((int)ServiceConfigTupleFields.ResetPeriodInDays, value);
99 + }
100 +
101 + public int RestartServiceDelayInSeconds
102 + {
103 + get => this.Fields[(int)ServiceConfigTupleFields.RestartServiceDelayInSeconds].AsNumber();
104 + set => this.Set((int)ServiceConfigTupleFields.RestartServiceDelayInSeconds, value);
105 + }
106 +
107 + public string ProgramCommandLine
108 + {
109 + get => this.Fields[(int)ServiceConfigTupleFields.ProgramCommandLine].AsString();
110 + set => this.Set((int)ServiceConfigTupleFields.ProgramCommandLine, value);
111 + }
112 +
113 + public string RebootMessage
114 + {
115 + get => this.Fields[(int)ServiceConfigTupleFields.RebootMessage].AsString();
116 + set => this.Set((int)ServiceConfigTupleFields.RebootMessage, value);
117 + }
118 + }
119 +}
\ No newline at end of file
src/wixext/Tuples/UserGroupTuple.cs new
+55
@@ -0,0 +1,55 @@
1 +// 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.
2 +
3 +namespace WixToolset.Util
4 +{
5 + using WixToolset.Data;
6 + using WixToolset.Util.Tuples;
7 +
8 + public static partial class UtilTupleDefinitions
9 + {
10 + public static readonly IntermediateTupleDefinition UserGroup = new IntermediateTupleDefinition(
11 + UtilTupleDefinitionType.UserGroup.ToString(),
12 + new[]
13 + {
14 + new IntermediateFieldDefinition(nameof(UserGroupTupleFields.User_), IntermediateFieldType.String),
15 + new IntermediateFieldDefinition(nameof(UserGroupTupleFields.Group_), IntermediateFieldType.String),
16 + },
17 + typeof(UserGroupTuple));
18 + }
19 +}
20 +
21 +namespace WixToolset.Util.Tuples
22 +{
23 + using WixToolset.Data;
24 +
25 + public enum UserGroupTupleFields
26 + {
27 + User_,
28 + Group_,
29 + }
30 +
31 + public class UserGroupTuple : IntermediateTuple
32 + {
33 + public UserGroupTuple() : base(UtilTupleDefinitions.UserGroup, null, null)
34 + {
35 + }
36 +
37 + public UserGroupTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilTupleDefinitions.UserGroup, sourceLineNumber, id)
38 + {
39 + }
40 +
41 + public IntermediateField this[UserGroupTupleFields index] => this.Fields[(int)index];
42 +
43 + public string User_
44 + {
45 + get => this.Fields[(int)UserGroupTupleFields.User_].AsString();
46 + set => this.Set((int)UserGroupTupleFields.User_, value);
47 + }
48 +
49 + public string Group_
50 + {
51 + get => this.Fields[(int)UserGroupTupleFields.Group_].AsString();
52 + set => this.Set((int)UserGroupTupleFields.Group_, value);
53 + }
54 + }
55 +}
\ No newline at end of file
src/wixext/Tuples/UserTuple.cs new
+87
@@ -0,0 +1,87 @@
1 +// 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.
2 +
3 +namespace WixToolset.Util
4 +{
5 + using WixToolset.Data;
6 + using WixToolset.Util.Tuples;
7 +
8 + public static partial class UtilTupleDefinitions
9 + {
10 + public static readonly IntermediateTupleDefinition User = new IntermediateTupleDefinition(
11 + UtilTupleDefinitionType.User.ToString(),
12 + new[]
13 + {
14 + new IntermediateFieldDefinition(nameof(UserTupleFields.User), IntermediateFieldType.String),
15 + new IntermediateFieldDefinition(nameof(UserTupleFields.Component_), IntermediateFieldType.String),
16 + new IntermediateFieldDefinition(nameof(UserTupleFields.Name), IntermediateFieldType.String),
17 + new IntermediateFieldDefinition(nameof(UserTupleFields.Domain), IntermediateFieldType.String),
18 + new IntermediateFieldDefinition(nameof(UserTupleFields.Password), IntermediateFieldType.String),
19 + new IntermediateFieldDefinition(nameof(UserTupleFields.Attributes), IntermediateFieldType.Number),
20 + },
21 + typeof(UserTuple));
22 + }
23 +}
24 +
25 +namespace WixToolset.Util.Tuples
26 +{
27 + using WixToolset.Data;
28 +
29 + public enum UserTupleFields
30 + {
31 + User,
32 + Component_,
33 + Name,
34 + Domain,
35 + Password,
36 + Attributes,
37 + }
38 +
39 + public class UserTuple : IntermediateTuple
40 + {
41 + public UserTuple() : base(UtilTupleDefinitions.User, null, null)
42 + {
43 + }
44 +
45 + public UserTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilTupleDefinitions.User, sourceLineNumber, id)
46 + {
47 + }
48 +
49 + public IntermediateField this[UserTupleFields index] => this.Fields[(int)index];
50 +
51 + public string User
52 + {
53 + get => this.Fields[(int)UserTupleFields.User].AsString();
54 + set => this.Set((int)UserTupleFields.User, value);
55 + }
56 +
57 + public string Component_
58 + {
59 + get => this.Fields[(int)UserTupleFields.Component_].AsString();
60 + set => this.Set((int)UserTupleFields.Component_, value);
61 + }
62 +
63 + public string Name
64 + {
65 + get => this.Fields[(int)UserTupleFields.Name].AsString();
66 + set => this.Set((int)UserTupleFields.Name, value);
67 + }
68 +
69 + public string Domain
70 + {
71 + get => this.Fields[(int)UserTupleFields.Domain].AsString();
72 + set => this.Set((int)UserTupleFields.Domain, value);
73 + }
74 +
75 + public string Password
76 + {
77 + get => this.Fields[(int)UserTupleFields.Password].AsString();
78 + set => this.Set((int)UserTupleFields.Password, value);
79 + }
80 +
81 + public int Attributes
82 + {
83 + get => this.Fields[(int)UserTupleFields.Attributes].AsNumber();
84 + set => this.Set((int)UserTupleFields.Attributes, value);
85 + }
86 + }
87 +}
\ No newline at end of file
src/wixext/Tuples/UtilTupleDefinitions.cs new
+111
@@ -0,0 +1,111 @@
1 +// 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.
2 +
3 +namespace WixToolset.Util
4 +{
5 + using System;
6 + using WixToolset.Data;
7 +
8 + public enum UtilTupleDefinitionType
9 + {
10 + EventManifest,
11 + FileShare,
12 + FileSharePermissions,
13 + Group,
14 + Perfmon,
15 + PerfmonManifest,
16 + PerformanceCategory,
17 + SecureObjects,
18 + ServiceConfig,
19 + User,
20 + UserGroup,
21 + WixCloseApplication,
22 + WixFormatFiles,
23 + WixInternetShortcut,
24 + WixRemoveFolderEx,
25 + WixRestartResource,
26 + WixTouchFile,
27 + XmlConfig,
28 + XmlFile,
29 + }
30 +
31 + public static partial class UtilTupleDefinitions
32 + {
33 + public static readonly Version Version = new Version("4.0.0");
34 +
35 + public static IntermediateTupleDefinition ByName(string name)
36 + {
37 + if (!Enum.TryParse(name, out UtilTupleDefinitionType type))
38 + {
39 + return null;
40 + }
41 +
42 + return ByType(type);
43 + }
44 +
45 + public static IntermediateTupleDefinition ByType(UtilTupleDefinitionType type)
46 + {
47 + switch (type)
48 + {
49 + case UtilTupleDefinitionType.EventManifest:
50 + return UtilTupleDefinitions.EventManifest;
51 +
52 + case UtilTupleDefinitionType.FileShare:
53 + return UtilTupleDefinitions.FileShare;
54 +
55 + case UtilTupleDefinitionType.FileSharePermissions:
56 + return UtilTupleDefinitions.FileSharePermissions;
57 +
58 + case UtilTupleDefinitionType.Group:
59 + return UtilTupleDefinitions.Group;
60 +
61 + case UtilTupleDefinitionType.Perfmon:
62 + return UtilTupleDefinitions.Perfmon;
63 +
64 + case UtilTupleDefinitionType.PerfmonManifest:
65 + return UtilTupleDefinitions.PerfmonManifest;
66 +
67 + case UtilTupleDefinitionType.PerformanceCategory:
68 + return UtilTupleDefinitions.PerformanceCategory;
69 +
70 + case UtilTupleDefinitionType.SecureObjects:
71 + return UtilTupleDefinitions.SecureObjects;
72 +
73 + case UtilTupleDefinitionType.ServiceConfig:
74 + return UtilTupleDefinitions.ServiceConfig;
75 +
76 + case UtilTupleDefinitionType.User:
77 + return UtilTupleDefinitions.User;
78 +
79 + case UtilTupleDefinitionType.UserGroup:
80 + return UtilTupleDefinitions.UserGroup;
81 +
82 + case UtilTupleDefinitionType.WixCloseApplication:
83 + return UtilTupleDefinitions.WixCloseApplication;
84 +
85 + case UtilTupleDefinitionType.WixFormatFiles:
86 + return UtilTupleDefinitions.WixFormatFiles;
87 +
88 + case UtilTupleDefinitionType.WixInternetShortcut:
89 + return UtilTupleDefinitions.WixInternetShortcut;
90 +
91 + case UtilTupleDefinitionType.WixRemoveFolderEx:
92 + return UtilTupleDefinitions.WixRemoveFolderEx;
93 +
94 + case UtilTupleDefinitionType.WixRestartResource:
95 + return UtilTupleDefinitions.WixRestartResource;
96 +
97 + case UtilTupleDefinitionType.WixTouchFile:
98 + return UtilTupleDefinitions.WixTouchFile;
99 +
100 + case UtilTupleDefinitionType.XmlConfig:
101 + return UtilTupleDefinitions.XmlConfig;
102 +
103 + case UtilTupleDefinitionType.XmlFile:
104 + return UtilTupleDefinitions.XmlFile;
105 +
106 + default:
107 + throw new ArgumentOutOfRangeException(nameof(type));
108 + }
109 + }
110 + }
111 +}
src/wixext/Tuples/WixCloseApplicationTuple.cs new
+111
@@ -0,0 +1,111 @@
1 +// 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.
2 +
3 +namespace WixToolset.Util
4 +{
5 + using WixToolset.Data;
6 + using WixToolset.Util.Tuples;
7 +
8 + public static partial class UtilTupleDefinitions
9 + {
10 + public static readonly IntermediateTupleDefinition WixCloseApplication = new IntermediateTupleDefinition(
11 + UtilTupleDefinitionType.WixCloseApplication.ToString(),
12 + new[]
13 + {
14 + new IntermediateFieldDefinition(nameof(WixCloseApplicationTupleFields.WixCloseApplication), IntermediateFieldType.String),
15 + new IntermediateFieldDefinition(nameof(WixCloseApplicationTupleFields.Target), IntermediateFieldType.String),
16 + new IntermediateFieldDefinition(nameof(WixCloseApplicationTupleFields.Description), IntermediateFieldType.String),
17 + new IntermediateFieldDefinition(nameof(WixCloseApplicationTupleFields.Condition), IntermediateFieldType.String),
18 + new IntermediateFieldDefinition(nameof(WixCloseApplicationTupleFields.Attributes), IntermediateFieldType.Number),
19 + new IntermediateFieldDefinition(nameof(WixCloseApplicationTupleFields.Sequence), IntermediateFieldType.Number),
20 + new IntermediateFieldDefinition(nameof(WixCloseApplicationTupleFields.Property), IntermediateFieldType.String),
21 + new IntermediateFieldDefinition(nameof(WixCloseApplicationTupleFields.TerminateExitCode), IntermediateFieldType.Number),
22 + new IntermediateFieldDefinition(nameof(WixCloseApplicationTupleFields.Timeout), IntermediateFieldType.Number),
23 + },
24 + typeof(WixCloseApplicationTuple));
25 + }
26 +}
27 +
28 +namespace WixToolset.Util.Tuples
29 +{
30 + using WixToolset.Data;
31 +
32 + public enum WixCloseApplicationTupleFields
33 + {
34 + WixCloseApplication,
35 + Target,
36 + Description,
37 + Condition,
38 + Attributes,
39 + Sequence,
40 + Property,
41 + TerminateExitCode,
42 + Timeout,
43 + }
44 +
45 + public class WixCloseApplicationTuple : IntermediateTuple
46 + {
47 + public WixCloseApplicationTuple() : base(UtilTupleDefinitions.WixCloseApplication, null, null)
48 + {
49 + }
50 +
51 + public WixCloseApplicationTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilTupleDefinitions.WixCloseApplication, sourceLineNumber, id)
52 + {
53 + }
54 +
55 + public IntermediateField this[WixCloseApplicationTupleFields index] => this.Fields[(int)index];
56 +
57 + public string WixCloseApplication
58 + {
59 + get => this.Fields[(int)WixCloseApplicationTupleFields.WixCloseApplication].AsString();
60 + set => this.Set((int)WixCloseApplicationTupleFields.WixCloseApplication, value);
61 + }
62 +
63 + public string Target
64 + {
65 + get => this.Fields[(int)WixCloseApplicationTupleFields.Target].AsString();
66 + set => this.Set((int)WixCloseApplicationTupleFields.Target, value);
67 + }
68 +
69 + public string Description
70 + {
71 + get => this.Fields[(int)WixCloseApplicationTupleFields.Description].AsString();
72 + set => this.Set((int)WixCloseApplicationTupleFields.Description, value);
73 + }
74 +
75 + public string Condition
76 + {
77 + get => this.Fields[(int)WixCloseApplicationTupleFields.Condition].AsString();
78 + set => this.Set((int)WixCloseApplicationTupleFields.Condition, value);
79 + }
80 +
81 + public int Attributes
82 + {
83 + get => this.Fields[(int)WixCloseApplicationTupleFields.Attributes].AsNumber();
84 + set => this.Set((int)WixCloseApplicationTupleFields.Attributes, value);
85 + }
86 +
87 + public int Sequence
88 + {
89 + get => this.Fields[(int)WixCloseApplicationTupleFields.Sequence].AsNumber();
90 + set => this.Set((int)WixCloseApplicationTupleFields.Sequence, value);
91 + }
92 +
93 + public string Property
94 + {
95 + get => this.Fields[(int)WixCloseApplicationTupleFields.Property].AsString();
96 + set => this.Set((int)WixCloseApplicationTupleFields.Property, value);
97 + }
98 +
99 + public int TerminateExitCode
100 + {
101 + get => this.Fields[(int)WixCloseApplicationTupleFields.TerminateExitCode].AsNumber();
102 + set => this.Set((int)WixCloseApplicationTupleFields.TerminateExitCode, value);
103 + }
104 +
105 + public int Timeout
106 + {
107 + get => this.Fields[(int)WixCloseApplicationTupleFields.Timeout].AsNumber();
108 + set => this.Set((int)WixCloseApplicationTupleFields.Timeout, value);
109 + }
110 + }
111 +}
\ No newline at end of file
src/wixext/Tuples/WixFormatFilesTuple.cs new
+55
@@ -0,0 +1,55 @@
1 +// 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.
2 +
3 +namespace WixToolset.Util
4 +{
5 + using WixToolset.Data;
6 + using WixToolset.Util.Tuples;
7 +
8 + public static partial class UtilTupleDefinitions
9 + {
10 + public static readonly IntermediateTupleDefinition WixFormatFiles = new IntermediateTupleDefinition(
11 + UtilTupleDefinitionType.WixFormatFiles.ToString(),
12 + new[]
13 + {
14 + new IntermediateFieldDefinition(nameof(WixFormatFilesTupleFields.Binary_), IntermediateFieldType.String),
15 + new IntermediateFieldDefinition(nameof(WixFormatFilesTupleFields.File_), IntermediateFieldType.String),
16 + },
17 + typeof(WixFormatFilesTuple));
18 + }
19 +}
20 +
21 +namespace WixToolset.Util.Tuples
22 +{
23 + using WixToolset.Data;
24 +
25 + public enum WixFormatFilesTupleFields
26 + {
27 + Binary_,
28 + File_,
29 + }
30 +
31 + public class WixFormatFilesTuple : IntermediateTuple
32 + {
33 + public WixFormatFilesTuple() : base(UtilTupleDefinitions.WixFormatFiles, null, null)
34 + {
35 + }
36 +
37 + public WixFormatFilesTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilTupleDefinitions.WixFormatFiles, sourceLineNumber, id)
38 + {
39 + }
40 +
41 + public IntermediateField this[WixFormatFilesTupleFields index] => this.Fields[(int)index];
42 +
43 + public string Binary_
44 + {
45 + get => this.Fields[(int)WixFormatFilesTupleFields.Binary_].AsString();
46 + set => this.Set((int)WixFormatFilesTupleFields.Binary_, value);
47 + }
48 +
49 + public string File_
50 + {
51 + get => this.Fields[(int)WixFormatFilesTupleFields.File_].AsString();
52 + set => this.Set((int)WixFormatFilesTupleFields.File_, value);
53 + }
54 + }
55 +}
\ No newline at end of file
src/wixext/Tuples/WixInternetShortcutTuple.cs new
+103
@@ -0,0 +1,103 @@
1 +// 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.
2 +
3 +namespace WixToolset.Util
4 +{
5 + using WixToolset.Data;
6 + using WixToolset.Util.Tuples;
7 +
8 + public static partial class UtilTupleDefinitions
9 + {
10 + public static readonly IntermediateTupleDefinition WixInternetShortcut = new IntermediateTupleDefinition(
11 + UtilTupleDefinitionType.WixInternetShortcut.ToString(),
12 + new[]
13 + {
14 + new IntermediateFieldDefinition(nameof(WixInternetShortcutTupleFields.WixInternetShortcut), IntermediateFieldType.String),
15 + new IntermediateFieldDefinition(nameof(WixInternetShortcutTupleFields.Component_), IntermediateFieldType.String),
16 + new IntermediateFieldDefinition(nameof(WixInternetShortcutTupleFields.Directory_), IntermediateFieldType.String),
17 + new IntermediateFieldDefinition(nameof(WixInternetShortcutTupleFields.Name), IntermediateFieldType.String),
18 + new IntermediateFieldDefinition(nameof(WixInternetShortcutTupleFields.Target), IntermediateFieldType.String),
19 + new IntermediateFieldDefinition(nameof(WixInternetShortcutTupleFields.Attributes), IntermediateFieldType.Number),
20 + new IntermediateFieldDefinition(nameof(WixInternetShortcutTupleFields.IconFile), IntermediateFieldType.String),
21 + new IntermediateFieldDefinition(nameof(WixInternetShortcutTupleFields.IconIndex), IntermediateFieldType.Number),
22 + },
23 + typeof(WixInternetShortcutTuple));
24 + }
25 +}
26 +
27 +namespace WixToolset.Util.Tuples
28 +{
29 + using WixToolset.Data;
30 +
31 + public enum WixInternetShortcutTupleFields
32 + {
33 + WixInternetShortcut,
34 + Component_,
35 + Directory_,
36 + Name,
37 + Target,
38 + Attributes,
39 + IconFile,
40 + IconIndex,
41 + }
42 +
43 + public class WixInternetShortcutTuple : IntermediateTuple
44 + {
45 + public WixInternetShortcutTuple() : base(UtilTupleDefinitions.WixInternetShortcut, null, null)
46 + {
47 + }
48 +
49 + public WixInternetShortcutTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilTupleDefinitions.WixInternetShortcut, sourceLineNumber, id)
50 + {
51 + }
52 +
53 + public IntermediateField this[WixInternetShortcutTupleFields index] => this.Fields[(int)index];
54 +
55 + public string WixInternetShortcut
56 + {
57 + get => this.Fields[(int)WixInternetShortcutTupleFields.WixInternetShortcut].AsString();
58 + set => this.Set((int)WixInternetShortcutTupleFields.WixInternetShortcut, value);
59 + }
60 +
61 + public string Component_
62 + {
63 + get => this.Fields[(int)WixInternetShortcutTupleFields.Component_].AsString();
64 + set => this.Set((int)WixInternetShortcutTupleFields.Component_, value);
65 + }
66 +
67 + public string Directory_
68 + {
69 + get => this.Fields[(int)WixInternetShortcutTupleFields.Directory_].AsString();
70 + set => this.Set((int)WixInternetShortcutTupleFields.Directory_, value);
71 + }
72 +
73 + public string Name
74 + {
75 + get => this.Fields[(int)WixInternetShortcutTupleFields.Name].AsString();
76 + set => this.Set((int)WixInternetShortcutTupleFields.Name, value);
77 + }
78 +
79 + public string Target
80 + {
81 + get => this.Fields[(int)WixInternetShortcutTupleFields.Target].AsString();
82 + set => this.Set((int)WixInternetShortcutTupleFields.Target, value);
83 + }
84 +
85 + public int Attributes
86 + {
87 + get => this.Fields[(int)WixInternetShortcutTupleFields.Attributes].AsNumber();
88 + set => this.Set((int)WixInternetShortcutTupleFields.Attributes, value);
89 + }
90 +
91 + public string IconFile
92 + {
93 + get => this.Fields[(int)WixInternetShortcutTupleFields.IconFile].AsString();
94 + set => this.Set((int)WixInternetShortcutTupleFields.IconFile, value);
95 + }
96 +
97 + public int IconIndex
98 + {
99 + get => this.Fields[(int)WixInternetShortcutTupleFields.IconIndex].AsNumber();
100 + set => this.Set((int)WixInternetShortcutTupleFields.IconIndex, value);
101 + }
102 + }
103 +}
\ No newline at end of file
src/wixext/Tuples/WixRemoveFolderExTuple.cs new
+71
@@ -0,0 +1,71 @@
1 +// 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.
2 +
3 +namespace WixToolset.Util
4 +{
5 + using WixToolset.Data;
6 + using WixToolset.Util.Tuples;
7 +
8 + public static partial class UtilTupleDefinitions
9 + {
10 + public static readonly IntermediateTupleDefinition WixRemoveFolderEx = new IntermediateTupleDefinition(
11 + UtilTupleDefinitionType.WixRemoveFolderEx.ToString(),
12 + new[]
13 + {
14 + new IntermediateFieldDefinition(nameof(WixRemoveFolderExTupleFields.WixRemoveFolderEx), IntermediateFieldType.String),
15 + new IntermediateFieldDefinition(nameof(WixRemoveFolderExTupleFields.Component_), IntermediateFieldType.String),
16 + new IntermediateFieldDefinition(nameof(WixRemoveFolderExTupleFields.Property), IntermediateFieldType.String),
17 + new IntermediateFieldDefinition(nameof(WixRemoveFolderExTupleFields.InstallMode), IntermediateFieldType.Number),
18 + },
19 + typeof(WixRemoveFolderExTuple));
20 + }
21 +}
22 +
23 +namespace WixToolset.Util.Tuples
24 +{
25 + using WixToolset.Data;
26 +
27 + public enum WixRemoveFolderExTupleFields
28 + {
29 + WixRemoveFolderEx,
30 + Component_,
31 + Property,
32 + InstallMode,
33 + }
34 +
35 + public class WixRemoveFolderExTuple : IntermediateTuple
36 + {
37 + public WixRemoveFolderExTuple() : base(UtilTupleDefinitions.WixRemoveFolderEx, null, null)
38 + {
39 + }
40 +
41 + public WixRemoveFolderExTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilTupleDefinitions.WixRemoveFolderEx, sourceLineNumber, id)
42 + {
43 + }
44 +
45 + public IntermediateField this[WixRemoveFolderExTupleFields index] => this.Fields[(int)index];
46 +
47 + public string WixRemoveFolderEx
48 + {
49 + get => this.Fields[(int)WixRemoveFolderExTupleFields.WixRemoveFolderEx].AsString();
50 + set => this.Set((int)WixRemoveFolderExTupleFields.WixRemoveFolderEx, value);
51 + }
52 +
53 + public string Component_
54 + {
55 + get => this.Fields[(int)WixRemoveFolderExTupleFields.Component_].AsString();
56 + set => this.Set((int)WixRemoveFolderExTupleFields.Component_, value);
57 + }
58 +
59 + public string Property
60 + {
61 + get => this.Fields[(int)WixRemoveFolderExTupleFields.Property].AsString();
62 + set => this.Set((int)WixRemoveFolderExTupleFields.Property, value);
63 + }
64 +
65 + public int InstallMode
66 + {
67 + get => this.Fields[(int)WixRemoveFolderExTupleFields.InstallMode].AsNumber();
68 + set => this.Set((int)WixRemoveFolderExTupleFields.InstallMode, value);
69 + }
70 + }
71 +}
\ No newline at end of file
src/wixext/Tuples/WixRestartResourceTuple.cs new
+71
@@ -0,0 +1,71 @@
1 +// 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.
2 +
3 +namespace WixToolset.Util
4 +{
5 + using WixToolset.Data;
6 + using WixToolset.Util.Tuples;
7 +
8 + public static partial class UtilTupleDefinitions
9 + {
10 + public static readonly IntermediateTupleDefinition WixRestartResource = new IntermediateTupleDefinition(
11 + UtilTupleDefinitionType.WixRestartResource.ToString(),
12 + new[]
13 + {
14 + new IntermediateFieldDefinition(nameof(WixRestartResourceTupleFields.WixRestartResource), IntermediateFieldType.String),
15 + new IntermediateFieldDefinition(nameof(WixRestartResourceTupleFields.Component_), IntermediateFieldType.String),
16 + new IntermediateFieldDefinition(nameof(WixRestartResourceTupleFields.Resource), IntermediateFieldType.String),
17 + new IntermediateFieldDefinition(nameof(WixRestartResourceTupleFields.Attributes), IntermediateFieldType.Number),
18 + },
19 + typeof(WixRestartResourceTuple));
20 + }
21 +}
22 +
23 +namespace WixToolset.Util.Tuples
24 +{
25 + using WixToolset.Data;
26 +
27 + public enum WixRestartResourceTupleFields
28 + {
29 + WixRestartResource,
30 + Component_,
31 + Resource,
32 + Attributes,
33 + }
34 +
35 + public class WixRestartResourceTuple : IntermediateTuple
36 + {
37 + public WixRestartResourceTuple() : base(UtilTupleDefinitions.WixRestartResource, null, null)
38 + {
39 + }
40 +
41 + public WixRestartResourceTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilTupleDefinitions.WixRestartResource, sourceLineNumber, id)
42 + {
43 + }
44 +
45 + public IntermediateField this[WixRestartResourceTupleFields index] => this.Fields[(int)index];
46 +
47 + public string WixRestartResource
48 + {
49 + get => this.Fields[(int)WixRestartResourceTupleFields.WixRestartResource].AsString();
50 + set => this.Set((int)WixRestartResourceTupleFields.WixRestartResource, value);
51 + }
52 +
53 + public string Component_
54 + {
55 + get => this.Fields[(int)WixRestartResourceTupleFields.Component_].AsString();
56 + set => this.Set((int)WixRestartResourceTupleFields.Component_, value);
57 + }
58 +
59 + public string Resource
60 + {
61 + get => this.Fields[(int)WixRestartResourceTupleFields.Resource].AsString();
62 + set => this.Set((int)WixRestartResourceTupleFields.Resource, value);
63 + }
64 +
65 + public int Attributes
66 + {
67 + get => this.Fields[(int)WixRestartResourceTupleFields.Attributes].AsNumber();
68 + set => this.Set((int)WixRestartResourceTupleFields.Attributes, value);
69 + }
70 + }
71 +}
\ No newline at end of file
src/wixext/Tuples/WixTouchFileTuple.cs new
+71
@@ -0,0 +1,71 @@
1 +// 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.
2 +
3 +namespace WixToolset.Util
4 +{
5 + using WixToolset.Data;
6 + using WixToolset.Util.Tuples;
7 +
8 + public static partial class UtilTupleDefinitions
9 + {
10 + public static readonly IntermediateTupleDefinition WixTouchFile = new IntermediateTupleDefinition(
11 + UtilTupleDefinitionType.WixTouchFile.ToString(),
12 + new[]
13 + {
14 + new IntermediateFieldDefinition(nameof(WixTouchFileTupleFields.WixTouchFile), IntermediateFieldType.String),
15 + new IntermediateFieldDefinition(nameof(WixTouchFileTupleFields.Component_), IntermediateFieldType.String),
16 + new IntermediateFieldDefinition(nameof(WixTouchFileTupleFields.Path), IntermediateFieldType.String),
17 + new IntermediateFieldDefinition(nameof(WixTouchFileTupleFields.Attributes), IntermediateFieldType.Number),
18 + },
19 + typeof(WixTouchFileTuple));
20 + }
21 +}
22 +
23 +namespace WixToolset.Util.Tuples
24 +{
25 + using WixToolset.Data;
26 +
27 + public enum WixTouchFileTupleFields
28 + {
29 + WixTouchFile,
30 + Component_,
31 + Path,
32 + Attributes,
33 + }
34 +
35 + public class WixTouchFileTuple : IntermediateTuple
36 + {
37 + public WixTouchFileTuple() : base(UtilTupleDefinitions.WixTouchFile, null, null)
38 + {
39 + }
40 +
41 + public WixTouchFileTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilTupleDefinitions.WixTouchFile, sourceLineNumber, id)
42 + {
43 + }
44 +
45 + public IntermediateField this[WixTouchFileTupleFields index] => this.Fields[(int)index];
46 +
47 + public string WixTouchFile
48 + {
49 + get => this.Fields[(int)WixTouchFileTupleFields.WixTouchFile].AsString();
50 + set => this.Set((int)WixTouchFileTupleFields.WixTouchFile, value);
51 + }
52 +
53 + public string Component_
54 + {
55 + get => this.Fields[(int)WixTouchFileTupleFields.Component_].AsString();
56 + set => this.Set((int)WixTouchFileTupleFields.Component_, value);
57 + }
58 +
59 + public string Path
60 + {
61 + get => this.Fields[(int)WixTouchFileTupleFields.Path].AsString();
62 + set => this.Set((int)WixTouchFileTupleFields.Path, value);
63 + }
64 +
65 + public int Attributes
66 + {
67 + get => this.Fields[(int)WixTouchFileTupleFields.Attributes].AsNumber();
68 + set => this.Set((int)WixTouchFileTupleFields.Attributes, value);
69 + }
70 + }
71 +}
\ No newline at end of file
src/wixext/Tuples/XmlConfigTuple.cs new
+111
@@ -0,0 +1,111 @@
1 +// 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.
2 +
3 +namespace WixToolset.Util
4 +{
5 + using WixToolset.Data;
6 + using WixToolset.Util.Tuples;
7 +
8 + public static partial class UtilTupleDefinitions
9 + {
10 + public static readonly IntermediateTupleDefinition XmlConfig = new IntermediateTupleDefinition(
11 + UtilTupleDefinitionType.XmlConfig.ToString(),
12 + new[]
13 + {
14 + new IntermediateFieldDefinition(nameof(XmlConfigTupleFields.XmlConfig), IntermediateFieldType.String),
15 + new IntermediateFieldDefinition(nameof(XmlConfigTupleFields.File), IntermediateFieldType.String),
16 + new IntermediateFieldDefinition(nameof(XmlConfigTupleFields.ElementPath), IntermediateFieldType.String),
17 + new IntermediateFieldDefinition(nameof(XmlConfigTupleFields.VerifyPath), IntermediateFieldType.String),
18 + new IntermediateFieldDefinition(nameof(XmlConfigTupleFields.Name), IntermediateFieldType.String),
19 + new IntermediateFieldDefinition(nameof(XmlConfigTupleFields.Value), IntermediateFieldType.String),
20 + new IntermediateFieldDefinition(nameof(XmlConfigTupleFields.Flags), IntermediateFieldType.Number),
21 + new IntermediateFieldDefinition(nameof(XmlConfigTupleFields.Component_), IntermediateFieldType.String),
22 + new IntermediateFieldDefinition(nameof(XmlConfigTupleFields.Sequence), IntermediateFieldType.Number),
23 + },
24 + typeof(XmlConfigTuple));
25 + }
26 +}
27 +
28 +namespace WixToolset.Util.Tuples
29 +{
30 + using WixToolset.Data;
31 +
32 + public enum XmlConfigTupleFields
33 + {
34 + XmlConfig,
35 + File,
36 + ElementPath,
37 + VerifyPath,
38 + Name,
39 + Value,
40 + Flags,
41 + Component_,
42 + Sequence,
43 + }
44 +
45 + public class XmlConfigTuple : IntermediateTuple
46 + {
47 + public XmlConfigTuple() : base(UtilTupleDefinitions.XmlConfig, null, null)
48 + {
49 + }
50 +
51 + public XmlConfigTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilTupleDefinitions.XmlConfig, sourceLineNumber, id)
52 + {
53 + }
54 +
55 + public IntermediateField this[XmlConfigTupleFields index] => this.Fields[(int)index];
56 +
57 + public string XmlConfig
58 + {
59 + get => this.Fields[(int)XmlConfigTupleFields.XmlConfig].AsString();
60 + set => this.Set((int)XmlConfigTupleFields.XmlConfig, value);
61 + }
62 +
63 + public string File
64 + {
65 + get => this.Fields[(int)XmlConfigTupleFields.File].AsString();
66 + set => this.Set((int)XmlConfigTupleFields.File, value);
67 + }
68 +
69 + public string ElementPath
70 + {
71 + get => this.Fields[(int)XmlConfigTupleFields.ElementPath].AsString();
72 + set => this.Set((int)XmlConfigTupleFields.ElementPath, value);
73 + }
74 +
75 + public string VerifyPath
76 + {
77 + get => this.Fields[(int)XmlConfigTupleFields.VerifyPath].AsString();
78 + set => this.Set((int)XmlConfigTupleFields.VerifyPath, value);
79 + }
80 +
81 + public string Name
82 + {
83 + get => this.Fields[(int)XmlConfigTupleFields.Name].AsString();
84 + set => this.Set((int)XmlConfigTupleFields.Name, value);
85 + }
86 +
87 + public string Value
88 + {
89 + get => this.Fields[(int)XmlConfigTupleFields.Value].AsString();
90 + set => this.Set((int)XmlConfigTupleFields.Value, value);
91 + }
92 +
93 + public int Flags
94 + {
95 + get => this.Fields[(int)XmlConfigTupleFields.Flags].AsNumber();
96 + set => this.Set((int)XmlConfigTupleFields.Flags, value);
97 + }
98 +
99 + public string Component_
100 + {
101 + get => this.Fields[(int)XmlConfigTupleFields.Component_].AsString();
102 + set => this.Set((int)XmlConfigTupleFields.Component_, value);
103 + }
104 +
105 + public int Sequence
106 + {
107 + get => this.Fields[(int)XmlConfigTupleFields.Sequence].AsNumber();
108 + set => this.Set((int)XmlConfigTupleFields.Sequence, value);
109 + }
110 + }
111 +}
\ No newline at end of file
src/wixext/Tuples/XmlFileTuple.cs new
+103
@@ -0,0 +1,103 @@
1 +// 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.
2 +
3 +namespace WixToolset.Util
4 +{
5 + using WixToolset.Data;
6 + using WixToolset.Util.Tuples;
7 +
8 + public static partial class UtilTupleDefinitions
9 + {
10 + public static readonly IntermediateTupleDefinition XmlFile = new IntermediateTupleDefinition(
11 + UtilTupleDefinitionType.XmlFile.ToString(),
12 + new[]
13 + {
14 + new IntermediateFieldDefinition(nameof(XmlFileTupleFields.XmlFile), IntermediateFieldType.String),
15 + new IntermediateFieldDefinition(nameof(XmlFileTupleFields.File), IntermediateFieldType.String),
16 + new IntermediateFieldDefinition(nameof(XmlFileTupleFields.ElementPath), IntermediateFieldType.String),
17 + new IntermediateFieldDefinition(nameof(XmlFileTupleFields.Name), IntermediateFieldType.String),
18 + new IntermediateFieldDefinition(nameof(XmlFileTupleFields.Value), IntermediateFieldType.String),
19 + new IntermediateFieldDefinition(nameof(XmlFileTupleFields.Flags), IntermediateFieldType.Number),
20 + new IntermediateFieldDefinition(nameof(XmlFileTupleFields.Component_), IntermediateFieldType.String),
21 + new IntermediateFieldDefinition(nameof(XmlFileTupleFields.Sequence), IntermediateFieldType.Number),
22 + },
23 + typeof(XmlFileTuple));
24 + }
25 +}
26 +
27 +namespace WixToolset.Util.Tuples
28 +{
29 + using WixToolset.Data;
30 +
31 + public enum XmlFileTupleFields
32 + {
33 + XmlFile,
34 + File,
35 + ElementPath,
36 + Name,
37 + Value,
38 + Flags,
39 + Component_,
40 + Sequence,
41 + }
42 +
43 + public class XmlFileTuple : IntermediateTuple
44 + {
45 + public XmlFileTuple() : base(UtilTupleDefinitions.XmlFile, null, null)
46 + {
47 + }
48 +
49 + public XmlFileTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilTupleDefinitions.XmlFile, sourceLineNumber, id)
50 + {
51 + }
52 +
53 + public IntermediateField this[XmlFileTupleFields index] => this.Fields[(int)index];
54 +
55 + public string XmlFile
56 + {
57 + get => this.Fields[(int)XmlFileTupleFields.XmlFile].AsString();
58 + set => this.Set((int)XmlFileTupleFields.XmlFile, value);
59 + }
60 +
61 + public string File
62 + {
63 + get => this.Fields[(int)XmlFileTupleFields.File].AsString();
64 + set => this.Set((int)XmlFileTupleFields.File, value);
65 + }
66 +
67 + public string ElementPath
68 + {
69 + get => this.Fields[(int)XmlFileTupleFields.ElementPath].AsString();
70 + set => this.Set((int)XmlFileTupleFields.ElementPath, value);
71 + }
72 +
73 + public string Name
74 + {
75 + get => this.Fields[(int)XmlFileTupleFields.Name].AsString();
76 + set => this.Set((int)XmlFileTupleFields.Name, value);
77 + }
78 +
79 + public string Value
80 + {
81 + get => this.Fields[(int)XmlFileTupleFields.Value].AsString();
82 + set => this.Set((int)XmlFileTupleFields.Value, value);
83 + }
84 +
85 + public int Flags
86 + {
87 + get => this.Fields[(int)XmlFileTupleFields.Flags].AsNumber();
88 + set => this.Set((int)XmlFileTupleFields.Flags, value);
89 + }
90 +
91 + public string Component_
92 + {
93 + get => this.Fields[(int)XmlFileTupleFields.Component_].AsString();
94 + set => this.Set((int)XmlFileTupleFields.Component_, value);
95 + }
96 +
97 + public int Sequence
98 + {
99 + get => this.Fields[(int)XmlFileTupleFields.Sequence].AsNumber();
100 + set => this.Set((int)XmlFileTupleFields.Sequence, value);
101 + }
102 + }
103 +}
\ No newline at end of file
src/wixext/UtilBinder.cs new
+347
@@ -0,0 +1,347 @@
1 +// 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.
2 +
3 +namespace WixToolset.Extensions
4 +{
5 +#if TODO_BRINGBACK_FOR_BUNDLES
6 + using System;
7 + using System.Collections.Generic;
8 + using System.Globalization;
9 + using WixToolset.Data;
10 + using WixToolset.Extensibility;
11 +
12 + /// <summary>
13 + /// The binder for the WiX Toolset Utility Extension.
14 + /// </summary>
15 + public sealed class UtilBinder : BinderExtension
16 + {
17 + // TODO: When WixSearch is supported in Product, etc, we may need to call
18 + // ReorderWixSearch() from each of those initializers.
19 +
20 + // TODO: A general-purpose "reorder this table given these constraints"
21 + // mechanism may end up being helpful. This could be declaratively stated
22 + // in the table definitions, or exposed from the core Wix.dll and called
23 + // as-needed by any extensions.
24 +
25 + /// <summary>
26 + /// Called before bundle binding occurs.
27 + /// </summary>
28 + public override void Initialize(Output bundle)
29 + {
30 + if (OutputType.Bundle == bundle.Type)
31 + {
32 + this.ReorderWixSearch(bundle);
33 + }
34 + }
35 +
36 + /// <summary>
37 + /// Reorders Any WixSearch items.
38 + /// </summary>
39 + /// <param name="output">Output containing the tables to process.</param>
40 + private void ReorderWixSearch(Output output)
41 + {
42 + Table wixSearchTable = output.Tables["WixSearch"];
43 + if (null == wixSearchTable || wixSearchTable.Rows.Count == 0)
44 + {
45 + // nothing to do!
46 + return;
47 + }
48 +
49 + RowDictionary rowDictionary = new RowDictionary();
50 + foreach (Row row in wixSearchTable.Rows)
51 + {
52 + rowDictionary.AddRow(row);
53 + }
54 +
55 + Constraints constraints = new Constraints();
56 + Table wixSearchRelationTable = output.Tables["WixSearchRelation"];
57 + if (null != wixSearchRelationTable && wixSearchRelationTable.Rows.Count > 0)
58 + {
59 + // add relational info to our data...
60 + foreach (Row row in wixSearchRelationTable.Rows)
61 + {
62 + constraints.AddConstraint((string)row[0], (string)row[1]);
63 + }
64 + }
65 +
66 + this.FindCircularReference(constraints);
67 +
68 + if (this.Core.EncounteredError)
69 + {
70 + return;
71 + }
72 +
73 + this.FlattenDependentReferences(constraints);
74 +
75 + // Reorder by topographical sort (http://en.wikipedia.org/wiki/Topological_sorting)
76 + // We use a variation of Kahn (1962) algorithm as described in
77 + // Wikipedia, with the additional criteria that start nodes are sorted
78 + // lexicographically at each step to ensure a deterministic ordering
79 + // based on 'after' dependencies and ID.
80 + TopologicalSort sorter = new TopologicalSort();
81 + List <string> sortedIds = sorter.Sort(rowDictionary.Keys, constraints);
82 +
83 + // Now, re-write the table with the searches in order...
84 + wixSearchTable.Rows.Clear();
85 + foreach (string id in sortedIds)
86 + {
87 + wixSearchTable.Rows.Add(rowDictionary[id]);
88 + }
89 + }
90 +
91 + /// <summary>
92 + /// A dictionary of Row items, indexed by their first column.
93 + /// </summary>
94 + private class RowDictionary : Dictionary<string, Row>
95 + {
96 + public void AddRow(Row row)
97 + {
98 + this.Add((string)row[0], row);
99 + }
100 +
101 + // TODO: Hide other Add methods?
102 + }
103 +
104 + /// <summary>
105 + /// A dictionary of constraints, mapping an id to a list of ids.
106 + /// </summary>
107 + private class Constraints : Dictionary<string, List<string>>
108 + {
109 + public void AddConstraint(string id, string afterId)
110 + {
111 + if (!this.ContainsKey(id))
112 + {
113 + this.Add(id, new List<string>());
114 + }
115 +
116 + // TODO: Show warning if a constraint is seen twice?
117 + if (!this[id].Contains(afterId))
118 + {
119 + this[id].Add(afterId);
120 + }
121 + }
122 +
123 + // TODO: Hide other Add methods?
124 + }
125 +
126 + /// <summary>
127 + /// Finds circular references in the constraints.
128 + /// </summary>
129 + /// <param name="constraints">Constraints to check.</param>
130 + /// <remarks>This is not particularly performant, but it works.</remarks>
131 + private void FindCircularReference(Constraints constraints)
132 + {
133 + foreach (string id in constraints.Keys)
134 + {
135 + List<string> seenIds = new List<string>();
136 + string chain = null;
137 + if (FindCircularReference(constraints, id, id, seenIds, out chain))
138 + {
139 + // We will show a separate message for every ID that's in
140 + // the loop. We could bail after the first one, but then
141 + // we wouldn't catch disjoint loops in a single run.
142 + this.Core.OnMessage(UtilErrors.CircularSearchReference(chain));
143 + }
144 + }
145 + }
146 +
147 + /// <summary>
148 + /// Recursive function that finds circular references in the constraints.
149 + /// </summary>
150 + /// <param name="constraints">Constraints to check.</param>
151 + /// <param name="checkId">The identifier currently being looking for. (Fixed across a given run.)</param>
152 + /// <param name="currentId">The idenifier curently being tested.</param>
153 + /// <param name="seenIds">A list of identifiers seen, to ensure each identifier is only expanded once.</param>
154 + /// <param name="chain">If a circular reference is found, will contain the chain of references.</param>
155 + /// <returns>True if a circular reference is found, false otherwise.</returns>
156 + private bool FindCircularReference(Constraints constraints, string checkId, string currentId, List<string> seenIds, out string chain)
157 + {
158 + chain = null;
159 + List<string> afterList = null;
160 + if (constraints.TryGetValue(currentId, out afterList))
161 + {
162 + foreach (string afterId in afterList)
163 + {
164 + if (afterId == checkId)
165 + {
166 + chain = String.Format(CultureInfo.InvariantCulture, "{0} -> {1}", currentId, afterId);
167 + return true;
168 + }
169 +
170 + if (!seenIds.Contains(afterId))
171 + {
172 + seenIds.Add(afterId);
173 + if (FindCircularReference(constraints, checkId, afterId, seenIds, out chain))
174 + {
175 + chain = String.Format(CultureInfo.InvariantCulture, "{0} -> {1}", currentId, chain);
176 + return true;
177 + }
178 + }
179 + }
180 + }
181 +
182 + return false;
183 + }
184 +
185 + /// <summary>
186 + /// Flattens any dependency chains to simplify reordering.
187 + /// </summary>
188 + /// <param name="constraints"></param>
189 + private void FlattenDependentReferences(Constraints constraints)
190 + {
191 + foreach (string id in constraints.Keys)
192 + {
193 + List<string> flattenedIds = new List<string>();
194 + AddDependentReferences(constraints, id, flattenedIds);
195 + List<string> constraintList = constraints[id];
196 + foreach (string flattenedId in flattenedIds)
197 + {
198 + if (!constraintList.Contains(flattenedId))
199 + {
200 + constraintList.Add(flattenedId);
201 + }
202 + }
203 + }
204 + }
205 +
206 + /// <summary>
207 + /// Adds dependent references to a list.
208 + /// </summary>
209 + /// <param name="constraints"></param>
210 + /// <param name="currentId"></param>
211 + /// <param name="seenIds"></param>
212 + private void AddDependentReferences(Constraints constraints, string currentId, List<string> seenIds)
213 + {
214 + List<string> afterList = null;
215 + if (constraints.TryGetValue(currentId, out afterList))
216 + {
217 + foreach (string afterId in afterList)
218 + {
219 + if (!seenIds.Contains(afterId))
220 + {
221 + seenIds.Add(afterId);
222 + AddDependentReferences(constraints, afterId, seenIds);
223 + }
224 + }
225 + }
226 + }
227 +
228 + /// <summary>
229 + /// Reorder by topological sort
230 + /// </summary>
231 + /// <remarks>
232 + /// We use a variation of Kahn (1962) algorithm as described in
233 + /// Wikipedia (http://en.wikipedia.org/wiki/Topological_sorting), with
234 + /// the additional criteria that start nodes are sorted lexicographically
235 + /// at each step to ensure a deterministic ordering based on 'after'
236 + /// dependencies and ID.
237 + /// </remarks>
238 + private class TopologicalSort
239 + {
240 + private List<string> startIds = new List<string>();
241 + private Constraints constraints;
242 +
243 + /// <summary>
244 + /// Reorder by topological sort
245 + /// </summary>
246 + /// <param name="allIds">The complete list of IDs.</param>
247 + /// <param name="constraints">Constraints to use.</param>
248 + /// <returns>The topologically sorted list of IDs.</returns>
249 + internal List<string> Sort(IEnumerable<string> allIds, Constraints constraints)
250 + {
251 + this.startIds.Clear();
252 + this.CopyConstraints(constraints);
253 +
254 + this.FindInitialStartIds(allIds);
255 +
256 + // We always create a new sortedId list, because we return it
257 + // to the caller and don't know what its lifetime may be.
258 + List<string> sortedIds = new List<string>();
259 +
260 + while (this.startIds.Count > 0)
261 + {
262 + this.SortStartIds();
263 +
264 + string currentId = this.startIds[0];
265 + sortedIds.Add(currentId);
266 + this.startIds.RemoveAt(0);
267 +
268 + this.ResolveConstraint(currentId);
269 + }
270 +
271 + return sortedIds;
272 + }
273 +
274 + /// <summary>
275 + /// Copies a Constraints set (to prevent modifying the incoming data).
276 + /// </summary>
277 + /// <param name="constraints">Constraints to copy.</param>
278 + private void CopyConstraints(Constraints constraints)
279 + {
280 + this.constraints = new Constraints();
281 + foreach (string id in constraints.Keys)
282 + {
283 + foreach (string afterId in constraints[id])
284 + {
285 + this.constraints.AddConstraint(id, afterId);
286 + }
287 + }
288 + }
289 +
290 + /// <summary>
291 + /// Finds initial start IDs. (Those with no constraints.)
292 + /// </summary>
293 + /// <param name="allIds">The complete list of IDs.</param>
294 + private void FindInitialStartIds(IEnumerable<string> allIds)
295 + {
296 + foreach (string id in allIds)
297 + {
298 + if (!this.constraints.ContainsKey(id))
299 + {
300 + this.startIds.Add(id);
301 + }
302 + }
303 + }
304 +
305 + /// <summary>
306 + /// Sorts start IDs.
307 + /// </summary>
308 + private void SortStartIds()
309 + {
310 + this.startIds.Sort();
311 + }
312 +
313 + /// <summary>
314 + /// Removes the resolved constraint and updates the list of startIds
315 + /// with any now-valid (all constraints resolved) IDs.
316 + /// </summary>
317 + /// <param name="resolvedId">The ID to resolve from the set of constraints.</param>
318 + private void ResolveConstraint(string resolvedId)
319 + {
320 + List<string> newStartIds = new List<string>();
321 +
322 + foreach (string id in constraints.Keys)
323 + {
324 + if (this.constraints[id].Contains(resolvedId))
325 + {
326 + this.constraints[id].Remove(resolvedId);
327 +
328 + // If we just removed the last constraint for this
329 + // ID, it is now a valid start ID.
330 + if (0 == this.constraints[id].Count)
331 + {
332 + newStartIds.Add(id);
333 + }
334 + }
335 + }
336 +
337 + foreach (string id in newStartIds)
338 + {
339 + this.constraints.Remove(id);
340 + }
341 +
342 + this.startIds.AddRange(newStartIds);
343 + }
344 + }
345 + }
346 +#endif
347 +}
src/wixext/UtilCompiler.cs new
+3911
@@ -0,0 +1,3911 @@
1 +// 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.
2 +
3 +namespace WixToolset.Util
4 +{
5 + using System;
6 + using System.Collections;
7 + using System.Collections.Generic;
8 + using System.Globalization;
9 + using System.Linq;
10 + using System.Text;
11 + using System.Text.RegularExpressions;
12 + using System.Xml.Linq;
13 + using WixToolset.Data;
14 + using WixToolset.Extensibility;
15 +
16 + /// <summary>
17 + /// The compiler for the WiX Toolset Utility Extension.
18 + /// </summary>
19 + public sealed class UtilCompiler : BaseCompilerExtension
20 + {
21 + // user creation attributes definitions (from sca.h)
22 + internal const int UserDontExpirePasswrd = 0x00000001;
23 + internal const int UserPasswdCantChange = 0x00000002;
24 + internal const int UserPasswdChangeReqdOnLogin = 0x00000004;
25 + internal const int UserDisableAccount = 0x00000008;
26 + internal const int UserFailIfExists = 0x00000010;
27 + internal const int UserUpdateIfExists = 0x00000020;
28 + internal const int UserLogonAsService = 0x00000040;
29 + internal const int UserLogonAsBatchJob = 0x00000080;
30 +
31 + internal const int UserDontRemoveOnUninstall = 0x00000100;
32 + internal const int UserDontCreateUser = 0x00000200;
33 + internal const int UserNonVital = 0x00000400;
34 +
35 + [Flags]
36 + internal enum WixFileSearchAttributes
37 + {
38 + Default = 0x001,
39 + MinVersionInclusive = 0x002,
40 + MaxVersionInclusive = 0x004,
41 + MinSizeInclusive = 0x008,
42 + MaxSizeInclusive = 0x010,
43 + MinDateInclusive = 0x020,
44 + MaxDateInclusive = 0x040,
45 + WantVersion = 0x080,
46 + WantExists = 0x100,
47 + IsDirectory = 0x200,
48 + }
49 +
50 + internal enum WixRegistrySearchFormat
51 + {
52 + Raw,
53 + Compatible,
54 + }
55 +
56 + [Flags]
57 + internal enum WixRegistrySearchAttributes
58 + {
59 + Raw = 0x01,
60 + Compatible = 0x02,
61 + ExpandEnvironmentVariables = 0x04,
62 + WantValue = 0x08,
63 + WantExists = 0x10,
64 + Win64 = 0x20,
65 + }
66 +
67 + internal enum WixComponentSearchAttributes
68 + {
69 + KeyPath = 0x1,
70 + State = 0x2,
71 + WantDirectory = 0x4,
72 + }
73 +
74 + [Flags]
75 + internal enum WixProductSearchAttributes
76 + {
77 + Version = 0x01,
78 + Language = 0x02,
79 + State = 0x04,
80 + Assignment = 0x08,
81 + UpgradeCode = 0x10,
82 + }
83 +
84 + internal enum WixRestartResourceAttributes
85 + {
86 + Filename = 1,
87 + ProcessName,
88 + ServiceName,
89 + TypeMask = 0xf,
90 + }
91 +
92 + internal enum WixRemoveFolderExOn
93 + {
94 + Install = 1,
95 + Uninstall = 2,
96 + Both = 3,
97 + }
98 +
99 + private static readonly Regex FindPropertyBrackets = new Regex(@"\[(?!\\|\])|(?<!\[\\\]|\[\\|\\\[)\]", RegexOptions.ExplicitCapture | RegexOptions.Compiled);
100 +
101 + public override XNamespace Namespace => "http://wixtoolset.org/schemas/v4/wxs/util";
102 +
103 + /// <summary>
104 + /// Types of Internet shortcuts.
105 + /// </summary>
106 + public enum InternetShortcutType
107 + {
108 + /// <summary>Create a .lnk file.</summary>
109 + Link = 0,
110 +
111 + /// <summary>Create a .url file.</summary>
112 + Url,
113 + }
114 +
115 + /// <summary>
116 + /// Types of permission setting methods.
117 + /// </summary>
118 + private enum PermissionType
119 + {
120 + /// <summary>LockPermissions (normal) type permission setting.</summary>
121 + LockPermissions,
122 +
123 + /// <summary>FileSharePermissions type permission setting.</summary>
124 + FileSharePermissions,
125 +
126 + /// <summary>SecureObjects type permission setting.</summary>
127 + SecureObjects,
128 + }
129 +
130 + /// <summary>
131 + /// Processes an element for the Compiler.
132 + /// </summary>
133 + /// <param name="parentElement">Parent element of element to process.</param>
134 + /// <param name="element">Element to process.</param>
135 + /// <param name="context">Extra information about the context in which this element is being parsed.</param>
136 + public override void ParseElement(Intermediate intermediate, IntermediateSection section, XElement parentElement, XElement element, IDictionary<string, string> context)
137 + {
138 + this.ParsePossibleKeyPathElement(intermediate, section, parentElement, element, context);
139 + }
140 +
141 + /// <summary>
142 + /// Processes an element for the Compiler.
143 + /// </summary>
144 + /// <param name="sourceLineNumbers">Source line number for the parent element.</param>
145 + /// <param name="parentElement">Parent element of element to process.</param>
146 + /// <param name="element">Element to process.</param>
147 + /// <param name="contextValues">Extra information about the context in which this element is being parsed.</param>
148 + public override ComponentKeyPath ParsePossibleKeyPathElement(Intermediate intermediate, IntermediateSection section, XElement parentElement, XElement element, IDictionary<string, string> context)
149 + {
150 + ComponentKeyPath possibleKeyPath = null;
151 +
152 + switch (parentElement.Name.LocalName)
153 + {
154 + case "CreateFolder":
155 + string createFolderId = context["DirectoryId"];
156 + string createFolderComponentId = context["ComponentId"];
157 +
158 + // If this doesn't parse successfully, something really odd is going on, so let the exception get thrown
159 + bool createFolderWin64 = Boolean.Parse(context["Win64"]);
160 +
161 + switch (element.Name.LocalName)
162 + {
163 + case "PermissionEx":
164 + this.ParsePermissionExElement(intermediate, section, element, createFolderId, createFolderComponentId, createFolderWin64, "CreateFolder");
165 + break;
166 + default:
167 + this.ParseHelper.UnexpectedElement(parentElement, element);
168 + break;
169 + }
170 + break;
171 + case "Component":
172 + string componentId = context["ComponentId"];
173 + string directoryId = context["DirectoryId"];
174 + bool componentWin64 = Boolean.Parse(context["Win64"]);
175 +
176 + switch (element.Name.LocalName)
177 + {
178 + case "EventSource":
179 + possibleKeyPath = this.ParseEventSourceElement(intermediate, section, element, componentId);
180 + break;
181 + case "FileShare":
182 + this.ParseFileShareElement(intermediate, section, element, componentId, directoryId);
183 + break;
184 + case "InternetShortcut":
185 + this.ParseInternetShortcutElement(intermediate, section, element, componentId, directoryId);
186 + break;
187 + case "PerformanceCategory":
188 + this.ParsePerformanceCategoryElement(intermediate, section, element, componentId);
189 + break;
190 + case "RemoveFolderEx":
191 + this.ParseRemoveFolderExElement(intermediate, section, element, componentId);
192 + break;
193 + case "RestartResource":
194 + this.ParseRestartResourceElement(intermediate, section, element, componentId);
195 + break;
196 + case "ServiceConfig":
197 + this.ParseServiceConfigElement(intermediate, section, element, componentId, "Component", null);
198 + break;
199 + case "TouchFile":
200 + this.ParseTouchFileElement(intermediate, section, element, componentId, componentWin64);
201 + break;
202 + case "User":
203 + this.ParseUserElement(intermediate, section, element, componentId);
204 + break;
205 + case "XmlFile":
206 + this.ParseXmlFileElement(intermediate, section, element, componentId);
207 + break;
208 + case "XmlConfig":
209 + this.ParseXmlConfigElement(intermediate, section, element, componentId, false);
210 + break;
211 + default:
212 + this.ParseHelper.UnexpectedElement(parentElement, element);
213 + break;
214 + }
215 + break;
216 + case "File":
217 + string fileId = context["FileId"];
218 + string fileComponentId = context["ComponentId"];
219 +
220 + // If this doesn't parse successfully, something really odd is going on, so let the exception get thrown
221 + bool fileWin64 = Boolean.Parse(context["Win64"]);
222 +
223 + switch (element.Name.LocalName)
224 + {
225 + case "PerfCounter":
226 + this.ParsePerfCounterElement(intermediate, section, element, fileComponentId, fileId);
227 + break;
228 + case "PermissionEx":
229 + this.ParsePermissionExElement(intermediate, section, element, fileId, fileComponentId, fileWin64, "File");
230 + break;
231 + case "PerfCounterManifest":
232 + this.ParsePerfCounterManifestElement(intermediate, section, element, fileComponentId, fileId);
233 + break;
234 + case "EventManifest":
235 + this.ParseEventManifestElement(intermediate, section, element, fileComponentId, fileId);
236 + break;
237 + case "FormatFile":
238 + this.ParseFormatFileElement(intermediate, section, element, fileId, fileWin64);
239 + break;
240 + default:
241 + this.ParseHelper.UnexpectedElement(parentElement, element);
242 + break;
243 + }
244 + break;
245 + case "Bundle":
246 + case "Fragment":
247 + case "Module":
248 + case "Product":
249 + switch (element.Name.LocalName)
250 + {
251 + case "CloseApplication":
252 + this.ParseCloseApplicationElement(intermediate, section, element);
253 + break;
254 + case "Group":
255 + this.ParseGroupElement(intermediate, section, element, null);
256 + break;
257 + case "RestartResource":
258 + // Currently not supported for Bundles.
259 + if (parentElement.Name.LocalName != "Bundle")
260 + {
261 + this.ParseRestartResourceElement(intermediate, section, element, null);
262 + }
263 + else
264 + {
265 + this.ParseHelper.UnexpectedElement(parentElement, element);
266 + }
267 + break;
268 + case "User":
269 + this.ParseUserElement(intermediate, section, element, null);
270 + break;
271 + case "ComponentSearch":
272 + case "ComponentSearchRef":
273 + case "DirectorySearch":
274 + case "DirectorySearchRef":
275 + case "FileSearch":
276 + case "FileSearchRef":
277 + case "ProductSearch":
278 + case "ProductSearchRef":
279 + case "RegistrySearch":
280 + case "RegistrySearchRef":
281 + // These will eventually be supported under Module/Product, but are not yet.
282 + if (parentElement.Name.LocalName == "Bundle" || parentElement.Name.LocalName == "Fragment")
283 + {
284 + // TODO: When these are supported by all section types, move
285 + // these out of the nested switch and back into the surrounding one.
286 + switch (element.Name.LocalName)
287 + {
288 + case "ComponentSearch":
289 + this.ParseComponentSearchElement(intermediate, section, element);
290 + break;
291 + case "ComponentSearchRef":
292 + this.ParseComponentSearchRefElement(intermediate, section, element);
293 + break;
294 + case "DirectorySearch":
295 + this.ParseDirectorySearchElement(intermediate, section, element);
296 + break;
297 + case "DirectorySearchRef":
298 + this.ParseWixSearchRefElement(intermediate, section, element);
299 + break;
300 + case "FileSearch":
301 + this.ParseFileSearchElement(intermediate, section, element);
302 + break;
303 + case "FileSearchRef":
304 + this.ParseWixSearchRefElement(intermediate, section, element);
305 + break;
306 + case "ProductSearch":
307 + this.ParseProductSearchElement(intermediate, section, element);
308 + break;
309 + case "ProductSearchRef":
310 + this.ParseWixSearchRefElement(intermediate, section, element);
311 + break;
312 + case "RegistrySearch":
313 + this.ParseRegistrySearchElement(intermediate, section, element);
314 + break;
315 + case "RegistrySearchRef":
316 + this.ParseWixSearchRefElement(intermediate, section, element);
317 + break;
318 + }
319 + }
320 + else
321 + {
322 + this.ParseHelper.UnexpectedElement(parentElement, element);
323 + }
324 + break;
325 + default:
326 + this.ParseHelper.UnexpectedElement(parentElement, element);
327 + break;
328 + }
329 + break;
330 + case "Registry":
331 + case "RegistryKey":
332 + case "RegistryValue":
333 + string registryId = context["RegistryId"];
334 + string registryComponentId = context["ComponentId"];
335 +
336 + // If this doesn't parse successfully, something really odd is going on, so let the exception get thrown
337 + bool registryWin64 = Boolean.Parse(context["Win64"]);
338 +
339 + switch (element.Name.LocalName)
340 + {
341 + case "PermissionEx":
342 + this.ParsePermissionExElement(intermediate, section, element, registryId, registryComponentId, registryWin64, "Registry");
343 + break;
344 + default:
345 + this.ParseHelper.UnexpectedElement(parentElement, element);
346 + break;
347 + }
348 + break;
349 + case "ServiceInstall":
350 + string serviceInstallId = context["ServiceInstallId"];
351 + string serviceInstallName = context["ServiceInstallName"];
352 + string serviceInstallComponentId = context["ServiceInstallComponentId"];
353 +
354 + // If this doesn't parse successfully, something really odd is going on, so let the exception get thrown
355 + bool serviceInstallWin64 = Boolean.Parse(context["Win64"]);
356 +
357 + switch (element.Name.LocalName)
358 + {
359 + case "PermissionEx":
360 + this.ParsePermissionExElement(intermediate, section, element, serviceInstallId, serviceInstallComponentId, serviceInstallWin64, "ServiceInstall");
361 + break;
362 + case "ServiceConfig":
363 + this.ParseServiceConfigElement(intermediate, section, element, serviceInstallComponentId, "ServiceInstall", serviceInstallName);
364 + break;
365 + default:
366 + this.ParseHelper.UnexpectedElement(parentElement, element);
367 + break;
368 + }
369 + break;
370 + default:
371 + this.ParseHelper.UnexpectedElement(parentElement, element);
372 + break;
373 + }
374 +
375 + return possibleKeyPath;
376 + }
377 +
378 + /// <summary>
379 + /// Parses the common search attributes shared across all searches.
380 + /// </summary>
381 + /// <param name="sourceLineNumbers">Source line number for the parent element.</param>
382 + /// <param name="attrib">Attribute to parse.</param>
383 + /// <param name="id">Value of the Id attribute.</param>
384 + /// <param name="variable">Value of the Variable attribute.</param>
385 + /// <param name="condition">Value of the Condition attribute.</param>
386 + /// <param name="after">Value of the After attribute.</param>
387 + private void ParseCommonSearchAttributes(SourceLineNumber sourceLineNumbers, XAttribute attrib, ref Identifier id, ref string variable, ref string condition, ref string after)
388 + {
389 + switch (attrib.Name.LocalName)
390 + {
391 + case "Id":
392 + id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib);
393 + break;
394 + case "Variable":
395 + variable = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
396 + // TODO: handle standard bundle variables
397 + break;
398 + case "Condition":
399 + condition = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
400 + break;
401 + case "After":
402 + after = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
403 + break;
404 + default:
405 + System.Diagnostics.Debug.Assert(false);
406 + break;
407 + }
408 + }
409 +
410 + /// <summary>
411 + /// Parses a ComponentSearch element.
412 + /// </summary>
413 + /// <param name="element">Element to parse.</param>
414 + private void ParseComponentSearchElement(Intermediate intermediate, IntermediateSection section, XElement element)
415 + {
416 + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
417 + Identifier id = null;
418 + string variable = null;
419 + string condition = null;
420 + string after = null;
421 + string guid = null;
422 + string productCode = null;
423 + Serialize.ComponentSearch.ResultType result = Serialize.ComponentSearch.ResultType.NotSet;
424 +
425 + foreach (XAttribute attrib in element.Attributes())
426 + {
427 + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
428 + {
429 + switch (attrib.Name.LocalName)
430 + {
431 + case "Id":
432 + case "Variable":
433 + case "Condition":
434 + case "After":
435 + this.ParseCommonSearchAttributes(sourceLineNumbers, attrib, ref id, ref variable, ref condition, ref after);
436 + break;
437 + case "Guid":
438 + guid = this.ParseHelper.GetAttributeGuidValue(sourceLineNumbers, attrib);
439 + break;
440 + case "ProductCode":
441 + productCode = this.ParseHelper.GetAttributeGuidValue(sourceLineNumbers, attrib);
442 + break;
443 + case "Result":
444 + string resultValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
445 + if (!Serialize.ComponentSearch.TryParseResultType(resultValue, out result))
446 + {
447 + this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, attrib.Parent.Name.LocalName, attrib.Name.LocalName,
448 + resultValue,
449 + Serialize.ComponentSearch.ResultType.directory.ToString(),
450 + Serialize.ComponentSearch.ResultType.state.ToString(),
451 + Serialize.ComponentSearch.ResultType.keyPath.ToString()));
452 + }
453 + break;
454 + default:
455 + this.ParseHelper.UnexpectedAttribute(element, attrib);
456 + break;
457 + }
458 + }
459 + else
460 + {
461 + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
462 + }
463 + }
464 +
465 + if (null == variable)
466 + {
467 + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Variable"));
468 + }
469 +
470 + if (null == guid)
471 + {
472 + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Guid"));
473 + }
474 +
475 + if (null == id)
476 + {
477 + id = this.ParseHelper.CreateIdentifier("wcs", variable, condition, after, guid, productCode, result.ToString());
478 + }
479 +
480 + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
481 +
482 + if (!this.Messaging.EncounteredError)
483 + {
484 + this.CreateWixSearchRow(section, sourceLineNumbers, id, variable, condition);
485 + if (after != null)
486 + {
487 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "WixSearch", after);
488 + // TODO: We're currently defaulting to "always run after", which we will need to change...
489 + this.CreateWixSearchRelationRow(section, sourceLineNumbers, id, after, 2);
490 + }
491 +
492 + WixComponentSearchAttributes attributes = WixComponentSearchAttributes.KeyPath;
493 + switch (result)
494 + {
495 + case Serialize.ComponentSearch.ResultType.directory:
496 + attributes = WixComponentSearchAttributes.WantDirectory;
497 + break;
498 + case Serialize.ComponentSearch.ResultType.keyPath:
499 + attributes = WixComponentSearchAttributes.KeyPath;
500 + break;
501 + case Serialize.ComponentSearch.ResultType.state:
502 + attributes = WixComponentSearchAttributes.State;
503 + break;
504 + }
505 +
506 + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixComponentSearch", id);
507 + row.Set(1, guid);
508 + row.Set(2, productCode);
509 + row.Set(3, (int)attributes);
510 + }
511 + }
512 +
513 + /// <summary>
514 + /// Parses a ComponentSearchRef element
515 + /// </summary>
516 + /// <param name="element">Element to parse.</param>
517 + private void ParseComponentSearchRefElement(Intermediate intermediate, IntermediateSection section, XElement element)
518 + {
519 + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
520 + string refId = null;
521 +
522 + foreach (XAttribute attrib in element.Attributes())
523 + {
524 + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
525 + {
526 + switch (attrib.Name.LocalName)
527 + {
528 + case "Id":
529 + refId = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
530 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "WixComponentSearch", refId);
531 + break;
532 + default:
533 + this.ParseHelper.UnexpectedAttribute(element, attrib);
534 + break;
535 + }
536 + }
537 + else
538 + {
539 + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
540 + }
541 + }
542 +
543 + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
544 + }
545 +
546 + /// <summary>
547 + /// Parses an event source element.
548 + /// </summary>
549 + /// <param name="element">Element to parse.</param>
550 + /// <param name="componentId">Identifier of parent component.</param>
551 + private ComponentKeyPath ParseEventSourceElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId)
552 + {
553 + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
554 + string sourceName = null;
555 + string logName = null;
556 + string categoryMessageFile = null;
557 + int categoryCount = CompilerConstants.IntegerNotSet;
558 + string eventMessageFile = null;
559 + string parameterMessageFile = null;
560 + int typesSupported = 0;
561 + bool isKeyPath = false;
562 +
563 + foreach (XAttribute attrib in element.Attributes())
564 + {
565 + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
566 + {
567 + switch (attrib.Name.LocalName)
568 + {
569 + case "CategoryCount":
570 + categoryCount = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, int.MaxValue);
571 + break;
572 + case "CategoryMessageFile":
573 + categoryMessageFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
574 + break;
575 + case "EventMessageFile":
576 + eventMessageFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
577 + break;
578 + case "KeyPath":
579 + isKeyPath = YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib);
580 + break;
581 + case "Log":
582 + logName = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
583 + if ("Security" == logName)
584 + {
585 + this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName, logName, "Application", "System", "<customEventLog>"));
586 + }
587 + break;
588 + case "Name":
589 + sourceName = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
590 + break;
591 + case "ParameterMessageFile":
592 + parameterMessageFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
593 + break;
594 + case "SupportsErrors":
595 + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
596 + {
597 + typesSupported |= 0x01; // EVENTLOG_ERROR_TYPE
598 + }
599 + break;
600 + case "SupportsFailureAudits":
601 + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
602 + {
603 + typesSupported |= 0x10; // EVENTLOG_AUDIT_FAILURE
604 + }
605 + break;
606 + case "SupportsInformationals":
607 + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
608 + {
609 + typesSupported |= 0x04; // EVENTLOG_INFORMATION_TYPE
610 + }
611 + break;
612 + case "SupportsSuccessAudits":
613 + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
614 + {
615 + typesSupported |= 0x08; // EVENTLOG_AUDIT_SUCCESS
616 + }
617 + break;
618 + case "SupportsWarnings":
619 + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
620 + {
621 + typesSupported |= 0x02; // EVENTLOG_WARNING_TYPE
622 + }
623 + break;
624 + default:
625 + this.ParseHelper.UnexpectedAttribute(element, attrib);
626 + break;
627 + }
628 + }
629 + else
630 + {
631 + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
632 + }
633 + }
634 +
635 + if (null == sourceName)
636 + {
637 + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Name"));
638 + }
639 +
640 + if (null == logName)
641 + {
642 + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "EventLog"));
643 + }
644 +
645 + if (null == eventMessageFile)
646 + {
647 + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "EventMessageFile"));
648 + }
649 +
650 + if (null == categoryMessageFile && 0 < categoryCount)
651 + {
652 + this.Messaging.Write(ErrorMessages.IllegalAttributeWithoutOtherAttributes(sourceLineNumbers, element.Name.LocalName, "CategoryCount", "CategoryMessageFile"));
653 + }
654 +
655 + if (null != categoryMessageFile && CompilerConstants.IntegerNotSet == categoryCount)
656 + {
657 + this.Messaging.Write(ErrorMessages.IllegalAttributeWithoutOtherAttributes(sourceLineNumbers, element.Name.LocalName, "CategoryMessageFile", "CategoryCount"));
658 + }
659 +
660 + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
661 +
662 + int registryRoot = 2; // MsiInterop.MsidbRegistryRootLocalMachine
663 + string eventSourceKey = String.Format(@"SYSTEM\CurrentControlSet\Services\EventLog\{0}\{1}", logName, sourceName);
664 + Identifier id = this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, registryRoot, eventSourceKey, "EventMessageFile", String.Concat("#%", eventMessageFile), componentId, false);
665 +
666 + if (null != categoryMessageFile)
667 + {
668 + this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, registryRoot, eventSourceKey, "CategoryMessageFile", String.Concat("#%", categoryMessageFile), componentId, false);
669 + }
670 +
671 + if (CompilerConstants.IntegerNotSet != categoryCount)
672 + {
673 + this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, registryRoot, eventSourceKey, "CategoryCount", String.Concat("#", categoryCount), componentId, false);
674 + }
675 +
676 + if (null != parameterMessageFile)
677 + {
678 + this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, registryRoot, eventSourceKey, "ParameterMessageFile", String.Concat("#%", parameterMessageFile), componentId, false);
679 + }
680 +
681 + if (0 != typesSupported)
682 + {
683 + this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, registryRoot, eventSourceKey, "TypesSupported", String.Concat("#", typesSupported), componentId, false);
684 + }
685 +
686 + return new ComponentKeyPath() { Id = id.Id, Explicit = isKeyPath, Type = ComponentKeyPathType.Registry };
687 + }
688 +
689 + /// <summary>
690 + /// Parses a close application element.
691 + /// </summary>
692 + /// <param name="element">Element to parse.</param>
693 + private void ParseCloseApplicationElement(Intermediate intermediate, IntermediateSection section, XElement element)
694 + {
695 + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
696 + string condition = null;
697 + string description = null;
698 + string target = null;
699 + string property = null;
700 + Identifier id = null;
701 + int attributes = 2; // default to CLOSEAPP_ATTRIBUTE_REBOOTPROMPT enabled
702 + int sequence = CompilerConstants.IntegerNotSet;
703 + int terminateExitCode = CompilerConstants.IntegerNotSet;
704 + int timeout = CompilerConstants.IntegerNotSet;
705 +
706 + foreach (XAttribute attrib in element.Attributes())
707 + {
708 + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
709 + {
710 + switch (attrib.Name.LocalName)
711 + {
712 + case "Id":
713 + id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib);
714 + break;
715 + case "Description":
716 + description = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
717 + break;
718 + case "Property":
719 + property = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
720 + break;
721 + case "Sequence":
722 + sequence = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, int.MaxValue);
723 + break;
724 + case "Timeout":
725 + timeout = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, int.MaxValue);
726 + break;
727 + case "Target":
728 + target = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
729 + break;
730 + case "CloseMessage":
731 + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
732 + {
733 + attributes |= 1; // CLOSEAPP_ATTRIBUTE_CLOSEMESSAGE
734 + }
735 + else
736 + {
737 + attributes &= ~1; // CLOSEAPP_ATTRIBUTE_CLOSEMESSAGE
738 + }
739 + break;
740 + case "EndSessionMessage":
741 + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
742 + {
743 + attributes |= 8; // CLOSEAPP_ATTRIBUTE_ENDSESSIONMESSAGE
744 + }
745 + else
746 + {
747 + attributes &= ~8; // CLOSEAPP_ATTRIBUTE_ENDSESSIONMESSAGE
748 + }
749 + break;
750 + case "PromptToContinue":
751 + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
752 + {
753 + attributes |= 0x40; // CLOSEAPP_ATTRIBUTE_PROMPTTOCONTINUE
754 + }
755 + else
756 + {
757 + attributes &= ~0x40; // CLOSEAPP_ATTRIBUTE_PROMPTTOCONTINUE
758 + }
759 + break;
760 + case "RebootPrompt":
761 + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
762 + {
763 + attributes |= 2; // CLOSEAPP_ATTRIBUTE_REBOOTPROMPT
764 + }
765 + else
766 + {
767 + attributes &= ~2; // CLOSEAPP_ATTRIBUTE_REBOOTPROMPT
768 + }
769 + break;
770 + case "ElevatedCloseMessage":
771 + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
772 + {
773 + attributes |= 4; // CLOSEAPP_ATTRIBUTE_ELEVATEDCLOSEMESSAGE
774 + }
775 + else
776 + {
777 + attributes &= ~4; // CLOSEAPP_ATTRIBUTE_ELEVATEDCLOSEMESSAGE
778 + }
779 + break;
780 + case "ElevatedEndSessionMessage":
781 + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
782 + {
783 + attributes |= 0x10; // CLOSEAPP_ATTRIBUTE_ELEVATEDENDSESSIONMESSAGE
784 + }
785 + else
786 + {
787 + attributes &= ~0x10; // CLOSEAPP_ATTRIBUTE_ELEVATEDENDSESSIONMESSAGE
788 + }
789 + break;
790 + case "TerminateProcess":
791 + terminateExitCode = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, int.MaxValue);
792 + attributes |= 0x20; // CLOSEAPP_ATTRIBUTE_TERMINATEPROCESS
793 + break;
794 + default:
795 + this.ParseHelper.UnexpectedAttribute(element, attrib);
796 + break;
797 + }
798 + }
799 + else
800 + {
801 + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
802 + }
803 + }
804 +
805 + if (null == target)
806 + {
807 + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Target"));
808 + }
809 + else if (null == id)
810 + {
811 + id = this.ParseHelper.CreateIdentifier("ca", target);
812 + }
813 +
814 + if (String.IsNullOrEmpty(description) && 0x40 == (attributes & 0x40))
815 + {
816 + this.Messaging.Write(ErrorMessages.IllegalAttributeValueWithoutOtherAttribute(sourceLineNumbers, element.Name.LocalName, "PromptToContinue", "yes", "Description"));
817 + }
818 +
819 + if (0x22 == (attributes & 0x22))
820 + {
821 + this.Messaging.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, element.Name.LocalName, "TerminateProcess", "RebootPrompt", "yes"));
822 + }
823 +
824 + // get the condition from the inner text of the element
825 + condition = this.ParseHelper.GetConditionInnerText(element);
826 +
827 + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
828 +
829 + // Reference CustomAction since nothing will happen without it
830 + if (this.Context.Platform == Platform.ARM)
831 + {
832 + // Ensure ARM version of the CA is referenced
833 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixCloseApplications_ARM");
834 + }
835 + else
836 + {
837 + // All other supported platforms use x86
838 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixCloseApplications");
839 + }
840 +
841 + if (!this.Messaging.EncounteredError)
842 + {
843 + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixCloseApplication", id);
844 + row.Set(1, target);
845 + row.Set(2, description);
846 + row.Set(3, condition);
847 + row.Set(4, attributes);
848 + if (CompilerConstants.IntegerNotSet != sequence)
849 + {
850 + row.Set(5, sequence);
851 + }
852 + row.Set(6, property);
853 + if (CompilerConstants.IntegerNotSet != terminateExitCode)
854 + {
855 + row.Set(7, terminateExitCode);
856 + }
857 + if (CompilerConstants.IntegerNotSet != timeout)
858 + {
859 + row.Set(8, timeout * 1000); // make the timeout milliseconds in the table.
860 + }
861 + }
862 + }
863 +
864 + /// <summary>
865 + /// Parses a DirectorySearch element.
866 + /// </summary>
867 + /// <param name="element">Element to parse.</param>
868 + private void ParseDirectorySearchElement(Intermediate intermediate, IntermediateSection section, XElement element)
869 + {
870 + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
871 + Identifier id = null;
872 + string variable = null;
873 + string condition = null;
874 + string after = null;
875 + string path = null;
876 + Serialize.DirectorySearch.ResultType result = Serialize.DirectorySearch.ResultType.NotSet;
877 +
878 + foreach (XAttribute attrib in element.Attributes())
879 + {
880 + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
881 + {
882 + switch (attrib.Name.LocalName)
883 + {
884 + case "Id":
885 + case "Variable":
886 + case "Condition":
887 + case "After":
888 + this.ParseCommonSearchAttributes(sourceLineNumbers, attrib, ref id, ref variable, ref condition, ref after);
889 + break;
890 + case "Path":
891 + path = this.ParseHelper.GetAttributeLongFilename(sourceLineNumbers, attrib, false, true);
892 + break;
893 + case "Result":
894 + string resultValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
895 + if (!Serialize.DirectorySearch.TryParseResultType(resultValue, out result))
896 + {
897 + this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, attrib.Parent.Name.LocalName, attrib.Name.LocalName,
898 + resultValue, Serialize.DirectorySearch.ResultType.exists.ToString()));
899 + }
900 + break;
901 + default:
902 + this.ParseHelper.UnexpectedAttribute(element, attrib);
903 + break;
904 + }
905 + }
906 + else
907 + {
908 + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
909 + }
910 + }
911 +
912 + if (null == variable)
913 + {
914 + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Variable"));
915 + }
916 +
917 + if (null == path)
918 + {
919 + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Path"));
920 + }
921 +
922 + if (null == id)
923 + {
924 + id = this.ParseHelper.CreateIdentifier("wds", variable, condition, after, path, result.ToString());
925 + }
926 +
927 + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
928 +
929 + if (!this.Messaging.EncounteredError)
930 + {
931 + this.CreateWixSearchRow(section, sourceLineNumbers, id, variable, condition);
932 + if (after != null)
933 + {
934 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "WixSearch", after);
935 + // TODO: We're currently defaulting to "always run after", which we will need to change...
936 + this.CreateWixSearchRelationRow(section, sourceLineNumbers, id, after, 2);
937 + }
938 +
939 + WixFileSearchAttributes attributes = WixFileSearchAttributes.IsDirectory;
940 + switch (result)
941 + {
942 + case Serialize.DirectorySearch.ResultType.exists:
943 + attributes |= WixFileSearchAttributes.WantExists;
944 + break;
945 + }
946 +
947 + this.CreateWixFileSearchRow(section, sourceLineNumbers, id, path, attributes);
948 + }
949 + }
950 +
951 + /// <summary>
952 + /// Parses a DirectorySearchRef, FileSearchRef, ProductSearchRef, and RegistrySearchRef elements
953 + /// </summary>
954 + /// <param name="node">Element to parse.</param>
955 + private void ParseWixSearchRefElement(Intermediate intermediate, IntermediateSection section, XElement node)
956 + {
957 + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node);
958 + string refId = null;
959 +
960 + foreach (XAttribute attrib in node.Attributes())
961 + {
962 + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
963 + {
964 + switch (attrib.Name.LocalName)
965 + {
966 + case "Id":
967 + refId = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
968 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "WixSearch", refId);
969 + break;
970 + default:
971 + this.ParseHelper.UnexpectedAttribute(node, attrib);
972 + break;
973 + }
974 + }
975 + else
976 + {
977 + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, node, attrib);
978 + }
979 + }
980 +
981 + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, node);
982 + }
983 +
984 + /// <summary>
985 + /// Parses a FileSearch element.
986 + /// </summary>
987 + /// <param name="node">Element to parse.</param>
988 + private void ParseFileSearchElement(Intermediate intermediate, IntermediateSection section, XElement node)
989 + {
990 + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node);
991 + Identifier id = null;
992 + string variable = null;
993 + string condition = null;
994 + string after = null;
995 + string path = null;
996 + Serialize.FileSearch.ResultType result = Serialize.FileSearch.ResultType.NotSet;
997 +
998 + foreach (XAttribute attrib in node.Attributes())
999 + {
1000 + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
1001 + {
1002 + switch (attrib.Name.LocalName)
1003 + {
1004 + case "Id":
1005 + case "Variable":
1006 + case "Condition":
1007 + case "After":
1008 + this.ParseCommonSearchAttributes(sourceLineNumbers, attrib, ref id, ref variable, ref condition, ref after);
1009 + break;
1010 + case "Path":
1011 + path = this.ParseHelper.GetAttributeLongFilename(sourceLineNumbers, attrib, false, true);
1012 + break;
1013 + case "Result":
1014 + string resultValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
1015 + if (!Serialize.FileSearch.TryParseResultType(resultValue, out result))
1016 + {
1017 + this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, attrib.Parent.Name.LocalName, attrib.Name.LocalName,
1018 + resultValue,
1019 + Serialize.FileSearch.ResultType.exists.ToString(),
1020 + Serialize.FileSearch.ResultType.version.ToString()));
1021 + }
1022 + break;
1023 + default:
1024 + this.ParseHelper.UnexpectedAttribute(node, attrib);
1025 + break;
1026 + }
1027 + }
1028 + else
1029 + {
1030 + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, node, attrib);
1031 + }
1032 + }
1033 +
1034 + if (null == variable)
1035 + {
1036 + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Variable"));
1037 + }
1038 +
1039 + if (null == path)
1040 + {
1041 + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Path"));
1042 + }
1043 +
1044 + if (null == id)
1045 + {
1046 + id = this.ParseHelper.CreateIdentifier("wfs", variable, condition, after, path, result.ToString());
1047 + }
1048 +
1049 + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, node);
1050 +
1051 + if (!this.Messaging.EncounteredError)
1052 + {
1053 + this.CreateWixSearchRow(section, sourceLineNumbers, id, variable, condition);
1054 + if (after != null)
1055 + {
1056 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "WixSearch", after);
1057 + // TODO: We're currently defaulting to "always run after", which we will need to change...
1058 + this.CreateWixSearchRelationRow(section, sourceLineNumbers, id, after, 2);
1059 + }
1060 +
1061 + WixFileSearchAttributes attributes = WixFileSearchAttributes.Default;
1062 + switch (result)
1063 + {
1064 + case Serialize.FileSearch.ResultType.exists:
1065 + attributes |= WixFileSearchAttributes.WantExists;
1066 + break;
1067 + case Serialize.FileSearch.ResultType.version:
1068 + attributes |= WixFileSearchAttributes.WantVersion;
1069 + break;
1070 + }
1071 +
1072 + this.CreateWixFileSearchRow(section, sourceLineNumbers, id, path, attributes);
1073 + }
1074 + }
1075 +
1076 + /// <summary>
1077 + /// Creates a row in the WixFileSearch table.
1078 + /// </summary>
1079 + /// <param name="sourceLineNumbers">Source line number for the parent element.</param>
1080 + /// <param name="id">Identifier of the search (key into the WixSearch table)</param>
1081 + /// <param name="path">File/directory path to search for.</param>
1082 + /// <param name="attributes"></param>
1083 + private void CreateWixFileSearchRow(IntermediateSection section, SourceLineNumber sourceLineNumbers, Identifier id, string path, WixFileSearchAttributes attributes)
1084 + {
1085 + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixFileSearch", id);
1086 + row.Set(1, path);
1087 + //row.Set(2, minVersion;
1088 + //row.Set(3, maxVersion;
1089 + //row.Set(4, minSize;
1090 + //row.Set(5, maxSize;
1091 + //row.Set(6, minDate;
1092 + //row.Set(7, maxDate;
1093 + //row.Set(8, languages;
1094 + row.Set(9, (int)attributes);
1095 + }
1096 +
1097 + /// <summary>
1098 + /// Creates a row in the WixSearch table.
1099 + /// </summary>
1100 + /// <param name="sourceLineNumbers">Source line number for the parent element.</param>
1101 + /// <param name="id">Identifier of the search.</param>
1102 + /// <param name="variable">The Burn variable to store the result into.</param>
1103 + /// <param name="condition">A condition to test before evaluating the search.</param>
1104 + private void CreateWixSearchRow(IntermediateSection section, SourceLineNumber sourceLineNumbers, Identifier id, string variable, string condition)
1105 + {
1106 + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixSearch", id);
1107 + row.Set(1, variable);
1108 + row.Set(2, condition);
1109 + }
1110 +
1111 + /// <summary>
1112 + ///
1113 + /// </summary>
1114 + /// <param name="sourceLineNumbers">Source line number for the parent element.</param>
1115 + /// <param name="id">Identifier of the search (key into the WixSearch table)</param>
1116 + /// <param name="parentId">Identifier of the search that comes before (key into the WixSearch table)</param>
1117 + /// <param name="attributes">Further details about the relation between id and parentId.</param>
1118 + private void CreateWixSearchRelationRow(IntermediateSection section, SourceLineNumber sourceLineNumbers, Identifier id, string parentId, int attributes)
1119 + {
1120 + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixSearchRelation", id);
1121 + row.Set(1, parentId);
1122 + row.Set(2, attributes);
1123 + }
1124 +
1125 + /// <summary>
1126 + /// Parses a file share element.
1127 + /// </summary>
1128 + /// <param name="element">Element to parse.</param>
1129 + /// <param name="componentId">Identifier of parent component.</param>
1130 + /// <param name="directoryId">Identifier of referred to directory.</param>
1131 + private void ParseFileShareElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, string directoryId)
1132 + {
1133 + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
1134 + string description = null;
1135 + string name = null;
1136 + string id = null;
1137 +
1138 + foreach (XAttribute attrib in element.Attributes())
1139 + {
1140 + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
1141 + {
1142 + switch (attrib.Name.LocalName)
1143 + {
1144 + case "Id":
1145 + id = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
1146 + break;
1147 + case "Name":
1148 + name = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
1149 + break;
1150 + case "Description":
1151 + description = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
1152 + break;
1153 + default:
1154 + this.ParseHelper.UnexpectedAttribute(element, attrib);
1155 + break;
1156 + }
1157 + }
1158 + else
1159 + {
1160 + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
1161 + }
1162 + }
1163 +
1164 + if (null == id)
1165 + {
1166 + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Id"));
1167 + }
1168 +
1169 + if (null == name)
1170 + {
1171 + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Name"));
1172 + }
1173 +
1174 + if (!element.Elements().Any())
1175 + {
1176 + this.Messaging.Write(ErrorMessages.ExpectedElement(sourceLineNumbers, element.Name.LocalName, "FileSharePermission"));
1177 + }
1178 +
1179 + foreach (XElement child in element.Elements())
1180 + {
1181 + if (this.Namespace == child.Name.Namespace)
1182 + {
1183 + switch (child.Name.LocalName)
1184 + {
1185 + case "FileSharePermission":
1186 + this.ParseFileSharePermissionElement(intermediate, section, child, id);
1187 + break;
1188 + default:
1189 + this.ParseHelper.UnexpectedElement(element, child);
1190 + break;
1191 + }
1192 + }
1193 + else
1194 + {
1195 + this.ParseHelper.ParseExtensionElement(this.Context.Extensions, intermediate, section, element, child);
1196 + }
1197 + }
1198 +
1199 + // Reference ConfigureSmbInstall and ConfigureSmbUninstall since nothing will happen without it
1200 + if (this.Context.Platform == Platform.ARM)
1201 + {
1202 + // Ensure ARM version of the CA is referenced
1203 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigureSmbInstall_ARM");
1204 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigureSmbUninstall_ARM");
1205 + }
1206 + else
1207 + {
1208 + // All other supported platforms use x86
1209 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigureSmbInstall");
1210 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigureSmbUninstall");
1211 + }
1212 +
1213 + if (!this.Messaging.EncounteredError)
1214 + {
1215 + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "FileShare");
1216 + row.Set(0, id);
1217 + row.Set(1, name);
1218 + row.Set(2, componentId);
1219 + row.Set(3, description);
1220 + row.Set(4, directoryId);
1221 + }
1222 + }
1223 +
1224 + /// <summary>
1225 + /// Parses a FileSharePermission element.
1226 + /// </summary>
1227 + /// <param name="element">Element to parse.</param>
1228 + /// <param name="fileShareId">The identifier of the parent FileShare element.</param>
1229 + private void ParseFileSharePermissionElement(Intermediate intermediate, IntermediateSection section, XElement element, string fileShareId)
1230 + {
1231 + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
1232 + BitArray bits = new BitArray(32);
1233 + int permission = 0;
1234 + string user = null;
1235 +
1236 + foreach (XAttribute attrib in element.Attributes())
1237 + {
1238 + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
1239 + {
1240 + switch (attrib.Name.LocalName)
1241 + {
1242 + case "User":
1243 + user = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
1244 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "User", user);
1245 + break;
1246 + default:
1247 + YesNoType attribValue = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib);
1248 + if (!this.TrySetBitFromName(UtilConstants.StandardPermissions, attrib.Name.LocalName, attribValue, bits, 16))
1249 + {
1250 + if (!this.TrySetBitFromName(UtilConstants.GenericPermissions, attrib.Name.LocalName, attribValue, bits, 28))
1251 + {
1252 + if (!this.TrySetBitFromName(UtilConstants.FolderPermissions, attrib.Name.LocalName, attribValue, bits, 0))
1253 + {
1254 + this.ParseHelper.UnexpectedAttribute(element, attrib);
1255 + break;
1256 + }
1257 + }
1258 + }
1259 + break;
1260 + }
1261 + }
1262 + else
1263 + {
1264 + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
1265 + }
1266 + }
1267 +
1268 + permission = this.CreateIntegerFromBitArray(bits);
1269 +
1270 + if (null == user)
1271 + {
1272 + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "User"));
1273 + }
1274 +
1275 + if (int.MinValue == permission) // just GENERIC_READ, which is MSI_NULL
1276 + {
1277 + this.Messaging.Write(ErrorMessages.GenericReadNotAllowed(sourceLineNumbers));
1278 + }
1279 +
1280 + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
1281 +
1282 + if (!this.Messaging.EncounteredError)
1283 + {
1284 + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "FileSharePermissions");
1285 + row.Set(0, fileShareId);
1286 + row.Set(1, user);
1287 + row.Set(2, permission);
1288 + }
1289 + }
1290 +
1291 + /// <summary>
1292 + /// Parses a group element.
1293 + /// </summary>
1294 + /// <param name="element">Node to be parsed.</param>
1295 + /// <param name="componentId">Component Id of the parent component of this element.</param>
1296 + private void ParseGroupElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId)
1297 + {
1298 + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
1299 + string id = null;
1300 + string domain = null;
1301 + string name = null;
1302 +
1303 + foreach (XAttribute attrib in element.Attributes())
1304 + {
1305 + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
1306 + {
1307 + switch (attrib.Name.LocalName)
1308 + {
1309 + case "Id":
1310 + id = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
1311 + break;
1312 + case "Name":
1313 + name = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
1314 + break;
1315 + case "Domain":
1316 + domain = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
1317 + break;
1318 + default:
1319 + this.ParseHelper.UnexpectedAttribute(element, attrib);
1320 + break;
1321 + }
1322 + }
1323 + else
1324 + {
1325 + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
1326 + }
1327 + }
1328 +
1329 + if (null == id)
1330 + {
1331 + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Id"));
1332 + }
1333 +
1334 + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
1335 +
1336 + if (!this.Messaging.EncounteredError)
1337 + {
1338 + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "Group");
1339 + row.Set(0, id);
1340 + row.Set(1, componentId);
1341 + row.Set(2, name);
1342 + row.Set(3, domain);
1343 + }
1344 + }
1345 +
1346 + /// <summary>
1347 + /// Parses a GroupRef element
1348 + /// </summary>
1349 + /// <param name="element">Element to parse.</param>
1350 + /// <param name="userId">Required user id to be joined to the group.</param>
1351 + private void ParseGroupRefElement(Intermediate intermediate, IntermediateSection section, XElement element, string userId)
1352 + {
1353 + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
1354 + string groupId = null;
1355 +
1356 + foreach (XAttribute attrib in element.Attributes())
1357 + {
1358 + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
1359 + {
1360 + switch (attrib.Name.LocalName)
1361 + {
1362 + case "Id":
1363 + groupId = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
1364 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "Group", groupId);
1365 + break;
1366 + default:
1367 + this.ParseHelper.UnexpectedAttribute(element, attrib);
1368 + break;
1369 + }
1370 + }
1371 + else
1372 + {
1373 + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
1374 + }
1375 + }
1376 +
1377 + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
1378 +
1379 + if (!this.Messaging.EncounteredError)
1380 + {
1381 + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "UserGroup");
1382 + row.Set(0, userId);
1383 + row.Set(1, groupId);
1384 + }
1385 + }
1386 +
1387 + /// <summary>
1388 + /// Parses an InternetShortcut element.
1389 + /// </summary>
1390 + /// <param name="element">Element to parse.</param>
1391 + /// <param name="componentId">Identifier of parent component.</param>
1392 + /// <param name="defaultTarget">Default directory if none is specified on the InternetShortcut element.</param>
1393 + private void ParseInternetShortcutElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, string defaultTarget)
1394 + {
1395 + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
1396 + string id = null;
1397 + string name = null;
1398 + string target = null;
1399 + string directoryId = null;
1400 + string type = null;
1401 + string iconFile = null;
1402 + int iconIndex = 0;
1403 +
1404 + foreach (XAttribute attrib in element.Attributes())
1405 + {
1406 + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
1407 + {
1408 + switch (attrib.Name.LocalName)
1409 + {
1410 + case "Directory":
1411 + directoryId = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
1412 + break;
1413 + case "Id":
1414 + id = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
1415 + break;
1416 + case "Name":
1417 + name = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
1418 + break;
1419 + case "Target":
1420 + target = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
1421 + break;
1422 + case "Type":
1423 + type = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
1424 + break;
1425 + case "IconFile":
1426 + iconFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
1427 + break;
1428 + case "IconIndex":
1429 + iconIndex = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, int.MaxValue);
1430 + break;
1431 + default:
1432 + this.ParseHelper.UnexpectedAttribute(element, attrib);
1433 + break;
1434 + }
1435 + }
1436 + else
1437 + {
1438 + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
1439 + }
1440 + }
1441 +
1442 + // If there was no directoryId specified on the InternetShortcut element, default to the one on
1443 + // the parent component.
1444 + if (null == directoryId)
1445 + {
1446 + directoryId = defaultTarget;
1447 + }
1448 +
1449 + if (null == id)
1450 + {
1451 + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Id"));
1452 + }
1453 +
1454 + // In theory this can never be the case, since InternetShortcut can only be under
1455 + // a component element, and if the Directory wasn't specified the default will come
1456 + // from the component. However, better safe than sorry, so here's a check to make sure
1457 + // it didn't wind up being null after setting it to the defaultTarget.
1458 + if (null == directoryId)
1459 + {
1460 + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Directory"));
1461 + }
1462 +
1463 + if (null == name)
1464 + {
1465 + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Name"));
1466 + }
1467 +
1468 + if (null == target)
1469 + {
1470 + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Target"));
1471 + }
1472 +
1473 + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
1474 +
1475 + InternetShortcutType shortcutType = InternetShortcutType.Link;
1476 + if (0 == String.Compare(type, "url", StringComparison.OrdinalIgnoreCase))
1477 + {
1478 + shortcutType = InternetShortcutType.Url;
1479 + }
1480 +
1481 + if (!this.Messaging.EncounteredError)
1482 + {
1483 + CreateWixInternetShortcut(intermediate, section, sourceLineNumbers, componentId, directoryId, id, name, target, shortcutType, iconFile, iconIndex);
1484 + }
1485 + }
1486 +
1487 + /// <summary>
1488 + /// Creates the rows needed for WixInternetShortcut to work.
1489 + /// </summary>
1490 + /// <param name="core">The CompilerCore object used to create rows.</param>
1491 + /// <param name="sourceLineNumbers">Source line information about the owner element.</param>
1492 + /// <param name="componentId">Identifier of parent component.</param>
1493 + /// <param name="directoryId">Identifier of directory containing shortcut.</param>
1494 + /// <param name="id">Identifier of shortcut.</param>
1495 + /// <param name="name">Name of shortcut without extension.</param>
1496 + /// <param name="target">Target URL of shortcut.</param>
1497 + 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)
1498 + {
1499 + // add the appropriate extension based on type of shortcut
1500 + name = String.Concat(name, InternetShortcutType.Url == type ? ".url" : ".lnk");
1501 +
1502 + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixInternetShortcut");
1503 + row.Set(0, shortcutId);
1504 + row.Set(1, componentId);
1505 + row.Set(2, directoryId);
1506 + row.Set(3, name);
1507 + row.Set(4, target);
1508 + row.Set(5, (int)type);
1509 + row.Set(6, iconFile);
1510 + row.Set(7, iconIndex);
1511 +
1512 + // Reference custom action because nothing will happen without it
1513 + if (this.Context.Platform == Platform.ARM)
1514 + {
1515 + // Ensure ARM version of the CA is referenced
1516 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixSchedInternetShortcuts_ARM");
1517 + }
1518 + else
1519 + {
1520 + // All other supported platforms use x86
1521 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixSchedInternetShortcuts");
1522 + }
1523 +
1524 + // make sure we have a CreateFolder table so that the immediate CA can add temporary rows to handle installation and uninstallation
1525 + this.ParseHelper.EnsureTable(section, sourceLineNumbers, "CreateFolder");
1526 +
1527 + // use built-in MSI functionality to remove the shortcuts rather than doing so via CA
1528 + row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "RemoveFile");
1529 + row.Set(0, shortcutId);
1530 + row.Set(1, componentId);
1531 + row.Set(2, this.ParseHelper.IsValidShortFilename(name, false) ? name : String.Concat(this.ParseHelper.CreateShortName(name, true, false, directoryId, name), "|", name));
1532 + row.Set(3, directoryId);
1533 + row.Set(4, 2); // msidbRemoveFileInstallModeOnRemove
1534 + }
1535 +
1536 + /// <summary>
1537 + /// Parses a performance category element.
1538 + /// </summary>
1539 + /// <param name="element">Element to parse.</param>
1540 + /// <param name="componentId">Identifier of parent component.</param>
1541 + private void ParsePerformanceCategoryElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId)
1542 + {
1543 + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
1544 + string id = null;
1545 + string name = null;
1546 + string help = null;
1547 + YesNoType multiInstance = YesNoType.No;
1548 + int defaultLanguage = 0x09; // default to "english"
1549 +
1550 + ArrayList parsedPerformanceCounters = new ArrayList();
1551 +
1552 + // default to managed performance counter
1553 + string library = "netfxperf.dll";
1554 + string openEntryPoint = "OpenPerformanceData";
1555 + string collectEntryPoint = "CollectPerformanceData";
1556 + string closeEntryPoint = "ClosePerformanceData";
1557 +
1558 + foreach (XAttribute attrib in element.Attributes())
1559 + {
1560 + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
1561 + {
1562 + switch (attrib.Name.LocalName)
1563 + {
1564 + case "Close":
1565 + closeEntryPoint = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
1566 + break;
1567 + case "Collect":
1568 + collectEntryPoint = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
1569 + break;
1570 + case "DefaultLanguage":
1571 + defaultLanguage = this.GetPerformanceCounterLanguage(sourceLineNumbers, attrib);
1572 + break;
1573 + case "Help":
1574 + help = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
1575 + break;
1576 + case "Id":
1577 + id = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
1578 + break;
1579 + case "Library":
1580 + library = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
1581 + break;
1582 + case "MultiInstance":
1583 + multiInstance = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib);
1584 + break;
1585 + case "Name":
1586 + name = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
1587 + break;
1588 + case "Open":
1589 + openEntryPoint = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
1590 + break;
1591 + default:
1592 + this.ParseHelper.UnexpectedAttribute(element, attrib);
1593 + break;
1594 + }
1595 + }
1596 + else
1597 + {
1598 + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
1599 + }
1600 + }
1601 +
1602 + if (null == id)
1603 + {
1604 + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Id"));
1605 + }
1606 +
1607 + if (null == name)
1608 + {
1609 + name = id;
1610 + }
1611 +
1612 + // Process the child counter elements.
1613 + foreach (XElement child in element.Elements())
1614 + {
1615 + if (this.Namespace == child.Name.Namespace)
1616 + {
1617 + switch (child.Name.LocalName)
1618 + {
1619 + case "PerformanceCounter":
1620 + ParsedPerformanceCounter counter = this.ParsePerformanceCounterElement(intermediate, section, child, defaultLanguage);
1621 + if (null != counter)
1622 + {
1623 + parsedPerformanceCounters.Add(counter);
1624 + }
1625 + break;
1626 + default:
1627 + this.ParseHelper.UnexpectedElement(element, child);
1628 + break;
1629 + }
1630 + }
1631 + else
1632 + {
1633 + this.ParseHelper.ParseExtensionElement(this.Context.Extensions, intermediate, section, element, child);
1634 + }
1635 + }
1636 +
1637 +
1638 + if (!this.Messaging.EncounteredError)
1639 + {
1640 + // Calculate the ini and h file content.
1641 + string objectName = "OBJECT_1";
1642 + string objectLanguage = defaultLanguage.ToString("D3", CultureInfo.InvariantCulture);
1643 +
1644 + StringBuilder sbIniData = new StringBuilder();
1645 + 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);
1646 + sbIniData.AppendFormat("[text]\r\n{0}_{1}_NAME={2}\r\n", objectName, objectLanguage, name);
1647 + if (null != help)
1648 + {
1649 + sbIniData.AppendFormat("{0}_{1}_HELP={2}\r\n", objectName, objectLanguage, help);
1650 + }
1651 +
1652 + int symbolConstantsCounter = 0;
1653 + StringBuilder sbSymbolicConstants = new StringBuilder();
1654 + sbSymbolicConstants.AppendFormat("#define {0} {1}\r\n", objectName, symbolConstantsCounter);
1655 +
1656 + StringBuilder sbCounterNames = new StringBuilder("[~]");
1657 + StringBuilder sbCounterTypes = new StringBuilder("[~]");
1658 + for (int i = 0; i < parsedPerformanceCounters.Count; ++i)
1659 + {
1660 + ParsedPerformanceCounter counter = (ParsedPerformanceCounter)parsedPerformanceCounters[i];
1661 + string counterName = String.Concat("DEVICE_COUNTER_", i + 1);
1662 +
1663 + sbIniData.AppendFormat("{0}_{1}_NAME={2}\r\n", counterName, counter.Language, counter.Name);
1664 + if (null != counter.Help)
1665 + {
1666 + sbIniData.AppendFormat("{0}_{1}_HELP={2}\r\n", counterName, counter.Language, counter.Help);
1667 + }
1668 +
1669 + symbolConstantsCounter += 2;
1670 + sbSymbolicConstants.AppendFormat("#define {0} {1}\r\n", counterName, symbolConstantsCounter);
1671 +
1672 + sbCounterNames.Append(UtilCompiler.FindPropertyBrackets.Replace(counter.Name, this.EscapeProperties));
1673 + sbCounterNames.Append("[~]");
1674 + sbCounterTypes.Append(counter.Type);
1675 + sbCounterTypes.Append("[~]");
1676 + }
1677 +
1678 + sbSymbolicConstants.AppendFormat("#define LAST_{0}_COUNTER_OFFSET {1}\r\n", objectName, symbolConstantsCounter);
1679 +
1680 + // Add the calculated INI and H strings to the PerformanceCategory table.
1681 + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "PerformanceCategory");
1682 + row.Set(0, id);
1683 + row.Set(1, componentId);
1684 + row.Set(2, name);
1685 + row.Set(3, sbIniData.ToString());
1686 + row.Set(4, sbSymbolicConstants.ToString());
1687 +
1688 + // Set up the application's performance key.
1689 + int registryRoot = 2; // HKLM
1690 + string escapedName = UtilCompiler.FindPropertyBrackets.Replace(name, this.EscapeProperties);
1691 + string linkageKey = String.Format(@"SYSTEM\CurrentControlSet\Services\{0}\Linkage", escapedName);
1692 + string performanceKey = String.Format(@"SYSTEM\CurrentControlSet\Services\{0}\Performance", escapedName);
1693 +
1694 + this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, registryRoot, linkageKey, "Export", escapedName, componentId, false);
1695 + this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, registryRoot, performanceKey, "-", null, componentId, false);
1696 + this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, registryRoot, performanceKey, "Library", library, componentId, false);
1697 + this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, registryRoot, performanceKey, "Open", openEntryPoint, componentId, false);
1698 + this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, registryRoot, performanceKey, "Collect", collectEntryPoint, componentId, false);
1699 + this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, registryRoot, performanceKey, "Close", closeEntryPoint, componentId, false);
1700 + this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, registryRoot, performanceKey, "IsMultiInstance", YesNoType.Yes == multiInstance ? "#1" : "#0", componentId, false);
1701 + this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, registryRoot, performanceKey, "Counter Names", sbCounterNames.ToString(), componentId, false);
1702 + this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, registryRoot, performanceKey, "Counter Types", sbCounterTypes.ToString(), componentId, false);
1703 + }
1704 +
1705 + // Reference InstallPerfCounterData and UninstallPerfCounterData since nothing will happen without them
1706 + if (this.Context.Platform == Platform.ARM)
1707 + {
1708 + // Ensure ARM version of the CAs are referenced
1709 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "InstallPerfCounterData_ARM");
1710 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "UninstallPerfCounterData_ARM");
1711 + }
1712 + else
1713 + {
1714 + // All other supported platforms use x86
1715 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "InstallPerfCounterData");
1716 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "UninstallPerfCounterData");
1717 + }
1718 + }
1719 +
1720 + /// <summary>
1721 + /// Gets the performance counter language as a decimal number.
1722 + /// </summary>
1723 + /// <param name="sourceLineNumbers">Source line information about the owner element.</param>
1724 + /// <param name="attribute">The attribute containing the value to get.</param>
1725 + /// <returns>Numeric representation of the language as per WinNT.h.</returns>
1726 + private int GetPerformanceCounterLanguage(SourceLineNumber sourceLineNumbers, XAttribute attribute)
1727 + {
1728 + int language = 0;
1729 + if (String.Empty == attribute.Value)
1730 + {
1731 + this.Messaging.Write(ErrorMessages.IllegalEmptyAttributeValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName));
1732 + }
1733 + else
1734 + {
1735 + switch (attribute.Value)
1736 + {
1737 + case "afrikaans":
1738 + language = 0x36;
1739 + break;
1740 + case "albanian":
1741 + language = 0x1c;
1742 + break;
1743 + case "arabic":
1744 + language = 0x01;
1745 + break;
1746 + case "armenian":
1747 + language = 0x2b;
1748 + break;
1749 + case "assamese":
1750 + language = 0x4d;
1751 + break;
1752 + case "azeri":
1753 + language = 0x2c;
1754 + break;
1755 + case "basque":
1756 + language = 0x2d;
1757 + break;
1758 + case "belarusian":
1759 + language = 0x23;
1760 + break;
1761 + case "bengali":
1762 + language = 0x45;
1763 + break;
1764 + case "bulgarian":
1765 + language = 0x02;
1766 + break;
1767 + case "catalan":
1768 + language = 0x03;
1769 + break;
1770 + case "chinese":
1771 + language = 0x04;
1772 + break;
1773 + case "croatian":
1774 + language = 0x1a;
1775 + break;
1776 + case "czech":
1777 + language = 0x05;
1778 + break;
1779 + case "danish":
1780 + language = 0x06;
1781 + break;
1782 + case "divehi":
1783 + language = 0x65;
1784 + break;
1785 + case "dutch":
1786 + language = 0x13;
1787 + break;
1788 + case "piglatin":
1789 + case "english":
1790 + language = 0x09;
1791 + break;
1792 + case "estonian":
1793 + language = 0x25;
1794 + break;
1795 + case "faeroese":
1796 + language = 0x38;
1797 + break;
1798 + case "farsi":
1799 + language = 0x29;
1800 + break;
1801 + case "finnish":
1802 + language = 0x0b;
1803 + break;
1804 + case "french":
1805 + language = 0x0c;
1806 + break;
1807 + case "galician":
1808 + language = 0x56;
1809 + break;
1810 + case "georgian":
1811 + language = 0x37;
1812 + break;
1813 + case "german":
1814 + language = 0x07;
1815 + break;
1816 + case "greek":
1817 + language = 0x08;
1818 + break;
1819 + case "gujarati":
1820 + language = 0x47;
1821 + break;
1822 + case "hebrew":
1823 + language = 0x0d;
1824 + break;
1825 + case "hindi":
1826 + language = 0x39;
1827 + break;
1828 + case "hungarian":
1829 + language = 0x0e;
1830 + break;
1831 + case "icelandic":
1832 + language = 0x0f;
1833 + break;
1834 + case "indonesian":
1835 + language = 0x21;
1836 + break;
1837 + case "italian":
1838 + language = 0x10;
1839 + break;
1840 + case "japanese":
1841 + language = 0x11;
1842 + break;
1843 + case "kannada":
1844 + language = 0x4b;
1845 + break;
1846 + case "kashmiri":
1847 + language = 0x60;
1848 + break;
1849 + case "kazak":
1850 + language = 0x3f;
1851 + break;
1852 + case "konkani":
1853 + language = 0x57;
1854 + break;
1855 + case "korean":
1856 + language = 0x12;
1857 + break;
1858 + case "kyrgyz":
1859 + language = 0x40;
1860 + break;
1861 + case "latvian":
1862 + language = 0x26;
1863 + break;
1864 + case "lithuanian":
1865 + language = 0x27;
1866 + break;
1867 + case "macedonian":
1868 + language = 0x2f;
1869 + break;
1870 + case "malay":
1871 + language = 0x3e;
1872 + break;
1873 + case "malayalam":
1874 + language = 0x4c;
1875 + break;
1876 + case "manipuri":
1877 + language = 0x58;
1878 + break;
1879 + case "marathi":
1880 + language = 0x4e;
1881 + break;
1882 + case "mongolian":
1883 + language = 0x50;
1884 + break;
1885 + case "nepali":
1886 + language = 0x61;
1887 + break;
1888 + case "norwegian":
1889 + language = 0x14;
1890 + break;
1891 + case "oriya":
1892 + language = 0x48;
1893 + break;
1894 + case "polish":
1895 + language = 0x15;
1896 + break;
1897 + case "portuguese":
1898 + language = 0x16;
1899 + break;
1900 + case "punjabi":
1901 + language = 0x46;
1902 + break;
1903 + case "romanian":
1904 + language = 0x18;
1905 + break;
1906 + case "russian":
1907 + language = 0x19;
1908 + break;
1909 + case "sanskrit":
1910 + language = 0x4f;
1911 + break;
1912 + case "serbian":
1913 + language = 0x1a;
1914 + break;
1915 + case "sindhi":
1916 + language = 0x59;
1917 + break;
1918 + case "slovak":
1919 + language = 0x1b;
1920 + break;
1921 + case "slovenian":
1922 + language = 0x24;
1923 + break;
1924 + case "spanish":
1925 + language = 0x0a;
1926 + break;
1927 + case "swahili":
1928 + language = 0x41;
1929 + break;
1930 + case "swedish":
1931 + language = 0x1d;
1932 + break;
1933 + case "syriac":
1934 + language = 0x5a;
1935 + break;
1936 + case "tamil":
1937 + language = 0x49;
1938 + break;
1939 + case "tatar":
1940 + language = 0x44;
1941 + break;
1942 + case "telugu":
1943 + language = 0x4a;
1944 + break;
1945 + case "thai":
1946 + language = 0x1e;
1947 + break;
1948 + case "turkish":
1949 + language = 0x1f;
1950 + break;
1951 + case "ukrainian":
1952 + language = 0x22;
1953 + break;
1954 + case "urdu":
1955 + language = 0x20;
1956 + break;
1957 + case "uzbek":
1958 + language = 0x43;
1959 + break;
1960 + case "vietnamese":
1961 + language = 0x2a;
1962 + break;
1963 + default:
1964 + this.Messaging.Write(ErrorMessages.IllegalEmptyAttributeValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName));
1965 + break;
1966 + }
1967 + }
1968 +
1969 + return language;
1970 + }
1971 +
1972 + /// <summary>
1973 + /// Parses a performance counter element.
1974 + /// </summary>
1975 + /// <param name="element">Element to parse.</param>
1976 + /// <param name="defaultLanguage">Default language for the performance counter.</param>
1977 + private ParsedPerformanceCounter ParsePerformanceCounterElement(Intermediate intermediate, IntermediateSection section, XElement element, int defaultLanguage)
1978 + {
1979 + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
1980 + ParsedPerformanceCounter parsedPerformanceCounter = null;
1981 + string name = null;
1982 + string help = null;
1983 + System.Diagnostics.PerformanceCounterType type = System.Diagnostics.PerformanceCounterType.NumberOfItems32;
1984 + int language = defaultLanguage;
1985 +
1986 + foreach (XAttribute attrib in element.Attributes())
1987 + {
1988 + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
1989 + {
1990 + switch (attrib.Name.LocalName)
1991 + {
1992 + case "Help":
1993 + help = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
1994 + break;
1995 + case "Name":
1996 + name = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
1997 + break;
1998 + case "Type":
1999 + type = this.GetPerformanceCounterType(sourceLineNumbers, attrib);
2000 + break;
2001 + case "Language":
2002 + language = this.GetPerformanceCounterLanguage(sourceLineNumbers, attrib);
2003 + break;
2004 + default:
2005 + this.ParseHelper.UnexpectedAttribute(element, attrib);
2006 + break;
2007 + }
2008 + }
2009 + else
2010 + {
2011 + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
2012 + }
2013 + }
2014 +
2015 + if (null == name)
2016 + {
2017 + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Name"));
2018 + }
2019 +
2020 + if (null == help)
2021 + {
2022 + this.Messaging.Write(UtilWarnings.RequiredAttributeForWindowsXP(sourceLineNumbers, element.Name.LocalName, "Help"));
2023 + }
2024 +
2025 + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
2026 +
2027 + if (!this.Messaging.EncounteredError)
2028 + {
2029 + parsedPerformanceCounter = new ParsedPerformanceCounter(name, help, type, language);
2030 + }
2031 +
2032 + return parsedPerformanceCounter;
2033 + }
2034 +
2035 + /// <summary>
2036 + /// Gets the performance counter type.
2037 + /// </summary>
2038 + /// <param name="sourceLineNumbers">Source line information about the owner element.</param>
2039 + /// <param name="attribute">The attribute containing the value to get.</param>
2040 + /// <returns>Numeric representation of the language as per WinNT.h.</returns>
2041 + private System.Diagnostics.PerformanceCounterType GetPerformanceCounterType(SourceLineNumber sourceLineNumbers, XAttribute attribute)
2042 + {
2043 + System.Diagnostics.PerformanceCounterType type = System.Diagnostics.PerformanceCounterType.NumberOfItems32;
2044 + if (String.Empty == attribute.Value)
2045 + {
2046 + this.Messaging.Write(ErrorMessages.IllegalEmptyAttributeValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName));
2047 + }
2048 + else
2049 + {
2050 + switch (attribute.Value)
2051 + {
2052 + case "averageBase":
2053 + type = System.Diagnostics.PerformanceCounterType.AverageBase;
2054 + break;
2055 + case "averageCount64":
2056 + type = System.Diagnostics.PerformanceCounterType.AverageCount64;
2057 + break;
2058 + case "averageTimer32":
2059 + type = System.Diagnostics.PerformanceCounterType.AverageTimer32;
2060 + break;
2061 + case "counterDelta32":
2062 + type = System.Diagnostics.PerformanceCounterType.CounterDelta32;
2063 + break;
2064 + case "counterTimerInverse":
2065 + type = System.Diagnostics.PerformanceCounterType.CounterTimerInverse;
2066 + break;
2067 + case "sampleFraction":
2068 + type = System.Diagnostics.PerformanceCounterType.SampleFraction;
2069 + break;
2070 + case "timer100Ns":
2071 + type = System.Diagnostics.PerformanceCounterType.Timer100Ns;
2072 + break;
2073 + case "counterTimer":
2074 + type = System.Diagnostics.PerformanceCounterType.CounterTimer;
2075 + break;
2076 + case "rawFraction":
2077 + type = System.Diagnostics.PerformanceCounterType.RawFraction;
2078 + break;
2079 + case "timer100NsInverse":
2080 + type = System.Diagnostics.PerformanceCounterType.Timer100NsInverse;
2081 + break;
2082 + case "counterMultiTimer":
2083 + type = System.Diagnostics.PerformanceCounterType.CounterMultiTimer;
2084 + break;
2085 + case "counterMultiTimer100Ns":
2086 + type = System.Diagnostics.PerformanceCounterType.CounterMultiTimer100Ns;
2087 + break;
2088 + case "counterMultiTimerInverse":
2089 + type = System.Diagnostics.PerformanceCounterType.CounterMultiTimerInverse;
2090 + break;
2091 + case "counterMultiTimer100NsInverse":
2092 + type = System.Diagnostics.PerformanceCounterType.CounterMultiTimer100NsInverse;
2093 + break;
2094 + case "elapsedTime":
2095 + type = System.Diagnostics.PerformanceCounterType.ElapsedTime;
2096 + break;
2097 + case "sampleBase":
2098 + type = System.Diagnostics.PerformanceCounterType.SampleBase;
2099 + break;
2100 + case "rawBase":
2101 + type = System.Diagnostics.PerformanceCounterType.RawBase;
2102 + break;
2103 + case "counterMultiBase":
2104 + type = System.Diagnostics.PerformanceCounterType.CounterMultiBase;
2105 + break;
2106 + case "rateOfCountsPerSecond64":
2107 + type = System.Diagnostics.PerformanceCounterType.RateOfCountsPerSecond64;
2108 + break;
2109 + case "rateOfCountsPerSecond32":
2110 + type = System.Diagnostics.PerformanceCounterType.RateOfCountsPerSecond32;
2111 + break;
2112 + case "countPerTimeInterval64":
2113 + type = System.Diagnostics.PerformanceCounterType.CountPerTimeInterval64;
2114 + break;
2115 + case "countPerTimeInterval32":
2116 + type = System.Diagnostics.PerformanceCounterType.CountPerTimeInterval32;
2117 + break;
2118 + case "sampleCounter":
2119 + type = System.Diagnostics.PerformanceCounterType.SampleCounter;
2120 + break;
2121 + case "counterDelta64":
2122 + type = System.Diagnostics.PerformanceCounterType.CounterDelta64;
2123 + break;
2124 + case "numberOfItems64":
2125 + type = System.Diagnostics.PerformanceCounterType.NumberOfItems64;
2126 + break;
2127 + case "numberOfItems32":
2128 + type = System.Diagnostics.PerformanceCounterType.NumberOfItems32;
2129 + break;
2130 + case "numberOfItemsHEX64":
2131 + type = System.Diagnostics.PerformanceCounterType.NumberOfItemsHEX64;
2132 + break;
2133 + case "numberOfItemsHEX32":
2134 + type = System.Diagnostics.PerformanceCounterType.NumberOfItemsHEX32;
2135 + break;
2136 + default:
2137 + this.Messaging.Write(ErrorMessages.IllegalEmptyAttributeValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName));
2138 + break;
2139 + }
2140 + }
2141 +
2142 + return type;
2143 + }
2144 +
2145 + /// <summary>
2146 + /// Parses a perf counter element.
2147 + /// </summary>
2148 + /// <param name="element">Element to parse.</param>
2149 + /// <param name="componentId">Identifier of parent component.</param>
2150 + /// <param name="fileId">Identifier of referenced file.</param>
2151 + private void ParsePerfCounterElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, string fileId)
2152 + {
2153 + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
2154 + string name = null;
2155 +
2156 + this.Messaging.Write(UtilWarnings.DeprecatedPerfCounterElement(sourceLineNumbers));
2157 +
2158 + foreach (XAttribute attrib in element.Attributes())
2159 + {
2160 + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
2161 + {
2162 + switch (attrib.Name.LocalName)
2163 + {
2164 + case "Name":
2165 + name = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
2166 + break;
2167 + default:
2168 + this.ParseHelper.UnexpectedAttribute(element, attrib);
2169 + break;
2170 + }
2171 + }
2172 + else
2173 + {
2174 + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
2175 + }
2176 + }
2177 +
2178 + if (null == name)
2179 + {
2180 + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Name"));
2181 + }
2182 +
2183 + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
2184 +
2185 + if (!this.Messaging.EncounteredError)
2186 + {
2187 + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "Perfmon");
2188 + row.Set(0, componentId);
2189 + row.Set(1, $"[#{fileId}]");
2190 + row.Set(2, name);
2191 + }
2192 +
2193 + // Reference ConfigurePerfmonInstall and ConfigurePerfmonUninstall since nothing will happen without them
2194 + if (this.Context.Platform == Platform.ARM)
2195 + {
2196 + // Ensure ARM version of the CAs are referenced
2197 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigurePerfmonInstall_ARM");
2198 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigurePerfmonUninstall_ARM");
2199 + }
2200 + else
2201 + {
2202 + // All other supported platforms use x86
2203 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigurePerfmonInstall");
2204 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigurePerfmonUninstall");
2205 + }
2206 + }
2207 +
2208 +
2209 + /// <summary>
2210 + /// Parses a perf manifest element.
2211 + /// </summary>
2212 + /// <param name="element">Element to parse.</param>
2213 + /// <param name="componentId">Identifier of parent component.</param>
2214 + /// <param name="fileId">Identifier of referenced file.</param>
2215 + private void ParsePerfCounterManifestElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, string fileId)
2216 + {
2217 + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
2218 + string resourceFileDirectory = null;
2219 +
2220 + foreach (XAttribute attrib in element.Attributes())
2221 + {
2222 + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
2223 + {
2224 + switch (attrib.Name.LocalName)
2225 + {
2226 + case "ResourceFileDirectory":
2227 + resourceFileDirectory = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
2228 + break;
2229 + default:
2230 + this.ParseHelper.UnexpectedAttribute(element, attrib);
2231 + break;
2232 + }
2233 + }
2234 + else
2235 + {
2236 + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
2237 + }
2238 + }
2239 +
2240 + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
2241 +
2242 + if (!this.Messaging.EncounteredError)
2243 + {
2244 + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "PerfmonManifest");
2245 + row.Set(0, componentId);
2246 + row.Set(1, $"[#{fileId}]");
2247 + row.Set(2, resourceFileDirectory);
2248 + }
2249 +
2250 + if (this.Context.Platform == Platform.ARM)
2251 + {
2252 + // Ensure ARM version of the CAs are referenced
2253 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigurePerfmonManifestRegister_ARM");
2254 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigurePerfmonManifestUnregister_ARM");
2255 + }
2256 + else
2257 + {
2258 + // All other supported platforms use x86
2259 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigurePerfmonManifestRegister");
2260 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigurePerfmonManifestUnregister");
2261 + }
2262 + }
2263 +
2264 + /// <summary>
2265 + /// Parses a format files element.
2266 + /// </summary>
2267 + /// <param name="element">Element to parse.</param>
2268 + /// <param name="fileId">Identifier of referenced file.</param>
2269 + /// <param name="win64">Flag to determine whether the component is 64-bit.</param>
2270 + private void ParseFormatFileElement(Intermediate intermediate, IntermediateSection section, XElement element, string fileId, bool win64)
2271 + {
2272 + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
2273 + string binaryId = null;
2274 +
2275 + foreach (XAttribute attrib in element.Attributes())
2276 + {
2277 + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
2278 + {
2279 + switch (attrib.Name.LocalName)
2280 + {
2281 + case "BinaryKey":
2282 + binaryId = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
2283 + break;
2284 + default:
2285 + this.ParseHelper.UnexpectedAttribute(element, attrib);
2286 + break;
2287 + }
2288 + }
2289 + else
2290 + {
2291 + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
2292 + }
2293 + }
2294 +
2295 + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
2296 +
2297 + if (null == binaryId)
2298 + {
2299 + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "BinaryKey"));
2300 + }
2301 +
2302 + if (!this.Messaging.EncounteredError)
2303 + {
2304 + switch (this.Context.Platform)
2305 + {
2306 + case Platform.X86:
2307 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixSchedFormatFiles");
2308 + break;
2309 + case Platform.X64:
2310 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixSchedFormatFiles_x64");
2311 + break;
2312 + case Platform.IA64:
2313 + case Platform.ARM:
2314 + this.Messaging.Write(ErrorMessages.UnsupportedPlatformForElement(sourceLineNumbers, this.Context.Platform.ToString(), element.Name.LocalName));
2315 + break;
2316 + }
2317 +
2318 + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixFormatFiles");
2319 + row.Set(0, binaryId);
2320 + row.Set(1, fileId);
2321 +
2322 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "Binary", binaryId);
2323 + }
2324 + }
2325 +
2326 + /// <summary>
2327 + /// Parses a event manifest element.
2328 + /// </summary>
2329 + /// <param name="element">Element to parse.</param>
2330 + /// <param name="componentId">Identifier of parent component.</param>
2331 + /// <param name="fileId">Identifier of referenced file.</param>
2332 + private void ParseEventManifestElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, string fileId)
2333 + {
2334 + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
2335 + string messageFile = null;
2336 + string resourceFile = null;
2337 + string parameterFile = null;
2338 +
2339 + foreach (XAttribute attrib in element.Attributes())
2340 + {
2341 + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
2342 + {
2343 + switch (attrib.Name.LocalName)
2344 + {
2345 + case "MessageFile":
2346 + messageFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
2347 + break;
2348 + case "ResourceFile":
2349 + resourceFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
2350 + break;
2351 + case "ParameterFile":
2352 + parameterFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
2353 + break;
2354 + default:
2355 + this.ParseHelper.UnexpectedAttribute(element, attrib);
2356 + break;
2357 + }
2358 + }
2359 + else
2360 + {
2361 + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
2362 + }
2363 + }
2364 +
2365 + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
2366 +
2367 + if (!this.Messaging.EncounteredError)
2368 + {
2369 + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "EventManifest");
2370 + row.Set(0, componentId);
2371 + row.Set(1, $"[#{fileId}]");
2372 +
2373 + if (null != messageFile)
2374 + {
2375 + var messageRow = this.ParseHelper.CreateRow(section, sourceLineNumbers, "XmlFile");
2376 + messageRow.Set(0, String.Concat("Config_", fileId, "MessageFile"));
2377 + messageRow.Set(1, $"[#{fileId}]");
2378 + messageRow.Set(2, "/*/*/*/*[\\[]@messageFileName[\\]]");
2379 + messageRow.Set(3, "messageFileName");
2380 + messageRow.Set(4, messageFile);
2381 + messageRow.Set(5, 4 | 0x00001000); //bulk write | preserve modified date
2382 + messageRow.Set(6, componentId);
2383 + }
2384 + if (null != parameterFile)
2385 + {
2386 + var resourceRow = this.ParseHelper.CreateRow(section, sourceLineNumbers, "XmlFile");
2387 + resourceRow.Set(0, String.Concat("Config_", fileId, "ParameterFile"));
2388 + resourceRow.Set(1, $"[#{fileId}]");
2389 + resourceRow.Set(2, "/*/*/*/*[\\[]@parameterFileName[\\]]");
2390 + resourceRow.Set(3, "parameterFileName");
2391 + resourceRow.Set(4, parameterFile);
2392 + resourceRow.Set(5, 4 | 0x00001000); //bulk write | preserve modified date
2393 + resourceRow.Set(6, componentId);
2394 + }
2395 + if (null != resourceFile)
2396 + {
2397 + var resourceRow = this.ParseHelper.CreateRow(section, sourceLineNumbers, "XmlFile");
2398 + resourceRow.Set(0, String.Concat("Config_", fileId, "ResourceFile"));
2399 + resourceRow.Set(1, $"[#{fileId}]");
2400 + resourceRow.Set(2, "/*/*/*/*[\\[]@resourceFileName[\\]]");
2401 + resourceRow.Set(3, "resourceFileName");
2402 + resourceRow.Set(4, resourceFile);
2403 + resourceRow.Set(5, 4 | 0x00001000); //bulk write | preserve modified date
2404 + resourceRow.Set(6, componentId);
2405 + }
2406 +
2407 + }
2408 +
2409 + if (this.Context.Platform == Platform.ARM)
2410 + {
2411 + // Ensure ARM version of the CA is referenced
2412 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigureEventManifestRegister_ARM");
2413 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigureEventManifestUnregister_ARM");
2414 + }
2415 + else
2416 + {
2417 + // All other supported platforms use x86
2418 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigureEventManifestRegister");
2419 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigureEventManifestUnregister");
2420 + }
2421 +
2422 + if (null != messageFile || null != parameterFile || null != resourceFile)
2423 + {
2424 + if (this.Context.Platform == Platform.ARM)
2425 + {
2426 + // Ensure ARM version of the CA is referenced
2427 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedXmlFile_ARM");
2428 + }
2429 + else
2430 + {
2431 + // All other supported platforms use x86
2432 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedXmlFile");
2433 + }
2434 + }
2435 + }
2436 +
2437 + /// <summary>
2438 + /// Parses a PermissionEx element.
2439 + /// </summary>
2440 + /// <param name="element">Element to parse.</param>
2441 + /// <param name="objectId">Identifier of object to be secured.</param>
2442 + /// <param name="componentId">Identifier of component, used to determine install state.</param>
2443 + /// <param name="win64">Flag to determine whether the component is 64-bit.</param>
2444 + /// <param name="tableName">Name of table that contains objectId.</param>
2445 + private void ParsePermissionExElement(Intermediate intermediate, IntermediateSection section, XElement element, string objectId, string componentId, bool win64, string tableName)
2446 + {
2447 + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
2448 + BitArray bits = new BitArray(32);
2449 + string domain = null;
2450 + int permission = 0;
2451 + string[] specialPermissions = null;
2452 + string user = null;
2453 +
2454 + PermissionType permissionType = PermissionType.SecureObjects;
2455 +
2456 + switch (tableName)
2457 + {
2458 + case "CreateFolder":
2459 + specialPermissions = UtilConstants.FolderPermissions;
2460 + break;
2461 + case "File":
2462 + specialPermissions = UtilConstants.FilePermissions;
2463 + break;
2464 + case "Registry":
2465 + specialPermissions = UtilConstants.RegistryPermissions;
2466 + if (String.IsNullOrEmpty(objectId))
2467 + {
2468 + this.Messaging.Write(UtilErrors.InvalidRegistryObject(sourceLineNumbers, element.Parent.Name.LocalName));
2469 + }
2470 + break;
2471 + case "ServiceInstall":
2472 + specialPermissions = UtilConstants.ServicePermissions;
2473 + permissionType = PermissionType.SecureObjects;
2474 + break;
2475 + default:
2476 + this.ParseHelper.UnexpectedElement(element.Parent, element);
2477 + break;
2478 + }
2479 +
2480 + foreach (XAttribute attrib in element.Attributes())
2481 + {
2482 + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
2483 + {
2484 + switch (attrib.Name.LocalName)
2485 + {
2486 + case "Domain":
2487 + if (PermissionType.FileSharePermissions == permissionType)
2488 + {
2489 + this.Messaging.Write(ErrorMessages.IllegalAttributeWhenNested(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName, element.Parent.Name.LocalName));
2490 + }
2491 + domain = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
2492 + break;
2493 + case "User":
2494 + user = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
2495 + break;
2496 + default:
2497 + YesNoType attribValue = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib);
2498 + if (!this.TrySetBitFromName(UtilConstants.StandardPermissions, attrib.Name.LocalName, attribValue, bits, 16))
2499 + {
2500 + if (!this.TrySetBitFromName(UtilConstants.GenericPermissions, attrib.Name.LocalName, attribValue, bits, 28))
2501 + {
2502 + if (!this.TrySetBitFromName(specialPermissions, attrib.Name.LocalName, attribValue, bits, 0))
2503 + {
2504 + this.ParseHelper.UnexpectedAttribute(element, attrib);
2505 + break;
2506 + }
2507 + }
2508 + }
2509 + break;
2510 + }
2511 + }
2512 + else
2513 + {
2514 + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
2515 + }
2516 + }
2517 +
2518 + permission = this.CreateIntegerFromBitArray(bits);
2519 +
2520 + if (null == user)
2521 + {
2522 + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "User"));
2523 + }
2524 +
2525 + if (int.MinValue == permission) // just GENERIC_READ, which is MSI_NULL
2526 + {
2527 + this.Messaging.Write(ErrorMessages.GenericReadNotAllowed(sourceLineNumbers));
2528 + }
2529 +
2530 + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
2531 +
2532 + if (!this.Messaging.EncounteredError)
2533 + {
2534 + if (win64)
2535 + {
2536 + if (this.Context.Platform == Platform.IA64)
2537 + {
2538 + this.Messaging.Write(ErrorMessages.UnsupportedPlatformForElement(sourceLineNumbers, "ia64", element.Name.LocalName));
2539 + }
2540 + else
2541 + {
2542 + // Ensure SchedSecureObjects (x64) is referenced
2543 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedSecureObjects_x64");
2544 + }
2545 + }
2546 + else if (this.Context.Platform == Platform.ARM)
2547 + {
2548 + // Ensure SchedSecureObjects (arm) is referenced
2549 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedSecureObjects_ARM");
2550 + }
2551 + else
2552 + {
2553 + // Ensure SchedSecureObjects (x86) is referenced, to handle this x86 component member
2554 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedSecureObjects");
2555 + }
2556 +
2557 + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "SecureObjects");
2558 + row.Set(0, objectId);
2559 + row.Set(1, tableName);
2560 + row.Set(2, domain);
2561 + row.Set(3, user);
2562 + row.Set(4, permission);
2563 + row.Set(5, componentId);
2564 + }
2565 + }
2566 +
2567 + /// <summary>
2568 + /// Parses a ProductSearch element.
2569 + /// </summary>
2570 + /// <param name="element">Element to parse.</param>
2571 + private void ParseProductSearchElement(Intermediate intermediate, IntermediateSection section, XElement element)
2572 + {
2573 + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
2574 + Identifier id = null;
2575 + string variable = null;
2576 + string condition = null;
2577 + string after = null;
2578 + string productCode = null;
2579 + string upgradeCode = null;
2580 +
2581 + Serialize.ProductSearch.ResultType result = Serialize.ProductSearch.ResultType.NotSet;
2582 +
2583 + foreach (XAttribute attrib in element.Attributes())
2584 + {
2585 + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
2586 + {
2587 + switch (attrib.Name.LocalName)
2588 + {
2589 + case "Id":
2590 + case "Variable":
2591 + case "Condition":
2592 + case "After":
2593 + this.ParseCommonSearchAttributes(sourceLineNumbers, attrib, ref id, ref variable, ref condition, ref after);
2594 + break;
2595 + case "ProductCode":
2596 + productCode = this.ParseHelper.GetAttributeGuidValue(sourceLineNumbers, attrib, false);
2597 + break;
2598 + case "UpgradeCode":
2599 + upgradeCode = this.ParseHelper.GetAttributeGuidValue(sourceLineNumbers, attrib, false);
2600 + break;
2601 + case "Result":
2602 + string resultValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
2603 + if (!Serialize.ProductSearch.TryParseResultType(resultValue, out result))
2604 + {
2605 + this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, attrib.Parent.Name.LocalName, attrib.Name.LocalName,
2606 + resultValue,
2607 + Serialize.ProductSearch.ResultType.version.ToString(),
2608 + Serialize.ProductSearch.ResultType.language.ToString(),
2609 + Serialize.ProductSearch.ResultType.state.ToString(),
2610 + Serialize.ProductSearch.ResultType.assignment.ToString()));
2611 + }
2612 + break;
2613 + default:
2614 + this.ParseHelper.UnexpectedAttribute(element, attrib);
2615 + break;
2616 + }
2617 + }
2618 + else
2619 + {
2620 + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
2621 + }
2622 + }
2623 +
2624 + if (null == variable)
2625 + {
2626 + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Variable"));
2627 + }
2628 +
2629 + if (null == upgradeCode && null == productCode)
2630 + {
2631 + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "ProductCode", "UpgradeCode", true));
2632 + }
2633 +
2634 + if (null != upgradeCode && null != productCode)
2635 + {
2636 + this.Messaging.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, element.Name.LocalName, "UpgradeCode", "ProductCode"));
2637 + }
2638 +
2639 + if (null == id)
2640 + {
2641 + id = this.ParseHelper.CreateIdentifier("wps", variable, condition, after, (productCode == null ? upgradeCode : productCode), result.ToString());
2642 + }
2643 +
2644 + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
2645 +
2646 + if (!this.Messaging.EncounteredError)
2647 + {
2648 + this.CreateWixSearchRow(section, sourceLineNumbers, id, variable, condition);
2649 + if (after != null)
2650 + {
2651 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "WixSearch", after);
2652 + // TODO: We're currently defaulting to "always run after", which we will need to change...
2653 + this.CreateWixSearchRelationRow(section, sourceLineNumbers, id, after, 2);
2654 + }
2655 +
2656 + WixProductSearchAttributes attributes = WixProductSearchAttributes.Version;
2657 + switch (result)
2658 + {
2659 + case Serialize.ProductSearch.ResultType.version:
2660 + attributes = WixProductSearchAttributes.Version;
2661 + break;
2662 + case Serialize.ProductSearch.ResultType.language:
2663 + attributes = WixProductSearchAttributes.Language;
2664 + break;
2665 + case Serialize.ProductSearch.ResultType.state:
2666 + attributes = WixProductSearchAttributes.State;
2667 + break;
2668 + case Serialize.ProductSearch.ResultType.assignment:
2669 + attributes = WixProductSearchAttributes.Assignment;
2670 + break;
2671 + }
2672 +
2673 + // set an additional flag if this is an upgrade code
2674 + if (null != upgradeCode)
2675 + {
2676 + attributes |= WixProductSearchAttributes.UpgradeCode;
2677 + }
2678 +
2679 + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixProductSearch");
2680 + row.Set(0, id);
2681 + row.Set(1, productCode ?? upgradeCode);
2682 + row.Set(2, (int)attributes);
2683 + }
2684 + }
2685 +
2686 + /// <summary>
2687 + /// Parses a RegistrySearch element.
2688 + /// </summary>
2689 + /// <param name="element">Element to parse.</param>
2690 + private void ParseRegistrySearchElement(Intermediate intermediate, IntermediateSection section, XElement element)
2691 + {
2692 + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
2693 + Identifier id = null;
2694 + string variable = null;
2695 + string condition = null;
2696 + string after = null;
2697 + int root = CompilerConstants.IntegerNotSet;
2698 + string key = null;
2699 + string value = null;
2700 + YesNoType expand = YesNoType.NotSet;
2701 + YesNoType win64 = YesNoType.NotSet;
2702 + Serialize.RegistrySearch.ResultType result = Serialize.RegistrySearch.ResultType.NotSet;
2703 + Serialize.RegistrySearch.FormatType format = Serialize.RegistrySearch.FormatType.raw;
2704 +
2705 + foreach (XAttribute attrib in element.Attributes())
2706 + {
2707 + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
2708 + {
2709 + switch (attrib.Name.LocalName)
2710 + {
2711 + case "Id":
2712 + case "Variable":
2713 + case "Condition":
2714 + case "After":
2715 + this.ParseCommonSearchAttributes(sourceLineNumbers, attrib, ref id, ref variable, ref condition, ref after);
2716 + break;
2717 + case "Root":
2718 + root = this.ParseHelper.GetAttributeMsidbRegistryRootValue(sourceLineNumbers, attrib, false);
2719 + break;
2720 + case "Key":
2721 + key = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
2722 + break;
2723 + case "Value":
2724 + value = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
2725 + break;
2726 + case "ExpandEnvironmentVariables":
2727 + expand = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib);
2728 + break;
2729 + case "Format":
2730 + string formatValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
2731 + if (!String.IsNullOrEmpty(formatValue))
2732 + {
2733 + if (!Serialize.RegistrySearch.TryParseFormatType(formatValue, out format))
2734 + {
2735 + this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, attrib.Parent.Name.LocalName, attrib.Name.LocalName,
2736 + formatValue, Serialize.RegistrySearch.FormatType.raw.ToString(), Serialize.RegistrySearch.FormatType.compatible.ToString()));
2737 + }
2738 + }
2739 + break;
2740 + case "Result":
2741 + string resultValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
2742 + if (!Serialize.RegistrySearch.TryParseResultType(resultValue, out result))
2743 + {
2744 + this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, attrib.Parent.Name.LocalName, attrib.Name.LocalName,
2745 + resultValue, Serialize.RegistrySearch.ResultType.exists.ToString(), Serialize.RegistrySearch.ResultType.value.ToString()));
2746 + }
2747 + break;
2748 + case "Win64":
2749 + win64 = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib);
2750 + break;
2751 + default:
2752 + this.ParseHelper.UnexpectedAttribute(element, attrib);
2753 + break;
2754 + }
2755 + }
2756 + else
2757 + {
2758 + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
2759 + }
2760 + }
2761 +
2762 + if (null == variable)
2763 + {
2764 + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Variable"));
2765 + }
2766 +
2767 + if (CompilerConstants.IntegerNotSet == root)
2768 + {
2769 + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Root"));
2770 + }
2771 +
2772 + if (null == key)
2773 + {
2774 + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Key"));
2775 + }
2776 +
2777 + if (Serialize.RegistrySearch.ResultType.NotSet == result)
2778 + {
2779 + result = Serialize.RegistrySearch.ResultType.value;
2780 + }
2781 +
2782 + if (null == id)
2783 + {
2784 + id = this.ParseHelper.CreateIdentifier("wrs", variable, condition, after, root.ToString(), key, value, result.ToString());
2785 + }
2786 +
2787 + WixRegistrySearchAttributes attributes = WixRegistrySearchAttributes.Raw;
2788 + switch (format)
2789 + {
2790 + case Serialize.RegistrySearch.FormatType.raw:
2791 + attributes = WixRegistrySearchAttributes.Raw;
2792 + break;
2793 + case Serialize.RegistrySearch.FormatType.compatible:
2794 + attributes = WixRegistrySearchAttributes.Compatible;
2795 + break;
2796 + }
2797 +
2798 + switch (result)
2799 + {
2800 + case Serialize.RegistrySearch.ResultType.exists:
2801 + attributes |= WixRegistrySearchAttributes.WantExists;
2802 + break;
2803 + case Serialize.RegistrySearch.ResultType.value:
2804 + attributes |= WixRegistrySearchAttributes.WantValue;
2805 + break;
2806 + }
2807 +
2808 + if (expand == YesNoType.Yes)
2809 + {
2810 + if (0 != (attributes & WixRegistrySearchAttributes.WantExists))
2811 + {
2812 + this.Messaging.Write(ErrorMessages.IllegalAttributeValueWithOtherAttribute(sourceLineNumbers, element.Name.LocalName,
2813 + "ExpandEnvironmentVariables", expand.ToString(), "Result", result.ToString()));
2814 + }
2815 +
2816 + attributes |= WixRegistrySearchAttributes.ExpandEnvironmentVariables;
2817 + }
2818 +
2819 + if (win64 == YesNoType.Yes)
2820 + {
2821 + attributes |= WixRegistrySearchAttributes.Win64;
2822 + }
2823 +
2824 + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
2825 +
2826 + if (!this.Messaging.EncounteredError)
2827 + {
2828 + this.CreateWixSearchRow(section, sourceLineNumbers, id, variable, condition);
2829 + if (after != null)
2830 + {
2831 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "WixSearch", after);
2832 + // TODO: We're currently defaulting to "always run after", which we will need to change...
2833 + this.CreateWixSearchRelationRow(section, sourceLineNumbers, id, after, 2);
2834 + }
2835 +
2836 + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixRegistrySearch", id);
2837 + row.Set(1, root);
2838 + row.Set(2, key);
2839 + row.Set(3, value);
2840 + row.Set(4, (int)attributes);
2841 + }
2842 + }
2843 +
2844 + /// <summary>
2845 + /// Parses a RemoveFolderEx element.
2846 + /// </summary>
2847 + /// <param name="element">Element to parse.</param>
2848 + /// <param name="componentId">Identifier of parent component.</param>
2849 + private void ParseRemoveFolderExElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId)
2850 + {
2851 + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
2852 + Identifier id = null;
2853 + int on = (int)WixRemoveFolderExOn.Uninstall;
2854 + string property = null;
2855 +
2856 + foreach (XAttribute attrib in element.Attributes())
2857 + {
2858 + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
2859 + {
2860 + switch (attrib.Name.LocalName)
2861 + {
2862 + case "Id":
2863 + id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib);
2864 + break;
2865 + case "On":
2866 + string onValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
2867 + if (onValue.Length == 0)
2868 + {
2869 + on = CompilerConstants.IllegalInteger;
2870 + }
2871 + else
2872 + {
2873 + switch (onValue)
2874 + {
2875 + case "install":
2876 + on = (int)WixRemoveFolderExOn.Install;
2877 + break;
2878 + case "uninstall":
2879 + on = (int)WixRemoveFolderExOn.Uninstall;
2880 + break;
2881 + case "both":
2882 + on = (int)WixRemoveFolderExOn.Both;
2883 + break;
2884 + default:
2885 + this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, "On", onValue, "install", "uninstall", "both"));
2886 + on = CompilerConstants.IllegalInteger;
2887 + break;
2888 + }
2889 + }
2890 + break;
2891 + case "Property":
2892 + property = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
2893 + break;
2894 + default:
2895 + this.ParseHelper.UnexpectedAttribute(element, attrib);
2896 + break;
2897 + }
2898 + }
2899 + else
2900 + {
2901 + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
2902 + }
2903 + }
2904 +
2905 + if (String.IsNullOrEmpty(property))
2906 + {
2907 + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Property"));
2908 + }
2909 +
2910 + if (null == id)
2911 + {
2912 + id = this.ParseHelper.CreateIdentifier("wrf", componentId, property, on.ToString(CultureInfo.InvariantCulture.NumberFormat));
2913 + }
2914 +
2915 + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
2916 +
2917 + if (!this.Messaging.EncounteredError)
2918 + {
2919 + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixRemoveFolderEx", id);
2920 + row.Set(1, componentId);
2921 + row.Set(2, property);
2922 + row.Set(3, on);
2923 +
2924 + this.ParseHelper.EnsureTable(section, sourceLineNumbers, "RemoveFile");
2925 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixRemoveFoldersEx");
2926 + }
2927 + }
2928 +
2929 + /// <summary>
2930 + /// Parses a RestartResource element.
2931 + /// </summary>
2932 + /// <param name="element">The element to parse.</param>
2933 + /// <param name="componentId">The identity of the parent component.</param>
2934 + private void ParseRestartResourceElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId)
2935 + {
2936 + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
2937 + Identifier id = null;
2938 + string resource = null;
2939 + int attributes = CompilerConstants.IntegerNotSet;
2940 +
2941 + foreach (XAttribute attrib in element.Attributes())
2942 + {
2943 + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
2944 + {
2945 + switch (attrib.Name.LocalName)
2946 + {
2947 + case "Id":
2948 + id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib);
2949 + break;
2950 +
2951 + case "Path":
2952 + resource = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
2953 + attributes = (int)WixRestartResourceAttributes.Filename;
2954 + break;
2955 +
2956 + case "ProcessName":
2957 + resource = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
2958 + attributes = (int)WixRestartResourceAttributes.ProcessName;
2959 + break;
2960 +
2961 + case "ServiceName":
2962 + resource = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
2963 + attributes = (int)WixRestartResourceAttributes.ServiceName;
2964 + break;
2965 +
2966 + default:
2967 + this.ParseHelper.UnexpectedAttribute(element, attrib);
2968 + break;
2969 + }
2970 + }
2971 + else
2972 + {
2973 + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
2974 + }
2975 + }
2976 +
2977 + // Validate the attribute.
2978 + if (null == id)
2979 + {
2980 + id = this.ParseHelper.CreateIdentifier("wrr", componentId, resource, attributes.ToString());
2981 + }
2982 +
2983 + if (String.IsNullOrEmpty(resource) || CompilerConstants.IntegerNotSet == attributes)
2984 + {
2985 + this.Messaging.Write(ErrorMessages.ExpectedAttributes(sourceLineNumbers, element.Name.LocalName, "Path", "ServiceName"));
2986 + }
2987 +
2988 + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
2989 +
2990 + if (!this.Messaging.EncounteredError)
2991 + {
2992 + // Add a reference to the WixRegisterRestartResources custom action since nothing will happen without it.
2993 + if (this.Context.Platform == Platform.ARM)
2994 + {
2995 + // Ensure ARM version of the CA is referenced
2996 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixRegisterRestartResources_ARM");
2997 + }
2998 + else
2999 + {
3000 + // All other supported platforms use x86
3001 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixRegisterRestartResources");
3002 + }
3003 +
3004 + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixRestartResource", id);
3005 + row.Set(1, componentId);
3006 + row.Set(2, resource);
3007 + row.Set(3, attributes);
3008 + }
3009 + }
3010 +
3011 + /// <summary>
3012 + /// Parses a service configuration element.
3013 + /// </summary>
3014 + /// <param name="element">Element to parse.</param>
3015 + /// <param name="componentId">Identifier of parent component.</param>
3016 + /// <param name="parentTableName">Name of parent element.</param>
3017 + /// <param name="parentTableServiceName">Optional name of service </param>
3018 + private void ParseServiceConfigElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, string parentTableName, string parentTableServiceName)
3019 + {
3020 + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
3021 + string firstFailureActionType = null;
3022 + bool newService = false;
3023 + string programCommandLine = null;
3024 + string rebootMessage = null;
3025 + int resetPeriod = CompilerConstants.IntegerNotSet;
3026 + int restartServiceDelay = CompilerConstants.IntegerNotSet;
3027 + string secondFailureActionType = null;
3028 + string serviceName = null;
3029 + string thirdFailureActionType = null;
3030 +
3031 + foreach (XAttribute attrib in element.Attributes())
3032 + {
3033 + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
3034 + {
3035 + switch (attrib.Name.LocalName)
3036 + {
3037 + case "FirstFailureActionType":
3038 + firstFailureActionType = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
3039 + break;
3040 + case "ProgramCommandLine":
3041 + programCommandLine = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
3042 + break;
3043 + case "RebootMessage":
3044 + rebootMessage = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
3045 + break;
3046 + case "ResetPeriodInDays":
3047 + resetPeriod = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, int.MaxValue);
3048 + break;
3049 + case "RestartServiceDelayInSeconds":
3050 + restartServiceDelay = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, int.MaxValue);
3051 + break;
3052 + case "SecondFailureActionType":
3053 + secondFailureActionType = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
3054 + break;
3055 + case "ServiceName":
3056 + serviceName = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
3057 + break;
3058 + case "ThirdFailureActionType":
3059 + thirdFailureActionType = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
3060 + break;
3061 + default:
3062 + this.ParseHelper.UnexpectedAttribute(element, attrib);
3063 + break;
3064 + }
3065 + }
3066 + else
3067 + {
3068 + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
3069 + }
3070 + }
3071 +
3072 + // if this element is a child of ServiceInstall then ignore the service name provided.
3073 + if ("ServiceInstall" == parentTableName)
3074 + {
3075 + // TODO: the ServiceName attribute should not be allowed in this case (the overwriting behavior may confuse users)
3076 + serviceName = parentTableServiceName;
3077 + newService = true;
3078 + }
3079 + else
3080 + {
3081 + // not a child of ServiceInstall, so ServiceName must have been provided
3082 + if (null == serviceName)
3083 + {
3084 + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "ServiceName"));
3085 + }
3086 + }
3087 +
3088 + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
3089 +
3090 + // Reference SchedServiceConfig since nothing will happen without it
3091 + if (this.Context.Platform == Platform.ARM)
3092 + {
3093 + // Ensure ARM version of the CA is referenced
3094 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedServiceConfig_ARM");
3095 + }
3096 + else
3097 + {
3098 + // All other supported platforms use x86
3099 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedServiceConfig");
3100 + }
3101 +
3102 + if (!this.Messaging.EncounteredError)
3103 + {
3104 + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "ServiceConfig");
3105 + row.Set(0, serviceName);
3106 + row.Set(1, componentId);
3107 + row.Set(2, (newService ? 1 : 0));
3108 + row.Set(3, firstFailureActionType);
3109 + row.Set(4, secondFailureActionType);
3110 + row.Set(5, thirdFailureActionType);
3111 + if (CompilerConstants.IntegerNotSet != resetPeriod)
3112 + {
3113 + row.Set(6, resetPeriod);
3114 + }
3115 +
3116 + if (CompilerConstants.IntegerNotSet != restartServiceDelay)
3117 + {
3118 + row.Set(7, restartServiceDelay);
3119 + }
3120 + row.Set(8, programCommandLine);
3121 + row.Set(9, rebootMessage);
3122 + }
3123 + }
3124 +
3125 + /// <summary>
3126 + /// Parses a touch file element.
3127 + /// </summary>
3128 + /// <param name="element">Element to parse.</param>
3129 + /// <param name="componentId">Identifier of parent component.</param>
3130 + /// <param name="win64">Indicates whether the path is a 64-bit path.</param>
3131 + private void ParseTouchFileElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, bool win64)
3132 + {
3133 + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
3134 + Identifier id = null;
3135 + string path = null;
3136 + YesNoType onInstall = YesNoType.NotSet;
3137 + YesNoType onReinstall = YesNoType.NotSet;
3138 + YesNoType onUninstall = YesNoType.NotSet;
3139 + YesNoType nonvital = YesNoType.NotSet;
3140 + int attributes = 0;
3141 +
3142 + foreach (XAttribute attrib in element.Attributes())
3143 + {
3144 + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
3145 + {
3146 + switch (attrib.Name.LocalName)
3147 + {
3148 + case "Id":
3149 + id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib);
3150 + break;
3151 + case "Path":
3152 + path = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
3153 + break;
3154 + case "OnInstall":
3155 + onInstall = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib);
3156 + break;
3157 + case "OnReinstall":
3158 + onReinstall = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib);
3159 + break;
3160 + case "OnUninstall":
3161 + onUninstall = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib);
3162 + break;
3163 + case "Nonvital":
3164 + nonvital = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib);
3165 + break;
3166 + default:
3167 + this.ParseHelper.UnexpectedAttribute(element, attrib);
3168 + break;
3169 + }
3170 + }
3171 + else
3172 + {
3173 + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
3174 + }
3175 + }
3176 +
3177 + if (null == path)
3178 + {
3179 + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Path"));
3180 + }
3181 +
3182 + // If none of the scheduling actions are set, default to touching on install and reinstall.
3183 + if (YesNoType.NotSet == onInstall && YesNoType.NotSet == onReinstall && YesNoType.NotSet == onUninstall)
3184 + {
3185 + onInstall = YesNoType.Yes;
3186 + onReinstall = YesNoType.Yes;
3187 + }
3188 +
3189 + attributes |= YesNoType.Yes == onInstall ? 0x1 : 0;
3190 + attributes |= YesNoType.Yes == onReinstall ? 0x2 : 0;
3191 + attributes |= YesNoType.Yes == onUninstall ? 0x4 : 0;
3192 + attributes |= win64 ? 0x10 : 0;
3193 + attributes |= YesNoType.Yes == nonvital ? 0 : 0x20;
3194 +
3195 + if (null == id)
3196 + {
3197 + id = this.ParseHelper.CreateIdentifier("tf", path, attributes.ToString());
3198 + }
3199 +
3200 + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
3201 +
3202 + if (!this.Messaging.EncounteredError)
3203 + {
3204 + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixTouchFile", id);
3205 + row.Set(1, componentId);
3206 + row.Set(2, path);
3207 + row.Set(3, attributes);
3208 +
3209 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixTouchFileDuringInstall");
3210 + }
3211 + }
3212 +
3213 + /// <summary>
3214 + /// Parses an user element.
3215 + /// </summary>
3216 + /// <param name="element">Element to parse.</param>
3217 + /// <param name="componentId">Optional identifier of parent component.</param>
3218 + private void ParseUserElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId)
3219 + {
3220 + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
3221 + Identifier id = null;
3222 + int attributes = 0;
3223 + string domain = null;
3224 + string name = null;
3225 + string password = null;
3226 +
3227 + foreach (XAttribute attrib in element.Attributes())
3228 + {
3229 + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
3230 + {
3231 + switch (attrib.Name.LocalName)
3232 + {
3233 + case "Id":
3234 + id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib);
3235 + break;
3236 + case "CanNotChangePassword":
3237 + if (null == componentId)
3238 + {
3239 + this.Messaging.Write(UtilErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName));
3240 + }
3241 +
3242 + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
3243 + {
3244 + attributes |= UserPasswdCantChange;
3245 + }
3246 + break;
3247 + case "CreateUser":
3248 + if (null == componentId)
3249 + {
3250 + this.Messaging.Write(UtilErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName));
3251 + }
3252 +
3253 + if (YesNoType.No == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
3254 + {
3255 + attributes |= UserDontCreateUser;
3256 + }
3257 + break;
3258 + case "Disabled":
3259 + if (null == componentId)
3260 + {
3261 + this.Messaging.Write(UtilErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName));
3262 + }
3263 +
3264 + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
3265 + {
3266 + attributes |= UserDisableAccount;
3267 + }
3268 + break;
3269 + case "Domain":
3270 + domain = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
3271 + break;
3272 + case "FailIfExists":
3273 + if (null == componentId)
3274 + {
3275 + this.Messaging.Write(UtilErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName));
3276 + }
3277 +
3278 + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
3279 + {
3280 + attributes |= UserFailIfExists;
3281 + }
3282 + break;
3283 + case "LogonAsService":
3284 + if (null == componentId)
3285 + {
3286 + this.Messaging.Write(UtilErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName));
3287 + }
3288 + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
3289 + {
3290 + attributes |= UserLogonAsService;
3291 + }
3292 + break;
3293 + case "LogonAsBatchJob":
3294 + if (null == componentId)
3295 + {
3296 + this.Messaging.Write(UtilErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName));
3297 + }
3298 + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
3299 + {
3300 + attributes |= UserLogonAsBatchJob;
3301 + }
3302 + break;
3303 + case "Name":
3304 + name = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
3305 + break;
3306 + case "Password":
3307 + password = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
3308 + break;
3309 + case "PasswordExpired":
3310 + if (null == componentId)
3311 + {
3312 + this.Messaging.Write(UtilErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName));
3313 + }
3314 +
3315 + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
3316 + {
3317 + attributes |= UserPasswdChangeReqdOnLogin;
3318 + }
3319 + break;
3320 + case "PasswordNeverExpires":
3321 + if (null == componentId)
3322 + {
3323 + this.Messaging.Write(UtilErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName));
3324 + }
3325 +
3326 + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
3327 + {
3328 + attributes |= UserDontExpirePasswrd;
3329 + }
3330 + break;
3331 + case "RemoveOnUninstall":
3332 + if (null == componentId)
3333 + {
3334 + this.Messaging.Write(UtilErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName));
3335 + }
3336 +
3337 + if (YesNoType.No == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
3338 + {
3339 + attributes |= UserDontRemoveOnUninstall;
3340 + }
3341 + break;
3342 + case "UpdateIfExists":
3343 + if (null == componentId)
3344 + {
3345 + this.Messaging.Write(UtilErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName));
3346 + }
3347 +
3348 + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
3349 + {
3350 + attributes |= UserUpdateIfExists;
3351 + }
3352 + break;
3353 + case "Vital":
3354 + if (null == componentId)
3355 + {
3356 + this.Messaging.Write(UtilErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName));
3357 + }
3358 +
3359 + if (YesNoType.No == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
3360 + {
3361 + attributes |= UserNonVital;
3362 + }
3363 + break;
3364 + default:
3365 + this.ParseHelper.UnexpectedAttribute(element, attrib);
3366 + break;
3367 + }
3368 + }
3369 + else
3370 + {
3371 + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
3372 + }
3373 + }
3374 +
3375 + if (null == id)
3376 + {
3377 + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Id"));
3378 + }
3379 +
3380 + if (null == name)
3381 + {
3382 + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Name"));
3383 + }
3384 +
3385 + foreach (XElement child in element.Elements())
3386 + {
3387 + if (this.Namespace == child.Name.Namespace)
3388 + {
3389 + switch (child.Name.LocalName)
3390 + {
3391 + case "GroupRef":
3392 + if (null == componentId)
3393 + {
3394 + SourceLineNumber childSourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(child);
3395 + this.Messaging.Write(UtilErrors.IllegalElementWithoutComponent(childSourceLineNumbers, child.Name.LocalName));
3396 + }
3397 +
3398 + this.ParseGroupRefElement(intermediate, section, child, id.Id);
3399 + break;
3400 + default:
3401 + this.ParseHelper.UnexpectedElement(element, child);
3402 + break;
3403 + }
3404 + }
3405 + else
3406 + {
3407 + this.ParseHelper.ParseExtensionElement(this.Context.Extensions, intermediate, section, element, child);
3408 + }
3409 + }
3410 +
3411 + if (null != componentId)
3412 + {
3413 + // Reference ConfigureIIs since nothing will happen without it
3414 + if (this.Context.Platform == Platform.ARM)
3415 + {
3416 + // Ensure ARM version of the CA is referenced
3417 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigureUsers_ARM");
3418 + }
3419 + else
3420 + {
3421 + // All other supported platforms use x86
3422 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigureUsers");
3423 + }
3424 + }
3425 +
3426 + if (!this.Messaging.EncounteredError)
3427 + {
3428 + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "User", id);
3429 + row.Set(1, componentId);
3430 + row.Set(2, name);
3431 + row.Set(3, domain);
3432 + row.Set(4, password);
3433 + row.Set(5, attributes);
3434 + }
3435 + }
3436 +
3437 + /// <summary>
3438 + /// Parses a XmlFile element.
3439 + /// </summary>
3440 + /// <param name="element">Element to parse.</param>
3441 + /// <param name="componentId">Identifier of parent component.</param>
3442 + private void ParseXmlFileElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId)
3443 + {
3444 + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
3445 + string id = null;
3446 + string file = null;
3447 + string elementPath = null;
3448 + string name = null;
3449 + string value = null;
3450 + int sequence = -1;
3451 + int flags = 0;
3452 +
3453 + foreach (XAttribute attrib in element.Attributes())
3454 + {
3455 + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
3456 + {
3457 + switch (attrib.Name.LocalName)
3458 + {
3459 + case "Action":
3460 + string actionValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
3461 + switch (actionValue)
3462 + {
3463 + case "createElement":
3464 + flags |= 0x00000001; // XMLFILE_CREATE_ELEMENT
3465 + break;
3466 + case "deleteValue":
3467 + flags |= 0x00000002; // XMLFILE_DELETE_VALUE
3468 + break;
3469 + case "bulkSetValue":
3470 + flags |= 0x00000004; // XMLFILE_BULKWRITE_VALUE
3471 + break;
3472 + case "setValue":
3473 + // no flag for set value since it's the default
3474 + break;
3475 + default:
3476 + this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, "Action", actionValue, "createElement", "deleteValue", "setValue", "bulkSetValue"));
3477 + break;
3478 + }
3479 + break;
3480 + case "SelectionLanguage":
3481 + string selectionLanguage = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
3482 + switch (selectionLanguage)
3483 + {
3484 + case "XPath":
3485 + flags |= 0x00000100; // XMLFILE_USE_XPATH
3486 + break;
3487 + case "XSLPattern":
3488 + // no flag for since it's the default
3489 + break;
3490 + default:
3491 + this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, "SelectionLanguage", selectionLanguage, "XPath", "XSLPattern"));
3492 + break;
3493 + }
3494 + break;
3495 + case "Id":
3496 + id = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
3497 + break;
3498 + case "File":
3499 + file = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
3500 + break;
3501 + case "ElementPath":
3502 + elementPath = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
3503 + break;
3504 + case "Name":
3505 + name = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
3506 + break;
3507 + case "Permanent":
3508 + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
3509 + {
3510 + flags |= 0x00010000; // XMLFILE_DONT_UNINSTALL
3511 + }
3512 + break;
3513 + case "Sequence":
3514 + sequence = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 1, short.MaxValue);
3515 + break;
3516 + case "Value":
3517 + value = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
3518 + break;
3519 + case "PreserveModifiedDate":
3520 + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
3521 + {
3522 + flags |= 0x00001000; // XMLFILE_PRESERVE_MODIFIED
3523 + }
3524 + break;
3525 + default:
3526 + this.ParseHelper.UnexpectedAttribute(element, attrib);
3527 + break;
3528 + }
3529 + }
3530 + else
3531 + {
3532 + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
3533 + }
3534 + }
3535 +
3536 + if (null == id)
3537 + {
3538 + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Id"));
3539 + }
3540 +
3541 + if (null == file)
3542 + {
3543 + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "File"));
3544 + }
3545 +
3546 + if (null == elementPath)
3547 + {
3548 + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "ElementPath"));
3549 + }
3550 +
3551 + if ((0x00000001 /*XMLFILE_CREATE_ELEMENT*/ & flags) != 0 && null == name)
3552 + {
3553 + this.Messaging.Write(ErrorMessages.IllegalAttributeWithoutOtherAttributes(sourceLineNumbers, element.Name.LocalName, "Action", "Name"));
3554 + }
3555 +
3556 + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
3557 +
3558 + if (!this.Messaging.EncounteredError)
3559 + {
3560 + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "XmlFile");
3561 + row.Set(0, id);
3562 + row.Set(1, file);
3563 + row.Set(2, elementPath);
3564 + row.Set(3, name);
3565 + row.Set(4, value);
3566 + row.Set(5, flags);
3567 + row.Set(6, componentId);
3568 + if (-1 != sequence)
3569 + {
3570 + row.Set(7, sequence);
3571 + }
3572 + }
3573 +
3574 + // Reference SchedXmlFile since nothing will happen without it
3575 + if (this.Context.Platform == Platform.ARM)
3576 + {
3577 + // Ensure ARM version of the CA is referenced
3578 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedXmlFile_ARM");
3579 + }
3580 + else
3581 + {
3582 + // All other supported platforms use x86
3583 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedXmlFile");
3584 + }
3585 + }
3586 +
3587 + /// <summary>
3588 + /// Parses a XmlConfig element.
3589 + /// </summary>
3590 + /// <param name="element">Element to parse.</param>
3591 + /// <param name="componentId">Identifier of parent component.</param>
3592 + /// <param name="nested">Whether or not the element is nested.</param>
3593 + private void ParseXmlConfigElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, bool nested)
3594 + {
3595 + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
3596 + string id = null;
3597 + string elementId = null;
3598 + string elementPath = null;
3599 + int flags = 0;
3600 + string file = null;
3601 + string name = null;
3602 + int sequence = CompilerConstants.IntegerNotSet;
3603 + string value = null;
3604 + string verifyPath = null;
3605 +
3606 + foreach (XAttribute attrib in element.Attributes())
3607 + {
3608 + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
3609 + {
3610 + switch (attrib.Name.LocalName)
3611 + {
3612 + case "Id":
3613 + id = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
3614 + break;
3615 + case "Action":
3616 + if (nested)
3617 + {
3618 + this.Messaging.Write(ErrorMessages.IllegalAttributeWhenNested(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName, element.Parent.Name.LocalName));
3619 + }
3620 + else
3621 + {
3622 + string actionValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
3623 + switch (actionValue)
3624 + {
3625 + case "create":
3626 + flags |= 0x10; // XMLCONFIG_CREATE
3627 + break;
3628 + case "delete":
3629 + flags |= 0x20; // XMLCONFIG_DELETE
3630 + break;
3631 + default:
3632 + this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName, actionValue, "create", "delete"));
3633 + break;
3634 + }
3635 + }
3636 + break;
3637 + case "ElementId":
3638 + elementId = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
3639 + break;
3640 + case "ElementPath":
3641 + elementPath = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
3642 + break;
3643 + case "File":
3644 + file = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
3645 + break;
3646 + case "Name":
3647 + name = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
3648 + break;
3649 + case "Node":
3650 + if (nested)
3651 + {
3652 + this.Messaging.Write(ErrorMessages.IllegalAttributeWhenNested(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName, element.Parent.Name.LocalName));
3653 + }
3654 + else
3655 + {
3656 + string nodeValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
3657 + switch (nodeValue)
3658 + {
3659 + case "element":
3660 + flags |= 0x1; // XMLCONFIG_ELEMENT
3661 + break;
3662 + case "value":
3663 + flags |= 0x2; // XMLCONFIG_VALUE
3664 + break;
3665 + case "document":
3666 + flags |= 0x4; // XMLCONFIG_DOCUMENT
3667 + break;
3668 + default:
3669 + this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName, nodeValue, "element", "value", "document"));
3670 + break;
3671 + }
3672 + }
3673 + break;
3674 + case "On":
3675 + if (nested)
3676 + {
3677 + this.Messaging.Write(ErrorMessages.IllegalAttributeWhenNested(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName, element.Parent.Name.LocalName));
3678 + }
3679 + else
3680 + {
3681 + string onValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
3682 + switch (onValue)
3683 + {
3684 + case "install":
3685 + flags |= 0x100; // XMLCONFIG_INSTALL
3686 + break;
3687 + case "uninstall":
3688 + flags |= 0x200; // XMLCONFIG_UNINSTALL
3689 + break;
3690 + default:
3691 + this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName, onValue, "install", "uninstall"));
3692 + break;
3693 + }
3694 + }
3695 + break;
3696 + case "PreserveModifiedDate":
3697 + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
3698 + {
3699 + flags |= 0x00001000; // XMLCONFIG_PRESERVE_MODIFIED
3700 + }
3701 + break;
3702 + case "Sequence":
3703 + sequence = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 1, short.MaxValue);
3704 + break;
3705 + case "Value":
3706 + value = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
3707 + break;
3708 + case "VerifyPath":
3709 + verifyPath = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
3710 + break;
3711 + default:
3712 + this.ParseHelper.UnexpectedAttribute(element, attrib);
3713 + break;
3714 + }
3715 + }
3716 + else
3717 + {
3718 + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
3719 + }
3720 + }
3721 +
3722 + if (null == id)
3723 + {
3724 + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Id"));
3725 + }
3726 +
3727 + if (null == file)
3728 + {
3729 + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "File"));
3730 + }
3731 +
3732 + if (null == elementId && null == elementPath)
3733 + {
3734 + this.Messaging.Write(ErrorMessages.ExpectedAttributes(sourceLineNumbers, element.Name.LocalName, "ElementId", "ElementPath"));
3735 + }
3736 + else if (null != elementId)
3737 + {
3738 + if (null != elementPath)
3739 + {
3740 + this.Messaging.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, element.Name.LocalName, "ElementId", "ElementPath"));
3741 + }
3742 +
3743 + if (0 != flags)
3744 + {
3745 + this.Messaging.Write(ErrorMessages.IllegalAttributeWithOtherAttributes(sourceLineNumbers, element.Name.LocalName, "ElementId", "Action", "Node", "On"));
3746 + }
3747 +
3748 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "XmlConfig", elementId);
3749 + }
3750 +
3751 + string innerText = this.ParseHelper.GetTrimmedInnerText(element);
3752 + if (null != value)
3753 + {
3754 + // cannot specify both the value attribute and inner text
3755 + if (!String.IsNullOrEmpty(innerText))
3756 + {
3757 + this.Messaging.Write(ErrorMessages.IllegalAttributeWithInnerText(sourceLineNumbers, element.Name.LocalName, "Value"));
3758 + }
3759 + }
3760 + else // value attribute not specified
3761 + {
3762 + if (!String.IsNullOrEmpty(innerText))
3763 + {
3764 + value = innerText;
3765 + }
3766 + }
3767 +
3768 + // find unexpected child elements
3769 + foreach (XElement child in element.Elements())
3770 + {
3771 + if (this.Namespace == child.Name.Namespace)
3772 + {
3773 + switch (child.Name.LocalName)
3774 + {
3775 + case "XmlConfig":
3776 + if (nested)
3777 + {
3778 + this.Messaging.Write(ErrorMessages.UnexpectedElement(sourceLineNumbers, element.Name.LocalName, child.Name.LocalName));
3779 + }
3780 + else
3781 + {
3782 + this.ParseXmlConfigElement(intermediate, section, child, componentId, true);
3783 + }
3784 + break;
3785 + default:
3786 + this.ParseHelper.UnexpectedElement(element, child);
3787 + break;
3788 + }
3789 + }
3790 + else
3791 + {
3792 + this.ParseHelper.ParseExtensionElement(this.Context.Extensions, intermediate, section, element, child);
3793 + }
3794 + }
3795 +
3796 + if (!this.Messaging.EncounteredError)
3797 + {
3798 + var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "XmlConfig");
3799 + row.Set(0, id);
3800 + row.Set(1, file);
3801 + row.Set(2, elementId ?? elementPath);
3802 + row.Set(3, verifyPath);
3803 + row.Set(4, name);
3804 + row.Set(5, value);
3805 + row.Set(6, flags);
3806 + row.Set(7, componentId);
3807 + if (CompilerConstants.IntegerNotSet != sequence)
3808 + {
3809 + row.Set(8, sequence);
3810 + }
3811 + }
3812 +
3813 + // Reference SchedXmlConfig since nothing will happen without it
3814 + if (this.Context.Platform == Platform.ARM)
3815 + {
3816 + // Ensure ARM version of the CA is referenced
3817 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedXmlConfig_ARM");
3818 + }
3819 + else
3820 + {
3821 + // All other supported platforms use x86
3822 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedXmlConfig");
3823 + }
3824 + }
3825 +
3826 + /// <summary>
3827 + /// Match evaluator to escape properties in a string.
3828 + /// </summary>
3829 + private string EscapeProperties(Match match)
3830 + {
3831 + string escape = null;
3832 + switch (match.Value)
3833 + {
3834 + case "[":
3835 + escape = @"[\[]";
3836 + break;
3837 + case "]":
3838 + escape = @"[\]]";
3839 + break;
3840 + }
3841 +
3842 + return escape;
3843 + }
3844 +
3845 + private int CreateIntegerFromBitArray(BitArray bits)
3846 + {
3847 + if (32 != bits.Length)
3848 + {
3849 + 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");
3850 + }
3851 +
3852 + int[] intArray = new int[1];
3853 + bits.CopyTo(intArray, 0);
3854 +
3855 + return intArray[0];
3856 + }
3857 +
3858 + private bool TrySetBitFromName(string[] attributeNames, string attributeName, YesNoType attributeValue, BitArray bits, int offset)
3859 + {
3860 + for (int i = 0; i < attributeNames.Length; i++)
3861 + {
3862 + if (attributeName.Equals(attributeNames[i], StringComparison.Ordinal))
3863 + {
3864 + bits.Set(i + offset, YesNoType.Yes == attributeValue);
3865 + return true;
3866 + }
3867 + }
3868 +
3869 + return false;
3870 + }
3871 +
3872 + /// <summary>
3873 + /// Private class that stores the data from a parsed PerformanceCounter element.
3874 + /// </summary>
3875 + private class ParsedPerformanceCounter
3876 + {
3877 + string name;
3878 + string help;
3879 + int type;
3880 + string language;
3881 +
3882 + internal ParsedPerformanceCounter(string name, string help, System.Diagnostics.PerformanceCounterType type, int language)
3883 + {
3884 + this.name = name;
3885 + this.help = help;
3886 + this.type = (int)type;
3887 + this.language = language.ToString("D3", CultureInfo.InvariantCulture);
3888 + }
3889 +
3890 + internal string Name
3891 + {
3892 + get { return this.name; }
3893 + }
3894 +
3895 + internal string Help
3896 + {
3897 + get { return this.help; }
3898 + }
3899 +
3900 + internal int Type
3901 + {
3902 + get { return this.type; }
3903 + }
3904 +
3905 + internal string Language
3906 + {
3907 + get { return this.language; }
3908 + }
3909 + }
3910 + }
3911 +}
src/wixext/UtilConstants.cs new
+17
@@ -0,0 +1,17 @@
1 +// 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.
2 +
3 +namespace WixToolset.Util
4 +{
5 + /// <summary>
6 + /// Constants used by Utility Extension.
7 + /// </summary>
8 + internal static class UtilConstants
9 + {
10 + internal static readonly string[] FilePermissions = { "Read", "Write", "Append", "ReadExtendedAttributes", "WriteExtendedAttributes", "Execute", null, "ReadAttributes", "WriteAttributes" };
11 + internal static readonly string[] FolderPermissions = { "Read", "CreateFile", "CreateChild", "ReadExtendedAttributes", "WriteExtendedAttributes", "Traverse", "DeleteChild", "ReadAttributes", "WriteAttributes" };
12 + internal static readonly string[] GenericPermissions = { "GenericAll", "GenericExecute", "GenericWrite", "GenericRead" };
13 + internal static readonly string[] RegistryPermissions = { "Read", "Write", "CreateSubkeys", "EnumerateSubkeys", "Notify", "CreateLink" };
14 + internal static readonly string[] ServicePermissions = { "ServiceQueryConfig", "ServiceChangeConfig", "ServiceQueryStatus", "ServiceEnumerateDependents", "ServiceStart", "ServiceStop", "ServicePauseContinue", "ServiceInterrogate", "ServiceUserDefinedControl" };
15 + internal static readonly string[] StandardPermissions = { "Delete", "ReadPermission", "ChangePermission", "TakeOwnership", "Synchronize" };
16 + }
17 +}
src/wixext/UtilDecompiler.cs new
+1543
@@ -0,0 +1,1543 @@
1 +// 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.
2 +
3 +namespace WixToolset.Extensions
4 +{
5 +#if TODO_CONSIDER_DECOMPILER
6 + using System;
7 + using System.IO;
8 + using System.Text;
9 + using System.Collections;
10 + using System.Diagnostics;
11 + using System.Globalization;
12 +
13 + using Util = WixToolset.Extensions.Serialize.Util;
14 + using WixToolset.Data;
15 + using WixToolset.Extensibility;
16 + using Wix = WixToolset.Data.Serialize;
17 +
18 + /// <summary>
19 + /// The decompiler for the WiX Toolset Utility Extension.
20 + /// </summary>
21 + public sealed class UtilDecompiler : DecompilerExtension
22 + {
23 + /// <summary>
24 + /// Creates a decompiler for Utility Extension.
25 + /// </summary>
26 + public UtilDecompiler()
27 + {
28 + this.TableDefinitions = UtilExtensionData.GetExtensionTableDefinitions();
29 + }
30 +
31 + /// <summary>
32 + /// Get the extensions library to be removed.
33 + /// </summary>
34 + /// <param name="tableDefinitions">Table definitions for library.</param>
35 + /// <returns>Library to remove from decompiled output.</returns>
36 + public override Library GetLibraryToRemove(TableDefinitionCollection tableDefinitions)
37 + {
38 + return UtilExtensionData.GetExtensionLibrary(tableDefinitions);
39 + }
40 +
41 + /// <summary>
42 + /// Called at the beginning of the decompilation of a database.
43 + /// </summary>
44 + /// <param name="tables">The collection of all tables.</param>
45 + public override void Initialize(TableIndexedCollection tables)
46 + {
47 + this.CleanupSecureCustomProperties(tables);
48 + this.CleanupInternetShortcutRemoveFileTables(tables);
49 + }
50 +
51 + /// <summary>
52 + /// Decompile the SecureCustomProperties field to PropertyRefs for known extension properties.
53 + /// </summary>
54 + /// <remarks>
55 + /// If we've referenced any of the suite or directory properties, add
56 + /// a PropertyRef to refer to the Property (and associated custom action)
57 + /// from the extension's library. Then remove the property from
58 + /// SecureCustomExtensions property so later decompilation won't create
59 + /// new Property elements.
60 + /// </remarks>
61 + /// <param name="tables">The collection of all tables.</param>
62 + private void CleanupSecureCustomProperties(TableIndexedCollection tables)
63 + {
64 + Table propertyTable = tables["Property"];
65 +
66 + if (null != propertyTable)
67 + {
68 + foreach (Row row in propertyTable.Rows)
69 + {
70 + if ("SecureCustomProperties" == row[0].ToString())
71 + {
72 + StringBuilder remainingProperties = new StringBuilder();
73 + string[] secureCustomProperties = row[1].ToString().Split(';');
74 + foreach (string property in secureCustomProperties)
75 + {
76 + if (property.StartsWith("WIX_SUITE_", StringComparison.Ordinal) || property.StartsWith("WIX_DIR_", StringComparison.Ordinal)
77 + || property.StartsWith("WIX_ACCOUNT_", StringComparison.Ordinal))
78 + {
79 + Wix.PropertyRef propertyRef = new Wix.PropertyRef();
80 + propertyRef.Id = property;
81 + this.Core.RootElement.AddChild(propertyRef);
82 + }
83 + else
84 + {
85 + if (0 < remainingProperties.Length)
86 + {
87 + remainingProperties.Append(";");
88 + }
89 + remainingProperties.Append(property);
90 + }
91 + }
92 +
93 + row[1] = remainingProperties.ToString();
94 + break;
95 + }
96 + }
97 + }
98 + }
99 +
100 + /// <summary>
101 + /// Remove RemoveFile rows that the InternetShortcut compiler extension adds for us.
102 + /// </summary>
103 + /// <param name="tables">The collection of all tables.</param>
104 + private void CleanupInternetShortcutRemoveFileTables(TableIndexedCollection tables)
105 + {
106 + // index the WixInternetShortcut table
107 + Table wixInternetShortcutTable = tables["WixInternetShortcut"];
108 + Hashtable wixInternetShortcuts = new Hashtable();
109 + if (null != wixInternetShortcutTable)
110 + {
111 + foreach (Row row in wixInternetShortcutTable.Rows)
112 + {
113 + wixInternetShortcuts.Add(row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), row);
114 + }
115 + }
116 +
117 + // remove the RemoveFile rows with primary keys that match the WixInternetShortcut table's
118 + Table removeFileTable = tables["RemoveFile"];
119 + if (null != removeFileTable)
120 + {
121 + for (int i = removeFileTable.Rows.Count - 1; 0 <= i; i--)
122 + {
123 + if (null != wixInternetShortcuts[removeFileTable.Rows[i][0]])
124 + {
125 + removeFileTable.Rows.RemoveAt(i);
126 + }
127 + }
128 + }
129 + }
130 +
131 + /// <summary>
132 + /// Decompiles an extension table.
133 + /// </summary>
134 + /// <param name="table">The table to decompile.</param>
135 + public override void DecompileTable(Table table)
136 + {
137 + switch (table.Name)
138 + {
139 + case "WixCloseApplication":
140 + this.DecompileWixCloseApplicationTable(table);
141 + break;
142 + case "WixRemoveFolderEx":
143 + this.DecompileWixRemoveFolderExTable(table);
144 + break;
145 + case "WixRestartResource":
146 + this.DecompileWixRestartResourceTable(table);
147 + break;
148 + case "FileShare":
149 + this.DecompileFileShareTable(table);
150 + break;
151 + case "FileSharePermissions":
152 + this.DecompileFileSharePermissionsTable(table);
153 + break;
154 + case "WixInternetShortcut":
155 + this.DecompileWixInternetShortcutTable(table);
156 + break;
157 + case "Group":
158 + this.DecompileGroupTable(table);
159 + break;
160 + case "Perfmon":
161 + this.DecompilePerfmonTable(table);
162 + break;
163 + case "PerfmonManifest":
164 + this.DecompilePerfmonManifestTable(table);
165 + break;
166 + case "EventManifest":
167 + this.DecompileEventManifestTable(table);
168 + break;
169 + case "SecureObjects":
170 + this.DecompileSecureObjectsTable(table);
171 + break;
172 + case "ServiceConfig":
173 + this.DecompileServiceConfigTable(table);
174 + break;
175 + case "User":
176 + this.DecompileUserTable(table);
177 + break;
178 + case "UserGroup":
179 + this.DecompileUserGroupTable(table);
180 + break;
181 + case "XmlConfig":
182 + this.DecompileXmlConfigTable(table);
183 + break;
184 + case "XmlFile":
185 + // XmlFile decompilation has been moved to FinalizeXmlFileTable function
186 + break;
187 + default:
188 + base.DecompileTable(table);
189 + break;
190 + }
191 + }
192 +
193 + /// <summary>
194 + /// Finalize decompilation.
195 + /// </summary>
196 + /// <param name="tables">The collection of all tables.</param>
197 + public override void Finish(TableIndexedCollection tables)
198 + {
199 + this.FinalizePerfmonTable(tables);
200 + this.FinalizePerfmonManifestTable(tables);
201 + this.FinalizeSecureObjectsTable(tables);
202 + this.FinalizeServiceConfigTable(tables);
203 + this.FinalizeXmlConfigTable(tables);
204 + this.FinalizeXmlFileTable(tables);
205 + this.FinalizeEventManifestTable(tables);
206 + }
207 +
208 + /// <summary>
209 + /// Decompile the WixCloseApplication table.
210 + /// </summary>
211 + /// <param name="table">The table to decompile.</param>
212 + private void DecompileWixCloseApplicationTable(Table table)
213 + {
214 + foreach (Row row in table.Rows)
215 + {
216 + Util.CloseApplication closeApplication = new Util.CloseApplication();
217 +
218 + closeApplication.Id = (string)row[0];
219 +
220 + closeApplication.Target = (string)row[1];
221 +
222 + if (null != row[2])
223 + {
224 + closeApplication.Description = (string)row[2];
225 + }
226 +
227 + if (null != row[3])
228 + {
229 + closeApplication.Content = (string)row[3];
230 + }
231 +
232 + // set defaults
233 + closeApplication.CloseMessage = Util.YesNoType.no;
234 + closeApplication.RebootPrompt = Util.YesNoType.yes;
235 + closeApplication.ElevatedCloseMessage = Util.YesNoType.no;
236 +
237 + if (null != row[4])
238 + {
239 + int attribute = (int)row[4];
240 +
241 + closeApplication.CloseMessage = (0x1 == (attribute & 0x1)) ? Util.YesNoType.yes : Util.YesNoType.no;
242 + closeApplication.RebootPrompt = (0x2 == (attribute & 0x2)) ? Util.YesNoType.yes : Util.YesNoType.no;
243 + closeApplication.ElevatedCloseMessage = (0x4 == (attribute & 0x4)) ? Util.YesNoType.yes : Util.YesNoType.no;
244 + }
245 +
246 + if (null != row[5])
247 + {
248 + closeApplication.Sequence = (int)row[5];
249 + }
250 +
251 + if (null != row[6])
252 + {
253 + closeApplication.Property = (string)row[6];
254 + }
255 +
256 + this.Core.RootElement.AddChild(closeApplication);
257 + }
258 + }
259 +
260 + /// <summary>
261 + /// Decompile the WixRemoveFolderEx table.
262 + /// </summary>
263 + /// <param name="table">The table to decompile.</param>
264 + private void DecompileWixRemoveFolderExTable(Table table)
265 + {
266 + foreach (Row row in table.Rows)
267 + {
268 + // Set the Id even if auto-generated previously.
269 + Util.RemoveFolderEx removeFolder = new Util.RemoveFolderEx();
270 + removeFolder.Id = (string)row[0];
271 + removeFolder.Property = (string)row[2];
272 +
273 + int installMode = (int)row[3];
274 + switch ((UtilCompiler.WixRemoveFolderExOn)installMode)
275 + {
276 + case UtilCompiler.WixRemoveFolderExOn.Install:
277 + removeFolder.On = Util.RemoveFolderEx.OnType.install;
278 + break;
279 +
280 + case UtilCompiler.WixRemoveFolderExOn.Uninstall:
281 + removeFolder.On = Util.RemoveFolderEx.OnType.uninstall;
282 + break;
283 +
284 + case UtilCompiler.WixRemoveFolderExOn.Both:
285 + removeFolder.On = Util.RemoveFolderEx.OnType.both;
286 + break;
287 +
288 + default:
289 + this.Core.OnMessage(WixWarnings.UnrepresentableColumnValue(row.SourceLineNumbers, table.Name, "InstallMode", installMode));
290 + break;
291 + }
292 +
293 + // Add to the appropriate Component or section element.
294 + string componentId = (string)row[1];
295 + Wix.Component component = (Wix.Component)this.Core.GetIndexedElement("Component", componentId);
296 + if (null != component)
297 + {
298 + component.AddChild(removeFolder);
299 + }
300 + else
301 + {
302 + this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Component_", componentId, "Component"));
303 + }
304 + }
305 + }
306 +
307 + /// <summary>
308 + /// Decompile the WixRestartResource table.
309 + /// </summary>
310 + /// <param name="table">The table to decompile.</param>
311 + private void DecompileWixRestartResourceTable(Table table)
312 + {
313 + foreach (Row row in table.Rows)
314 + {
315 + // Set the Id even if auto-generated previously.
316 + Util.RestartResource restartResource = new Util.RestartResource();
317 + restartResource.Id = (string)row[0];
318 +
319 + // Determine the resource type and set accordingly.
320 + string resource = (string)row[2];
321 + int attributes = (int)row[3];
322 + UtilCompiler.WixRestartResourceAttributes type = (UtilCompiler.WixRestartResourceAttributes)(attributes & (int)UtilCompiler.WixRestartResourceAttributes.TypeMask);
323 +
324 + switch (type)
325 + {
326 + case UtilCompiler.WixRestartResourceAttributes.Filename:
327 + restartResource.Path = resource;
328 + break;
329 +
330 + case UtilCompiler.WixRestartResourceAttributes.ProcessName:
331 + restartResource.ProcessName = resource;
332 + break;
333 +
334 + case UtilCompiler.WixRestartResourceAttributes.ServiceName:
335 + restartResource.ServiceName = resource;
336 + break;
337 +
338 + default:
339 + this.Core.OnMessage(WixWarnings.UnrepresentableColumnValue(row.SourceLineNumbers, table.Name, "Attributes", attributes));
340 + break;
341 + }
342 +
343 + // Add to the appropriate Component or section element.
344 + string componentId = (string)row[1];
345 + if (!String.IsNullOrEmpty(componentId))
346 + {
347 + Wix.Component component = (Wix.Component)this.Core.GetIndexedElement("Component", componentId);
348 + if (null != component)
349 + {
350 + component.AddChild(restartResource);
351 + }
352 + else
353 + {
354 + this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Component_", componentId, "Component"));
355 + }
356 + }
357 + else
358 + {
359 + this.Core.RootElement.AddChild(restartResource);
360 + }
361 + }
362 + }
363 +
364 + /// <summary>
365 + /// Decompile the FileShare table.
366 + /// </summary>
367 + /// <param name="table">The table to decompile.</param>
368 + private void DecompileFileShareTable(Table table)
369 + {
370 + foreach (Row row in table.Rows)
371 + {
372 + Util.FileShare fileShare = new Util.FileShare();
373 +
374 + fileShare.Id = (string)row[0];
375 +
376 + fileShare.Name = (string)row[1];
377 +
378 + if (null != row[3])
379 + {
380 + fileShare.Description = (string)row[3];
381 + }
382 +
383 + // the Directory_ column is set by the parent Component
384 +
385 + // the User_ and Permissions columns are deprecated
386 +
387 + Wix.Component component = (Wix.Component)this.Core.GetIndexedElement("Component", (string)row[2]);
388 + if (null != component)
389 + {
390 + component.AddChild(fileShare);
391 + }
392 + else
393 + {
394 + this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Component_", (string)row[2], "Component"));
395 + }
396 + this.Core.IndexElement(row, fileShare);
397 + }
398 + }
399 +
400 + /// <summary>
401 + /// Decompile the FileSharePermissions table.
402 + /// </summary>
403 + /// <param name="table">The table to decompile.</param>
404 + private void DecompileFileSharePermissionsTable(Table table)
405 + {
406 + foreach (Row row in table.Rows)
407 + {
408 + Util.FileSharePermission fileSharePermission = new Util.FileSharePermission();
409 +
410 + fileSharePermission.User = (string)row[1];
411 +
412 + string[] specialPermissions = UtilConstants.FolderPermissions;
413 + int permissions = (int)row[2];
414 + for (int i = 0; i < 32; i++)
415 + {
416 + if (0 != ((permissions >> i) & 1))
417 + {
418 + string name = null;
419 +
420 + if (16 > i && specialPermissions.Length > i)
421 + {
422 + name = specialPermissions[i];
423 + }
424 + else if (28 > i && UtilConstants.StandardPermissions.Length > (i - 16))
425 + {
426 + name = UtilConstants.StandardPermissions[i - 16];
427 + }
428 + else if (0 <= (i - 28) && UtilConstants.GenericPermissions.Length > (i - 28))
429 + {
430 + name = UtilConstants.GenericPermissions[i - 28];
431 + }
432 +
433 + if (null == name)
434 + {
435 + this.Core.OnMessage(WixWarnings.UnknownPermission(row.SourceLineNumbers, row.Table.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), i));
436 + }
437 + else
438 + {
439 + switch (name)
440 + {
441 + case "ChangePermission":
442 + fileSharePermission.ChangePermission = Util.YesNoType.yes;
443 + break;
444 + case "CreateChild":
445 + fileSharePermission.CreateChild = Util.YesNoType.yes;
446 + break;
447 + case "CreateFile":
448 + fileSharePermission.CreateFile = Util.YesNoType.yes;
449 + break;
450 + case "Delete":
451 + fileSharePermission.Delete = Util.YesNoType.yes;
452 + break;
453 + case "DeleteChild":
454 + fileSharePermission.DeleteChild = Util.YesNoType.yes;
455 + break;
456 + case "GenericAll":
457 + fileSharePermission.GenericAll = Util.YesNoType.yes;
458 + break;
459 + case "GenericExecute":
460 + fileSharePermission.GenericExecute = Util.YesNoType.yes;
461 + break;
462 + case "GenericRead":
463 + fileSharePermission.GenericRead = Util.YesNoType.yes;
464 + break;
465 + case "GenericWrite":
466 + fileSharePermission.GenericWrite = Util.YesNoType.yes;
467 + break;
468 + case "Read":
469 + fileSharePermission.Read = Util.YesNoType.yes;
470 + break;
471 + case "ReadAttributes":
472 + fileSharePermission.ReadAttributes = Util.YesNoType.yes;
473 + break;
474 + case "ReadExtendedAttributes":
475 + fileSharePermission.ReadExtendedAttributes = Util.YesNoType.yes;
476 + break;
477 + case "ReadPermission":
478 + fileSharePermission.ReadPermission = Util.YesNoType.yes;
479 + break;
480 + case "Synchronize":
481 + fileSharePermission.Synchronize = Util.YesNoType.yes;
482 + break;
483 + case "TakeOwnership":
484 + fileSharePermission.TakeOwnership = Util.YesNoType.yes;
485 + break;
486 + case "Traverse":
487 + fileSharePermission.Traverse = Util.YesNoType.yes;
488 + break;
489 + case "WriteAttributes":
490 + fileSharePermission.WriteAttributes = Util.YesNoType.yes;
491 + break;
492 + case "WriteExtendedAttributes":
493 + fileSharePermission.WriteExtendedAttributes = Util.YesNoType.yes;
494 + break;
495 + default:
496 + Debug.Fail(String.Format("Unknown permission '{0}'.", name));
497 + break;
498 + }
499 + }
500 + }
501 + }
502 +
503 + Util.FileShare fileShare = (Util.FileShare)this.Core.GetIndexedElement("FileShare", (string)row[0]);
504 + if (null != fileShare)
505 + {
506 + fileShare.AddChild(fileSharePermission);
507 + }
508 + else
509 + {
510 + this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "FileShare_", (string)row[0], "FileShare"));
511 + }
512 + }
513 + }
514 +
515 + /// <summary>
516 + /// Decompile the Group table.
517 + /// </summary>
518 + /// <param name="table">The table to decompile.</param>
519 + private void DecompileGroupTable(Table table)
520 + {
521 + foreach (Row row in table.Rows)
522 + {
523 + Util.Group group = new Util.Group();
524 +
525 + group.Id = (string)row[0];
526 +
527 + if (null != row[1])
528 + {
529 + this.Core.OnMessage(WixWarnings.UnrepresentableColumnValue(row.SourceLineNumbers, table.Name, "Component_", (string)row[1]));
530 + }
531 +
532 + group.Name = (string)row[2];
533 +
534 + if (null != row[3])
535 + {
536 + group.Domain = (string)row[3];
537 + }
538 +
539 + this.Core.RootElement.AddChild(group);
540 + }
541 + }
542 +
543 + /// <summary>
544 + /// Decompile the WixInternetShortcut table.
545 + /// </summary>
546 + /// <param name="table">The table to decompile.</param>
547 + private void DecompileWixInternetShortcutTable(Table table)
548 + {
549 + foreach (Row row in table.Rows)
550 + {
551 + Util.InternetShortcut internetShortcut = new Util.InternetShortcut();
552 + internetShortcut.Id = (string)row[0];
553 + internetShortcut.Directory = (string)row[2];
554 + // remove .lnk/.url extension because compiler extension adds it back for us
555 + internetShortcut.Name = Path.ChangeExtension((string)row[3], null);
556 + internetShortcut.Target = (string)row[4];
557 + internetShortcut.IconFile = (string)row[6];
558 + internetShortcut.IconIndex = (int)row[7];
559 +
560 + UtilCompiler.InternetShortcutType shortcutType = (UtilCompiler.InternetShortcutType)row[5];
561 + switch (shortcutType)
562 + {
563 + case UtilCompiler.InternetShortcutType.Link:
564 + internetShortcut.Type = Util.InternetShortcut.TypeType.link;
565 + break;
566 + case UtilCompiler.InternetShortcutType.Url:
567 + internetShortcut.Type = Util.InternetShortcut.TypeType.url;
568 + break;
569 + }
570 +
571 + Wix.Component component = (Wix.Component)this.Core.GetIndexedElement("Component", (string)row[1]);
572 + if (null != component)
573 + {
574 + component.AddChild(internetShortcut);
575 + }
576 + else
577 + {
578 + this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Component_", (string)row[1], "Component"));
579 + }
580 +
581 + this.Core.IndexElement(row, internetShortcut);
582 + }
583 + }
584 +
585 + /// <summary>
586 + /// Decompile the Perfmon table.
587 + /// </summary>
588 + /// <param name="table">The table to decompile.</param>
589 + private void DecompilePerfmonTable(Table table)
590 + {
591 + foreach (Row row in table.Rows)
592 + {
593 + Util.PerfCounter perfCounter = new Util.PerfCounter();
594 +
595 + perfCounter.Name = (string)row[2];
596 +
597 + this.Core.IndexElement(row, perfCounter);
598 + }
599 + }
600 +
601 + /// <summary>
602 + /// Decompile the PerfmonManifest table.
603 + /// </summary>
604 + /// <param name="table">The table to decompile.</param>
605 + private void DecompilePerfmonManifestTable(Table table)
606 + {
607 + foreach (Row row in table.Rows)
608 + {
609 + Util.PerfCounterManifest perfCounterManifest = new Util.PerfCounterManifest();
610 +
611 + perfCounterManifest.ResourceFileDirectory = (string)row[2];
612 +
613 + this.Core.IndexElement(row, perfCounterManifest);
614 + }
615 + }
616 +
617 + /// <summary>
618 + /// Decompile the EventManifest table.
619 + /// </summary>
620 + /// <param name="table">The table to decompile.</param>
621 + private void DecompileEventManifestTable(Table table)
622 + {
623 + foreach (Row row in table.Rows)
624 + {
625 + Util.EventManifest eventManifest = new Util.EventManifest();
626 + this.Core.IndexElement(row, eventManifest);
627 + }
628 + }
629 +
630 + /// <summary>
631 + /// Decompile the SecureObjects table.
632 + /// </summary>
633 + /// <param name="table">The table to decompile.</param>
634 + private void DecompileSecureObjectsTable(Table table)
635 + {
636 + foreach (Row row in table.Rows)
637 + {
638 + Util.PermissionEx permissionEx = new Util.PermissionEx();
639 +
640 + string[] specialPermissions;
641 + switch ((string)row[1])
642 + {
643 + case "CreateFolder":
644 + specialPermissions = UtilConstants.FolderPermissions;
645 + break;
646 + case "File":
647 + specialPermissions = UtilConstants.FilePermissions;
648 + break;
649 + case "Registry":
650 + specialPermissions = UtilConstants.RegistryPermissions;
651 + break;
652 + case "ServiceInstall":
653 + specialPermissions = UtilConstants.ServicePermissions;
654 + break;
655 + default:
656 + this.Core.OnMessage(WixWarnings.IllegalColumnValue(row.SourceLineNumbers, row.Table.Name, row.Fields[1].Column.Name, row[1]));
657 + return;
658 + }
659 +
660 + int permissionBits = (int)row[4];
661 + for (int i = 0; i < 32; i++)
662 + {
663 + if (0 != ((permissionBits >> i) & 1))
664 + {
665 + string name = null;
666 +
667 + if (16 > i && specialPermissions.Length > i)
668 + {
669 + name = specialPermissions[i];
670 + }
671 + else if (28 > i && UtilConstants.StandardPermissions.Length > (i - 16))
672 + {
673 + name = UtilConstants.StandardPermissions[i - 16];
674 + }
675 + else if (0 <= (i - 28) && UtilConstants.GenericPermissions.Length > (i - 28))
676 + {
677 + name = UtilConstants.GenericPermissions[i - 28];
678 + }
679 +
680 + if (null == name)
681 + {
682 + this.Core.OnMessage(WixWarnings.UnknownPermission(row.SourceLineNumbers, row.Table.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), i));
683 + }
684 + else
685 + {
686 + switch (name)
687 + {
688 + case "Append":
689 + permissionEx.Append = Util.YesNoType.yes;
690 + break;
691 + case "ChangePermission":
692 + permissionEx.ChangePermission = Util.YesNoType.yes;
693 + break;
694 + case "CreateChild":
695 + permissionEx.CreateChild = Util.YesNoType.yes;
696 + break;
697 + case "CreateFile":
698 + permissionEx.CreateFile = Util.YesNoType.yes;
699 + break;
700 + case "CreateLink":
701 + permissionEx.CreateLink = Util.YesNoType.yes;
702 + break;
703 + case "CreateSubkeys":
704 + permissionEx.CreateSubkeys = Util.YesNoType.yes;
705 + break;
706 + case "Delete":
707 + permissionEx.Delete = Util.YesNoType.yes;
708 + break;
709 + case "DeleteChild":
710 + permissionEx.DeleteChild = Util.YesNoType.yes;
711 + break;
712 + case "EnumerateSubkeys":
713 + permissionEx.EnumerateSubkeys = Util.YesNoType.yes;
714 + break;
715 + case "Execute":
716 + permissionEx.Execute = Util.YesNoType.yes;
717 + break;
718 + case "GenericAll":
719 + permissionEx.GenericAll = Util.YesNoType.yes;
720 + break;
721 + case "GenericExecute":
722 + permissionEx.GenericExecute = Util.YesNoType.yes;
723 + break;
724 + case "GenericRead":
725 + permissionEx.GenericRead = Util.YesNoType.yes;
726 + break;
727 + case "GenericWrite":
728 + permissionEx.GenericWrite = Util.YesNoType.yes;
729 + break;
730 + case "Notify":
731 + permissionEx.Notify = Util.YesNoType.yes;
732 + break;
733 + case "Read":
734 + permissionEx.Read = Util.YesNoType.yes;
735 + break;
736 + case "ReadAttributes":
737 + permissionEx.ReadAttributes = Util.YesNoType.yes;
738 + break;
739 + case "ReadExtendedAttributes":
740 + permissionEx.ReadExtendedAttributes = Util.YesNoType.yes;
741 + break;
742 + case "ReadPermission":
743 + permissionEx.ReadPermission = Util.YesNoType.yes;
744 + break;
745 + case "ServiceChangeConfig":
746 + permissionEx.ServiceChangeConfig = Util.YesNoType.yes;
747 + break;
748 + case "ServiceEnumerateDependents":
749 + permissionEx.ServiceEnumerateDependents = Util.YesNoType.yes;
750 + break;
751 + case "ServiceInterrogate":
752 + permissionEx.ServiceInterrogate = Util.YesNoType.yes;
753 + break;
754 + case "ServicePauseContinue":
755 + permissionEx.ServicePauseContinue = Util.YesNoType.yes;
756 + break;
757 + case "ServiceQueryConfig":
758 + permissionEx.ServiceQueryConfig = Util.YesNoType.yes;
759 + break;
760 + case "ServiceQueryStatus":
761 + permissionEx.ServiceQueryStatus = Util.YesNoType.yes;
762 + break;
763 + case "ServiceStart":
764 + permissionEx.ServiceStart = Util.YesNoType.yes;
765 + break;
766 + case "ServiceStop":
767 + permissionEx.ServiceStop = Util.YesNoType.yes;
768 + break;
769 + case "ServiceUserDefinedControl":
770 + permissionEx.ServiceUserDefinedControl = Util.YesNoType.yes;
771 + break;
772 + case "Synchronize":
773 + permissionEx.Synchronize = Util.YesNoType.yes;
774 + break;
775 + case "TakeOwnership":
776 + permissionEx.TakeOwnership = Util.YesNoType.yes;
777 + break;
778 + case "Traverse":
779 + permissionEx.Traverse = Util.YesNoType.yes;
780 + break;
781 + case "Write":
782 + permissionEx.Write = Util.YesNoType.yes;
783 + break;
784 + case "WriteAttributes":
785 + permissionEx.WriteAttributes = Util.YesNoType.yes;
786 + break;
787 + case "WriteExtendedAttributes":
788 + permissionEx.WriteExtendedAttributes = Util.YesNoType.yes;
789 + break;
790 + default:
791 + throw new InvalidOperationException(String.Format("Unknown permission attribute '{0}'.", name));
792 + }
793 + }
794 + }
795 + }
796 +
797 + if (null != row[2])
798 + {
799 + permissionEx.Domain = (string)row[2];
800 + }
801 +
802 + permissionEx.User = (string)row[3];
803 +
804 + this.Core.IndexElement(row, permissionEx);
805 + }
806 + }
807 +
808 + /// <summary>
809 + /// Decompile the ServiceConfig table.
810 + /// </summary>
811 + /// <param name="table">The table to decompile.</param>
812 + private void DecompileServiceConfigTable(Table table)
813 + {
814 + foreach (Row row in table.Rows)
815 + {
816 + Util.ServiceConfig serviceConfig = new Util.ServiceConfig();
817 +
818 + serviceConfig.ServiceName = (string)row[0];
819 +
820 + switch ((string)row[3])
821 + {
822 + case "none":
823 + serviceConfig.FirstFailureActionType = Util.ServiceConfig.FirstFailureActionTypeType.none;
824 + break;
825 + case "reboot":
826 + serviceConfig.FirstFailureActionType = Util.ServiceConfig.FirstFailureActionTypeType.reboot;
827 + break;
828 + case "restart":
829 + serviceConfig.FirstFailureActionType = Util.ServiceConfig.FirstFailureActionTypeType.restart;
830 + break;
831 + case "runCommand":
832 + serviceConfig.FirstFailureActionType = Util.ServiceConfig.FirstFailureActionTypeType.runCommand;
833 + break;
834 + default:
835 + this.Core.OnMessage(WixWarnings.IllegalColumnValue(row.SourceLineNumbers, table.Name, row.Fields[3].Column.Name, row[3]));
836 + break;
837 + }
838 +
839 + switch ((string)row[4])
840 + {
841 + case "none":
842 + serviceConfig.SecondFailureActionType = Util.ServiceConfig.SecondFailureActionTypeType.none;
843 + break;
844 + case "reboot":
845 + serviceConfig.SecondFailureActionType = Util.ServiceConfig.SecondFailureActionTypeType.reboot;
846 + break;
847 + case "restart":
848 + serviceConfig.SecondFailureActionType = Util.ServiceConfig.SecondFailureActionTypeType.restart;
849 + break;
850 + case "runCommand":
851 + serviceConfig.SecondFailureActionType = Util.ServiceConfig.SecondFailureActionTypeType.runCommand;
852 + break;
853 + default:
854 + this.Core.OnMessage(WixWarnings.IllegalColumnValue(row.SourceLineNumbers, table.Name, row.Fields[4].Column.Name, row[4]));
855 + break;
856 + }
857 +
858 + switch ((string)row[5])
859 + {
860 + case "none":
861 + serviceConfig.ThirdFailureActionType = Util.ServiceConfig.ThirdFailureActionTypeType.none;
862 + break;
863 + case "reboot":
864 + serviceConfig.ThirdFailureActionType = Util.ServiceConfig.ThirdFailureActionTypeType.reboot;
865 + break;
866 + case "restart":
867 + serviceConfig.ThirdFailureActionType = Util.ServiceConfig.ThirdFailureActionTypeType.restart;
868 + break;
869 + case "runCommand":
870 + serviceConfig.ThirdFailureActionType = Util.ServiceConfig.ThirdFailureActionTypeType.runCommand;
871 + break;
872 + default:
873 + this.Core.OnMessage(WixWarnings.IllegalColumnValue(row.SourceLineNumbers, table.Name, row.Fields[5].Column.Name, row[5]));
874 + break;
875 + }
876 +
877 + if (null != row[6])
878 + {
879 + serviceConfig.ResetPeriodInDays = (int)row[6];
880 + }
881 +
882 + if (null != row[7])
883 + {
884 + serviceConfig.RestartServiceDelayInSeconds = (int)row[7];
885 + }
886 +
887 + if (null != row[8])
888 + {
889 + serviceConfig.ProgramCommandLine = (string)row[8];
890 + }
891 +
892 + if (null != row[9])
893 + {
894 + serviceConfig.RebootMessage = (string)row[9];
895 + }
896 +
897 + this.Core.IndexElement(row, serviceConfig);
898 + }
899 + }
900 +
901 + /// <summary>
902 + /// Decompile the User table.
903 + /// </summary>
904 + /// <param name="table">The table to decompile.</param>
905 + private void DecompileUserTable(Table table)
906 + {
907 + foreach (Row row in table.Rows)
908 + {
909 + Util.User user = new Util.User();
910 +
911 + user.Id = (string)row[0];
912 +
913 + user.Name = (string)row[2];
914 +
915 + if (null != row[3])
916 + {
917 + user.Domain = (string)row[3];
918 + }
919 +
920 + if (null != row[4])
921 + {
922 + user.Password = (string)row[4];
923 + }
924 +
925 + if (null != row[5])
926 + {
927 + int attributes = (int)row[5];
928 +
929 + if (UtilCompiler.UserDontExpirePasswrd == (attributes & UtilCompiler.UserDontExpirePasswrd))
930 + {
931 + user.PasswordNeverExpires = Util.YesNoType.yes;
932 + }
933 +
934 + if (UtilCompiler.UserPasswdCantChange == (attributes & UtilCompiler.UserPasswdCantChange))
935 + {
936 + user.CanNotChangePassword = Util.YesNoType.yes;
937 + }
938 +
939 + if (UtilCompiler.UserPasswdChangeReqdOnLogin == (attributes & UtilCompiler.UserPasswdChangeReqdOnLogin))
940 + {
941 + user.PasswordExpired = Util.YesNoType.yes;
942 + }
943 +
944 + if (UtilCompiler.UserDisableAccount == (attributes & UtilCompiler.UserDisableAccount))
945 + {
946 + user.Disabled = Util.YesNoType.yes;
947 + }
948 +
949 + if (UtilCompiler.UserFailIfExists == (attributes & UtilCompiler.UserFailIfExists))
950 + {
951 + user.FailIfExists = Util.YesNoType.yes;
952 + }
953 +
954 + if (UtilCompiler.UserUpdateIfExists == (attributes & UtilCompiler.UserUpdateIfExists))
955 + {
956 + user.UpdateIfExists = Util.YesNoType.yes;
957 + }
958 +
959 + if (UtilCompiler.UserLogonAsService == (attributes & UtilCompiler.UserLogonAsService))
960 + {
961 + user.LogonAsService = Util.YesNoType.yes;
962 + }
963 +
964 + if (UtilCompiler.UserDontRemoveOnUninstall == (attributes & UtilCompiler.UserDontRemoveOnUninstall))
965 + {
966 + user.RemoveOnUninstall = Util.YesNoType.no;
967 + }
968 +
969 + if (UtilCompiler.UserDontCreateUser == (attributes & UtilCompiler.UserDontCreateUser))
970 + {
971 + user.CreateUser = Util.YesNoType.no;
972 + }
973 +
974 + if (UtilCompiler.UserNonVital == (attributes & UtilCompiler.UserNonVital))
975 + {
976 + user.Vital = Util.YesNoType.no;
977 + }
978 + }
979 +
980 + if (null != row[1])
981 + {
982 + Wix.Component component = (Wix.Component)this.Core.GetIndexedElement("Component", (string)row[1]);
983 +
984 + if (null != component)
985 + {
986 + component.AddChild(user);
987 + }
988 + else
989 + {
990 + this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Component_", (string)row[1], "Component"));
991 + }
992 + }
993 + else
994 + {
995 + this.Core.RootElement.AddChild(user);
996 + }
997 + this.Core.IndexElement(row, user);
998 + }
999 + }
1000 +
1001 + /// <summary>
1002 + /// Decompile the UserGroup table.
1003 + /// </summary>
1004 + /// <param name="table">The table to decompile.</param>
1005 + private void DecompileUserGroupTable(Table table)
1006 + {
1007 + foreach (Row row in table.Rows)
1008 + {
1009 + Util.User user = (Util.User)this.Core.GetIndexedElement("User", (string)row[0]);
1010 +
1011 + if (null != user)
1012 + {
1013 + Util.GroupRef groupRef = new Util.GroupRef();
1014 +
1015 + groupRef.Id = (string)row[1];
1016 +
1017 + user.AddChild(groupRef);
1018 + }
1019 + else
1020 + {
1021 + this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Group_", (string)row[0], "Group"));
1022 + }
1023 + }
1024 + }
1025 +
1026 + /// <summary>
1027 + /// Decompile the XmlConfig table.
1028 + /// </summary>
1029 + /// <param name="table">The table to decompile.</param>
1030 + private void DecompileXmlConfigTable(Table table)
1031 + {
1032 + foreach (Row row in table.Rows)
1033 + {
1034 + Util.XmlConfig xmlConfig = new Util.XmlConfig();
1035 +
1036 + xmlConfig.Id = (string)row[0];
1037 +
1038 + xmlConfig.File = (string)row[1];
1039 +
1040 + xmlConfig.ElementPath = (string)row[2];
1041 +
1042 + if (null != row[3])
1043 + {
1044 + xmlConfig.VerifyPath = (string)row[3];
1045 + }
1046 +
1047 + if (null != row[4])
1048 + {
1049 + xmlConfig.Name = (string)row[4];
1050 + }
1051 +
1052 + if (null != row[5])
1053 + {
1054 + xmlConfig.Value = (string)row[5];
1055 + }
1056 +
1057 + int flags = (int)row[6];
1058 +
1059 + if (0x1 == (flags & 0x1))
1060 + {
1061 + xmlConfig.Node = Util.XmlConfig.NodeType.element;
1062 + }
1063 + else if (0x2 == (flags & 0x2))
1064 + {
1065 + xmlConfig.Node = Util.XmlConfig.NodeType.value;
1066 + }
1067 + else if (0x4 == (flags & 0x4))
1068 + {
1069 + xmlConfig.Node = Util.XmlConfig.NodeType.document;
1070 + }
1071 +
1072 + if (0x10 == (flags & 0x10))
1073 + {
1074 + xmlConfig.Action = Util.XmlConfig.ActionType.create;
1075 + }
1076 + else if (0x20 == (flags & 0x20))
1077 + {
1078 + xmlConfig.Action = Util.XmlConfig.ActionType.delete;
1079 + }
1080 +
1081 + if (0x100 == (flags & 0x100))
1082 + {
1083 + xmlConfig.On = Util.XmlConfig.OnType.install;
1084 + }
1085 + else if (0x200 == (flags & 0x200))
1086 + {
1087 + xmlConfig.On = Util.XmlConfig.OnType.uninstall;
1088 + }
1089 +
1090 + if (0x00001000 == (flags & 0x00001000))
1091 + {
1092 + xmlConfig.PreserveModifiedDate = Util.YesNoType.yes;
1093 + }
1094 +
1095 + if (null != row[8])
1096 + {
1097 + xmlConfig.Sequence = (int)row[8];
1098 + }
1099 +
1100 + this.Core.IndexElement(row, xmlConfig);
1101 + }
1102 + }
1103 +
1104 + /// <summary>
1105 + /// Finalize the Perfmon table.
1106 + /// </summary>
1107 + /// <param name="tables">The collection of all tables.</param>
1108 + /// <remarks>
1109 + /// Since the PerfCounter element nests under a File element, but
1110 + /// the Perfmon table does not have a foreign key relationship with
1111 + /// the File table (instead it has a formatted string that usually
1112 + /// refers to a file row - but doesn't have to), the nesting must
1113 + /// be inferred during finalization.
1114 + /// </remarks>
1115 + private void FinalizePerfmonTable(TableIndexedCollection tables)
1116 + {
1117 + Table perfmonTable = tables["Perfmon"];
1118 +
1119 + if (null != perfmonTable)
1120 + {
1121 + foreach (Row row in perfmonTable.Rows)
1122 + {
1123 + string formattedFile = (string)row[1];
1124 + Util.PerfCounter perfCounter = (Util.PerfCounter)this.Core.GetIndexedElement(row);
1125 +
1126 + // try to "de-format" the File column's value to determine the proper parent File element
1127 + if ((formattedFile.StartsWith("[#", StringComparison.Ordinal) || formattedFile.StartsWith("[!", StringComparison.Ordinal))
1128 + && formattedFile.EndsWith("]", StringComparison.Ordinal))
1129 + {
1130 + string fileId = formattedFile.Substring(2, formattedFile.Length - 3);
1131 +
1132 + Wix.File file = (Wix.File)this.Core.GetIndexedElement("File", fileId);
1133 + if (null != file)
1134 + {
1135 + file.AddChild(perfCounter);
1136 + }
1137 + else
1138 + {
1139 + this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, perfmonTable.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "File", formattedFile, "File"));
1140 + }
1141 + }
1142 + else
1143 + {
1144 + this.Core.OnMessage(UtilErrors.IllegalFileValueInPerfmonOrManifest(formattedFile, "Perfmon"));
1145 + }
1146 + }
1147 + }
1148 + }
1149 +
1150 + /// <summary>
1151 + /// Finalize the PerfmonManifest table.
1152 + /// </summary>
1153 + /// <param name="tables">The collection of all tables.</param>
1154 + private void FinalizePerfmonManifestTable(TableIndexedCollection tables)
1155 + {
1156 + Table perfmonManifestTable = tables["PerfmonManifest"];
1157 +
1158 + if (null != perfmonManifestTable)
1159 + {
1160 + foreach (Row row in perfmonManifestTable.Rows)
1161 + {
1162 + string formattedFile = (string)row[1];
1163 + Util.PerfCounterManifest perfCounterManifest = (Util.PerfCounterManifest)this.Core.GetIndexedElement(row);
1164 +
1165 + // try to "de-format" the File column's value to determine the proper parent File element
1166 + if ((formattedFile.StartsWith("[#", StringComparison.Ordinal) || formattedFile.StartsWith("[!", StringComparison.Ordinal))
1167 + && formattedFile.EndsWith("]", StringComparison.Ordinal))
1168 + {
1169 + string fileId = formattedFile.Substring(2, formattedFile.Length - 3);
1170 +
1171 + Wix.File file = (Wix.File)this.Core.GetIndexedElement("File", fileId);
1172 + if (null != file)
1173 + {
1174 + file.AddChild(perfCounterManifest);
1175 + }
1176 + else
1177 + {
1178 + this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, perfCounterManifest.ResourceFileDirectory, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "File", formattedFile, "File"));
1179 + }
1180 + }
1181 + else
1182 + {
1183 + this.Core.OnMessage(UtilErrors.IllegalFileValueInPerfmonOrManifest(formattedFile, "PerfmonManifest"));
1184 + }
1185 + }
1186 + }
1187 + }
1188 +
1189 + /// <summary>
1190 + /// Finalize the SecureObjects table.
1191 + /// </summary>
1192 + /// <param name="tables">The collection of all tables.</param>
1193 + /// <remarks>
1194 + /// Nests the PermissionEx elements below their parent elements. There are no declared foreign
1195 + /// keys for the parents of the SecureObjects table.
1196 + /// </remarks>
1197 + private void FinalizeSecureObjectsTable(TableIndexedCollection tables)
1198 + {
1199 + Table createFolderTable = tables["CreateFolder"];
1200 + Table secureObjectsTable = tables["SecureObjects"];
1201 +
1202 + Hashtable createFolders = new Hashtable();
1203 +
1204 + // index the CreateFolder table because the foreign key to this table from the
1205 + // LockPermissions table is only part of the primary key of this table
1206 + if (null != createFolderTable)
1207 + {
1208 + foreach (Row row in createFolderTable.Rows)
1209 + {
1210 + Wix.CreateFolder createFolder = (Wix.CreateFolder)this.Core.GetIndexedElement(row);
1211 + string directoryId = (string)row[0];
1212 +
1213 + if (!createFolders.Contains(directoryId))
1214 + {
1215 + createFolders.Add(directoryId, new ArrayList());
1216 + }
1217 + ((ArrayList)createFolders[directoryId]).Add(createFolder);
1218 + }
1219 + }
1220 +
1221 + if (null != secureObjectsTable)
1222 + {
1223 + foreach (Row row in secureObjectsTable.Rows)
1224 + {
1225 + string id = (string)row[0];
1226 + string table = (string)row[1];
1227 +
1228 + Util.PermissionEx permissionEx = (Util.PermissionEx)this.Core.GetIndexedElement(row);
1229 +
1230 + if ("CreateFolder" == table)
1231 + {
1232 + ArrayList createFolderElements = (ArrayList)createFolders[id];
1233 +
1234 + if (null != createFolderElements)
1235 + {
1236 + foreach (Wix.CreateFolder createFolder in createFolderElements)
1237 + {
1238 + createFolder.AddChild(permissionEx);
1239 + }
1240 + }
1241 + else
1242 + {
1243 + this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, "SecureObjects", row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "LockObject", id, table));
1244 + }
1245 + }
1246 + else
1247 + {
1248 + Wix.IParentElement parentElement = (Wix.IParentElement)this.Core.GetIndexedElement(table, id);
1249 +
1250 + if (null != parentElement)
1251 + {
1252 + parentElement.AddChild(permissionEx);
1253 + }
1254 + else
1255 + {
1256 + this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, "SecureObjects", row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "LockObject", id, table));
1257 + }
1258 + }
1259 + }
1260 + }
1261 + }
1262 +
1263 + /// <summary>
1264 + /// Finalize the ServiceConfig table.
1265 + /// </summary>
1266 + /// <param name="tables">The collection of all tables.</param>
1267 + /// <remarks>
1268 + /// Since there is no foreign key from the ServiceName column to the
1269 + /// ServiceInstall table, this relationship must be handled late.
1270 + /// </remarks>
1271 + private void FinalizeServiceConfigTable(TableIndexedCollection tables)
1272 + {
1273 + Table serviceConfigTable = tables["ServiceConfig"];
1274 + Table serviceInstallTable = tables["ServiceInstall"];
1275 +
1276 + Hashtable serviceInstalls = new Hashtable();
1277 +
1278 + // index the ServiceInstall table because the foreign key used by the ServiceConfig
1279 + // table is actually the ServiceInstall.Name, not the ServiceInstall.ServiceInstall
1280 + // this is unfortunate because the service Name is not guaranteed to be unique, so
1281 + // decompiler must assume there could be multiple matches and add the ServiceConfig to each
1282 + // TODO: the Component column information should be taken into acount to accurately identify
1283 + // the correct column to use
1284 + if (null != serviceInstallTable)
1285 + {
1286 + foreach (Row row in serviceInstallTable.Rows)
1287 + {
1288 + string name = (string)row[1];
1289 + Wix.ServiceInstall serviceInstall = (Wix.ServiceInstall)this.Core.GetIndexedElement(row);
1290 +
1291 + if (!serviceInstalls.Contains(name))
1292 + {
1293 + serviceInstalls.Add(name, new ArrayList());
1294 + }
1295 +
1296 + ((ArrayList)serviceInstalls[name]).Add(serviceInstall);
1297 + }
1298 + }
1299 +
1300 + if (null != serviceConfigTable)
1301 + {
1302 + foreach (Row row in serviceConfigTable.Rows)
1303 + {
1304 + Util.ServiceConfig serviceConfig = (Util.ServiceConfig)this.Core.GetIndexedElement(row);
1305 +
1306 + if (0 == (int)row[2])
1307 + {
1308 + Wix.Component component = (Wix.Component)this.Core.GetIndexedElement("Component", (string)row[1]);
1309 +
1310 + if (null != component)
1311 + {
1312 + component.AddChild(serviceConfig);
1313 + }
1314 + else
1315 + {
1316 + this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, serviceConfigTable.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Component_", (string)row[1], "Component"));
1317 + }
1318 + }
1319 + else
1320 + {
1321 + ArrayList serviceInstallElements = (ArrayList)serviceInstalls[row[0]];
1322 +
1323 + if (null != serviceInstallElements)
1324 + {
1325 + foreach (Wix.ServiceInstall serviceInstall in serviceInstallElements)
1326 + {
1327 + serviceInstall.AddChild(serviceConfig);
1328 + }
1329 + }
1330 + else
1331 + {
1332 + this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, serviceConfigTable.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "ServiceName", (string)row[0], "ServiceInstall"));
1333 + }
1334 + }
1335 + }
1336 + }
1337 + }
1338 +
1339 + /// <summary>
1340 + /// Finalize the XmlConfig table.
1341 + /// </summary>
1342 + /// <param name="tables">Collection of all tables.</param>
1343 + private void FinalizeXmlConfigTable(TableIndexedCollection tables)
1344 + {
1345 + Table xmlConfigTable = tables["XmlConfig"];
1346 +
1347 + if (null != xmlConfigTable)
1348 + {
1349 + foreach (Row row in xmlConfigTable.Rows)
1350 + {
1351 + Util.XmlConfig xmlConfig = (Util.XmlConfig)this.Core.GetIndexedElement(row);
1352 +
1353 + if (null == row[6] || 0 == (int)row[6])
1354 + {
1355 + Util.XmlConfig parentXmlConfig = (Util.XmlConfig)this.Core.GetIndexedElement("XmlConfig", (string)row[2]);
1356 +
1357 + if (null != parentXmlConfig)
1358 + {
1359 + parentXmlConfig.AddChild(xmlConfig);
1360 + }
1361 + else
1362 + {
1363 + this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, xmlConfigTable.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "ElementPath", (string)row[2], "XmlConfig"));
1364 + }
1365 + }
1366 + else
1367 + {
1368 + Wix.Component component = (Wix.Component)this.Core.GetIndexedElement("Component", (string)row[7]);
1369 +
1370 + if (null != component)
1371 + {
1372 + component.AddChild(xmlConfig);
1373 + }
1374 + else
1375 + {
1376 + this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, xmlConfigTable.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Component_", (string)row[7], "Component"));
1377 + }
1378 + }
1379 + }
1380 + }
1381 + }
1382 +
1383 +
1384 + /// <summary>
1385 + /// Finalize the XmlFile table.
1386 + /// </summary>
1387 + /// <param name="tables">The collection of all tables.</param>
1388 + /// <remarks>
1389 + /// Some of the XmlFile table rows are compiler generated from util:EventManifest node
1390 + /// These rows should not be appended to component.
1391 + /// </remarks>
1392 + private void FinalizeXmlFileTable(TableIndexedCollection tables)
1393 + {
1394 + Table xmlFileTable = tables["XmlFile"];
1395 + Table eventManifestTable = tables["EventManifest"];
1396 +
1397 + if (null != xmlFileTable)
1398 + {
1399 + foreach (Row row in xmlFileTable.Rows)
1400 + {
1401 + bool bManifestGenerated = false;
1402 + string xmlFileConfigId = (string)row[0];
1403 + if (null != eventManifestTable)
1404 + {
1405 + foreach (Row emrow in eventManifestTable.Rows)
1406 + {
1407 + string formattedFile = (string)emrow[1];
1408 + if ((formattedFile.StartsWith("[#", StringComparison.Ordinal) || formattedFile.StartsWith("[!", StringComparison.Ordinal))
1409 + && formattedFile.EndsWith("]", StringComparison.Ordinal))
1410 + {
1411 + string fileId = formattedFile.Substring(2, formattedFile.Length - 3);
1412 + if (String.Equals(String.Concat("Config_", fileId, "ResourceFile"), xmlFileConfigId))
1413 + {
1414 + Util.EventManifest eventManifest = (Util.EventManifest)this.Core.GetIndexedElement(emrow);
1415 + if (null != eventManifest)
1416 + {
1417 + eventManifest.ResourceFile = (string)row[4];
1418 + }
1419 + bManifestGenerated = true;
1420 + }
1421 +
1422 + else if (String.Equals(String.Concat("Config_", fileId, "MessageFile"), xmlFileConfigId))
1423 + {
1424 + Util.EventManifest eventManifest = (Util.EventManifest)this.Core.GetIndexedElement(emrow);
1425 + if (null != eventManifest)
1426 + {
1427 + eventManifest.MessageFile = (string)row[4];
1428 + }
1429 + bManifestGenerated = true;
1430 + }
1431 + }
1432 + }
1433 + }
1434 +
1435 + if (true == bManifestGenerated)
1436 + continue;
1437 +
1438 + Util.XmlFile xmlFile = new Util.XmlFile();
1439 +
1440 + xmlFile.Id = (string)row[0];
1441 + xmlFile.File = (string)row[1];
1442 + xmlFile.ElementPath = (string)row[2];
1443 +
1444 + if (null != row[3])
1445 + {
1446 + xmlFile.Name = (string)row[3];
1447 + }
1448 +
1449 + if (null != row[4])
1450 + {
1451 + xmlFile.Value = (string)row[4];
1452 + }
1453 +
1454 + int flags = (int)row[5];
1455 + if (0x1 == (flags & 0x1) && 0x2 == (flags & 0x2))
1456 + {
1457 + this.Core.OnMessage(WixWarnings.IllegalColumnValue(row.SourceLineNumbers, xmlFileTable.Name, row.Fields[5].Column.Name, row[5]));
1458 + }
1459 + else if (0x1 == (flags & 0x1))
1460 + {
1461 + xmlFile.Action = Util.XmlFile.ActionType.createElement;
1462 + }
1463 + else if (0x2 == (flags & 0x2))
1464 + {
1465 + xmlFile.Action = Util.XmlFile.ActionType.deleteValue;
1466 + }
1467 + else
1468 + {
1469 + xmlFile.Action = Util.XmlFile.ActionType.setValue;
1470 + }
1471 +
1472 + if (0x100 == (flags & 0x100))
1473 + {
1474 + xmlFile.SelectionLanguage = Util.XmlFile.SelectionLanguageType.XPath;
1475 + }
1476 +
1477 + if (0x00001000 == (flags & 0x00001000))
1478 + {
1479 + xmlFile.PreserveModifiedDate = Util.YesNoType.yes;
1480 + }
1481 +
1482 + if (0x00010000 == (flags & 0x00010000))
1483 + {
1484 + xmlFile.Permanent = Util.YesNoType.yes;
1485 + }
1486 +
1487 + if (null != row[7])
1488 + {
1489 + xmlFile.Sequence = (int)row[7];
1490 + }
1491 +
1492 + Wix.Component component = (Wix.Component)this.Core.GetIndexedElement("Component", (string)row[6]);
1493 +
1494 + if (null != component)
1495 + {
1496 + component.AddChild(xmlFile);
1497 + }
1498 + else
1499 + {
1500 + this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, xmlFileTable.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Component_", (string)row[6], "Component"));
1501 + }
1502 + }
1503 + }
1504 + }
1505 +
1506 + /// <summary>
1507 + /// Finalize the eventManifest table.
1508 + /// This function must be called after FinalizeXmlFileTable
1509 + /// </summary>
1510 + /// <param name="tables">The collection of all tables.</param>
1511 + private void FinalizeEventManifestTable(TableIndexedCollection tables)
1512 + {
1513 + Table eventManifestTable = tables["EventManifest"];
1514 +
1515 + if (null != eventManifestTable)
1516 + {
1517 + foreach (Row row in eventManifestTable.Rows)
1518 + {
1519 + string formattedFile = (string)row[1];
1520 + Util.EventManifest eventManifest = (Util.EventManifest)this.Core.GetIndexedElement(row);
1521 +
1522 + // try to "de-format" the File column's value to determine the proper parent File element
1523 + if ((formattedFile.StartsWith("[#", StringComparison.Ordinal) || formattedFile.StartsWith("[!", StringComparison.Ordinal))
1524 + && formattedFile.EndsWith("]", StringComparison.Ordinal))
1525 + {
1526 + string fileId = formattedFile.Substring(2, formattedFile.Length - 3);
1527 +
1528 + Wix.File file = (Wix.File)this.Core.GetIndexedElement("File", fileId);
1529 + if (null != file)
1530 + {
1531 + file.AddChild(eventManifest);
1532 + }
1533 + }
1534 + else
1535 + {
1536 + this.Core.OnMessage(UtilErrors.IllegalFileValueInPerfmonOrManifest(formattedFile, "EventManifest"));
1537 + }
1538 + }
1539 + }
1540 + }
1541 + }
1542 +#endif
1543 +}
src/wixext/UtilErrors.cs new
+109
@@ -0,0 +1,109 @@
1 +// 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.
2 +
3 +namespace WixToolset.Util
4 +{
5 + using System;
6 + using System.Resources;
7 + using WixToolset.Data;
8 +
9 + public static class UtilErrors
10 + {
11 + public static Message ArgumentRequiresValue(string argument)
12 + {
13 + return Message(null, Ids.ArgumentRequiresValue, "The argument '{0}' does not have a value specified and it is required.", argument);
14 + }
15 +
16 + public static Message CircularSearchReference(string chain)
17 + {
18 + 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);
19 + }
20 +
21 + public static Message DirectoryNotFound(string directory)
22 + {
23 + return Message(null, Ids.DirectoryNotFound, "The directory '{0}' could not be found.", directory);
24 + }
25 +
26 + public static Message EmptyDirectory(string directory)
27 + {
28 + 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);
29 + }
30 +
31 + public static Message ErrorTransformingHarvestedWiX(string transform, string message)
32 + {
33 + return Message(null, Ids.ErrorTransformingHarvestedWiX, "Error applying transform {0} to harvested WiX: {1}", transform, message);
34 + }
35 +
36 + public static Message FileNotFound(string file)
37 + {
38 + return Message(null, Ids.FileNotFound, "The file '{0}' cannot be found.", file);
39 + }
40 +
41 + public static Message IllegalAttributeWithoutComponent(SourceLineNumber sourceLineNumbers, string elementName, string attributeName)
42 + {
43 + 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);
44 + }
45 +
46 + public static Message IllegalElementWithoutComponent(SourceLineNumber sourceLineNumbers, string elementName)
47 + {
48 + 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);
49 + }
50 +
51 + public static Message IllegalFileValueInPerfmonOrManifest(string file, string table)
52 + {
53 + 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);
54 + }
55 +
56 + public static Message InvalidRegistryObject(SourceLineNumber sourceLineNumbers, string registryElementName)
57 + {
58 + 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);
59 + }
60 +
61 + public static Message PerformanceCategoryNotFound(string key)
62 + {
63 + return Message(null, Ids.PerformanceCategoryNotFound, "Performance category '{0}' not found.", key);
64 + }
65 +
66 + public static Message SpacesNotAllowedInArgumentValue(string arg, string value)
67 + {
68 + 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);
69 + }
70 +
71 + public static Message UnableToOpenRegistryKey(string key)
72 + {
73 + return Message(null, Ids.UnableToOpenRegistryKey, "Unable to open registry key '{0}'.", key);
74 + }
75 +
76 + public static Message UnsupportedPerformanceCounterType(string key)
77 + {
78 + return Message(null, Ids.UnsupportedPerformanceCounterType, "Unsupported performance counter type '{0}'.", key);
79 + }
80 +
81 + private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args)
82 + {
83 + return new Message(sourceLineNumber, MessageLevel.Error, (int)id, format, args);
84 + }
85 +
86 + private static Message Message(SourceLineNumber sourceLineNumber, Ids id, ResourceManager resourceManager, string resourceName, params object[] args)
87 + {
88 + return new Message(sourceLineNumber, MessageLevel.Error, (int)id, resourceManager, resourceName, args);
89 + }
90 +
91 + public enum Ids
92 + {
93 + IllegalAttributeWithoutComponent = 5050,
94 + IllegalElementWithoutComponent = 5051,
95 + DirectoryNotFound = 5052,
96 + EmptyDirectory = 5053,
97 + IllegalFileValueInPerfmonOrManifest = 5054,
98 + ErrorTransformingHarvestedWiX = 5055,
99 + UnableToOpenRegistryKey = 5056,
100 + SpacesNotAllowedInArgumentValue = 5057,
101 + ArgumentRequiresValue = 5058,
102 + FileNotFound = 5059,
103 + PerformanceCategoryNotFound = 5060,
104 + UnsupportedPerformanceCounterType = 5061,
105 + CircularSearchReference = 5062,
106 + InvalidRegistryObject = 5063,
107 + }
108 + }
109 +}
src/wixext/UtilExtensionData.cs new
+21
@@ -0,0 +1,21 @@
1 +// 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.
2 +
3 +namespace WixToolset.Util
4 +{
5 + using WixToolset.Data;
6 + using WixToolset.Extensibility;
7 +
8 + public sealed class UtilExtensionData : BaseExtensionData
9 + {
10 + public override bool TryGetTupleDefinitionByName(string name, out IntermediateTupleDefinition tupleDefinition)
11 + {
12 + tupleDefinition = UtilTupleDefinitions.ByName(name);
13 + return tupleDefinition != null;
14 + }
15 +
16 + public override Intermediate GetLibrary(ITupleDefinitionCreator tupleDefinitions)
17 + {
18 + return Intermediate.Load(typeof(UtilExtensionData).Assembly, "WixToolset.Util.util.wixlib", tupleDefinitions);
19 + }
20 + }
21 +}
src/wixext/UtilExtensionFactory.cs new
+18
@@ -0,0 +1,18 @@
1 +// 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.
2 +
3 +namespace WixToolset.Util
4 +{
5 + using System;
6 + using System.Collections.Generic;
7 + using WixToolset.Extensibility;
8 +
9 + public class UtilExtensionFactory : BaseExtensionFactory
10 + {
11 + protected override IEnumerable<Type> ExtensionTypes => new[]
12 + {
13 + typeof(UtilCompiler),
14 + typeof(UtilExtensionData),
15 + typeof(UtilWindowsInstallerBackendExtension),
16 + };
17 + }
18 +}
src/wixext/UtilWarnings.cs new
+72
@@ -0,0 +1,72 @@
1 +// 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.
2 +
3 +namespace WixToolset.Util
4 +{
5 + using System;
6 + using System.Resources;
7 + using WixToolset.Data;
8 +
9 + public static class UtilWarnings
10 + {
11 + public static Message AssemblyHarvestFailed(string file, string message)
12 + {
13 + 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);
14 + }
15 +
16 + public static Message DeprecatedPerfCounterElement(SourceLineNumber sourceLineNumbers)
17 + {
18 + return Message(sourceLineNumbers, Ids.DeprecatedPerfCounterElement, "The PerfCounter element has been deprecated. Please use the PerformanceCounter element instead.");
19 + }
20 +
21 + public static Message DuplicateDllRegistryEntry(string registryKey, string componentId)
22 + {
23 + return Message(null, Ids.DuplicateDllRegistryEntry, "Ignoring the registry key '{0}', it has already been added to the component '{1}'.", registryKey, componentId);
24 + }
25 +
26 + public static Message DuplicateDllRegistryEntry(string registryKey, string registryKeyValue, string componentId)
27 + {
28 + 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);
29 + }
30 +
31 + public static Message RequiredAttributeForWindowsXP(SourceLineNumber sourceLineNumbers, string elementName, string attributeName)
32 + {
33 + 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);
34 + }
35 +
36 + public static Message SelfRegHarvestFailed(string file, string message)
37 + {
38 + 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);
39 + }
40 +
41 + public static Message TypeLibLoadFailed(string file, string message)
42 + {
43 + 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);
44 + }
45 +
46 + public static Message UnsupportedRegistryType(string registryValue, int regFileLineNumber, string unsupportedType)
47 + {
48 + 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);
49 + }
50 +
51 + private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args)
52 + {
53 + return new Message(sourceLineNumber, MessageLevel.Warning, (int)id, format, args);
54 + }
55 +
56 + private static Message Message(SourceLineNumber sourceLineNumber, Ids id, ResourceManager resourceManager, string resourceName, params object[] args)
57 + {
58 + return new Message(sourceLineNumber, MessageLevel.Warning, (int)id, resourceManager, resourceName, args);
59 + }
60 +
61 + public enum Ids
62 + {
63 + SelfRegHarvestFailed = 5150,
64 + AssemblyHarvestFailed = 5151,
65 + TypeLibLoadFailed = 5152,
66 + DeprecatedPerfCounterElement = 5153,
67 + RequiredAttributeForWindowsXP = 5154,
68 + DuplicateDllRegistryEntry = 5156,
69 + UnsupportedRegistryType = 5157,
70 + }
71 + }
72 +}
src/wixext/UtilWindowsInstallerBackendExtension.cs new
+26
@@ -0,0 +1,26 @@
1 +// 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.
2 +
3 +namespace WixToolset.Util
4 +{
5 + using System.Linq;
6 + using System.Xml;
7 + using WixToolset.Data.WindowsInstaller;
8 + using WixToolset.Extensibility;
9 +
10 + public class UtilWindowsInstallerBackendExtension : BaseWindowsInstallerBackendExtension
11 + {
12 + private static readonly TableDefinition[] Tables = LoadTables();
13 +
14 + protected override TableDefinition[] TableDefinitionsForTuples => Tables;
15 +
16 + private static TableDefinition[] LoadTables()
17 + {
18 + using (var resourceStream = typeof(UtilWindowsInstallerBackendExtension).Assembly.GetManifestResourceStream("WixToolset.Util.tables.xml"))
19 + using (var reader = XmlReader.Create(resourceStream))
20 + {
21 + var tables = TableDefinitionCollection.Load(reader);
22 + return tables.ToArray();
23 + }
24 + }
25 + }
26 +}
src/wixext/WixToolset.Util.wixext.csproj new
+34
@@ -0,0 +1,34 @@
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<!-- 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. -->
3 +
4 +<Project Sdk="Microsoft.NET.Sdk">
5 + <PropertyGroup>
6 + <TargetFramework>netstandard2.0</TargetFramework>
7 + <RootNamespace>WixToolset.Util</RootNamespace>
8 + <Description>WiX Toolset Utility Extension</Description>
9 + <Title>WiX Toolset Util Extension</Title>
10 + <IsTool>true</IsTool>
11 + <ContentTargetFolders>build</ContentTargetFolders>
12 + </PropertyGroup>
13 +
14 + <ItemGroup>
15 + <Content Include="$(MSBuildThisFileName).targets" />
16 + <Content Include="util.xsd" PackagePath="tools" />
17 + <EmbeddedResource Include="tables.xml" />
18 + <EmbeddedResource Include="$(OutputPath)..\util.wixlib" />
19 + </ItemGroup>
20 +
21 + <ItemGroup>
22 + <ProjectReference Include="$(WixToolsetRootFolder)\Data\src\WixToolset.Data\WixToolset.Data.csproj" Condition=" '$(Configuration)' == 'Debug' And Exists('$(WixToolsetRootFolder)\Data\src\WixToolset.Data\WixToolset.Data.csproj') " />
23 + <ProjectReference Include="$(WixToolsetRootFolder)\Extensibility\src\WixToolset.Extensibility\WixToolset.Extensibility.csproj" Condition=" '$(Configuration)' == 'Debug' And Exists('$(WixToolsetRootFolder)\Extensibility\src\WixToolset.Extensibility\WixToolset.Extensibility.csproj') " />
24 + <PackageReference Include="WixToolset.Extensibility" Version="4.0.*" Condition=" '$(Configuration)' == 'Release' Or !Exists('$(WixToolsetRootFolder)\Extensibility\src\WixToolset.Extensibility\WixToolset.Extensibility.csproj') " PrivateAssets="all" />
25 + </ItemGroup>
26 +
27 + <ItemGroup>
28 + <ProjectReference Include="..\wixlib\util.wixproj" ReferenceOutputAssembly="false" />
29 + </ItemGroup>
30 +
31 + <ItemGroup>
32 + <PackageReference Include="Nerdbank.GitVersioning" Version="2.1.7" PrivateAssets="all" />
33 + </ItemGroup>
34 +</Project>
src/wixext/WixToolset.Util.wixext.targets new
+8
@@ -0,0 +1,8 @@
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<!-- 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. -->
3 +
4 +<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
5 + <ItemGroup>
6 + <WixExtension Include="$(MSBuildThisFileDirectory)..\tools\WixToolset.Util.wixext.dll" />
7 + </ItemGroup>
8 +</Project>
src/wixext/tables.xml new
+242
@@ -0,0 +1,242 @@
1 +<?xml version="1.0" encoding="utf-8" ?>
2 +<!-- 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. -->
3 +
4 +
5 +<tableDefinitions xmlns="http://wixtoolset.org/schemas/v4/wi/tables">
6 + <tableDefinition name="WixCloseApplication">
7 + <columnDefinition name="WixCloseApplication" type="string" length="72" primaryKey="yes" modularize="column"
8 + category="identifier" description="Primary key, non-localized token in table."/>
9 + <columnDefinition name="Target" type="localized" length="0" modularize="property"
10 + category="formatted" description="Name of executable to ensure is closed."/>
11 + <columnDefinition name="Description" type="string" length="0" nullable="yes" localizable="yes" modularize="property"
12 + category="formatted" description="Description string displayed to user when executable is in use."/>
13 + <columnDefinition name="Condition" type="string" length="0" nullable="yes" localizable="yes" modularize="condition"
14 + category="condition" description="Optional expression which skips the closing."/>
15 + <columnDefinition name="Attributes" type="number" length="4"
16 + minValue="0" maxValue="2147483647" description="A 32-bit word that specifies the attribute flags to be applied."/>
17 + <columnDefinition name="Sequence" type="number" length="4" nullable="yes"
18 + minValue="1" maxValue="2147483647" description="Sequence to order the closings by."/>
19 + <columnDefinition name="Property" type="string" length="72" nullable="yes" localizable="yes" modularize="property"
20 + category="identifier" description="Optional property that is set to the number of running instances of the app."/>
21 + <columnDefinition name="TerminateExitCode" type="number" length="4" nullable="yes"
22 + minValue="0" maxValue="2147483647" description="Exit code to return from a terminated application."/>
23 + <columnDefinition name="Timeout" type="number" length="4" nullable="yes"
24 + minValue="1" maxValue="2147483647" description="Timeout in milliseconds before scheduling restart or terminating application."/>
25 + </tableDefinition>
26 + <tableDefinition name="WixRemoveFolderEx" createSymbols="yes">
27 + <columnDefinition name="WixRemoveFolderEx" type="string" length="72" primaryKey="yes" modularize="column"
28 + category="identifier" description="Identifier for the WixRemoveFolderEx row in the package."/>
29 + <columnDefinition name="Component_" type="string" length="72" modularize="column"
30 + keyTable="Component" keyColumn="1" category="identifier" description="Foreign key into the Component table used to determine install state"/>
31 + <columnDefinition name="Property" type="string" length="72" modularize="property"
32 + category="identifier" description="Name of Property that contains the root of the directory tree to remove."/>
33 + <columnDefinition name="InstallMode" type="number" length="2"
34 + minValue="1" maxValue="3" description="1 == Remove only when the associated component is being installed (msiInstallStateLocal or msiInstallStateSource), 2 == Remove only when the associated component is being removed (msiInstallStateAbsent), 3 = Remove in either of the above cases."/>
35 + </tableDefinition>
36 + <tableDefinition name="WixRestartResource">
37 + <columnDefinition name="WixRestartResource" type="string" length="72" primaryKey="yes" modularize="column"
38 + category="identifier" description="Primary key, non-localized identifier."/>
39 + <columnDefinition name="Component_" type="string" length="72" nullable="yes" modularize="column"
40 + keyTable="Component" keyColumn="1" category="identifier" description="Foreign key into the Component table used to determine install state."/>
41 + <columnDefinition name="Resource" type="string" length="0" modularize="property"
42 + category="formatted" description="The resource to be registered with the Restart Manager."/>
43 + <columnDefinition name="Attributes" type="number" length="4"
44 + minValue="0" maxValue="2147483647" description="A 32-bit word that specifies the type of resource and flags used for processing."/>
45 + </tableDefinition>
46 + <tableDefinition name="FileShare" createSymbols="yes">
47 + <columnDefinition name="FileShare" type="string" length="72" primaryKey="yes" modularize="column"
48 + category="identifier" description="Primary key, non-localized identifier"/>
49 + <columnDefinition name="ShareName" type="string" length="255"
50 + category="formatted" description="The actual share name used"/>
51 + <columnDefinition name="Component_" type="string" length="72" modularize="column"
52 + keyTable="Component" keyColumn="1" category="identifier" description="Foreign key into the Component table used to determine install state"/>
53 + <columnDefinition name="Description" type="string" length="255" nullable="yes"
54 + category="text" description="Description string displayed for the file share"/>
55 + <columnDefinition name="Directory_" type="string" length="72" modularize="column"
56 + keyTable="Directory" keyColumn="1" category="identifier" description="Foreign key referencing directory that the share is created on"/>
57 + <columnDefinition name="User_" type="string" length="72" modularize="column" nullable="yes"
58 + keyTable="User" keyColumn="1" category="identifier" description="Foreign key, User to give access permissions to"/>
59 + <columnDefinition name="Permissions" type="number" length="4" nullable="yes"
60 + description="Permissions int, as on EXPLICIT_ACCESS.grfAccessPermissions in MSDN"/>
61 + </tableDefinition>
62 + <tableDefinition name="FileSharePermissions">
63 + <columnDefinition name="FileShare_" type="string" length="72" primaryKey="yes" modularize="column"
64 + keyTable="FileShare" keyColumn="1" category="identifier" description="FileShare that these premissions are to be applied to."/>
65 + <columnDefinition name="User_" type="string" length="72" primaryKey="yes" modularize="column"
66 + category="identifier" description="User that these premissions are to apply to."/>
67 + <columnDefinition name="Permissions" type="number" length="4"
68 + description="Permissions int, as on EXPLICIT_ACCESS.grfAccessPermissions in MSDN"/>
69 + </tableDefinition>
70 + <tableDefinition name="Group" createSymbols="yes">
71 + <columnDefinition name="Group" type="string" length="72" primaryKey="yes" modularize="column"
72 + category="identifier" description="Primary key, non-localized token"/>
73 + <columnDefinition name="Component_" type="string" length="72" nullable="yes" modularize="column"
74 + keyTable="Component" keyColumn="1" category="text" description="Foreign key, Component used to determine install state"/>
75 + <columnDefinition name="Name" type="string" length="255" modularize="property"
76 + category="formatted" description="Group name"/>
77 + <columnDefinition name="Domain" type="string" length="255" nullable="yes" modularize="property"
78 + category="formatted" description="Group domain"/>
79 + </tableDefinition>
80 + <tableDefinition name="WixInternetShortcut" createSymbols="yes">
81 + <columnDefinition name="WixInternetShortcut" type="string" length="72" primaryKey="yes" modularize="column"
82 + category="identifier" description="Primary key, non-localized token in table."/>
83 + <columnDefinition name="Component_" type="string" length="72" modularize="column"
84 + keyTable="Component" keyColumn="1" category="text" description="Foreign key, Component used to determine install state"/>
85 + <columnDefinition name="Directory_" type="string" length="72" modularize="column"
86 + keyTable="Directory" keyColumn="1" category="identifier" description="Foreign key referencing directory that the shortcut is created in"/>
87 + <columnDefinition name="Name" type="string" length="72" modularize="property"
88 + category="text" description="Name used for shortcut."/>
89 + <columnDefinition name="Target" type="localized" length="0" escapeIdtCharacters="yes"
90 + category="text" description="URL target."/>
91 + <columnDefinition name="Attributes" type="number" length="2"
92 + description="Attribute flags that control how the shortcut is created."/>
93 + <columnDefinition name="IconFile" type="localized" length="0" escapeIdtCharacters="yes"
94 + category="text" nullable="yes" description="Icon file for shortcut"/>
95 + <columnDefinition name="IconIndex" type="number" length="4"
96 + nullable="yes" description="Index of the icon being referenced."/>
97 + </tableDefinition>
98 + <tableDefinition name="PerformanceCategory">
99 + <columnDefinition name="PerformanceCategory" type="string" length="72" primaryKey="yes" modularize="column"
100 + category="identifier" description="Primary key, non-localized token in table."/>
101 + <columnDefinition name="Component_" type="string" length="72" modularize="column"
102 + keyTable="Component" keyColumn="1" category="identifier" description="Component used to determine install state"/>
103 + <columnDefinition name="Name" type="string" length="80"
104 + category="text" description="Name of the performance counter category."/>
105 + <columnDefinition name="IniData" type="localized" length="0" escapeIdtCharacters="yes"
106 + category="text" description="Data that goes into the performance counter .ini file."/>
107 + <columnDefinition name="ConstantData" type="localized" length="0" escapeIdtCharacters="yes"
108 + category="text" description="Data that goes into the performance counter .h file."/>
109 + </tableDefinition>
110 + <tableDefinition name="Perfmon">
111 + <columnDefinition name="Component_" type="string" length="72" primaryKey="yes" modularize="column"
112 + keyTable="Component" keyColumn="1" category="identifier" description="Component used to determine install state"/>
113 + <columnDefinition name="File" type="string" length="72" primaryKey="yes" modularize="property"
114 + category="formatted" description="Name of .INI file"/>
115 + <columnDefinition name="Name" type="string" length="72" primaryKey="yes"
116 + category="text" description="Service name in registry"/>
117 + </tableDefinition>
118 + <tableDefinition name="PerfmonManifest">
119 + <columnDefinition name="Component_" type="string" length="72" primaryKey="yes" modularize="column"
120 + keyTable="Component" keyColumn="1" category="identifier" description="Component used to determine install state"/>
121 + <columnDefinition name="File" type="string" length="72" primaryKey="yes" modularize="property"
122 + category="formatted" description="Name of perfmon manifest file"/>
123 + <columnDefinition name="ResourceFileDirectory" type="string" length="255" primaryKey="yes"
124 + category="formatted" description="The path of the Resource File Directory"/>
125 + </tableDefinition>
126 + <tableDefinition name="EventManifest">
127 + <columnDefinition name="Component_" type="string" length="72" primaryKey="yes" modularize="column"
128 + keyTable="Component" keyColumn="1" category="identifier" description="Component used to determine install state"/>
129 + <columnDefinition name="File" type="string" length="72" primaryKey="yes" modularize="property"
130 + category="formatted" description="Name of event manifest file"/>
131 + </tableDefinition>
132 + <tableDefinition name="SecureObjects">
133 + <columnDefinition name="SecureObject" type="string" length="72" primaryKey="yes" modularize="column"
134 + category="identifier" description="Primary key, non-localized token in Table"/>
135 + <columnDefinition name="Table" type="string" length="32" primaryKey="yes"
136 + category="text" description="Table SecureObject should be securing"/>
137 + <columnDefinition name="Domain" type="string" length="255" primaryKey="yes" nullable="yes" modularize="property"
138 + category="text" description="Domain half of user account to secure"/>
139 + <columnDefinition name="User" type="string" length="255" primaryKey="yes" modularize="property"
140 + category="text" description="Username half of user account to secure"/>
141 + <columnDefinition name="Permission" type="number" length="4" nullable="yes"
142 + minValue="-2147483647" maxValue="2147483647" description="Permissions to grant to User"/>
143 + <columnDefinition name="Component_" type="string" length="72" modularize="column"
144 + keyTable="Component" keyColumn="1" category="identifier" description="Foreign key into the Component table used to determine install state"/>
145 + </tableDefinition>
146 + <tableDefinition name="ServiceConfig">
147 + <columnDefinition name="ServiceName" type="string" length="72" primaryKey="yes"
148 + category="formatted" description="Primary key, non-localized token"/>
149 + <columnDefinition name="Component_" type="string" length="72" modularize="column"
150 + keyTable="Component" keyColumn="1" category="identifier" description="Foreign key, Component used to determine install state "/>
151 + <columnDefinition name="NewService" type="number" length="1"
152 + minValue="0" maxValue="1" description="Whether the affected service is being installed or already exists."/>
153 + <columnDefinition name="FirstFailureActionType" type="string" length="32"
154 + category="text" description="First failure action type for configured service to take."/>
155 + <columnDefinition name="SecondFailureActionType" type="string" length="32"
156 + category="text" description="Second failure action type for configured service to take."/>
157 + <columnDefinition name="ThirdFailureActionType" type="string" length="32"
158 + category="text" description="Third failure action type for configured service to take."/>
159 + <columnDefinition name="ResetPeriodInDays" type="number" length="4" nullable="yes"
160 + category="integer" minValue="0" description="Period after which to reset the failure count for the service."/>
161 + <columnDefinition name="RestartServiceDelayInSeconds" type="number" length="4" nullable="yes"
162 + category="integer" minValue="0" description="Period after which to restart the service after a given failure."/>
163 + <columnDefinition name="ProgramCommandLine" type="string" length="255" nullable="yes"
164 + category="formatted" description="Command line for program to run if failure action is RUN_COMMAND."/>
165 + <columnDefinition name="RebootMessage" type="string" length="255" nullable="yes"
166 + category="text" description="Message to show to users when rebooting if failure action is REBOOT."/>
167 + </tableDefinition>
168 + <tableDefinition name="WixTouchFile" createSymbols="yes">
169 + <columnDefinition name="WixTouchFile" type="string" length="72" primaryKey="yes" modularize="column"
170 + category="identifier" description="Identifier for the WixTouchFile row in the package."/>
171 + <columnDefinition name="Component_" type="string" length="72" modularize="column"
172 + keyTable="Component" keyColumn="1" category="identifier" description="Foreign key into the Component table used to determine install state"/>
173 + <columnDefinition name="Path" type="string" length="255" modularize="property"
174 + category="formatted" description="Formatted column that resolves to the path to touch."/>
175 + <columnDefinition name="Attributes" type="number" length="2"
176 + minValue="1" maxValue="63" description="1 == Touch only when the associated component is being installed, 2 == Touch only when the associated component is being repaired , 4 == Touch only when the associated component is being removed, 16 = path is in 64-bit location, 32 = touching the file is vital."/>
177 + </tableDefinition>
178 + <tableDefinition name="User" createSymbols="yes">
179 + <columnDefinition name="User" type="string" length="72" primaryKey="yes" modularize="column"
180 + category="identifier" description="Primary key, non-localized token"/>
181 + <columnDefinition name="Component_" type="string" length="72" nullable="yes" modularize="column"
182 + keyTable="Component" keyColumn="1" category="text" description="Foreign key, Component used to determine install state"/>
183 + <columnDefinition name="Name" type="string" length="255" modularize="property"
184 + category="formatted" description="User name"/>
185 + <columnDefinition name="Domain" type="string" length="255" nullable="yes" modularize="property"
186 + category="formatted" description="User domain"/>
187 + <columnDefinition name="Password" type="string" length="255" nullable="yes" modularize="property"
188 + category="formatted" description="User password"/>
189 + <columnDefinition name="Attributes" type="number" length="4" nullable="yes"
190 + minValue="0" maxValue="65535" description="Attributes describing how to create the user"/>
191 + </tableDefinition>
192 + <tableDefinition name="UserGroup">
193 + <columnDefinition name="User_" type="string" length="72" primaryKey="yes" modularize="column"
194 + keyTable="User" keyColumn="1" category="identifier" description="User to be joined to a Group."/>
195 + <columnDefinition name="Group_" type="string" length="72" primaryKey="yes" modularize="column"
196 + keyTable="Group" keyColumn="1" category="identifier" description="User to be joined to a Group."/>
197 + </tableDefinition>
198 + <tableDefinition name="XmlFile">
199 + <columnDefinition name="XmlFile" type="string" length="72" primaryKey="yes" modularize="column"
200 + category="identifier" description="Primary key, non-localized token."/>
201 + <columnDefinition name="File" type="localized" length="255" modularize="property"
202 + category="formatted" description="The .XML file in which to write the information"/>
203 + <columnDefinition name="ElementPath" type="localized" length="0" modularize="property"
204 + category="formatted" description="The .XML file element to modify."/>
205 + <columnDefinition name="Name" type="localized" length="255" modularize="property" nullable="yes"
206 + category="formatted" description="The .XML file node to set/add in the element."/>
207 + <columnDefinition name="Value" type="localized" length="0" modularize="property" nullable="yes"
208 + category="formatted" description="The value to be written."/>
209 + <columnDefinition name="Flags" type="number" length="4"
210 + minValue="0" maxValue="70143" description="Flags"/>
211 + <columnDefinition name="Component_" type="string" length="72" modularize="column"
212 + keyTable="Component" keyColumn="1" category="identifier" description="Foreign key into the Component table referencing component that controls the installing of the .XML value."/>
213 + <columnDefinition name="Sequence" type="number" length="2" nullable="yes"
214 + description="Order to execute the XML modifications."/>
215 + </tableDefinition>
216 + <tableDefinition name="XmlConfig" createSymbols="yes">
217 + <columnDefinition name="XmlConfig" type="string" length="72" primaryKey="yes" modularize="column"
218 + category="identifier" description="Primary key, non-localized token."/>
219 + <columnDefinition name="File" type="localized" length="255" modularize="property"
220 + category="formatted" description="The .XML file in which to write the information"/>
221 + <columnDefinition name="ElementPath" type="localized" length="0" modularize="property"
222 + category="formatted" description="The XPATH query for an element to modify or add children to. Can also be a foreign key reference to another XmlConfig row if no attributes are set and the row referenced is a create element row."/>
223 + <columnDefinition name="VerifyPath" type="localized" length="0" modularize="property" nullable="yes"
224 + category="formatted" description="The XPATH query run from ElementPath to verify whether a repair is necessary. Also used to uninstall."/>
225 + <columnDefinition name="Name" type="localized" length="255" modularize="property" nullable="yes"
226 + category="formatted" description="The .XML file node to set/add in the element."/>
227 + <columnDefinition name="Value" type="localized" length="0" modularize="property" nullable="yes" escapeIdtCharacters="yes"
228 + category="formatted" description="The value to be written."/>
229 + <columnDefinition name="Flags" type="number" length="4"
230 + minValue="0" maxValue="65536" description="Element=1,Value=2,Document=4,Create=16,Delete=32,Install=256,Uninstall=512"/>
231 + <columnDefinition name="Component_" type="string" length="72" modularize="column"
232 + keyTable="Component" keyColumn="1" category="identifier" description="Foreign key into the Component table referencing component that controls the installing of the .XML value."/>
233 + <columnDefinition name="Sequence" type="number" length="2" nullable="yes"
234 + description="Order to execute the XML modifications."/>
235 + </tableDefinition>
236 + <tableDefinition name="WixFormatFiles">
237 + <columnDefinition name="Binary_" type="string" length="72" primaryKey="yes" modularize="column"
238 + keyTable="Binary" keyColumn="1" category="identifier" description="Binary data to be formatted."/>
239 + <columnDefinition name="File_" type="string" length="72" primaryKey="yes" modularize="column"
240 + keyTable="File" keyColumn="1" category="identifier" description="File whose component controls the custom action and where the formatted data is written."/>
241 + </tableDefinition>
242 +</tableDefinitions>
src/wixext/util.cs new
+11461
@@ -0,0 +1,11461 @@
1 +//------------------------------------------------------------------------------
2 +// <auto-generated>
3 +// This code was generated by a tool.
4 +// Runtime Version:4.0.30319.42000
5 +//
6 +// Changes to this file may cause incorrect behavior and will be lost if
7 +// the code is regenerated.
8 +// </auto-generated>
9 +//------------------------------------------------------------------------------
10 +
11 +namespace WixToolset.Util.Serialize
12 +{
13 + using System;
14 + using System.CodeDom.Compiler;
15 + using System.Collections;
16 + using System.Diagnostics.CodeAnalysis;
17 + using System.Globalization;
18 + using System.Xml;
19 + using WixToolset.Data.Serialize;
20 +
21 +
22 + /// <summary>
23 + /// Values of this type will either be "yes" or "no".
24 + /// </summary>
25 + [GeneratedCode("XsdGen", "4.0.0.0")]
26 + public enum YesNoType
27 + {
28 +
29 + IllegalValue = int.MaxValue,
30 +
31 + NotSet = -1,
32 +
33 + no,
34 +
35 + yes,
36 + }
37 +
38 + [GeneratedCode("XsdGen", "4.0.0.0")]
39 + public class Enums
40 + {
41 +
42 + /// <summary>
43 + /// Parses a YesNoType from a string.
44 + /// </summary>
45 + public static YesNoType ParseYesNoType(string value)
46 + {
47 + YesNoType parsedValue;
48 + Enums.TryParseYesNoType(value, out parsedValue);
49 + return parsedValue;
50 + }
51 +
52 + /// <summary>
53 + /// Tries to parse a YesNoType from a string.
54 + /// </summary>
55 + public static bool TryParseYesNoType(string value, out YesNoType parsedValue)
56 + {
57 + parsedValue = YesNoType.NotSet;
58 + if (string.IsNullOrEmpty(value))
59 + {
60 + return false;
61 + }
62 + if (("no" == value))
63 + {
64 + parsedValue = YesNoType.no;
65 + }
66 + else
67 + {
68 + if (("yes" == value))
69 + {
70 + parsedValue = YesNoType.yes;
71 + }
72 + else
73 + {
74 + parsedValue = YesNoType.IllegalValue;
75 + return false;
76 + }
77 + }
78 + return true;
79 + }
80 +
81 + /// <summary>
82 + /// Parses a PerformanceCounterLanguageType from a string.
83 + /// </summary>
84 + public static PerformanceCounterLanguageType ParsePerformanceCounterLanguageType(string value)
85 + {
86 + PerformanceCounterLanguageType parsedValue;
87 + Enums.TryParsePerformanceCounterLanguageType(value, out parsedValue);
88 + return parsedValue;
89 + }
90 +
91 + /// <summary>
92 + /// Tries to parse a PerformanceCounterLanguageType from a string.
93 + /// </summary>
94 + public static bool TryParsePerformanceCounterLanguageType(string value, out PerformanceCounterLanguageType parsedValue)
95 + {
96 + parsedValue = PerformanceCounterLanguageType.NotSet;
97 + if (string.IsNullOrEmpty(value))
98 + {
99 + return false;
100 + }
101 + if (("afrikaans" == value))
102 + {
103 + parsedValue = PerformanceCounterLanguageType.afrikaans;
104 + }
105 + else
106 + {
107 + if (("albanian" == value))
108 + {
109 + parsedValue = PerformanceCounterLanguageType.albanian;
110 + }
111 + else
112 + {
113 + if (("arabic" == value))
114 + {
115 + parsedValue = PerformanceCounterLanguageType.arabic;
116 + }
117 + else
118 + {
119 + if (("armenian" == value))
120 + {
121 + parsedValue = PerformanceCounterLanguageType.armenian;
122 + }
123 + else
124 + {
125 + if (("assamese" == value))
126 + {
127 + parsedValue = PerformanceCounterLanguageType.assamese;
128 + }
129 + else
130 + {
131 + if (("azeri" == value))
132 + {
133 + parsedValue = PerformanceCounterLanguageType.azeri;
134 + }
135 + else
136 + {
137 + if (("basque" == value))
138 + {
139 + parsedValue = PerformanceCounterLanguageType.basque;
140 + }
141 + else
142 + {
143 + if (("belarusian" == value))
144 + {
145 + parsedValue = PerformanceCounterLanguageType.belarusian;
146 + }
147 + else
148 + {
149 + if (("bengali" == value))
150 + {
151 + parsedValue = PerformanceCounterLanguageType.bengali;
152 + }
153 + else
154 + {
155 + if (("bulgarian" == value))
156 + {
157 + parsedValue = PerformanceCounterLanguageType.bulgarian;
158 + }
159 + else
160 + {
161 + if (("catalan" == value))
162 + {
163 + parsedValue = PerformanceCounterLanguageType.catalan;
164 + }
165 + else
166 + {
167 + if (("chinese" == value))
168 + {
169 + parsedValue = PerformanceCounterLanguageType.chinese;
170 + }
171 + else
172 + {
173 + if (("croatian" == value))
174 + {
175 + parsedValue = PerformanceCounterLanguageType.croatian;
176 + }
177 + else
178 + {
179 + if (("czech" == value))
180 + {
181 + parsedValue = PerformanceCounterLanguageType.czech;
182 + }
183 + else
184 + {
185 + if (("danish" == value))
186 + {
187 + parsedValue = PerformanceCounterLanguageType.danish;
188 + }
189 + else
190 + {
191 + if (("divehi" == value))
192 + {
193 + parsedValue = PerformanceCounterLanguageType.divehi;
194 + }
195 + else
196 + {
197 + if (("dutch" == value))
198 + {
199 + parsedValue = PerformanceCounterLanguageType.dutch;
200 + }
201 + else
202 + {
203 + if (("english" == value))
204 + {
205 + parsedValue = PerformanceCounterLanguageType.english;
206 + }
207 + else
208 + {
209 + if (("estonian" == value))
210 + {
211 + parsedValue = PerformanceCounterLanguageType.estonian;
212 + }
213 + else
214 + {
215 + if (("faeroese" == value))
216 + {
217 + parsedValue = PerformanceCounterLanguageType.faeroese;
218 + }
219 + else
220 + {
221 + if (("farsi" == value))
222 + {
223 + parsedValue = PerformanceCounterLanguageType.farsi;
224 + }
225 + else
226 + {
227 + if (("finnish" == value))
228 + {
229 + parsedValue = PerformanceCounterLanguageType.finnish;
230 + }
231 + else
232 + {
233 + if (("french" == value))
234 + {
235 + parsedValue = PerformanceCounterLanguageType.french;
236 + }
237 + else
238 + {
239 + if (("galician" == value))
240 + {
241 + parsedValue = PerformanceCounterLanguageType.galician;
242 + }
243 + else
244 + {
245 + if (("georgian" == value))
246 + {
247 + parsedValue = PerformanceCounterLanguageType.georgian;
248 + }
249 + else
250 + {
251 + if (("german" == value))
252 + {
253 + parsedValue = PerformanceCounterLanguageType.german;
254 + }
255 + else
256 + {
257 + if (("greek" == value))
258 + {
259 + parsedValue = PerformanceCounterLanguageType.greek;
260 + }
261 + else
262 + {
263 + if (("gujarati" == value))
264 + {
265 + parsedValue = PerformanceCounterLanguageType.gujarati;
266 + }
267 + else
268 + {
269 + if (("hebrew" == value))
270 + {
271 + parsedValue = PerformanceCounterLanguageType.hebrew;
272 + }
273 + else
274 + {
275 + if (("hindi" == value))
276 + {
277 + parsedValue = PerformanceCounterLanguageType.hindi;
278 + }
279 + else
280 + {
281 + if (("hungarian" == value))
282 + {
283 + parsedValue = PerformanceCounterLanguageType.hungarian;
284 + }
285 + else
286 + {
287 + if (("icelandic" == value))
288 + {
289 + parsedValue = PerformanceCounterLanguageType.icelandic;
290 + }
291 + else
292 + {
293 + if (("indonesian" == value))
294 + {
295 + parsedValue = PerformanceCounterLanguageType.indonesian;
296 + }
297 + else
298 + {
299 + if (("italian" == value))
300 + {
301 + parsedValue = PerformanceCounterLanguageType.italian;
302 + }
303 + else
304 + {
305 + if (("japanese" == value))
306 + {
307 + parsedValue = PerformanceCounterLanguageType.japanese;
308 + }
309 + else
310 + {
311 + if (("kannada" == value))
312 + {
313 + parsedValue = PerformanceCounterLanguageType.kannada;
314 + }
315 + else
316 + {
317 + if (("kashmiri" == value))
318 + {
319 + parsedValue = PerformanceCounterLanguageType.kashmiri;
320 + }
321 + else
322 + {
323 + if (("kazak" == value))
324 + {
325 + parsedValue = PerformanceCounterLanguageType.kazak;
326 + }
327 + else
328 + {
329 + if (("konkani" == value))
330 + {
331 + parsedValue = PerformanceCounterLanguageType.konkani;
332 + }
333 + else
334 + {
335 + if (("korean" == value))
336 + {
337 + parsedValue = PerformanceCounterLanguageType.korean;
338 + }
339 + else
340 + {
341 + if (("kyrgyz" == value))
342 + {
343 + parsedValue = PerformanceCounterLanguageType.kyrgyz;
344 + }
345 + else
346 + {
347 + if (("latvian" == value))
348 + {
349 + parsedValue = PerformanceCounterLanguageType.latvian;
350 + }
351 + else
352 + {
353 + if (("lithuanian" == value))
354 + {
355 + parsedValue = PerformanceCounterLanguageType.lithuanian;
356 + }
357 + else
358 + {
359 + if (("macedonian" == value))
360 + {
361 + parsedValue = PerformanceCounterLanguageType.macedonian;
362 + }
363 + else
364 + {
365 + if (("malay" == value))
366 + {
367 + parsedValue = PerformanceCounterLanguageType.malay;
368 + }
369 + else
370 + {
371 + if (("malayalam" == value))
372 + {
373 + parsedValue = PerformanceCounterLanguageType.malayalam;
374 + }
375 + else
376 + {
377 + if (("manipuri" == value))
378 + {
379 + parsedValue = PerformanceCounterLanguageType.manipuri;
380 + }
381 + else
382 + {
383 + if (("marathi" == value))
384 + {
385 + parsedValue = PerformanceCounterLanguageType.marathi;
386 + }
387 + else
388 + {
389 + if (("mongolian" == value))
390 + {
391 + parsedValue = PerformanceCounterLanguageType.mongolian;
392 + }
393 + else
394 + {
395 + if (("nepali" == value))
396 + {
397 + parsedValue = PerformanceCounterLanguageType.nepali;
398 + }
399 + else
400 + {
401 + if (("norwegian" == value))
402 + {
403 + parsedValue = PerformanceCounterLanguageType.norwegian;
404 + }
405 + else
406 + {
407 + if (("oriya" == value))
408 + {
409 + parsedValue = PerformanceCounterLanguageType.oriya;
410 + }
411 + else
412 + {
413 + if (("polish" == value))
414 + {
415 + parsedValue = PerformanceCounterLanguageType.polish;
416 + }
417 + else
418 + {
419 + if (("portuguese" == value))
420 + {
421 + parsedValue = PerformanceCounterLanguageType.portuguese;
422 + }
423 + else
424 + {
425 + if (("punjabi" == value))
426 + {
427 + parsedValue = PerformanceCounterLanguageType.punjabi;
428 + }
429 + else
430 + {
431 + if (("romanian" == value))
432 + {
433 + parsedValue = PerformanceCounterLanguageType.romanian;
434 + }
435 + else
436 + {
437 + if (("russian" == value))
438 + {
439 + parsedValue = PerformanceCounterLanguageType.russian;
440 + }
441 + else
442 + {
443 + if (("sanskrit" == value))
444 + {
445 + parsedValue = PerformanceCounterLanguageType.sanskrit;
446 + }
447 + else
448 + {
449 + if (("serbian" == value))
450 + {
451 + parsedValue = PerformanceCounterLanguageType.serbian;
452 + }
453 + else
454 + {
455 + if (("sindhi" == value))
456 + {
457 + parsedValue = PerformanceCounterLanguageType.sindhi;
458 + }
459 + else
460 + {
461 + if (("slovak" == value))
462 + {
463 + parsedValue = PerformanceCounterLanguageType.slovak;
464 + }
465 + else
466 + {
467 + if (("slovenian" == value))
468 + {
469 + parsedValue = PerformanceCounterLanguageType.slovenian;
470 + }
471 + else
472 + {
473 + if (("spanish" == value))
474 + {
475 + parsedValue = PerformanceCounterLanguageType.spanish;
476 + }
477 + else
478 + {
479 + if (("swahili" == value))
480 + {
481 + parsedValue = PerformanceCounterLanguageType.swahili;
482 + }
483 + else
484 + {
485 + if (("swedish" == value))
486 + {
487 + parsedValue = PerformanceCounterLanguageType.swedish;
488 + }
489 + else
490 + {
491 + if (("syriac" == value))
492 + {
493 + parsedValue = PerformanceCounterLanguageType.syriac;
494 + }
495 + else
496 + {
497 + if (("tamil" == value))
498 + {
499 + parsedValue = PerformanceCounterLanguageType.tamil;
500 + }
501 + else
502 + {
503 + if (("tatar" == value))
504 + {
505 + parsedValue = PerformanceCounterLanguageType.tatar;
506 + }
507 + else
508 + {
509 + if (("telugu" == value))
510 + {
511 + parsedValue = PerformanceCounterLanguageType.telugu;
512 + }
513 + else
514 + {
515 + if (("thai" == value))
516 + {
517 + parsedValue = PerformanceCounterLanguageType.thai;
518 + }
519 + else
520 + {
521 + if (("turkish" == value))
522 + {
523 + parsedValue = PerformanceCounterLanguageType.turkish;
524 + }
525 + else
526 + {
527 + if (("ukrainian" == value))
528 + {
529 + parsedValue = PerformanceCounterLanguageType.ukrainian;
530 + }
531 + else
532 + {
533 + if (("urdu" == value))
534 + {
535 + parsedValue = PerformanceCounterLanguageType.urdu;
536 + }
537 + else
538 + {
539 + if (("uzbek" == value))
540 + {
541 + parsedValue = PerformanceCounterLanguageType.uzbek;
542 + }
543 + else
544 + {
545 + if (("vietnamese" == value))
546 + {
547 + parsedValue = PerformanceCounterLanguageType.vietnamese;
548 + }
549 + else
550 + {
551 + parsedValue = PerformanceCounterLanguageType.IllegalValue;
552 + return false;
553 + }
554 + }
555 + }
556 + }
557 + }
558 + }
559 + }
560 + }
561 + }
562 + }
563 + }
564 + }
565 + }
566 + }
567 + }
568 + }
569 + }
570 + }
571 + }
572 + }
573 + }
574 + }
575 + }
576 + }
577 + }
578 + }
579 + }
580 + }
581 + }
582 + }
583 + }
584 + }
585 + }
586 + }
587 + }
588 + }
589 + }
590 + }
591 + }
592 + }
593 + }
594 + }
595 + }
596 + }
597 + }
598 + }
599 + }
600 + }
601 + }
602 + }
603 + }
604 + }
605 + }
606 + }
607 + }
608 + }
609 + }
610 + }
611 + }
612 + }
613 + }
614 + }
615 + }
616 + }
617 + }
618 + }
619 + }
620 + }
621 + }
622 + }
623 + }
624 + }
625 + }
626 + }
627 + }
628 + return true;
629 + }
630 +
631 + /// <summary>
632 + /// Parses a PerformanceCounterTypesType from a string.
633 + /// </summary>
634 + public static PerformanceCounterTypesType ParsePerformanceCounterTypesType(string value)
635 + {
636 + PerformanceCounterTypesType parsedValue;
637 + Enums.TryParsePerformanceCounterTypesType(value, out parsedValue);
638 + return parsedValue;
639 + }
640 +
641 + /// <summary>
642 + /// Tries to parse a PerformanceCounterTypesType from a string.
643 + /// </summary>
644 + public static bool TryParsePerformanceCounterTypesType(string value, out PerformanceCounterTypesType parsedValue)
645 + {
646 + parsedValue = PerformanceCounterTypesType.NotSet;
647 + if (string.IsNullOrEmpty(value))
648 + {
649 + return false;
650 + }
651 + if (("averageBase" == value))
652 + {
653 + parsedValue = PerformanceCounterTypesType.averageBase;
654 + }
655 + else
656 + {
657 + if (("averageCount64" == value))
658 + {
659 + parsedValue = PerformanceCounterTypesType.averageCount64;
660 + }
661 + else
662 + {
663 + if (("averageTimer32" == value))
664 + {
665 + parsedValue = PerformanceCounterTypesType.averageTimer32;
666 + }
667 + else
668 + {
669 + if (("counterDelta32" == value))
670 + {
671 + parsedValue = PerformanceCounterTypesType.counterDelta32;
672 + }
673 + else
674 + {
675 + if (("counterTimerInverse" == value))
676 + {
677 + parsedValue = PerformanceCounterTypesType.counterTimerInverse;
678 + }
679 + else
680 + {
681 + if (("sampleFraction" == value))
682 + {
683 + parsedValue = PerformanceCounterTypesType.sampleFraction;
684 + }
685 + else
686 + {
687 + if (("timer100Ns" == value))
688 + {
689 + parsedValue = PerformanceCounterTypesType.timer100Ns;
690 + }
691 + else
692 + {
693 + if (("counterTimer" == value))
694 + {
695 + parsedValue = PerformanceCounterTypesType.counterTimer;
696 + }
697 + else
698 + {
699 + if (("rawFraction" == value))
700 + {
701 + parsedValue = PerformanceCounterTypesType.rawFraction;
702 + }
703 + else
704 + {
705 + if (("timer100NsInverse" == value))
706 + {
707 + parsedValue = PerformanceCounterTypesType.timer100NsInverse;
708 + }
709 + else
710 + {
711 + if (("counterMultiTimer" == value))
712 + {
713 + parsedValue = PerformanceCounterTypesType.counterMultiTimer;
714 + }
715 + else
716 + {
717 + if (("counterMultiTimer100Ns" == value))
718 + {
719 + parsedValue = PerformanceCounterTypesType.counterMultiTimer100Ns;
720 + }
721 + else
722 + {
723 + if (("counterMultiTimerInverse" == value))
724 + {
725 + parsedValue = PerformanceCounterTypesType.counterMultiTimerInverse;
726 + }
727 + else
728 + {
729 + if (("counterMultiTimer100NsInverse" == value))
730 + {
731 + parsedValue = PerformanceCounterTypesType.counterMultiTimer100NsInverse;
732 + }
733 + else
734 + {
735 + if (("elapsedTime" == value))
736 + {
737 + parsedValue = PerformanceCounterTypesType.elapsedTime;
738 + }
739 + else
740 + {
741 + if (("sampleBase" == value))
742 + {
743 + parsedValue = PerformanceCounterTypesType.sampleBase;
744 + }
745 + else
746 + {
747 + if (("rawBase" == value))
748 + {
749 + parsedValue = PerformanceCounterTypesType.rawBase;
750 + }
751 + else
752 + {
753 + if (("counterMultiBase" == value))
754 + {
755 + parsedValue = PerformanceCounterTypesType.counterMultiBase;
756 + }
757 + else
758 + {
759 + if (("rateOfCountsPerSecond64" == value))
760 + {
761 + parsedValue = PerformanceCounterTypesType.rateOfCountsPerSecond64;
762 + }
763 + else
764 + {
765 + if (("rateOfCountsPerSecond32" == value))
766 + {
767 + parsedValue = PerformanceCounterTypesType.rateOfCountsPerSecond32;
768 + }
769 + else
770 + {
771 + if (("countPerTimeInterval64" == value))
772 + {
773 + parsedValue = PerformanceCounterTypesType.countPerTimeInterval64;
774 + }
775 + else
776 + {
777 + if (("countPerTimeInterval32" == value))
778 + {
779 + parsedValue = PerformanceCounterTypesType.countPerTimeInterval32;
780 + }
781 + else
782 + {
783 + if (("sampleCounter" == value))
784 + {
785 + parsedValue = PerformanceCounterTypesType.sampleCounter;
786 + }
787 + else
788 + {
789 + if (("counterDelta64" == value))
790 + {
791 + parsedValue = PerformanceCounterTypesType.counterDelta64;
792 + }
793 + else
794 + {
795 + if (("numberOfItems64" == value))
796 + {
797 + parsedValue = PerformanceCounterTypesType.numberOfItems64;
798 + }
799 + else
800 + {
801 + if (("numberOfItems32" == value))
802 + {
803 + parsedValue = PerformanceCounterTypesType.numberOfItems32;
804 + }
805 + else
806 + {
807 + if (("numberOfItemsHEX64" == value))
808 + {
809 + parsedValue = PerformanceCounterTypesType.numberOfItemsHEX64;
810 + }
811 + else
812 + {
813 + if (("numberOfItemsHEX32" == value))
814 + {
815 + parsedValue = PerformanceCounterTypesType.numberOfItemsHEX32;
816 + }
817 + else
818 + {
819 + parsedValue = PerformanceCounterTypesType.IllegalValue;
820 + return false;
821 + }
822 + }
823 + }
824 + }
825 + }
826 + }
827 + }
828 + }
829 + }
830 + }
831 + }
832 + }
833 + }
834 + }
835 + }
836 + }
837 + }
838 + }
839 + }
840 + }
841 + }
842 + }
843 + }
844 + }
845 + }
846 + }
847 + }
848 + }
849 + return true;
850 + }
851 + }
852 +
853 + /// <summary>
854 + /// Enumeration of valid languages for performance counters.
855 + /// </summary>
856 + [GeneratedCode("XsdGen", "4.0.0.0")]
857 + public enum PerformanceCounterLanguageType
858 + {
859 +
860 + IllegalValue = int.MaxValue,
861 +
862 + NotSet = -1,
863 +
864 + afrikaans,
865 +
866 + albanian,
867 +
868 + arabic,
869 +
870 + armenian,
871 +
872 + assamese,
873 +
874 + azeri,
875 +
876 + basque,
877 +
878 + belarusian,
879 +
880 + bengali,
881 +
882 + bulgarian,
883 +
884 + catalan,
885 +
886 + chinese,
887 +
888 + croatian,
889 +
890 + czech,
891 +
892 + danish,
893 +
894 + divehi,
895 +
896 + dutch,
897 +
898 + english,
899 +
900 + estonian,
901 +
902 + faeroese,
903 +
904 + farsi,
905 +
906 + finnish,
907 +
908 + french,
909 +
910 + galician,
911 +
912 + georgian,
913 +
914 + german,
915 +
916 + greek,
917 +
918 + gujarati,
919 +
920 + hebrew,
921 +
922 + hindi,
923 +
924 + hungarian,
925 +
926 + icelandic,
927 +
928 + indonesian,
929 +
930 + italian,
931 +
932 + japanese,
933 +
934 + kannada,
935 +
936 + kashmiri,
937 +
938 + kazak,
939 +
940 + konkani,
941 +
942 + korean,
943 +
944 + kyrgyz,
945 +
946 + latvian,
947 +
948 + lithuanian,
949 +
950 + macedonian,
951 +
952 + malay,
953 +
954 + malayalam,
955 +
956 + manipuri,
957 +
958 + marathi,
959 +
960 + mongolian,
961 +
962 + nepali,
963 +
964 + norwegian,
965 +
966 + oriya,
967 +
968 + polish,
969 +
970 + portuguese,
971 +
972 + punjabi,
973 +
974 + romanian,
975 +
976 + russian,
977 +
978 + sanskrit,
979 +
980 + serbian,
981 +
982 + sindhi,
983 +
984 + slovak,
985 +
986 + slovenian,
987 +
988 + spanish,
989 +
990 + swahili,
991 +
992 + swedish,
993 +
994 + syriac,
995 +
996 + tamil,
997 +
998 + tatar,
999 +
1000 + telugu,
1001 +
1002 + thai,
1003 +
1004 + turkish,
1005 +
1006 + ukrainian,
1007 +
1008 + urdu,
1009 +
1010 + uzbek,
1011 +
1012 + vietnamese,
1013 + }
1014 +
1015 + /// <summary>
1016 + /// Enumeration of valid types for performance counters.
1017 + /// </summary>
1018 + [GeneratedCode("XsdGen", "4.0.0.0")]
1019 + public enum PerformanceCounterTypesType
1020 + {
1021 +
1022 + IllegalValue = int.MaxValue,
1023 +
1024 + NotSet = -1,
1025 +
1026 + averageBase,
1027 +
1028 + averageCount64,
1029 +
1030 + averageTimer32,
1031 +
1032 + counterDelta32,
1033 +
1034 + counterTimerInverse,
1035 +
1036 + sampleFraction,
1037 +
1038 + timer100Ns,
1039 +
1040 + counterTimer,
1041 +
1042 + rawFraction,
1043 +
1044 + timer100NsInverse,
1045 +
1046 + counterMultiTimer,
1047 +
1048 + counterMultiTimer100Ns,
1049 +
1050 + counterMultiTimerInverse,
1051 +
1052 + counterMultiTimer100NsInverse,
1053 +
1054 + elapsedTime,
1055 +
1056 + sampleBase,
1057 +
1058 + rawBase,
1059 +
1060 + counterMultiBase,
1061 +
1062 + rateOfCountsPerSecond64,
1063 +
1064 + rateOfCountsPerSecond32,
1065 +
1066 + countPerTimeInterval64,
1067 +
1068 + countPerTimeInterval32,
1069 +
1070 + sampleCounter,
1071 +
1072 + counterDelta64,
1073 +
1074 + numberOfItems64,
1075 +
1076 + numberOfItems32,
1077 +
1078 + numberOfItemsHEX64,
1079 +
1080 + numberOfItemsHEX32,
1081 + }
1082 +
1083 + /// <summary>
1084 + /// Closes applications or schedules a reboot if application cannot be closed.
1085 + /// </summary>
1086 + [GeneratedCode("XsdGen", "4.0.0.0")]
1087 + public class CloseApplication : ISchemaElement, ISetAttributes
1088 + {
1089 +
1090 + private string idField;
1091 +
1092 + private bool idFieldSet;
1093 +
1094 + private string targetField;
1095 +
1096 + private bool targetFieldSet;
1097 +
1098 + private string descriptionField;
1099 +
1100 + private bool descriptionFieldSet;
1101 +
1102 + private int sequenceField;
1103 +
1104 + private bool sequenceFieldSet;
1105 +
1106 + private YesNoType closeMessageField;
1107 +
1108 + private bool closeMessageFieldSet;
1109 +
1110 + private YesNoType endSessionMessageField;
1111 +
1112 + private bool endSessionMessageFieldSet;
1113 +
1114 + private YesNoType elevatedCloseMessageField;
1115 +
1116 + private bool elevatedCloseMessageFieldSet;
1117 +
1118 + private YesNoType elevatedEndSessionMessageField;
1119 +
1120 + private bool elevatedEndSessionMessageFieldSet;
1121 +
1122 + private YesNoType rebootPromptField;
1123 +
1124 + private bool rebootPromptFieldSet;
1125 +
1126 + private YesNoType promptToContinueField;
1127 +
1128 + private bool promptToContinueFieldSet;
1129 +
1130 + private string propertyField;
1131 +
1132 + private bool propertyFieldSet;
1133 +
1134 + private int terminateProcessField;
1135 +
1136 + private bool terminateProcessFieldSet;
1137 +
1138 + private int timeoutField;
1139 +
1140 + private bool timeoutFieldSet;
1141 +
1142 + private string contentField;
1143 +
1144 + private bool contentFieldSet;
1145 +
1146 + private ISchemaElement parentElement;
1147 +
1148 + /// <summary>
1149 + /// Identifier for the close application (primary key). If the Id is not specified, one will be generated.
1150 + /// </summary>
1151 + public string Id
1152 + {
1153 + get
1154 + {
1155 + return this.idField;
1156 + }
1157 + set
1158 + {
1159 + this.idFieldSet = true;
1160 + this.idField = value;
1161 + }
1162 + }
1163 +
1164 + /// <summary>
1165 + /// Name of the exectuable to be closed. This should only be the file name.
1166 + /// </summary>
1167 + public string Target
1168 + {
1169 + get
1170 + {
1171 + return this.targetField;
1172 + }
1173 + set
1174 + {
1175 + this.targetFieldSet = true;
1176 + this.targetField = value;
1177 + }
1178 + }
1179 +
1180 + /// <summary>
1181 + /// Description to show if application is running and needs to be closed.
1182 + /// </summary>
1183 + public string Description
1184 + {
1185 + get
1186 + {
1187 + return this.descriptionField;
1188 + }
1189 + set
1190 + {
1191 + this.descriptionFieldSet = true;
1192 + this.descriptionField = value;
1193 + }
1194 + }
1195 +
1196 + /// <summary>
1197 + /// Optionally orders the applications to be closed.
1198 + /// </summary>
1199 + public int Sequence
1200 + {
1201 + get
1202 + {
1203 + return this.sequenceField;
1204 + }
1205 + set
1206 + {
1207 + this.sequenceFieldSet = true;
1208 + this.sequenceField = value;
1209 + }
1210 + }
1211 +
1212 + /// <summary>
1213 + /// Optionally sends a close message to the application. Default is no.
1214 + /// </summary>
1215 + public YesNoType CloseMessage
1216 + {
1217 + get
1218 + {
1219 + return this.closeMessageField;
1220 + }
1221 + set
1222 + {
1223 + this.closeMessageFieldSet = true;
1224 + this.closeMessageField = value;
1225 + }
1226 + }
1227 +
1228 + /// <summary>
1229 + /// Sends WM_QUERYENDSESSION then WM_ENDSESSION messages to the application. Default is "no".
1230 + /// </summary>
1231 + public YesNoType EndSessionMessage
1232 + {
1233 + get
1234 + {
1235 + return this.endSessionMessageField;
1236 + }
1237 + set
1238 + {
1239 + this.endSessionMessageFieldSet = true;
1240 + this.endSessionMessageField = value;
1241 + }
1242 + }
1243 +
1244 + /// <summary>
1245 + /// Optionally sends a close message to the application from deffered action without impersonation. Default is no.
1246 + /// </summary>
1247 + public YesNoType ElevatedCloseMessage
1248 + {
1249 + get
1250 + {
1251 + return this.elevatedCloseMessageField;
1252 + }
1253 + set
1254 + {
1255 + this.elevatedCloseMessageFieldSet = true;
1256 + this.elevatedCloseMessageField = value;
1257 + }
1258 + }
1259 +
1260 + /// <summary>
1261 + /// Sends WM_QUERYENDSESSION then WM_ENDSESSION messages to the application from a deffered action without impersonation. Default is "no".
1262 + /// </summary>
1263 + public YesNoType ElevatedEndSessionMessage
1264 + {
1265 + get
1266 + {
1267 + return this.elevatedEndSessionMessageField;
1268 + }
1269 + set
1270 + {
1271 + this.elevatedEndSessionMessageFieldSet = true;
1272 + this.elevatedEndSessionMessageField = value;
1273 + }
1274 + }
1275 +
1276 + /// <summary>
1277 + /// 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".
1278 + /// </summary>
1279 + public YesNoType RebootPrompt
1280 + {
1281 + get
1282 + {
1283 + return this.rebootPromptField;
1284 + }
1285 + set
1286 + {
1287 + this.rebootPromptFieldSet = true;
1288 + this.rebootPromptField = value;
1289 + }
1290 + }
1291 +
1292 + /// <summary>
1293 + /// 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
1294 + /// 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
1295 + /// 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
1296 + /// set on the CloseApplication element. The default is "no".
1297 + /// </summary>
1298 + public YesNoType PromptToContinue
1299 + {
1300 + get
1301 + {
1302 + return this.promptToContinueField;
1303 + }
1304 + set
1305 + {
1306 + this.promptToContinueFieldSet = true;
1307 + this.promptToContinueField = value;
1308 + }
1309 + }
1310 +
1311 + /// <summary>
1312 + /// 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.
1313 + /// </summary>
1314 + public string Property
1315 + {
1316 + get
1317 + {
1318 + return this.propertyField;
1319 + }
1320 + set
1321 + {
1322 + this.propertyFieldSet = true;
1323 + this.propertyField = value;
1324 + }
1325 + }
1326 +
1327 + /// <summary>
1328 + /// 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.
1329 + /// If this attribute is specified, the RebootPrompt attribute must be "no". The default is "no".
1330 + /// </summary>
1331 + public int TerminateProcess
1332 + {
1333 + get
1334 + {
1335 + return this.terminateProcessField;
1336 + }
1337 + set
1338 + {
1339 + this.terminateProcessFieldSet = true;
1340 + this.terminateProcessField = value;
1341 + }
1342 + }
1343 +
1344 + /// <summary>
1345 + /// 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
1346 + /// the RebootPrompt or TerminateProcess attributes will be considered. The default value is "5" seconds.
1347 + /// </summary>
1348 + public int Timeout
1349 + {
1350 + get
1351 + {
1352 + return this.timeoutField;
1353 + }
1354 + set
1355 + {
1356 + this.timeoutFieldSet = true;
1357 + this.timeoutField = value;
1358 + }
1359 + }
1360 +
1361 + /// <summary>
1362 + /// Condition that determines if the application should be closed. Must be blank or evaluate to true
1363 + /// for the application to be scheduled for closing.
1364 + /// </summary>
1365 + public string Content
1366 + {
1367 + get
1368 + {
1369 + return this.contentField;
1370 + }
1371 + set
1372 + {
1373 + this.contentFieldSet = true;
1374 + this.contentField = value;
1375 + }
1376 + }
1377 +
1378 + public virtual ISchemaElement ParentElement
1379 + {
1380 + get
1381 + {
1382 + return this.parentElement;
1383 + }
1384 + set
1385 + {
1386 + this.parentElement = value;
1387 + }
1388 + }
1389 +
1390 + /// <summary>
1391 + /// Processes this element and all child elements into an XmlWriter.
1392 + /// </summary>
1393 + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
1394 + public virtual void OutputXml(XmlWriter writer)
1395 + {
1396 + if ((null == writer))
1397 + {
1398 + throw new ArgumentNullException("writer");
1399 + }
1400 + writer.WriteStartElement("CloseApplication", "http://wixtoolset.org/schemas/v4/wxs/util");
1401 + if (this.idFieldSet)
1402 + {
1403 + writer.WriteAttributeString("Id", this.idField);
1404 + }
1405 + if (this.targetFieldSet)
1406 + {
1407 + writer.WriteAttributeString("Target", this.targetField);
1408 + }
1409 + if (this.descriptionFieldSet)
1410 + {
1411 + writer.WriteAttributeString("Description", this.descriptionField);
1412 + }
1413 + if (this.sequenceFieldSet)
1414 + {
1415 + writer.WriteAttributeString("Sequence", this.sequenceField.ToString(CultureInfo.InvariantCulture));
1416 + }
1417 + if (this.closeMessageFieldSet)
1418 + {
1419 + if ((this.closeMessageField == YesNoType.no))
1420 + {
1421 + writer.WriteAttributeString("CloseMessage", "no");
1422 + }
1423 + if ((this.closeMessageField == YesNoType.yes))
1424 + {
1425 + writer.WriteAttributeString("CloseMessage", "yes");
1426 + }
1427 + }
1428 + if (this.endSessionMessageFieldSet)
1429 + {
1430 + if ((this.endSessionMessageField == YesNoType.no))
1431 + {
1432 + writer.WriteAttributeString("EndSessionMessage", "no");
1433 + }
1434 + if ((this.endSessionMessageField == YesNoType.yes))
1435 + {
1436 + writer.WriteAttributeString("EndSessionMessage", "yes");
1437 + }
1438 + }
1439 + if (this.elevatedCloseMessageFieldSet)
1440 + {
1441 + if ((this.elevatedCloseMessageField == YesNoType.no))
1442 + {
1443 + writer.WriteAttributeString("ElevatedCloseMessage", "no");
1444 + }
1445 + if ((this.elevatedCloseMessageField == YesNoType.yes))
1446 + {
1447 + writer.WriteAttributeString("ElevatedCloseMessage", "yes");
1448 + }
1449 + }
1450 + if (this.elevatedEndSessionMessageFieldSet)
1451 + {
1452 + if ((this.elevatedEndSessionMessageField == YesNoType.no))
1453 + {
1454 + writer.WriteAttributeString("ElevatedEndSessionMessage", "no");
1455 + }
1456 + if ((this.elevatedEndSessionMessageField == YesNoType.yes))
1457 + {
1458 + writer.WriteAttributeString("ElevatedEndSessionMessage", "yes");
1459 + }
1460 + }
1461 + if (this.rebootPromptFieldSet)
1462 + {
1463 + if ((this.rebootPromptField == YesNoType.no))
1464 + {
1465 + writer.WriteAttributeString("RebootPrompt", "no");
1466 + }
1467 + if ((this.rebootPromptField == YesNoType.yes))
1468 + {
1469 + writer.WriteAttributeString("RebootPrompt", "yes");
1470 + }
1471 + }
1472 + if (this.promptToContinueFieldSet)
1473 + {
1474 + if ((this.promptToContinueField == YesNoType.no))
1475 + {
1476 + writer.WriteAttributeString("PromptToContinue", "no");
1477 + }
1478 + if ((this.promptToContinueField == YesNoType.yes))
1479 + {
1480 + writer.WriteAttributeString("PromptToContinue", "yes");
1481 + }
1482 + }
1483 + if (this.propertyFieldSet)
1484 + {
1485 + writer.WriteAttributeString("Property", this.propertyField);
1486 + }
1487 + if (this.terminateProcessFieldSet)
1488 + {
1489 + writer.WriteAttributeString("TerminateProcess", this.terminateProcessField.ToString(CultureInfo.InvariantCulture));
1490 + }
1491 + if (this.timeoutFieldSet)
1492 + {
1493 + writer.WriteAttributeString("Timeout", this.timeoutField.ToString(CultureInfo.InvariantCulture));
1494 + }
1495 + if (this.contentFieldSet)
1496 + {
1497 + writer.WriteString(this.contentField);
1498 + }
1499 + writer.WriteEndElement();
1500 + }
1501 +
1502 + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
1503 + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
1504 + void ISetAttributes.SetAttribute(string name, string value)
1505 + {
1506 + if (String.IsNullOrEmpty(name))
1507 + {
1508 + throw new ArgumentNullException("name");
1509 + }
1510 + if (("Id" == name))
1511 + {
1512 + this.idField = value;
1513 + this.idFieldSet = true;
1514 + }
1515 + if (("Target" == name))
1516 + {
1517 + this.targetField = value;
1518 + this.targetFieldSet = true;
1519 + }
1520 + if (("Description" == name))
1521 + {
1522 + this.descriptionField = value;
1523 + this.descriptionFieldSet = true;
1524 + }
1525 + if (("Sequence" == name))
1526 + {
1527 + this.sequenceField = Convert.ToInt32(value, CultureInfo.InvariantCulture);
1528 + this.sequenceFieldSet = true;
1529 + }
1530 + if (("CloseMessage" == name))
1531 + {
1532 + this.closeMessageField = Enums.ParseYesNoType(value);
1533 + this.closeMessageFieldSet = true;
1534 + }
1535 + if (("EndSessionMessage" == name))
1536 + {
1537 + this.endSessionMessageField = Enums.ParseYesNoType(value);
1538 + this.endSessionMessageFieldSet = true;
1539 + }
1540 + if (("ElevatedCloseMessage" == name))
1541 + {
1542 + this.elevatedCloseMessageField = Enums.ParseYesNoType(value);
1543 + this.elevatedCloseMessageFieldSet = true;
1544 + }
1545 + if (("ElevatedEndSessionMessage" == name))
1546 + {
1547 + this.elevatedEndSessionMessageField = Enums.ParseYesNoType(value);
1548 + this.elevatedEndSessionMessageFieldSet = true;
1549 + }
1550 + if (("RebootPrompt" == name))
1551 + {
1552 + this.rebootPromptField = Enums.ParseYesNoType(value);
1553 + this.rebootPromptFieldSet = true;
1554 + }
1555 + if (("PromptToContinue" == name))
1556 + {
1557 + this.promptToContinueField = Enums.ParseYesNoType(value);
1558 + this.promptToContinueFieldSet = true;
1559 + }
1560 + if (("Property" == name))
1561 + {
1562 + this.propertyField = value;
1563 + this.propertyFieldSet = true;
1564 + }
1565 + if (("TerminateProcess" == name))
1566 + {
1567 + this.terminateProcessField = Convert.ToInt32(value, CultureInfo.InvariantCulture);
1568 + this.terminateProcessFieldSet = true;
1569 + }
1570 + if (("Timeout" == name))
1571 + {
1572 + this.timeoutField = Convert.ToInt32(value, CultureInfo.InvariantCulture);
1573 + this.timeoutFieldSet = true;
1574 + }
1575 + if (("Content" == name))
1576 + {
1577 + this.contentField = value;
1578 + this.contentFieldSet = true;
1579 + }
1580 + }
1581 + }
1582 +
1583 + /// <summary>
1584 + /// Describes a component search.
1585 + /// </summary>
1586 + [GeneratedCode("XsdGen", "4.0.0.0")]
1587 + public class ComponentSearch : ISchemaElement, ISetAttributes
1588 + {
1589 +
1590 + private string idField;
1591 +
1592 + private bool idFieldSet;
1593 +
1594 + private string variableField;
1595 +
1596 + private bool variableFieldSet;
1597 +
1598 + private string conditionField;
1599 +
1600 + private bool conditionFieldSet;
1601 +
1602 + private string afterField;
1603 +
1604 + private bool afterFieldSet;
1605 +
1606 + private string guidField;
1607 +
1608 + private bool guidFieldSet;
1609 +
1610 + private string productCodeField;
1611 +
1612 + private bool productCodeFieldSet;
1613 +
1614 + private ResultType resultField;
1615 +
1616 + private bool resultFieldSet;
1617 +
1618 + private ISchemaElement parentElement;
1619 +
1620 + /// <summary>
1621 + /// Id of the search for ordering and dependency.
1622 + /// </summary>
1623 + public string Id
1624 + {
1625 + get
1626 + {
1627 + return this.idField;
1628 + }
1629 + set
1630 + {
1631 + this.idFieldSet = true;
1632 + this.idField = value;
1633 + }
1634 + }
1635 +
1636 + /// <summary>
1637 + /// Name of the variable in which to place the result of the search.
1638 + /// </summary>
1639 + public string Variable
1640 + {
1641 + get
1642 + {
1643 + return this.variableField;
1644 + }
1645 + set
1646 + {
1647 + this.variableFieldSet = true;
1648 + this.variableField = value;
1649 + }
1650 + }
1651 +
1652 + /// <summary>
1653 + /// Condition for evaluating the search. If this evaluates to false, the search is not executed at all.
1654 + /// </summary>
1655 + public string Condition
1656 + {
1657 + get
1658 + {
1659 + return this.conditionField;
1660 + }
1661 + set
1662 + {
1663 + this.conditionFieldSet = true;
1664 + this.conditionField = value;
1665 + }
1666 + }
1667 +
1668 + /// <summary>
1669 + /// Id of the search that this one should come after.
1670 + /// </summary>
1671 + public string After
1672 + {
1673 + get
1674 + {
1675 + return this.afterField;
1676 + }
1677 + set
1678 + {
1679 + this.afterFieldSet = true;
1680 + this.afterField = value;
1681 + }
1682 + }
1683 +
1684 + /// <summary>
1685 + /// Component to search for.
1686 + /// </summary>
1687 + public string Guid
1688 + {
1689 + get
1690 + {
1691 + return this.guidField;
1692 + }
1693 + set
1694 + {
1695 + this.guidFieldSet = true;
1696 + this.guidField = value;
1697 + }
1698 + }
1699 +
1700 + /// <summary>
1701 + /// Optional ProductCode to determine if the component is installed.
1702 + /// </summary>
1703 + public string ProductCode
1704 + {
1705 + get
1706 + {
1707 + return this.productCodeField;
1708 + }
1709 + set
1710 + {
1711 + this.productCodeFieldSet = true;
1712 + this.productCodeField = value;
1713 + }
1714 + }
1715 +
1716 + /// <summary>
1717 + /// Rather than saving the matching key path into the variable, a ComponentSearch can save an attribute of the component instead.
1718 + /// </summary>
1719 + public ResultType Result
1720 + {
1721 + get
1722 + {
1723 + return this.resultField;
1724 + }
1725 + set
1726 + {
1727 + this.resultFieldSet = true;
1728 + this.resultField = value;
1729 + }
1730 + }
1731 +
1732 + public virtual ISchemaElement ParentElement
1733 + {
1734 + get
1735 + {
1736 + return this.parentElement;
1737 + }
1738 + set
1739 + {
1740 + this.parentElement = value;
1741 + }
1742 + }
1743 +
1744 + /// <summary>
1745 + /// Parses a ResultType from a string.
1746 + /// </summary>
1747 + public static ResultType ParseResultType(string value)
1748 + {
1749 + ResultType parsedValue;
1750 + ComponentSearch.TryParseResultType(value, out parsedValue);
1751 + return parsedValue;
1752 + }
1753 +
1754 + /// <summary>
1755 + /// Tries to parse a ResultType from a string.
1756 + /// </summary>
1757 + public static bool TryParseResultType(string value, out ResultType parsedValue)
1758 + {
1759 + parsedValue = ResultType.NotSet;
1760 + if (string.IsNullOrEmpty(value))
1761 + {
1762 + return false;
1763 + }
1764 + if (("directory" == value))
1765 + {
1766 + parsedValue = ResultType.directory;
1767 + }
1768 + else
1769 + {
1770 + if (("state" == value))
1771 + {
1772 + parsedValue = ResultType.state;
1773 + }
1774 + else
1775 + {
1776 + if (("keyPath" == value))
1777 + {
1778 + parsedValue = ResultType.keyPath;
1779 + }
1780 + else
1781 + {
1782 + parsedValue = ResultType.IllegalValue;
1783 + return false;
1784 + }
1785 + }
1786 + }
1787 + return true;
1788 + }
1789 +
1790 + /// <summary>
1791 + /// Processes this element and all child elements into an XmlWriter.
1792 + /// </summary>
1793 + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
1794 + public virtual void OutputXml(XmlWriter writer)
1795 + {
1796 + if ((null == writer))
1797 + {
1798 + throw new ArgumentNullException("writer");
1799 + }
1800 + writer.WriteStartElement("ComponentSearch", "http://wixtoolset.org/schemas/v4/wxs/util");
1801 + if (this.idFieldSet)
1802 + {
1803 + writer.WriteAttributeString("Id", this.idField);
1804 + }
1805 + if (this.variableFieldSet)
1806 + {
1807 + writer.WriteAttributeString("Variable", this.variableField);
1808 + }
1809 + if (this.conditionFieldSet)
1810 + {
1811 + writer.WriteAttributeString("Condition", this.conditionField);
1812 + }
1813 + if (this.afterFieldSet)
1814 + {
1815 + writer.WriteAttributeString("After", this.afterField);
1816 + }
1817 + if (this.guidFieldSet)
1818 + {
1819 + writer.WriteAttributeString("Guid", this.guidField);
1820 + }
1821 + if (this.productCodeFieldSet)
1822 + {
1823 + writer.WriteAttributeString("ProductCode", this.productCodeField);
1824 + }
1825 + if (this.resultFieldSet)
1826 + {
1827 + if ((this.resultField == ResultType.directory))
1828 + {
1829 + writer.WriteAttributeString("Result", "directory");
1830 + }
1831 + if ((this.resultField == ResultType.state))
1832 + {
1833 + writer.WriteAttributeString("Result", "state");
1834 + }
1835 + if ((this.resultField == ResultType.keyPath))
1836 + {
1837 + writer.WriteAttributeString("Result", "keyPath");
1838 + }
1839 + }
1840 + writer.WriteEndElement();
1841 + }
1842 +
1843 + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
1844 + void ISetAttributes.SetAttribute(string name, string value)
1845 + {
1846 + if (String.IsNullOrEmpty(name))
1847 + {
1848 + throw new ArgumentNullException("name");
1849 + }
1850 + if (("Id" == name))
1851 + {
1852 + this.idField = value;
1853 + this.idFieldSet = true;
1854 + }
1855 + if (("Variable" == name))
1856 + {
1857 + this.variableField = value;
1858 + this.variableFieldSet = true;
1859 + }
1860 + if (("Condition" == name))
1861 + {
1862 + this.conditionField = value;
1863 + this.conditionFieldSet = true;
1864 + }
1865 + if (("After" == name))
1866 + {
1867 + this.afterField = value;
1868 + this.afterFieldSet = true;
1869 + }
1870 + if (("Guid" == name))
1871 + {
1872 + this.guidField = value;
1873 + this.guidFieldSet = true;
1874 + }
1875 + if (("ProductCode" == name))
1876 + {
1877 + this.productCodeField = value;
1878 + this.productCodeFieldSet = true;
1879 + }
1880 + if (("Result" == name))
1881 + {
1882 + this.resultField = ComponentSearch.ParseResultType(value);
1883 + this.resultFieldSet = true;
1884 + }
1885 + }
1886 +
1887 + [GeneratedCode("XsdGen", "4.0.0.0")]
1888 + public enum ResultType
1889 + {
1890 +
1891 + IllegalValue = int.MaxValue,
1892 +
1893 + NotSet = -1,
1894 +
1895 + /// <summary>
1896 + /// Saves the parent directory for the component's file key path; other types of key path are returned unmodified.
1897 + /// </summary>
1898 + directory,
1899 +
1900 + /// <summary>
1901 + /// 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)
1902 + /// </summary>
1903 + state,
1904 +
1905 + /// <summary>
1906 + /// Saves the key path of the component if installed. This is the default.
1907 + /// </summary>
1908 + keyPath,
1909 + }
1910 + }
1911 +
1912 + /// <summary>
1913 + /// References a ComponentSearch.
1914 + /// </summary>
1915 + [GeneratedCode("XsdGen", "4.0.0.0")]
1916 + public class ComponentSearchRef : ISchemaElement, ISetAttributes
1917 + {
1918 +
1919 + private string idField;
1920 +
1921 + private bool idFieldSet;
1922 +
1923 + private ISchemaElement parentElement;
1924 +
1925 + public string Id
1926 + {
1927 + get
1928 + {
1929 + return this.idField;
1930 + }
1931 + set
1932 + {
1933 + this.idFieldSet = true;
1934 + this.idField = value;
1935 + }
1936 + }
1937 +
1938 + public virtual ISchemaElement ParentElement
1939 + {
1940 + get
1941 + {
1942 + return this.parentElement;
1943 + }
1944 + set
1945 + {
1946 + this.parentElement = value;
1947 + }
1948 + }
1949 +
1950 + /// <summary>
1951 + /// Processes this element and all child elements into an XmlWriter.
1952 + /// </summary>
1953 + public virtual void OutputXml(XmlWriter writer)
1954 + {
1955 + if ((null == writer))
1956 + {
1957 + throw new ArgumentNullException("writer");
1958 + }
1959 + writer.WriteStartElement("ComponentSearchRef", "http://wixtoolset.org/schemas/v4/wxs/util");
1960 + if (this.idFieldSet)
1961 + {
1962 + writer.WriteAttributeString("Id", this.idField);
1963 + }
1964 + writer.WriteEndElement();
1965 + }
1966 +
1967 + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
1968 + void ISetAttributes.SetAttribute(string name, string value)
1969 + {
1970 + if (String.IsNullOrEmpty(name))
1971 + {
1972 + throw new ArgumentNullException("name");
1973 + }
1974 + if (("Id" == name))
1975 + {
1976 + this.idField = value;
1977 + this.idFieldSet = true;
1978 + }
1979 + }
1980 + }
1981 +
1982 + /// <summary>
1983 + /// Describes a directory search.
1984 + /// </summary>
1985 + [GeneratedCode("XsdGen", "4.0.0.0")]
1986 + public class DirectorySearch : ISchemaElement, ISetAttributes
1987 + {
1988 +
1989 + private string idField;
1990 +
1991 + private bool idFieldSet;
1992 +
1993 + private string variableField;
1994 +
1995 + private bool variableFieldSet;
1996 +
1997 + private string conditionField;
1998 +
1999 + private bool conditionFieldSet;
2000 +
2001 + private string afterField;
2002 +
2003 + private bool afterFieldSet;
2004 +
2005 + private string pathField;
2006 +
2007 + private bool pathFieldSet;
2008 +
2009 + private ResultType resultField;
2010 +
2011 + private bool resultFieldSet;
2012 +
2013 + private ISchemaElement parentElement;
2014 +
2015 + /// <summary>
2016 + /// Id of the search for ordering and dependency.
2017 + /// </summary>
2018 + public string Id
2019 + {
2020 + get
2021 + {
2022 + return this.idField;
2023 + }
2024 + set
2025 + {
2026 + this.idFieldSet = true;
2027 + this.idField = value;
2028 + }
2029 + }
2030 +
2031 + /// <summary>
2032 + /// Name of the variable in which to place the result of the search.
2033 + /// </summary>
2034 + public string Variable
2035 + {
2036 + get
2037 + {
2038 + return this.variableField;
2039 + }
2040 + set
2041 + {
2042 + this.variableFieldSet = true;
2043 + this.variableField = value;
2044 + }
2045 + }
2046 +
2047 + /// <summary>
2048 + /// Condition for evaluating the search. If this evaluates to false, the search is not executed at all.
2049 + /// </summary>
2050 + public string Condition
2051 + {
2052 + get
2053 + {
2054 + return this.conditionField;
2055 + }
2056 + set
2057 + {
2058 + this.conditionFieldSet = true;
2059 + this.conditionField = value;
2060 + }
2061 + }
2062 +
2063 + /// <summary>
2064 + /// Id of the search that this one should come after.
2065 + /// </summary>
2066 + public string After
2067 + {
2068 + get
2069 + {
2070 + return this.afterField;
2071 + }
2072 + set
2073 + {
2074 + this.afterFieldSet = true;
2075 + this.afterField = value;
2076 + }
2077 + }
2078 +
2079 + /// <summary>
2080 + /// Directory path to search for.
2081 + /// </summary>
2082 + public string Path
2083 + {
2084 + get
2085 + {
2086 + return this.pathField;
2087 + }
2088 + set
2089 + {
2090 + this.pathFieldSet = true;
2091 + this.pathField = value;
2092 + }
2093 + }
2094 +
2095 + /// <summary>
2096 + /// Rather than saving the matching directory path into the variable, a DirectorySearch can save an
2097 + /// attribute of the matching directory instead.
2098 + /// </summary>
2099 + public ResultType Result
2100 + {
2101 + get
2102 + {
2103 + return this.resultField;
2104 + }
2105 + set
2106 + {
2107 + this.resultFieldSet = true;
2108 + this.resultField = value;
2109 + }
2110 + }
2111 +
2112 + public virtual ISchemaElement ParentElement
2113 + {
2114 + get
2115 + {
2116 + return this.parentElement;
2117 + }
2118 + set
2119 + {
2120 + this.parentElement = value;
2121 + }
2122 + }
2123 +
2124 + /// <summary>
2125 + /// Parses a ResultType from a string.
2126 + /// </summary>
2127 + public static ResultType ParseResultType(string value)
2128 + {
2129 + ResultType parsedValue;
2130 + DirectorySearch.TryParseResultType(value, out parsedValue);
2131 + return parsedValue;
2132 + }
2133 +
2134 + /// <summary>
2135 + /// Tries to parse a ResultType from a string.
2136 + /// </summary>
2137 + public static bool TryParseResultType(string value, out ResultType parsedValue)
2138 + {
2139 + parsedValue = ResultType.NotSet;
2140 + if (string.IsNullOrEmpty(value))
2141 + {
2142 + return false;
2143 + }
2144 + if (("exists" == value))
2145 + {
2146 + parsedValue = ResultType.exists;
2147 + }
2148 + else
2149 + {
2150 + parsedValue = ResultType.IllegalValue;
2151 + return false;
2152 + }
2153 + return true;
2154 + }
2155 +
2156 + /// <summary>
2157 + /// Processes this element and all child elements into an XmlWriter.
2158 + /// </summary>
2159 + public virtual void OutputXml(XmlWriter writer)
2160 + {
2161 + if ((null == writer))
2162 + {
2163 + throw new ArgumentNullException("writer");
2164 + }
2165 + writer.WriteStartElement("DirectorySearch", "http://wixtoolset.org/schemas/v4/wxs/util");
2166 + if (this.idFieldSet)
2167 + {
2168 + writer.WriteAttributeString("Id", this.idField);
2169 + }
2170 + if (this.variableFieldSet)
2171 + {
2172 + writer.WriteAttributeString("Variable", this.variableField);
2173 + }
2174 + if (this.conditionFieldSet)
2175 + {
2176 + writer.WriteAttributeString("Condition", this.conditionField);
2177 + }
2178 + if (this.afterFieldSet)
2179 + {
2180 + writer.WriteAttributeString("After", this.afterField);
2181 + }
2182 + if (this.pathFieldSet)
2183 + {
2184 + writer.WriteAttributeString("Path", this.pathField);
2185 + }
2186 + if (this.resultFieldSet)
2187 + {
2188 + if ((this.resultField == ResultType.exists))
2189 + {
2190 + writer.WriteAttributeString("Result", "exists");
2191 + }
2192 + }
2193 + writer.WriteEndElement();
2194 + }
2195 +
2196 + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
2197 + void ISetAttributes.SetAttribute(string name, string value)
2198 + {
2199 + if (String.IsNullOrEmpty(name))
2200 + {
2201 + throw new ArgumentNullException("name");
2202 + }
2203 + if (("Id" == name))
2204 + {
2205 + this.idField = value;
2206 + this.idFieldSet = true;
2207 + }
2208 + if (("Variable" == name))
2209 + {
2210 + this.variableField = value;
2211 + this.variableFieldSet = true;
2212 + }
2213 + if (("Condition" == name))
2214 + {
2215 + this.conditionField = value;
2216 + this.conditionFieldSet = true;
2217 + }
2218 + if (("After" == name))
2219 + {
2220 + this.afterField = value;
2221 + this.afterFieldSet = true;
2222 + }
2223 + if (("Path" == name))
2224 + {
2225 + this.pathField = value;
2226 + this.pathFieldSet = true;
2227 + }
2228 + if (("Result" == name))
2229 + {
2230 + this.resultField = DirectorySearch.ParseResultType(value);
2231 + this.resultFieldSet = true;
2232 + }
2233 + }
2234 +
2235 + [GeneratedCode("XsdGen", "4.0.0.0")]
2236 + public enum ResultType
2237 + {
2238 +
2239 + IllegalValue = int.MaxValue,
2240 +
2241 + NotSet = -1,
2242 +
2243 + /// <summary>
2244 + /// Saves true if a matching directory is found; false otherwise.
2245 + /// </summary>
2246 + exists,
2247 + }
2248 + }
2249 +
2250 + /// <summary>
2251 + /// References a DirectorySearch.
2252 + /// </summary>
2253 + [GeneratedCode("XsdGen", "4.0.0.0")]
2254 + public class DirectorySearchRef : ISchemaElement, ISetAttributes
2255 + {
2256 +
2257 + private string idField;
2258 +
2259 + private bool idFieldSet;
2260 +
2261 + private ISchemaElement parentElement;
2262 +
2263 + public string Id
2264 + {
2265 + get
2266 + {
2267 + return this.idField;
2268 + }
2269 + set
2270 + {
2271 + this.idFieldSet = true;
2272 + this.idField = value;
2273 + }
2274 + }
2275 +
2276 + public virtual ISchemaElement ParentElement
2277 + {
2278 + get
2279 + {
2280 + return this.parentElement;
2281 + }
2282 + set
2283 + {
2284 + this.parentElement = value;
2285 + }
2286 + }
2287 +
2288 + /// <summary>
2289 + /// Processes this element and all child elements into an XmlWriter.
2290 + /// </summary>
2291 + public virtual void OutputXml(XmlWriter writer)
2292 + {
2293 + if ((null == writer))
2294 + {
2295 + throw new ArgumentNullException("writer");
2296 + }
2297 + writer.WriteStartElement("DirectorySearchRef", "http://wixtoolset.org/schemas/v4/wxs/util");
2298 + if (this.idFieldSet)
2299 + {
2300 + writer.WriteAttributeString("Id", this.idField);
2301 + }
2302 + writer.WriteEndElement();
2303 + }
2304 +
2305 + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
2306 + void ISetAttributes.SetAttribute(string name, string value)
2307 + {
2308 + if (String.IsNullOrEmpty(name))
2309 + {
2310 + throw new ArgumentNullException("name");
2311 + }
2312 + if (("Id" == name))
2313 + {
2314 + this.idField = value;
2315 + this.idFieldSet = true;
2316 + }
2317 + }
2318 + }
2319 +
2320 + /// <summary>
2321 + /// Creates an event source.
2322 + /// </summary>
2323 + [GeneratedCode("XsdGen", "4.0.0.0")]
2324 + public class EventSource : ISchemaElement, ISetAttributes
2325 + {
2326 +
2327 + private int categoryCountField;
2328 +
2329 + private bool categoryCountFieldSet;
2330 +
2331 + private string categoryMessageFileField;
2332 +
2333 + private bool categoryMessageFileFieldSet;
2334 +
2335 + private string eventMessageFileField;
2336 +
2337 + private bool eventMessageFileFieldSet;
2338 +
2339 + private YesNoType keyPathField;
2340 +
2341 + private bool keyPathFieldSet;
2342 +
2343 + private string logField;
2344 +
2345 + private bool logFieldSet;
2346 +
2347 + private string nameField;
2348 +
2349 + private bool nameFieldSet;
2350 +
2351 + private string parameterMessageFileField;
2352 +
2353 + private bool parameterMessageFileFieldSet;
2354 +
2355 + private YesNoType supportsErrorsField;
2356 +
2357 + private bool supportsErrorsFieldSet;
2358 +
2359 + private YesNoType supportsFailureAuditsField;
2360 +
2361 + private bool supportsFailureAuditsFieldSet;
2362 +
2363 + private YesNoType supportsInformationalsField;
2364 +
2365 + private bool supportsInformationalsFieldSet;
2366 +
2367 + private YesNoType supportsSuccessAuditsField;
2368 +
2369 + private bool supportsSuccessAuditsFieldSet;
2370 +
2371 + private YesNoType supportsWarningsField;
2372 +
2373 + private bool supportsWarningsFieldSet;
2374 +
2375 + private ISchemaElement parentElement;
2376 +
2377 + /// <summary>
2378 + /// The number of categories in CategoryMessageFile. CategoryMessageFile
2379 + /// must be specified too.
2380 + /// </summary>
2381 + public int CategoryCount
2382 + {
2383 + get
2384 + {
2385 + return this.categoryCountField;
2386 + }
2387 + set
2388 + {
2389 + this.categoryCountFieldSet = true;
2390 + this.categoryCountField = value;
2391 + }
2392 + }
2393 +
2394 + /// <summary>
2395 + /// Name of the category message file. CategoryCount must be specified too.
2396 + /// Note that this is a formatted field, so you can use [#fileId] syntax to
2397 + /// refer to a file being installed. It is also written as a REG_EXPAND_SZ
2398 + /// string, so you can use %environment_variable% syntax to refer to a file
2399 + /// already present on the user's machine.
2400 + /// </summary>
2401 + public string CategoryMessageFile
2402 + {
2403 + get
2404 + {
2405 + return this.categoryMessageFileField;
2406 + }
2407 + set
2408 + {
2409 + this.categoryMessageFileFieldSet = true;
2410 + this.categoryMessageFileField = value;
2411 + }
2412 + }
2413 +
2414 + /// <summary>
2415 + /// Name of the event message file.
2416 + /// Note that this is a formatted field, so you can use [#fileId] syntax to
2417 + /// refer to a file being installed. It is also written as a REG_EXPAND_SZ
2418 + /// string, so you can use %environment_variable% syntax to refer to a file
2419 + /// already present on the user's machine.
2420 + /// </summary>
2421 + public string EventMessageFile
2422 + {
2423 + get
2424 + {
2425 + return this.eventMessageFileField;
2426 + }
2427 + set
2428 + {
2429 + this.eventMessageFileFieldSet = true;
2430 + this.eventMessageFileField = value;
2431 + }
2432 + }
2433 +
2434 + /// <summary>
2435 + /// Marks the EventSource registry as the key path of the component it belongs to.
2436 + /// </summary>
2437 + public YesNoType KeyPath
2438 + {
2439 + get
2440 + {
2441 + return this.keyPathField;
2442 + }
2443 + set
2444 + {
2445 + this.keyPathFieldSet = true;
2446 + this.keyPathField = value;
2447 + }
2448 + }
2449 +
2450 + /// <summary>
2451 + /// Name of the event source's log.
2452 + /// </summary>
2453 + public string Log
2454 + {
2455 + get
2456 + {
2457 + return this.logField;
2458 + }
2459 + set
2460 + {
2461 + this.logFieldSet = true;
2462 + this.logField = value;
2463 + }
2464 + }
2465 +
2466 + /// <summary>
2467 + /// Name of the event source.
2468 + /// </summary>
2469 + public string Name
2470 + {
2471 + get
2472 + {
2473 + return this.nameField;
2474 + }
2475 + set
2476 + {
2477 + this.nameFieldSet = true;
2478 + this.nameField = value;
2479 + }
2480 + }
2481 +
2482 + /// <summary>
2483 + /// Name of the parameter message file.
2484 + /// Note that this is a formatted field, so you can use [#fileId] syntax to
2485 + /// refer to a file being installed. It is also written as a REG_EXPAND_SZ
2486 + /// string, so you can use %environment_variable% syntax to refer to a file
2487 + /// already present on the user's machine.
2488 + /// </summary>
2489 + public string ParameterMessageFile
2490 + {
2491 + get
2492 + {
2493 + return this.parameterMessageFileField;
2494 + }
2495 + set
2496 + {
2497 + this.parameterMessageFileFieldSet = true;
2498 + this.parameterMessageFileField = value;
2499 + }
2500 + }
2501 +
2502 + /// <summary>
2503 + /// Equivalent to EVENTLOG_ERROR_TYPE.
2504 + /// </summary>
2505 + public YesNoType SupportsErrors
2506 + {
2507 + get
2508 + {
2509 + return this.supportsErrorsField;
2510 + }
2511 + set
2512 + {
2513 + this.supportsErrorsFieldSet = true;
2514 + this.supportsErrorsField = value;
2515 + }
2516 + }
2517 +
2518 + /// <summary>
2519 + /// Equivalent to EVENTLOG_AUDIT_FAILURE.
2520 + /// </summary>
2521 + public YesNoType SupportsFailureAudits
2522 + {
2523 + get
2524 + {
2525 + return this.supportsFailureAuditsField;
2526 + }
2527 + set
2528 + {
2529 + this.supportsFailureAuditsFieldSet = true;
2530 + this.supportsFailureAuditsField = value;
2531 + }
2532 + }
2533 +
2534 + /// <summary>
2535 + /// Equivalent to EVENTLOG_INFORMATION_TYPE.
2536 + /// </summary>
2537 + public YesNoType SupportsInformationals
2538 + {
2539 + get
2540 + {
2541 + return this.supportsInformationalsField;
2542 + }
2543 + set
2544 + {
2545 + this.supportsInformationalsFieldSet = true;
2546 + this.supportsInformationalsField = value;
2547 + }
2548 + }
2549 +
2550 + /// <summary>
2551 + /// Equivalent to EVENTLOG_AUDIT_SUCCESS.
2552 + /// </summary>
2553 + public YesNoType SupportsSuccessAudits
2554 + {
2555 + get
2556 + {
2557 + return this.supportsSuccessAuditsField;
2558 + }
2559 + set
2560 + {
2561 + this.supportsSuccessAuditsFieldSet = true;
2562 + this.supportsSuccessAuditsField = value;
2563 + }
2564 + }
2565 +
2566 + /// <summary>
2567 + /// Equivalent to EVENTLOG_WARNING_TYPE.
2568 + /// </summary>
2569 + public YesNoType SupportsWarnings
2570 + {
2571 + get
2572 + {
2573 + return this.supportsWarningsField;
2574 + }
2575 + set
2576 + {
2577 + this.supportsWarningsFieldSet = true;
2578 + this.supportsWarningsField = value;
2579 + }
2580 + }
2581 +
2582 + public virtual ISchemaElement ParentElement
2583 + {
2584 + get
2585 + {
2586 + return this.parentElement;
2587 + }
2588 + set
2589 + {
2590 + this.parentElement = value;
2591 + }
2592 + }
2593 +
2594 + /// <summary>
2595 + /// Processes this element and all child elements into an XmlWriter.
2596 + /// </summary>
2597 + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
2598 + public virtual void OutputXml(XmlWriter writer)
2599 + {
2600 + if ((null == writer))
2601 + {
2602 + throw new ArgumentNullException("writer");
2603 + }
2604 + writer.WriteStartElement("EventSource", "http://wixtoolset.org/schemas/v4/wxs/util");
2605 + if (this.categoryCountFieldSet)
2606 + {
2607 + writer.WriteAttributeString("CategoryCount", this.categoryCountField.ToString(CultureInfo.InvariantCulture));
2608 + }
2609 + if (this.categoryMessageFileFieldSet)
2610 + {
2611 + writer.WriteAttributeString("CategoryMessageFile", this.categoryMessageFileField);
2612 + }
2613 + if (this.eventMessageFileFieldSet)
2614 + {
2615 + writer.WriteAttributeString("EventMessageFile", this.eventMessageFileField);
2616 + }
2617 + if (this.keyPathFieldSet)
2618 + {
2619 + if ((this.keyPathField == YesNoType.no))
2620 + {
2621 + writer.WriteAttributeString("KeyPath", "no");
2622 + }
2623 + if ((this.keyPathField == YesNoType.yes))
2624 + {
2625 + writer.WriteAttributeString("KeyPath", "yes");
2626 + }
2627 + }
2628 + if (this.logFieldSet)
2629 + {
2630 + writer.WriteAttributeString("Log", this.logField);
2631 + }
2632 + if (this.nameFieldSet)
2633 + {
2634 + writer.WriteAttributeString("Name", this.nameField);
2635 + }
2636 + if (this.parameterMessageFileFieldSet)
2637 + {
2638 + writer.WriteAttributeString("ParameterMessageFile", this.parameterMessageFileField);
2639 + }
2640 + if (this.supportsErrorsFieldSet)
2641 + {
2642 + if ((this.supportsErrorsField == YesNoType.no))
2643 + {
2644 + writer.WriteAttributeString("SupportsErrors", "no");
2645 + }
2646 + if ((this.supportsErrorsField == YesNoType.yes))
2647 + {
2648 + writer.WriteAttributeString("SupportsErrors", "yes");
2649 + }
2650 + }
2651 + if (this.supportsFailureAuditsFieldSet)
2652 + {
2653 + if ((this.supportsFailureAuditsField == YesNoType.no))
2654 + {
2655 + writer.WriteAttributeString("SupportsFailureAudits", "no");
2656 + }
2657 + if ((this.supportsFailureAuditsField == YesNoType.yes))
2658 + {
2659 + writer.WriteAttributeString("SupportsFailureAudits", "yes");
2660 + }
2661 + }
2662 + if (this.supportsInformationalsFieldSet)
2663 + {
2664 + if ((this.supportsInformationalsField == YesNoType.no))
2665 + {
2666 + writer.WriteAttributeString("SupportsInformationals", "no");
2667 + }
2668 + if ((this.supportsInformationalsField == YesNoType.yes))
2669 + {
2670 + writer.WriteAttributeString("SupportsInformationals", "yes");
2671 + }
2672 + }
2673 + if (this.supportsSuccessAuditsFieldSet)
2674 + {
2675 + if ((this.supportsSuccessAuditsField == YesNoType.no))
2676 + {
2677 + writer.WriteAttributeString("SupportsSuccessAudits", "no");
2678 + }
2679 + if ((this.supportsSuccessAuditsField == YesNoType.yes))
2680 + {
2681 + writer.WriteAttributeString("SupportsSuccessAudits", "yes");
2682 + }
2683 + }
2684 + if (this.supportsWarningsFieldSet)
2685 + {
2686 + if ((this.supportsWarningsField == YesNoType.no))
2687 + {
2688 + writer.WriteAttributeString("SupportsWarnings", "no");
2689 + }
2690 + if ((this.supportsWarningsField == YesNoType.yes))
2691 + {
2692 + writer.WriteAttributeString("SupportsWarnings", "yes");
2693 + }
2694 + }
2695 + writer.WriteEndElement();
2696 + }
2697 +
2698 + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
2699 + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
2700 + void ISetAttributes.SetAttribute(string name, string value)
2701 + {
2702 + if (String.IsNullOrEmpty(name))
2703 + {
2704 + throw new ArgumentNullException("name");
2705 + }
2706 + if (("CategoryCount" == name))
2707 + {
2708 + this.categoryCountField = Convert.ToInt32(value, CultureInfo.InvariantCulture);
2709 + this.categoryCountFieldSet = true;
2710 + }
2711 + if (("CategoryMessageFile" == name))
2712 + {
2713 + this.categoryMessageFileField = value;
2714 + this.categoryMessageFileFieldSet = true;
2715 + }
2716 + if (("EventMessageFile" == name))
2717 + {
2718 + this.eventMessageFileField = value;
2719 + this.eventMessageFileFieldSet = true;
2720 + }
2721 + if (("KeyPath" == name))
2722 + {
2723 + this.keyPathField = Enums.ParseYesNoType(value);
2724 + this.keyPathFieldSet = true;
2725 + }
2726 + if (("Log" == name))
2727 + {
2728 + this.logField = value;
2729 + this.logFieldSet = true;
2730 + }
2731 + if (("Name" == name))
2732 + {
2733 + this.nameField = value;
2734 + this.nameFieldSet = true;
2735 + }
2736 + if (("ParameterMessageFile" == name))
2737 + {
2738 + this.parameterMessageFileField = value;
2739 + this.parameterMessageFileFieldSet = true;
2740 + }
2741 + if (("SupportsErrors" == name))
2742 + {
2743 + this.supportsErrorsField = Enums.ParseYesNoType(value);
2744 + this.supportsErrorsFieldSet = true;
2745 + }
2746 + if (("SupportsFailureAudits" == name))
2747 + {
2748 + this.supportsFailureAuditsField = Enums.ParseYesNoType(value);
2749 + this.supportsFailureAuditsFieldSet = true;
2750 + }
2751 + if (("SupportsInformationals" == name))
2752 + {
2753 + this.supportsInformationalsField = Enums.ParseYesNoType(value);
2754 + this.supportsInformationalsFieldSet = true;
2755 + }
2756 + if (("SupportsSuccessAudits" == name))
2757 + {
2758 + this.supportsSuccessAuditsField = Enums.ParseYesNoType(value);
2759 + this.supportsSuccessAuditsFieldSet = true;
2760 + }
2761 + if (("SupportsWarnings" == name))
2762 + {
2763 + this.supportsWarningsField = Enums.ParseYesNoType(value);
2764 + this.supportsWarningsFieldSet = true;
2765 + }
2766 + }
2767 + }
2768 +
2769 + /// <summary>
2770 + /// Describes a file search.
2771 + /// </summary>
2772 + [GeneratedCode("XsdGen", "4.0.0.0")]
2773 + public class FileSearch : ISchemaElement, ISetAttributes
2774 + {
2775 +
2776 + private string idField;
2777 +
2778 + private bool idFieldSet;
2779 +
2780 + private string variableField;
2781 +
2782 + private bool variableFieldSet;
2783 +
2784 + private string conditionField;
2785 +
2786 + private bool conditionFieldSet;
2787 +
2788 + private string afterField;
2789 +
2790 + private bool afterFieldSet;
2791 +
2792 + private string pathField;
2793 +
2794 + private bool pathFieldSet;
2795 +
2796 + private ResultType resultField;
2797 +
2798 + private bool resultFieldSet;
2799 +
2800 + private ISchemaElement parentElement;
2801 +
2802 + /// <summary>
2803 + /// Id of the search for ordering and dependency.
2804 + /// </summary>
2805 + public string Id
2806 + {
2807 + get
2808 + {
2809 + return this.idField;
2810 + }
2811 + set
2812 + {
2813 + this.idFieldSet = true;
2814 + this.idField = value;
2815 + }
2816 + }
2817 +
2818 + /// <summary>
2819 + /// Name of the variable in which to place the result of the search.
2820 + /// </summary>
2821 + public string Variable
2822 + {
2823 + get
2824 + {
2825 + return this.variableField;
2826 + }
2827 + set
2828 + {
2829 + this.variableFieldSet = true;
2830 + this.variableField = value;
2831 + }
2832 + }
2833 +
2834 + /// <summary>
2835 + /// Condition for evaluating the search. If this evaluates to false, the search is not executed at all.
2836 + /// </summary>
2837 + public string Condition
2838 + {
2839 + get
2840 + {
2841 + return this.conditionField;
2842 + }
2843 + set
2844 + {
2845 + this.conditionFieldSet = true;
2846 + this.conditionField = value;
2847 + }
2848 + }
2849 +
2850 + /// <summary>
2851 + /// Id of the search that this one should come after.
2852 + /// </summary>
2853 + public string After
2854 + {
2855 + get
2856 + {
2857 + return this.afterField;
2858 + }
2859 + set
2860 + {
2861 + this.afterFieldSet = true;
2862 + this.afterField = value;
2863 + }
2864 + }
2865 +
2866 + /// <summary>
2867 + /// File path to search for.
2868 + /// </summary>
2869 + public string Path
2870 + {
2871 + get
2872 + {
2873 + return this.pathField;
2874 + }
2875 + set
2876 + {
2877 + this.pathFieldSet = true;
2878 + this.pathField = value;
2879 + }
2880 + }
2881 +
2882 + /// <summary>
2883 + /// Rather than saving the matching file path into the variable, a FileSearch can save an attribute of the matching file instead.
2884 + /// </summary>
2885 + public ResultType Result
2886 + {
2887 + get
2888 + {
2889 + return this.resultField;
2890 + }
2891 + set
2892 + {
2893 + this.resultFieldSet = true;
2894 + this.resultField = value;
2895 + }
2896 + }
2897 +
2898 + public virtual ISchemaElement ParentElement
2899 + {
2900 + get
2901 + {
2902 + return this.parentElement;
2903 + }
2904 + set
2905 + {
2906 + this.parentElement = value;
2907 + }
2908 + }
2909 +
2910 + /// <summary>
2911 + /// Parses a ResultType from a string.
2912 + /// </summary>
2913 + public static ResultType ParseResultType(string value)
2914 + {
2915 + ResultType parsedValue;
2916 + FileSearch.TryParseResultType(value, out parsedValue);
2917 + return parsedValue;
2918 + }
2919 +
2920 + /// <summary>
2921 + /// Tries to parse a ResultType from a string.
2922 + /// </summary>
2923 + public static bool TryParseResultType(string value, out ResultType parsedValue)
2924 + {
2925 + parsedValue = ResultType.NotSet;
2926 + if (string.IsNullOrEmpty(value))
2927 + {
2928 + return false;
2929 + }
2930 + if (("exists" == value))
2931 + {
2932 + parsedValue = ResultType.exists;
2933 + }
2934 + else
2935 + {
2936 + if (("version" == value))
2937 + {
2938 + parsedValue = ResultType.version;
2939 + }
2940 + else
2941 + {
2942 + parsedValue = ResultType.IllegalValue;
2943 + return false;
2944 + }
2945 + }
2946 + return true;
2947 + }
2948 +
2949 + /// <summary>
2950 + /// Processes this element and all child elements into an XmlWriter.
2951 + /// </summary>
2952 + public virtual void OutputXml(XmlWriter writer)
2953 + {
2954 + if ((null == writer))
2955 + {
2956 + throw new ArgumentNullException("writer");
2957 + }
2958 + writer.WriteStartElement("FileSearch", "http://wixtoolset.org/schemas/v4/wxs/util");
2959 + if (this.idFieldSet)
2960 + {
2961 + writer.WriteAttributeString("Id", this.idField);
2962 + }
2963 + if (this.variableFieldSet)
2964 + {
2965 + writer.WriteAttributeString("Variable", this.variableField);
2966 + }
2967 + if (this.conditionFieldSet)
2968 + {
2969 + writer.WriteAttributeString("Condition", this.conditionField);
2970 + }
2971 + if (this.afterFieldSet)
2972 + {
2973 + writer.WriteAttributeString("After", this.afterField);
2974 + }
2975 + if (this.pathFieldSet)
2976 + {
2977 + writer.WriteAttributeString("Path", this.pathField);
2978 + }
2979 + if (this.resultFieldSet)
2980 + {
2981 + if ((this.resultField == ResultType.exists))
2982 + {
2983 + writer.WriteAttributeString("Result", "exists");
2984 + }
2985 + if ((this.resultField == ResultType.version))
2986 + {
2987 + writer.WriteAttributeString("Result", "version");
2988 + }
2989 + }
2990 + writer.WriteEndElement();
2991 + }
2992 +
2993 + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
2994 + void ISetAttributes.SetAttribute(string name, string value)
2995 + {
2996 + if (String.IsNullOrEmpty(name))
2997 + {
2998 + throw new ArgumentNullException("name");
2999 + }
3000 + if (("Id" == name))
3001 + {
3002 + this.idField = value;
3003 + this.idFieldSet = true;
3004 + }
3005 + if (("Variable" == name))
3006 + {
3007 + this.variableField = value;
3008 + this.variableFieldSet = true;
3009 + }
3010 + if (("Condition" == name))
3011 + {
3012 + this.conditionField = value;
3013 + this.conditionFieldSet = true;
3014 + }
3015 + if (("After" == name))
3016 + {
3017 + this.afterField = value;
3018 + this.afterFieldSet = true;
3019 + }
3020 + if (("Path" == name))
3021 + {
3022 + this.pathField = value;
3023 + this.pathFieldSet = true;
3024 + }
3025 + if (("Result" == name))
3026 + {
3027 + this.resultField = FileSearch.ParseResultType(value);
3028 + this.resultFieldSet = true;
3029 + }
3030 + }
3031 +
3032 + [GeneratedCode("XsdGen", "4.0.0.0")]
3033 + public enum ResultType
3034 + {
3035 +
3036 + IllegalValue = int.MaxValue,
3037 +
3038 + NotSet = -1,
3039 +
3040 + /// <summary>
3041 + /// Saves true if a matching file is found; false otherwise.
3042 + /// </summary>
3043 + exists,
3044 +
3045 + /// <summary>
3046 + /// Saves the version information for files that have it (.exe, .dll); zero-version (0.0.0.0) otherwise.
3047 + /// </summary>
3048 + version,
3049 + }
3050 + }
3051 +
3052 + /// <summary>
3053 + /// References a FileSearch.
3054 + /// </summary>
3055 + [GeneratedCode("XsdGen", "4.0.0.0")]
3056 + public class FileSearchRef : ISchemaElement, ISetAttributes
3057 + {
3058 +
3059 + private string idField;
3060 +
3061 + private bool idFieldSet;
3062 +
3063 + private ISchemaElement parentElement;
3064 +
3065 + public string Id
3066 + {
3067 + get
3068 + {
3069 + return this.idField;
3070 + }
3071 + set
3072 + {
3073 + this.idFieldSet = true;
3074 + this.idField = value;
3075 + }
3076 + }
3077 +
3078 + public virtual ISchemaElement ParentElement
3079 + {
3080 + get
3081 + {
3082 + return this.parentElement;
3083 + }
3084 + set
3085 + {
3086 + this.parentElement = value;
3087 + }
3088 + }
3089 +
3090 + /// <summary>
3091 + /// Processes this element and all child elements into an XmlWriter.
3092 + /// </summary>
3093 + public virtual void OutputXml(XmlWriter writer)
3094 + {
3095 + if ((null == writer))
3096 + {
3097 + throw new ArgumentNullException("writer");
3098 + }
3099 + writer.WriteStartElement("FileSearchRef", "http://wixtoolset.org/schemas/v4/wxs/util");
3100 + if (this.idFieldSet)
3101 + {
3102 + writer.WriteAttributeString("Id", this.idField);
3103 + }
3104 + writer.WriteEndElement();
3105 + }
3106 +
3107 + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
3108 + void ISetAttributes.SetAttribute(string name, string value)
3109 + {
3110 + if (String.IsNullOrEmpty(name))
3111 + {
3112 + throw new ArgumentNullException("name");
3113 + }
3114 + if (("Id" == name))
3115 + {
3116 + this.idField = value;
3117 + this.idFieldSet = true;
3118 + }
3119 + }
3120 + }
3121 +
3122 + /// <summary>
3123 + /// Creates a file share out of the component's directory.
3124 + /// </summary>
3125 + [GeneratedCode("XsdGen", "4.0.0.0")]
3126 + public class FileShare : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes
3127 + {
3128 +
3129 + private ElementCollection children;
3130 +
3131 + private string idField;
3132 +
3133 + private bool idFieldSet;
3134 +
3135 + private string nameField;
3136 +
3137 + private bool nameFieldSet;
3138 +
3139 + private string descriptionField;
3140 +
3141 + private bool descriptionFieldSet;
3142 +
3143 + private ISchemaElement parentElement;
3144 +
3145 + public FileShare()
3146 + {
3147 + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence);
3148 + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(FileSharePermission)));
3149 + this.children = childCollection0;
3150 + }
3151 +
3152 + public virtual IEnumerable Children
3153 + {
3154 + get
3155 + {
3156 + return this.children;
3157 + }
3158 + }
3159 +
3160 + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")]
3161 + public virtual IEnumerable this[System.Type childType]
3162 + {
3163 + get
3164 + {
3165 + return this.children.Filter(childType);
3166 + }
3167 + }
3168 +
3169 + /// <summary>
3170 + /// Identifier for the file share (primary key).
3171 + /// </summary>
3172 + public string Id
3173 + {
3174 + get
3175 + {
3176 + return this.idField;
3177 + }
3178 + set
3179 + {
3180 + this.idFieldSet = true;
3181 + this.idField = value;
3182 + }
3183 + }
3184 +
3185 + /// <summary>
3186 + /// Name of the file share.
3187 + /// </summary>
3188 + public string Name
3189 + {
3190 + get
3191 + {
3192 + return this.nameField;
3193 + }
3194 + set
3195 + {
3196 + this.nameFieldSet = true;
3197 + this.nameField = value;
3198 + }
3199 + }
3200 +
3201 + /// <summary>
3202 + /// Description of the file share.
3203 + /// </summary>
3204 + public string Description
3205 + {
3206 + get
3207 + {
3208 + return this.descriptionField;
3209 + }
3210 + set
3211 + {
3212 + this.descriptionFieldSet = true;
3213 + this.descriptionField = value;
3214 + }
3215 + }
3216 +
3217 + public virtual ISchemaElement ParentElement
3218 + {
3219 + get
3220 + {
3221 + return this.parentElement;
3222 + }
3223 + set
3224 + {
3225 + this.parentElement = value;
3226 + }
3227 + }
3228 +
3229 + public virtual void AddChild(ISchemaElement child)
3230 + {
3231 + if ((null == child))
3232 + {
3233 + throw new ArgumentNullException("child");
3234 + }
3235 + this.children.AddElement(child);
3236 + child.ParentElement = this;
3237 + }
3238 +
3239 + public virtual void RemoveChild(ISchemaElement child)
3240 + {
3241 + if ((null == child))
3242 + {
3243 + throw new ArgumentNullException("child");
3244 + }
3245 + this.children.RemoveElement(child);
3246 + child.ParentElement = null;
3247 + }
3248 +
3249 + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
3250 + ISchemaElement ICreateChildren.CreateChild(string childName)
3251 + {
3252 + if (String.IsNullOrEmpty(childName))
3253 + {
3254 + throw new ArgumentNullException("childName");
3255 + }
3256 + ISchemaElement childValue = null;
3257 + if (("FileSharePermission" == childName))
3258 + {
3259 + childValue = new FileSharePermission();
3260 + }
3261 + if ((null == childValue))
3262 + {
3263 + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name."));
3264 + }
3265 + return childValue;
3266 + }
3267 +
3268 + /// <summary>
3269 + /// Processes this element and all child elements into an XmlWriter.
3270 + /// </summary>
3271 + public virtual void OutputXml(XmlWriter writer)
3272 + {
3273 + if ((null == writer))
3274 + {
3275 + throw new ArgumentNullException("writer");
3276 + }
3277 + writer.WriteStartElement("FileShare", "http://wixtoolset.org/schemas/v4/wxs/util");
3278 + if (this.idFieldSet)
3279 + {
3280 + writer.WriteAttributeString("Id", this.idField);
3281 + }
3282 + if (this.nameFieldSet)
3283 + {
3284 + writer.WriteAttributeString("Name", this.nameField);
3285 + }
3286 + if (this.descriptionFieldSet)
3287 + {
3288 + writer.WriteAttributeString("Description", this.descriptionField);
3289 + }
3290 + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); )
3291 + {
3292 + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current));
3293 + childElement.OutputXml(writer);
3294 + }
3295 + writer.WriteEndElement();
3296 + }
3297 +
3298 + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
3299 + void ISetAttributes.SetAttribute(string name, string value)
3300 + {
3301 + if (String.IsNullOrEmpty(name))
3302 + {
3303 + throw new ArgumentNullException("name");
3304 + }
3305 + if (("Id" == name))
3306 + {
3307 + this.idField = value;
3308 + this.idFieldSet = true;
3309 + }
3310 + if (("Name" == name))
3311 + {
3312 + this.nameField = value;
3313 + this.nameFieldSet = true;
3314 + }
3315 + if (("Description" == name))
3316 + {
3317 + this.descriptionField = value;
3318 + this.descriptionFieldSet = true;
3319 + }
3320 + }
3321 + }
3322 +
3323 + /// <summary>
3324 + /// Sets ACLs on a FileShare. This element has no Id attribute.
3325 + /// The table and key are taken from the parent element.
3326 + /// </summary>
3327 + [GeneratedCode("XsdGen", "4.0.0.0")]
3328 + public class FileSharePermission : ISchemaElement, ISetAttributes
3329 + {
3330 +
3331 + private string userField;
3332 +
3333 + private bool userFieldSet;
3334 +
3335 + private YesNoType readField;
3336 +
3337 + private bool readFieldSet;
3338 +
3339 + private YesNoType deleteField;
3340 +
3341 + private bool deleteFieldSet;
3342 +
3343 + private YesNoType readPermissionField;
3344 +
3345 + private bool readPermissionFieldSet;
3346 +
3347 + private YesNoType changePermissionField;
3348 +
3349 + private bool changePermissionFieldSet;
3350 +
3351 + private YesNoType takeOwnershipField;
3352 +
3353 + private bool takeOwnershipFieldSet;
3354 +
3355 + private YesNoType readAttributesField;
3356 +
3357 + private bool readAttributesFieldSet;
3358 +
3359 + private YesNoType writeAttributesField;
3360 +
3361 + private bool writeAttributesFieldSet;
3362 +
3363 + private YesNoType readExtendedAttributesField;
3364 +
3365 + private bool readExtendedAttributesFieldSet;
3366 +
3367 + private YesNoType writeExtendedAttributesField;
3368 +
3369 + private bool writeExtendedAttributesFieldSet;
3370 +
3371 + private YesNoType synchronizeField;
3372 +
3373 + private bool synchronizeFieldSet;
3374 +
3375 + private YesNoType createFileField;
3376 +
3377 + private bool createFileFieldSet;
3378 +
3379 + private YesNoType createChildField;
3380 +
3381 + private bool createChildFieldSet;
3382 +
3383 + private YesNoType deleteChildField;
3384 +
3385 + private bool deleteChildFieldSet;
3386 +
3387 + private YesNoType traverseField;
3388 +
3389 + private bool traverseFieldSet;
3390 +
3391 + private YesNoType genericAllField;
3392 +
3393 + private bool genericAllFieldSet;
3394 +
3395 + private YesNoType genericExecuteField;
3396 +
3397 + private bool genericExecuteFieldSet;
3398 +
3399 + private YesNoType genericWriteField;
3400 +
3401 + private bool genericWriteFieldSet;
3402 +
3403 + private YesNoType genericReadField;
3404 +
3405 + private bool genericReadFieldSet;
3406 +
3407 + private ISchemaElement parentElement;
3408 +
3409 + public string User
3410 + {
3411 + get
3412 + {
3413 + return this.userField;
3414 + }
3415 + set
3416 + {
3417 + this.userFieldSet = true;
3418 + this.userField = value;
3419 + }
3420 + }
3421 +
3422 + public YesNoType Read
3423 + {
3424 + get
3425 + {
3426 + return this.readField;
3427 + }
3428 + set
3429 + {
3430 + this.readFieldSet = true;
3431 + this.readField = value;
3432 + }
3433 + }
3434 +
3435 + public YesNoType Delete
3436 + {
3437 + get
3438 + {
3439 + return this.deleteField;
3440 + }
3441 + set
3442 + {
3443 + this.deleteFieldSet = true;
3444 + this.deleteField = value;
3445 + }
3446 + }
3447 +
3448 + public YesNoType ReadPermission
3449 + {
3450 + get
3451 + {
3452 + return this.readPermissionField;
3453 + }
3454 + set
3455 + {
3456 + this.readPermissionFieldSet = true;
3457 + this.readPermissionField = value;
3458 + }
3459 + }
3460 +
3461 + public YesNoType ChangePermission
3462 + {
3463 + get
3464 + {
3465 + return this.changePermissionField;
3466 + }
3467 + set
3468 + {
3469 + this.changePermissionFieldSet = true;
3470 + this.changePermissionField = value;
3471 + }
3472 + }
3473 +
3474 + public YesNoType TakeOwnership
3475 + {
3476 + get
3477 + {
3478 + return this.takeOwnershipField;
3479 + }
3480 + set
3481 + {
3482 + this.takeOwnershipFieldSet = true;
3483 + this.takeOwnershipField = value;
3484 + }
3485 + }
3486 +
3487 + public YesNoType ReadAttributes
3488 + {
3489 + get
3490 + {
3491 + return this.readAttributesField;
3492 + }
3493 + set
3494 + {
3495 + this.readAttributesFieldSet = true;
3496 + this.readAttributesField = value;
3497 + }
3498 + }
3499 +
3500 + public YesNoType WriteAttributes
3501 + {
3502 + get
3503 + {
3504 + return this.writeAttributesField;
3505 + }
3506 + set
3507 + {
3508 + this.writeAttributesFieldSet = true;
3509 + this.writeAttributesField = value;
3510 + }
3511 + }
3512 +
3513 + public YesNoType ReadExtendedAttributes
3514 + {
3515 + get
3516 + {
3517 + return this.readExtendedAttributesField;
3518 + }
3519 + set
3520 + {
3521 + this.readExtendedAttributesFieldSet = true;
3522 + this.readExtendedAttributesField = value;
3523 + }
3524 + }
3525 +
3526 + public YesNoType WriteExtendedAttributes
3527 + {
3528 + get
3529 + {
3530 + return this.writeExtendedAttributesField;
3531 + }
3532 + set
3533 + {
3534 + this.writeExtendedAttributesFieldSet = true;
3535 + this.writeExtendedAttributesField = value;
3536 + }
3537 + }
3538 +
3539 + public YesNoType Synchronize
3540 + {
3541 + get
3542 + {
3543 + return this.synchronizeField;
3544 + }
3545 + set
3546 + {
3547 + this.synchronizeFieldSet = true;
3548 + this.synchronizeField = value;
3549 + }
3550 + }
3551 +
3552 + /// <summary>
3553 + /// For a directory, the right to create a file in the directory. Only valid under a 'CreateFolder' parent.
3554 + /// </summary>
3555 + public YesNoType CreateFile
3556 + {
3557 + get
3558 + {
3559 + return this.createFileField;
3560 + }
3561 + set
3562 + {
3563 + this.createFileFieldSet = true;
3564 + this.createFileField = value;
3565 + }
3566 + }
3567 +
3568 + /// <summary>
3569 + /// For a directory, the right to create a subdirectory. Only valid under a 'CreateFolder' parent.
3570 + /// </summary>
3571 + public YesNoType CreateChild
3572 + {
3573 + get
3574 + {
3575 + return this.createChildField;
3576 + }
3577 + set
3578 + {
3579 + this.createChildFieldSet = true;
3580 + this.createChildField = value;
3581 + }
3582 + }
3583 +
3584 + /// <summary>
3585 + /// 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.
3586 + /// </summary>
3587 + public YesNoType DeleteChild
3588 + {
3589 + get
3590 + {
3591 + return this.deleteChildField;
3592 + }
3593 + set
3594 + {
3595 + this.deleteChildFieldSet = true;
3596 + this.deleteChildField = value;
3597 + }
3598 + }
3599 +
3600 + /// <summary>
3601 + /// 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.
3602 + /// </summary>
3603 + public YesNoType Traverse
3604 + {
3605 + get
3606 + {
3607 + return this.traverseField;
3608 + }
3609 + set
3610 + {
3611 + this.traverseFieldSet = true;
3612 + this.traverseField = value;
3613 + }
3614 + }
3615 +
3616 + public YesNoType GenericAll
3617 + {
3618 + get
3619 + {
3620 + return this.genericAllField;
3621 + }
3622 + set
3623 + {
3624 + this.genericAllFieldSet = true;
3625 + this.genericAllField = value;
3626 + }
3627 + }
3628 +
3629 + public YesNoType GenericExecute
3630 + {
3631 + get
3632 + {
3633 + return this.genericExecuteField;
3634 + }
3635 + set
3636 + {
3637 + this.genericExecuteFieldSet = true;
3638 + this.genericExecuteField = value;
3639 + }
3640 + }
3641 +
3642 + public YesNoType GenericWrite
3643 + {
3644 + get
3645 + {
3646 + return this.genericWriteField;
3647 + }
3648 + set
3649 + {
3650 + this.genericWriteFieldSet = true;
3651 + this.genericWriteField = value;
3652 + }
3653 + }
3654 +
3655 + /// <summary>
3656 + /// specifying this will fail to grant read access
3657 + /// </summary>
3658 + public YesNoType GenericRead
3659 + {
3660 + get
3661 + {
3662 + return this.genericReadField;
3663 + }
3664 + set
3665 + {
3666 + this.genericReadFieldSet = true;
3667 + this.genericReadField = value;
3668 + }
3669 + }
3670 +
3671 + public virtual ISchemaElement ParentElement
3672 + {
3673 + get
3674 + {
3675 + return this.parentElement;
3676 + }
3677 + set
3678 + {
3679 + this.parentElement = value;
3680 + }
3681 + }
3682 +
3683 + /// <summary>
3684 + /// Processes this element and all child elements into an XmlWriter.
3685 + /// </summary>
3686 + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
3687 + public virtual void OutputXml(XmlWriter writer)
3688 + {
3689 + if ((null == writer))
3690 + {
3691 + throw new ArgumentNullException("writer");
3692 + }
3693 + writer.WriteStartElement("FileSharePermission", "http://wixtoolset.org/schemas/v4/wxs/util");
3694 + if (this.userFieldSet)
3695 + {
3696 + writer.WriteAttributeString("User", this.userField);
3697 + }
3698 + if (this.readFieldSet)
3699 + {
3700 + if ((this.readField == YesNoType.no))
3701 + {
3702 + writer.WriteAttributeString("Read", "no");
3703 + }
3704 + if ((this.readField == YesNoType.yes))
3705 + {
3706 + writer.WriteAttributeString("Read", "yes");
3707 + }
3708 + }
3709 + if (this.deleteFieldSet)
3710 + {
3711 + if ((this.deleteField == YesNoType.no))
3712 + {
3713 + writer.WriteAttributeString("Delete", "no");
3714 + }
3715 + if ((this.deleteField == YesNoType.yes))
3716 + {
3717 + writer.WriteAttributeString("Delete", "yes");
3718 + }
3719 + }
3720 + if (this.readPermissionFieldSet)
3721 + {
3722 + if ((this.readPermissionField == YesNoType.no))
3723 + {
3724 + writer.WriteAttributeString("ReadPermission", "no");
3725 + }
3726 + if ((this.readPermissionField == YesNoType.yes))
3727 + {
3728 + writer.WriteAttributeString("ReadPermission", "yes");
3729 + }
3730 + }
3731 + if (this.changePermissionFieldSet)
3732 + {
3733 + if ((this.changePermissionField == YesNoType.no))
3734 + {
3735 + writer.WriteAttributeString("ChangePermission", "no");
3736 + }
3737 + if ((this.changePermissionField == YesNoType.yes))
3738 + {
3739 + writer.WriteAttributeString("ChangePermission", "yes");
3740 + }
3741 + }
3742 + if (this.takeOwnershipFieldSet)
3743 + {
3744 + if ((this.takeOwnershipField == YesNoType.no))
3745 + {
3746 + writer.WriteAttributeString("TakeOwnership", "no");
3747 + }
3748 + if ((this.takeOwnershipField == YesNoType.yes))
3749 + {
3750 + writer.WriteAttributeString("TakeOwnership", "yes");
3751 + }
3752 + }
3753 + if (this.readAttributesFieldSet)
3754 + {
3755 + if ((this.readAttributesField == YesNoType.no))
3756 + {
3757 + writer.WriteAttributeString("ReadAttributes", "no");
3758 + }
3759 + if ((this.readAttributesField == YesNoType.yes))
3760 + {
3761 + writer.WriteAttributeString("ReadAttributes", "yes");
3762 + }
3763 + }
3764 + if (this.writeAttributesFieldSet)
3765 + {
3766 + if ((this.writeAttributesField == YesNoType.no))
3767 + {
3768 + writer.WriteAttributeString("WriteAttributes", "no");
3769 + }
3770 + if ((this.writeAttributesField == YesNoType.yes))
3771 + {
3772 + writer.WriteAttributeString("WriteAttributes", "yes");
3773 + }
3774 + }
3775 + if (this.readExtendedAttributesFieldSet)
3776 + {
3777 + if ((this.readExtendedAttributesField == YesNoType.no))
3778 + {
3779 + writer.WriteAttributeString("ReadExtendedAttributes", "no");
3780 + }
3781 + if ((this.readExtendedAttributesField == YesNoType.yes))
3782 + {
3783 + writer.WriteAttributeString("ReadExtendedAttributes", "yes");
3784 + }
3785 + }
3786 + if (this.writeExtendedAttributesFieldSet)
3787 + {
3788 + if ((this.writeExtendedAttributesField == YesNoType.no))
3789 + {
3790 + writer.WriteAttributeString("WriteExtendedAttributes", "no");
3791 + }
3792 + if ((this.writeExtendedAttributesField == YesNoType.yes))
3793 + {
3794 + writer.WriteAttributeString("WriteExtendedAttributes", "yes");
3795 + }
3796 + }
3797 + if (this.synchronizeFieldSet)
3798 + {
3799 + if ((this.synchronizeField == YesNoType.no))
3800 + {
3801 + writer.WriteAttributeString("Synchronize", "no");
3802 + }
3803 + if ((this.synchronizeField == YesNoType.yes))
3804 + {
3805 + writer.WriteAttributeString("Synchronize", "yes");
3806 + }
3807 + }
3808 + if (this.createFileFieldSet)
3809 + {
3810 + if ((this.createFileField == YesNoType.no))
3811 + {
3812 + writer.WriteAttributeString("CreateFile", "no");
3813 + }
3814 + if ((this.createFileField == YesNoType.yes))
3815 + {
3816 + writer.WriteAttributeString("CreateFile", "yes");
3817 + }
3818 + }
3819 + if (this.createChildFieldSet)
3820 + {
3821 + if ((this.createChildField == YesNoType.no))
3822 + {
3823 + writer.WriteAttributeString("CreateChild", "no");
3824 + }
3825 + if ((this.createChildField == YesNoType.yes))
3826 + {
3827 + writer.WriteAttributeString("CreateChild", "yes");
3828 + }
3829 + }
3830 + if (this.deleteChildFieldSet)
3831 + {
3832 + if ((this.deleteChildField == YesNoType.no))
3833 + {
3834 + writer.WriteAttributeString("DeleteChild", "no");
3835 + }
3836 + if ((this.deleteChildField == YesNoType.yes))
3837 + {
3838 + writer.WriteAttributeString("DeleteChild", "yes");
3839 + }
3840 + }
3841 + if (this.traverseFieldSet)
3842 + {
3843 + if ((this.traverseField == YesNoType.no))
3844 + {
3845 + writer.WriteAttributeString("Traverse", "no");
3846 + }
3847 + if ((this.traverseField == YesNoType.yes))
3848 + {
3849 + writer.WriteAttributeString("Traverse", "yes");
3850 + }
3851 + }
3852 + if (this.genericAllFieldSet)
3853 + {
3854 + if ((this.genericAllField == YesNoType.no))
3855 + {
3856 + writer.WriteAttributeString("GenericAll", "no");
3857 + }
3858 + if ((this.genericAllField == YesNoType.yes))
3859 + {
3860 + writer.WriteAttributeString("GenericAll", "yes");
3861 + }
3862 + }
3863 + if (this.genericExecuteFieldSet)
3864 + {
3865 + if ((this.genericExecuteField == YesNoType.no))
3866 + {
3867 + writer.WriteAttributeString("GenericExecute", "no");
3868 + }
3869 + if ((this.genericExecuteField == YesNoType.yes))
3870 + {
3871 + writer.WriteAttributeString("GenericExecute", "yes");
3872 + }
3873 + }
3874 + if (this.genericWriteFieldSet)
3875 + {
3876 + if ((this.genericWriteField == YesNoType.no))
3877 + {
3878 + writer.WriteAttributeString("GenericWrite", "no");
3879 + }
3880 + if ((this.genericWriteField == YesNoType.yes))
3881 + {
3882 + writer.WriteAttributeString("GenericWrite", "yes");
3883 + }
3884 + }
3885 + if (this.genericReadFieldSet)
3886 + {
3887 + if ((this.genericReadField == YesNoType.no))
3888 + {
3889 + writer.WriteAttributeString("GenericRead", "no");
3890 + }
3891 + if ((this.genericReadField == YesNoType.yes))
3892 + {
3893 + writer.WriteAttributeString("GenericRead", "yes");
3894 + }
3895 + }
3896 + writer.WriteEndElement();
3897 + }
3898 +
3899 + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
3900 + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
3901 + void ISetAttributes.SetAttribute(string name, string value)
3902 + {
3903 + if (String.IsNullOrEmpty(name))
3904 + {
3905 + throw new ArgumentNullException("name");
3906 + }
3907 + if (("User" == name))
3908 + {
3909 + this.userField = value;
3910 + this.userFieldSet = true;
3911 + }
3912 + if (("Read" == name))
3913 + {
3914 + this.readField = Enums.ParseYesNoType(value);
3915 + this.readFieldSet = true;
3916 + }
3917 + if (("Delete" == name))
3918 + {
3919 + this.deleteField = Enums.ParseYesNoType(value);
3920 + this.deleteFieldSet = true;
3921 + }
3922 + if (("ReadPermission" == name))
3923 + {
3924 + this.readPermissionField = Enums.ParseYesNoType(value);
3925 + this.readPermissionFieldSet = true;
3926 + }
3927 + if (("ChangePermission" == name))
3928 + {
3929 + this.changePermissionField = Enums.ParseYesNoType(value);
3930 + this.changePermissionFieldSet = true;
3931 + }
3932 + if (("TakeOwnership" == name))
3933 + {
3934 + this.takeOwnershipField = Enums.ParseYesNoType(value);
3935 + this.takeOwnershipFieldSet = true;
3936 + }
3937 + if (("ReadAttributes" == name))
3938 + {
3939 + this.readAttributesField = Enums.ParseYesNoType(value);
3940 + this.readAttributesFieldSet = true;
3941 + }
3942 + if (("WriteAttributes" == name))
3943 + {
3944 + this.writeAttributesField = Enums.ParseYesNoType(value);
3945 + this.writeAttributesFieldSet = true;
3946 + }
3947 + if (("ReadExtendedAttributes" == name))
3948 + {
3949 + this.readExtendedAttributesField = Enums.ParseYesNoType(value);
3950 + this.readExtendedAttributesFieldSet = true;
3951 + }
3952 + if (("WriteExtendedAttributes" == name))
3953 + {
3954 + this.writeExtendedAttributesField = Enums.ParseYesNoType(value);
3955 + this.writeExtendedAttributesFieldSet = true;
3956 + }
3957 + if (("Synchronize" == name))
3958 + {
3959 + this.synchronizeField = Enums.ParseYesNoType(value);
3960 + this.synchronizeFieldSet = true;
3961 + }
3962 + if (("CreateFile" == name))
3963 + {
3964 + this.createFileField = Enums.ParseYesNoType(value);
3965 + this.createFileFieldSet = true;
3966 + }
3967 + if (("CreateChild" == name))
3968 + {
3969 + this.createChildField = Enums.ParseYesNoType(value);
3970 + this.createChildFieldSet = true;
3971 + }
3972 + if (("DeleteChild" == name))
3973 + {
3974 + this.deleteChildField = Enums.ParseYesNoType(value);
3975 + this.deleteChildFieldSet = true;
3976 + }
3977 + if (("Traverse" == name))
3978 + {
3979 + this.traverseField = Enums.ParseYesNoType(value);
3980 + this.traverseFieldSet = true;
3981 + }
3982 + if (("GenericAll" == name))
3983 + {
3984 + this.genericAllField = Enums.ParseYesNoType(value);
3985 + this.genericAllFieldSet = true;
3986 + }
3987 + if (("GenericExecute" == name))
3988 + {
3989 + this.genericExecuteField = Enums.ParseYesNoType(value);
3990 + this.genericExecuteFieldSet = true;
3991 + }
3992 + if (("GenericWrite" == name))
3993 + {
3994 + this.genericWriteField = Enums.ParseYesNoType(value);
3995 + this.genericWriteFieldSet = true;
3996 + }
3997 + if (("GenericRead" == name))
3998 + {
3999 + this.genericReadField = Enums.ParseYesNoType(value);
4000 + this.genericReadFieldSet = true;
4001 + }
4002 + }
4003 + }
4004 +
4005 + /// <summary>
4006 + /// Formats a file's contents at install time. The contents are formatted according to the rules of the
4007 + /// </summary>
4008 + [GeneratedCode("XsdGen", "4.0.0.0")]
4009 + public class FormatFile : ISchemaElement, ISetAttributes
4010 + {
4011 +
4012 + private string binaryKeyField;
4013 +
4014 + private bool binaryKeyFieldSet;
4015 +
4016 + private ISchemaElement parentElement;
4017 +
4018 + /// <summary>
4019 + /// The id of a Binary row that contains a copy of the file. The file in the Binary table overwrites whatever
4020 + /// file is installed by the parent component.
4021 + /// </summary>
4022 + public string BinaryKey
4023 + {
4024 + get
4025 + {
4026 + return this.binaryKeyField;
4027 + }
4028 + set
4029 + {
4030 + this.binaryKeyFieldSet = true;
4031 + this.binaryKeyField = value;
4032 + }
4033 + }
4034 +
4035 + public virtual ISchemaElement ParentElement
4036 + {
4037 + get
4038 + {
4039 + return this.parentElement;
4040 + }
4041 + set
4042 + {
4043 + this.parentElement = value;
4044 + }
4045 + }
4046 +
4047 + /// <summary>
4048 + /// Processes this element and all child elements into an XmlWriter.
4049 + /// </summary>
4050 + public virtual void OutputXml(XmlWriter writer)
4051 + {
4052 + if ((null == writer))
4053 + {
4054 + throw new ArgumentNullException("writer");
4055 + }
4056 + writer.WriteStartElement("FormatFile", "http://wixtoolset.org/schemas/v4/wxs/util");
4057 + if (this.binaryKeyFieldSet)
4058 + {
4059 + writer.WriteAttributeString("BinaryKey", this.binaryKeyField);
4060 + }
4061 + writer.WriteEndElement();
4062 + }
4063 +
4064 + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
4065 + void ISetAttributes.SetAttribute(string name, string value)
4066 + {
4067 + if (String.IsNullOrEmpty(name))
4068 + {
4069 + throw new ArgumentNullException("name");
4070 + }
4071 + if (("BinaryKey" == name))
4072 + {
4073 + this.binaryKeyField = value;
4074 + this.binaryKeyFieldSet = true;
4075 + }
4076 + }
4077 + }
4078 +
4079 + /// <summary>
4080 + /// Finds user groups on the local machine or specified Active Directory domain. The local machine will be
4081 + /// searched for the group first then fallback to looking in Active Directory. This element is not capable
4082 + /// of creating new groups but can be used to add new or existing users to an existing group.
4083 + /// </summary>
4084 + [GeneratedCode("XsdGen", "4.0.0.0")]
4085 + public class Group : ISchemaElement, ISetAttributes
4086 + {
4087 +
4088 + private string idField;
4089 +
4090 + private bool idFieldSet;
4091 +
4092 + private string nameField;
4093 +
4094 + private bool nameFieldSet;
4095 +
4096 + private string domainField;
4097 +
4098 + private bool domainFieldSet;
4099 +
4100 + private ISchemaElement parentElement;
4101 +
4102 + /// <summary>
4103 + /// Unique identifier in your installation package for this group.
4104 + /// </summary>
4105 + public string Id
4106 + {
4107 + get
4108 + {
4109 + return this.idField;
4110 + }
4111 + set
4112 + {
4113 + this.idFieldSet = true;
4114 + this.idField = value;
4115 + }
4116 + }
4117 +
4118 + /// <summary>
4119 + /// A
4120 + /// </summary>
4121 + public string Name
4122 + {
4123 + get
4124 + {
4125 + return this.nameField;
4126 + }
4127 + set
4128 + {
4129 + this.nameFieldSet = true;
4130 + this.nameField = value;
4131 + }
4132 + }
4133 +
4134 + /// <summary>
4135 + /// An optional
4136 + /// </summary>
4137 + public string Domain
4138 + {
4139 + get
4140 + {
4141 + return this.domainField;
4142 + }
4143 + set
4144 + {
4145 + this.domainFieldSet = true;
4146 + this.domainField = value;
4147 + }
4148 + }
4149 +
4150 + public virtual ISchemaElement ParentElement
4151 + {
4152 + get
4153 + {
4154 + return this.parentElement;
4155 + }
4156 + set
4157 + {
4158 + this.parentElement = value;
4159 + }
4160 + }
4161 +
4162 + /// <summary>
4163 + /// Processes this element and all child elements into an XmlWriter.
4164 + /// </summary>
4165 + public virtual void OutputXml(XmlWriter writer)
4166 + {
4167 + if ((null == writer))
4168 + {
4169 + throw new ArgumentNullException("writer");
4170 + }
4171 + writer.WriteStartElement("Group", "http://wixtoolset.org/schemas/v4/wxs/util");
4172 + if (this.idFieldSet)
4173 + {
4174 + writer.WriteAttributeString("Id", this.idField);
4175 + }
4176 + if (this.nameFieldSet)
4177 + {
4178 + writer.WriteAttributeString("Name", this.nameField);
4179 + }
4180 + if (this.domainFieldSet)
4181 + {
4182 + writer.WriteAttributeString("Domain", this.domainField);
4183 + }
4184 + writer.WriteEndElement();
4185 + }
4186 +
4187 + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
4188 + void ISetAttributes.SetAttribute(string name, string value)
4189 + {
4190 + if (String.IsNullOrEmpty(name))
4191 + {
4192 + throw new ArgumentNullException("name");
4193 + }
4194 + if (("Id" == name))
4195 + {
4196 + this.idField = value;
4197 + this.idFieldSet = true;
4198 + }
4199 + if (("Name" == name))
4200 + {
4201 + this.nameField = value;
4202 + this.nameFieldSet = true;
4203 + }
4204 + if (("Domain" == name))
4205 + {
4206 + this.domainField = value;
4207 + this.domainFieldSet = true;
4208 + }
4209 + }
4210 + }
4211 +
4212 + /// <summary>
4213 + /// Used to join a user to a group
4214 + /// </summary>
4215 + [GeneratedCode("XsdGen", "4.0.0.0")]
4216 + public class GroupRef : ISchemaElement, ISetAttributes
4217 + {
4218 +
4219 + private string idField;
4220 +
4221 + private bool idFieldSet;
4222 +
4223 + private ISchemaElement parentElement;
4224 +
4225 + public string Id
4226 + {
4227 + get
4228 + {
4229 + return this.idField;
4230 + }
4231 + set
4232 + {
4233 + this.idFieldSet = true;
4234 + this.idField = value;
4235 + }
4236 + }
4237 +
4238 + public virtual ISchemaElement ParentElement
4239 + {
4240 + get
4241 + {
4242 + return this.parentElement;
4243 + }
4244 + set
4245 + {
4246 + this.parentElement = value;
4247 + }
4248 + }
4249 +
4250 + /// <summary>
4251 + /// Processes this element and all child elements into an XmlWriter.
4252 + /// </summary>
4253 + public virtual void OutputXml(XmlWriter writer)
4254 + {
4255 + if ((null == writer))
4256 + {
4257 + throw new ArgumentNullException("writer");
4258 + }
4259 + writer.WriteStartElement("GroupRef", "http://wixtoolset.org/schemas/v4/wxs/util");
4260 + if (this.idFieldSet)
4261 + {
4262 + writer.WriteAttributeString("Id", this.idField);
4263 + }
4264 + writer.WriteEndElement();
4265 + }
4266 +
4267 + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
4268 + void ISetAttributes.SetAttribute(string name, string value)
4269 + {
4270 + if (String.IsNullOrEmpty(name))
4271 + {
4272 + throw new ArgumentNullException("name");
4273 + }
4274 + if (("Id" == name))
4275 + {
4276 + this.idField = value;
4277 + this.idFieldSet = true;
4278 + }
4279 + }
4280 + }
4281 +
4282 + /// <summary>
4283 + /// Creates a shortcut to a URL.
4284 + /// </summary>
4285 + [GeneratedCode("XsdGen", "4.0.0.0")]
4286 + public class InternetShortcut : ISchemaElement, ISetAttributes
4287 + {
4288 +
4289 + private string idField;
4290 +
4291 + private bool idFieldSet;
4292 +
4293 + private string directoryField;
4294 +
4295 + private bool directoryFieldSet;
4296 +
4297 + private string nameField;
4298 +
4299 + private bool nameFieldSet;
4300 +
4301 + private string targetField;
4302 +
4303 + private bool targetFieldSet;
4304 +
4305 + private TypeType typeField;
4306 +
4307 + private bool typeFieldSet;
4308 +
4309 + private string iconFileField;
4310 +
4311 + private bool iconFileFieldSet;
4312 +
4313 + private int iconIndexField;
4314 +
4315 + private bool iconIndexFieldSet;
4316 +
4317 + private ISchemaElement parentElement;
4318 +
4319 + /// <summary>
4320 + /// Unique identifier in your installation package for this Internet shortcut.
4321 + /// </summary>
4322 + public string Id
4323 + {
4324 + get
4325 + {
4326 + return this.idField;
4327 + }
4328 + set
4329 + {
4330 + this.idFieldSet = true;
4331 + this.idField = value;
4332 + }
4333 + }
4334 +
4335 + /// <summary>
4336 + /// Identifier reference to Directory element where shortcut is to be created. This attribute's value defaults to the parent Component directory.
4337 + /// </summary>
4338 + public string Directory
4339 + {
4340 + get
4341 + {
4342 + return this.directoryField;
4343 + }
4344 + set
4345 + {
4346 + this.directoryFieldSet = true;
4347 + this.directoryField = value;
4348 + }
4349 + }
4350 +
4351 + /// <summary>
4352 + /// The name of the shortcut file, which is visible to the user. (The .lnk
4353 + /// extension is added automatically and by default, is not shown to the user.)
4354 + /// </summary>
4355 + public string Name
4356 + {
4357 + get
4358 + {
4359 + return this.nameField;
4360 + }
4361 + set
4362 + {
4363 + this.nameFieldSet = true;
4364 + this.nameField = value;
4365 + }
4366 + }
4367 +
4368 + /// <summary>
4369 + /// URL that should be opened when the user selects the shortcut. Windows
4370 + /// opens the URL in the appropriate handler for the protocol specified
4371 + /// in the URL. Note that this is a formatted field, so you can use
4372 + /// [#fileId] syntax to refer to a file being installed (using the file:
4373 + /// protocol).
4374 + /// </summary>
4375 + public string Target
4376 + {
4377 + get
4378 + {
4379 + return this.targetField;
4380 + }
4381 + set
4382 + {
4383 + this.targetFieldSet = true;
4384 + this.targetField = value;
4385 + }
4386 + }
4387 +
4388 + /// <summary>
4389 + /// Which type of shortcut should be created.
4390 + /// </summary>
4391 + public TypeType Type
4392 + {
4393 + get
4394 + {
4395 + return this.typeField;
4396 + }
4397 + set
4398 + {
4399 + this.typeFieldSet = true;
4400 + this.typeField = value;
4401 + }
4402 + }
4403 +
4404 + /// <summary>
4405 + /// Icon file that should be displayed. Note that this is a formatted field, so you can use
4406 + /// [#fileId] syntax to refer to a file being installed (using the file:
4407 + /// protocol).
4408 + /// </summary>
4409 + public string IconFile
4410 + {
4411 + get
4412 + {
4413 + return this.iconFileField;
4414 + }
4415 + set
4416 + {
4417 + this.iconFileFieldSet = true;
4418 + this.iconFileField = value;
4419 + }
4420 + }
4421 +
4422 + /// <summary>
4423 + /// Index of the icon being referenced
4424 + /// </summary>
4425 + public int IconIndex
4426 + {
4427 + get
4428 + {
4429 + return this.iconIndexField;
4430 + }
4431 + set
4432 + {
4433 + this.iconIndexFieldSet = true;
4434 + this.iconIndexField = value;
4435 + }
4436 + }
4437 +
4438 + public virtual ISchemaElement ParentElement
4439 + {
4440 + get
4441 + {
4442 + return this.parentElement;
4443 + }
4444 + set
4445 + {
4446 + this.parentElement = value;
4447 + }
4448 + }
4449 +
4450 + /// <summary>
4451 + /// Parses a TypeType from a string.
4452 + /// </summary>
4453 + public static TypeType ParseTypeType(string value)
4454 + {
4455 + TypeType parsedValue;
4456 + InternetShortcut.TryParseTypeType(value, out parsedValue);
4457 + return parsedValue;
4458 + }
4459 +
4460 + /// <summary>
4461 + /// Tries to parse a TypeType from a string.
4462 + /// </summary>
4463 + public static bool TryParseTypeType(string value, out TypeType parsedValue)
4464 + {
4465 + parsedValue = TypeType.NotSet;
4466 + if (string.IsNullOrEmpty(value))
4467 + {
4468 + return false;
4469 + }
4470 + if (("url" == value))
4471 + {
4472 + parsedValue = TypeType.url;
4473 + }
4474 + else
4475 + {
4476 + if (("link" == value))
4477 + {
4478 + parsedValue = TypeType.link;
4479 + }
4480 + else
4481 + {
4482 + parsedValue = TypeType.IllegalValue;
4483 + return false;
4484 + }
4485 + }
4486 + return true;
4487 + }
4488 +
4489 + /// <summary>
4490 + /// Processes this element and all child elements into an XmlWriter.
4491 + /// </summary>
4492 + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
4493 + public virtual void OutputXml(XmlWriter writer)
4494 + {
4495 + if ((null == writer))
4496 + {
4497 + throw new ArgumentNullException("writer");
4498 + }
4499 + writer.WriteStartElement("InternetShortcut", "http://wixtoolset.org/schemas/v4/wxs/util");
4500 + if (this.idFieldSet)
4501 + {
4502 + writer.WriteAttributeString("Id", this.idField);
4503 + }
4504 + if (this.directoryFieldSet)
4505 + {
4506 + writer.WriteAttributeString("Directory", this.directoryField);
4507 + }
4508 + if (this.nameFieldSet)
4509 + {
4510 + writer.WriteAttributeString("Name", this.nameField);
4511 + }
4512 + if (this.targetFieldSet)
4513 + {
4514 + writer.WriteAttributeString("Target", this.targetField);
4515 + }
4516 + if (this.typeFieldSet)
4517 + {
4518 + if ((this.typeField == TypeType.url))
4519 + {
4520 + writer.WriteAttributeString("Type", "url");
4521 + }
4522 + if ((this.typeField == TypeType.link))
4523 + {
4524 + writer.WriteAttributeString("Type", "link");
4525 + }
4526 + }
4527 + if (this.iconFileFieldSet)
4528 + {
4529 + writer.WriteAttributeString("IconFile", this.iconFileField);
4530 + }
4531 + if (this.iconIndexFieldSet)
4532 + {
4533 + writer.WriteAttributeString("IconIndex", this.iconIndexField.ToString(CultureInfo.InvariantCulture));
4534 + }
4535 + writer.WriteEndElement();
4536 + }
4537 +
4538 + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
4539 + void ISetAttributes.SetAttribute(string name, string value)
4540 + {
4541 + if (String.IsNullOrEmpty(name))
4542 + {
4543 + throw new ArgumentNullException("name");
4544 + }
4545 + if (("Id" == name))
4546 + {
4547 + this.idField = value;
4548 + this.idFieldSet = true;
4549 + }
4550 + if (("Directory" == name))
4551 + {
4552 + this.directoryField = value;
4553 + this.directoryFieldSet = true;
4554 + }
4555 + if (("Name" == name))
4556 + {
4557 + this.nameField = value;
4558 + this.nameFieldSet = true;
4559 + }
4560 + if (("Target" == name))
4561 + {
4562 + this.targetField = value;
4563 + this.targetFieldSet = true;
4564 + }
4565 + if (("Type" == name))
4566 + {
4567 + this.typeField = InternetShortcut.ParseTypeType(value);
4568 + this.typeFieldSet = true;
4569 + }
4570 + if (("IconFile" == name))
4571 + {
4572 + this.iconFileField = value;
4573 + this.iconFileFieldSet = true;
4574 + }
4575 + if (("IconIndex" == name))
4576 + {
4577 + this.iconIndexField = Convert.ToInt32(value, CultureInfo.InvariantCulture);
4578 + this.iconIndexFieldSet = true;
4579 + }
4580 + }
4581 +
4582 + [GeneratedCode("XsdGen", "4.0.0.0")]
4583 + public enum TypeType
4584 + {
4585 +
4586 + IllegalValue = int.MaxValue,
4587 +
4588 + NotSet = -1,
4589 +
4590 + /// <summary>
4591 + /// Creates .url files using IUniformResourceLocatorW.
4592 + /// </summary>
4593 + url,
4594 +
4595 + /// <summary>
4596 + /// Creates .lnk files using IShellLinkW (default).
4597 + /// </summary>
4598 + link,
4599 + }
4600 + }
4601 +
4602 + /// <summary>
4603 + /// Used to create performance categories and configure performance counters.
4604 + /// </summary>
4605 + [GeneratedCode("XsdGen", "4.0.0.0")]
4606 + public class PerformanceCategory : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes
4607 + {
4608 +
4609 + private ElementCollection children;
4610 +
4611 + private string idField;
4612 +
4613 + private bool idFieldSet;
4614 +
4615 + private string nameField;
4616 +
4617 + private bool nameFieldSet;
4618 +
4619 + private string helpField;
4620 +
4621 + private bool helpFieldSet;
4622 +
4623 + private YesNoType multiInstanceField;
4624 +
4625 + private bool multiInstanceFieldSet;
4626 +
4627 + private string libraryField;
4628 +
4629 + private bool libraryFieldSet;
4630 +
4631 + private string openField;
4632 +
4633 + private bool openFieldSet;
4634 +
4635 + private string closeField;
4636 +
4637 + private bool closeFieldSet;
4638 +
4639 + private string collectField;
4640 +
4641 + private bool collectFieldSet;
4642 +
4643 + private PerformanceCounterLanguageType defaultLanguageField;
4644 +
4645 + private bool defaultLanguageFieldSet;
4646 +
4647 + private ISchemaElement parentElement;
4648 +
4649 + public PerformanceCategory()
4650 + {
4651 + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence);
4652 + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(PerformanceCounter)));
4653 + this.children = childCollection0;
4654 + }
4655 +
4656 + public virtual IEnumerable Children
4657 + {
4658 + get
4659 + {
4660 + return this.children;
4661 + }
4662 + }
4663 +
4664 + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")]
4665 + public virtual IEnumerable this[System.Type childType]
4666 + {
4667 + get
4668 + {
4669 + return this.children.Filter(childType);
4670 + }
4671 + }
4672 +
4673 + /// <summary>
4674 + /// Unique identifier in your installation package for this performance counter category.
4675 + /// </summary>
4676 + public string Id
4677 + {
4678 + get
4679 + {
4680 + return this.idField;
4681 + }
4682 + set
4683 + {
4684 + this.idFieldSet = true;
4685 + this.idField = value;
4686 + }
4687 + }
4688 +
4689 + /// <summary>
4690 + /// 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.
4691 + /// </summary>
4692 + public string Name
4693 + {
4694 + get
4695 + {
4696 + return this.nameField;
4697 + }
4698 + set
4699 + {
4700 + this.nameFieldSet = true;
4701 + this.nameField = value;
4702 + }
4703 + }
4704 +
4705 + /// <summary>
4706 + /// Optional help text for the performance counter category.
4707 + /// </summary>
4708 + public string Help
4709 + {
4710 + get
4711 + {
4712 + return this.helpField;
4713 + }
4714 + set
4715 + {
4716 + this.helpFieldSet = true;
4717 + this.helpField = value;
4718 + }
4719 + }
4720 +
4721 + /// <summary>
4722 + /// Flag that specifies whether the performance counter category is multi or single instanced. Default is single instance.
4723 + /// </summary>
4724 + public YesNoType MultiInstance
4725 + {
4726 + get
4727 + {
4728 + return this.multiInstanceField;
4729 + }
4730 + set
4731 + {
4732 + this.multiInstanceFieldSet = true;
4733 + this.multiInstanceField = value;
4734 + }
4735 + }
4736 +
4737 + /// <summary>
4738 + /// DLL that contains the performance counter. The default is "netfxperf.dll" which should be used for all managed code performance counters.
4739 + /// </summary>
4740 + public string Library
4741 + {
4742 + get
4743 + {
4744 + return this.libraryField;
4745 + }
4746 + set
4747 + {
4748 + this.libraryFieldSet = true;
4749 + this.libraryField = value;
4750 + }
4751 + }
4752 +
4753 + /// <summary>
4754 + /// 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.
4755 + /// </summary>
4756 + public string Open
4757 + {
4758 + get
4759 + {
4760 + return this.openField;
4761 + }
4762 + set
4763 + {
4764 + this.openFieldSet = true;
4765 + this.openField = value;
4766 + }
4767 + }
4768 +
4769 + /// <summary>
4770 + /// 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.
4771 + /// </summary>
4772 + public string Close
4773 + {
4774 + get
4775 + {
4776 + return this.closeField;
4777 + }
4778 + set
4779 + {
4780 + this.closeFieldSet = true;
4781 + this.closeField = value;
4782 + }
4783 + }
4784 +
4785 + /// <summary>
4786 + /// 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.
4787 + /// </summary>
4788 + public string Collect
4789 + {
4790 + get
4791 + {
4792 + return this.collectField;
4793 + }
4794 + set
4795 + {
4796 + this.collectFieldSet = true;
4797 + this.collectField = value;
4798 + }
4799 + }
4800 +
4801 + /// <summary>
4802 + /// Default language for the performance category and contained counters' names and help text.
4803 + /// </summary>
4804 + public PerformanceCounterLanguageType DefaultLanguage
4805 + {
4806 + get
4807 + {
4808 + return this.defaultLanguageField;
4809 + }
4810 + set
4811 + {
4812 + this.defaultLanguageFieldSet = true;
4813 + this.defaultLanguageField = value;
4814 + }
4815 + }
4816 +
4817 + public virtual ISchemaElement ParentElement
4818 + {
4819 + get
4820 + {
4821 + return this.parentElement;
4822 + }
4823 + set
4824 + {
4825 + this.parentElement = value;
4826 + }
4827 + }
4828 +
4829 + public virtual void AddChild(ISchemaElement child)
4830 + {
4831 + if ((null == child))
4832 + {
4833 + throw new ArgumentNullException("child");
4834 + }
4835 + this.children.AddElement(child);
4836 + child.ParentElement = this;
4837 + }
4838 +
4839 + public virtual void RemoveChild(ISchemaElement child)
4840 + {
4841 + if ((null == child))
4842 + {
4843 + throw new ArgumentNullException("child");
4844 + }
4845 + this.children.RemoveElement(child);
4846 + child.ParentElement = null;
4847 + }
4848 +
4849 + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
4850 + ISchemaElement ICreateChildren.CreateChild(string childName)
4851 + {
4852 + if (String.IsNullOrEmpty(childName))
4853 + {
4854 + throw new ArgumentNullException("childName");
4855 + }
4856 + ISchemaElement childValue = null;
4857 + if (("PerformanceCounter" == childName))
4858 + {
4859 + childValue = new PerformanceCounter();
4860 + }
4861 + if ((null == childValue))
4862 + {
4863 + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name."));
4864 + }
4865 + return childValue;
4866 + }
4867 +
4868 + /// <summary>
4869 + /// Processes this element and all child elements into an XmlWriter.
4870 + /// </summary>
4871 + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
4872 + public virtual void OutputXml(XmlWriter writer)
4873 + {
4874 + if ((null == writer))
4875 + {
4876 + throw new ArgumentNullException("writer");
4877 + }
4878 + writer.WriteStartElement("PerformanceCategory", "http://wixtoolset.org/schemas/v4/wxs/util");
4879 + if (this.idFieldSet)
4880 + {
4881 + writer.WriteAttributeString("Id", this.idField);
4882 + }
4883 + if (this.nameFieldSet)
4884 + {
4885 + writer.WriteAttributeString("Name", this.nameField);
4886 + }
4887 + if (this.helpFieldSet)
4888 + {
4889 + writer.WriteAttributeString("Help", this.helpField);
4890 + }
4891 + if (this.multiInstanceFieldSet)
4892 + {
4893 + if ((this.multiInstanceField == YesNoType.no))
4894 + {
4895 + writer.WriteAttributeString("MultiInstance", "no");
4896 + }
4897 + if ((this.multiInstanceField == YesNoType.yes))
4898 + {
4899 + writer.WriteAttributeString("MultiInstance", "yes");
4900 + }
4901 + }
4902 + if (this.libraryFieldSet)
4903 + {
4904 + writer.WriteAttributeString("Library", this.libraryField);
4905 + }
4906 + if (this.openFieldSet)
4907 + {
4908 + writer.WriteAttributeString("Open", this.openField);
4909 + }
4910 + if (this.closeFieldSet)
4911 + {
4912 + writer.WriteAttributeString("Close", this.closeField);
4913 + }
4914 + if (this.collectFieldSet)
4915 + {
4916 + writer.WriteAttributeString("Collect", this.collectField);
4917 + }
4918 + if (this.defaultLanguageFieldSet)
4919 + {
4920 + if ((this.defaultLanguageField == PerformanceCounterLanguageType.afrikaans))
4921 + {
4922 + writer.WriteAttributeString("DefaultLanguage", "afrikaans");
4923 + }
4924 + if ((this.defaultLanguageField == PerformanceCounterLanguageType.albanian))
4925 + {
4926 + writer.WriteAttributeString("DefaultLanguage", "albanian");
4927 + }
4928 + if ((this.defaultLanguageField == PerformanceCounterLanguageType.arabic))
4929 + {
4930 + writer.WriteAttributeString("DefaultLanguage", "arabic");
4931 + }
4932 + if ((this.defaultLanguageField == PerformanceCounterLanguageType.armenian))
4933 + {
4934 + writer.WriteAttributeString("DefaultLanguage", "armenian");
4935 + }
4936 + if ((this.defaultLanguageField == PerformanceCounterLanguageType.assamese))
4937 + {
4938 + writer.WriteAttributeString("DefaultLanguage", "assamese");
4939 + }
4940 + if ((this.defaultLanguageField == PerformanceCounterLanguageType.azeri))
4941 + {
4942 + writer.WriteAttributeString("DefaultLanguage", "azeri");
4943 + }
4944 + if ((this.defaultLanguageField == PerformanceCounterLanguageType.basque))
4945 + {
4946 + writer.WriteAttributeString("DefaultLanguage", "basque");
4947 + }
4948 + if ((this.defaultLanguageField == PerformanceCounterLanguageType.belarusian))
4949 + {
4950 + writer.WriteAttributeString("DefaultLanguage", "belarusian");
4951 + }
4952 + if ((this.defaultLanguageField == PerformanceCounterLanguageType.bengali))
4953 + {
4954 + writer.WriteAttributeString("DefaultLanguage", "bengali");
4955 + }
4956 + if ((this.defaultLanguageField == PerformanceCounterLanguageType.bulgarian))
4957 + {
4958 + writer.WriteAttributeString("DefaultLanguage", "bulgarian");
4959 + }
4960 + if ((this.defaultLanguageField == PerformanceCounterLanguageType.catalan))
4961 + {
4962 + writer.WriteAttributeString("DefaultLanguage", "catalan");
4963 + }
4964 + if ((this.defaultLanguageField == PerformanceCounterLanguageType.chinese))
4965 + {
4966 + writer.WriteAttributeString("DefaultLanguage", "chinese");
4967 + }
4968 + if ((this.defaultLanguageField == PerformanceCounterLanguageType.croatian))
4969 + {
4970 + writer.WriteAttributeString("DefaultLanguage", "croatian");
4971 + }
4972 + if ((this.defaultLanguageField == PerformanceCounterLanguageType.czech))
4973 + {
4974 + writer.WriteAttributeString("DefaultLanguage", "czech");
4975 + }
4976 + if ((this.defaultLanguageField == PerformanceCounterLanguageType.danish))
4977 + {
4978 + writer.WriteAttributeString("DefaultLanguage", "danish");
4979 + }
4980 + if ((this.defaultLanguageField == PerformanceCounterLanguageType.divehi))
4981 + {
4982 + writer.WriteAttributeString("DefaultLanguage", "divehi");
4983 + }
4984 + if ((this.defaultLanguageField == PerformanceCounterLanguageType.dutch))
4985 + {
4986 + writer.WriteAttributeString("DefaultLanguage", "dutch");
4987 + }
4988 + if ((this.defaultLanguageField == PerformanceCounterLanguageType.english))
4989 + {
4990 + writer.WriteAttributeString("DefaultLanguage", "english");
4991 + }
4992 + if ((this.defaultLanguageField == PerformanceCounterLanguageType.estonian))
4993 + {
4994 + writer.WriteAttributeString("DefaultLanguage", "estonian");
4995 + }
4996 + if ((this.defaultLanguageField == PerformanceCounterLanguageType.faeroese))
4997 + {
4998 + writer.WriteAttributeString("DefaultLanguage", "faeroese");
4999 + }

This file is too large to show in full.

src/wixext/util.xsd new
+1692
@@ -0,0 +1,1692 @@
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<!-- 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. -->
3 +
4 +
5 +<xs:schema xmlns:html="http://www.w3.org/1999/xhtml"
6 + xmlns:wix="http://wixtoolset.org/schemas/v4/wxs"
7 + xmlns:xs="http://www.w3.org/2001/XMLSchema"
8 + xmlns:xse=" http://wixtoolset.org/schemas/XmlSchemaExtension"
9 + targetNamespace="http://wixtoolset.org/schemas/v4/wxs/util"
10 + xmlns="http://wixtoolset.org/schemas/v4/wxs/util">
11 + <xs:annotation>
12 + <xs:documentation>
13 + The source code schema for the WiX Toolset Utility Extension.
14 + </xs:documentation>
15 + </xs:annotation>
16 + <xs:import namespace="http://wixtoolset.org/schemas/v4/wxs" />
17 + <xs:element name="CloseApplication">
18 + <xs:annotation>
19 + <xs:appinfo>
20 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Product" />
21 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Module" />
22 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Fragment" />
23 + </xs:appinfo>
24 + <xs:documentation>Closes applications or schedules a reboot if application cannot be closed.</xs:documentation>
25 + </xs:annotation>
26 + <xs:complexType>
27 + <xs:simpleContent>
28 + <xs:extension base="xs:string">
29 + <xs:annotation>
30 + <xs:documentation>
31 + Condition that determines if the application should be closed. Must be blank or evaluate to true
32 + for the application to be scheduled for closing.
33 + </xs:documentation>
34 + </xs:annotation>
35 + <xs:attribute name="Id" type="xs:string">
36 + <xs:annotation>
37 + <xs:documentation>Identifier for the close application (primary key). If the Id is not specified, one will be generated.</xs:documentation>
38 + </xs:annotation>
39 + </xs:attribute>
40 + <xs:attribute name="Target" type="xs:string" use="required">
41 + <xs:annotation>
42 + <xs:documentation>Name of the exectuable to be closed. This should only be the file name.</xs:documentation>
43 + </xs:annotation>
44 + </xs:attribute>
45 + <xs:attribute name="Description" type="xs:string">
46 + <xs:annotation>
47 + <xs:documentation>Description to show if application is running and needs to be closed.</xs:documentation>
48 + </xs:annotation>
49 + </xs:attribute>
50 + <xs:attribute name="Sequence" type="xs:integer">
51 + <xs:annotation>
52 + <xs:documentation>Optionally orders the applications to be closed.</xs:documentation>
53 + </xs:annotation>
54 + </xs:attribute>
55 + <xs:attribute name="CloseMessage" type="YesNoType">
56 + <xs:annotation>
57 + <xs:documentation>Optionally sends a close message to the application. Default is no.</xs:documentation>
58 + </xs:annotation>
59 + </xs:attribute>
60 + <xs:attribute name="EndSessionMessage" type="YesNoType">
61 + <xs:annotation>
62 + <xs:documentation>Sends WM_QUERYENDSESSION then WM_ENDSESSION messages to the application. Default is "no".</xs:documentation>
63 + </xs:annotation>
64 + </xs:attribute>
65 + <xs:attribute name="ElevatedCloseMessage" type="YesNoType">
66 + <xs:annotation>
67 + <xs:documentation>Optionally sends a close message to the application from deffered action without impersonation. Default is no.</xs:documentation>
68 + </xs:annotation>
69 + </xs:attribute>
70 + <xs:attribute name="ElevatedEndSessionMessage" type="YesNoType">
71 + <xs:annotation>
72 + <xs:documentation>Sends WM_QUERYENDSESSION then WM_ENDSESSION messages to the application from a deffered action without impersonation. Default is "no".</xs:documentation>
73 + </xs:annotation>
74 + </xs:attribute>
75 + <xs:attribute name="RebootPrompt" type="YesNoType">
76 + <xs:annotation>
77 + <xs:documentation>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".</xs:documentation>
78 + </xs:annotation>
79 + </xs:attribute>
80 + <xs:attribute name="PromptToContinue" type="YesNoType">
81 + <xs:annotation>
82 + <xs:documentation>
83 + 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
84 + 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
85 + 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
86 + set on the CloseApplication element. The default is "no".
87 + </xs:documentation>
88 + </xs:annotation>
89 + </xs:attribute>
90 + <xs:attribute name="Property" type="xs:string">
91 + <xs:annotation>
92 + <xs:documentation>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.</xs:documentation>
93 + </xs:annotation>
94 + </xs:attribute>
95 + <xs:attribute name="TerminateProcess" type="xs:integer">
96 + <xs:annotation>
97 + <xs:documentation>
98 + 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.
99 + If this attribute is specified, the RebootPrompt attribute must be "no". The default is "no".
100 + </xs:documentation>
101 + </xs:annotation>
102 + </xs:attribute>
103 + <xs:attribute name="Timeout" type="xs:integer">
104 + <xs:annotation>
105 + <xs:documentation>
106 + 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
107 + the RebootPrompt or TerminateProcess attributes will be considered. The default value is "5" seconds.
108 + </xs:documentation>
109 + </xs:annotation>
110 + </xs:attribute>
111 + </xs:extension>
112 + </xs:simpleContent>
113 + </xs:complexType>
114 + </xs:element>
115 + <xs:element name="ComponentSearch">
116 + <xs:annotation>
117 + <xs:documentation>Describes a component search.</xs:documentation>
118 + <xs:appinfo>
119 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Bundle" />
120 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Fragment" />
121 + </xs:appinfo>
122 + </xs:annotation>
123 + <xs:complexType>
124 + <xs:attributeGroup ref="SearchCommonAttributes" />
125 + <xs:attribute name="Guid" type="xs:string" use="required">
126 + <xs:annotation>
127 + <xs:documentation>Component to search for.</xs:documentation>
128 + </xs:annotation>
129 + </xs:attribute>
130 + <xs:attribute name="ProductCode" type="xs:string">
131 + <xs:annotation>
132 + <xs:documentation>Optional ProductCode to determine if the component is installed.</xs:documentation>
133 + </xs:annotation>
134 + </xs:attribute>
135 + <xs:attribute name="Result">
136 + <xs:annotation>
137 + <xs:documentation>
138 + Rather than saving the matching key path into the variable, a ComponentSearch can save an attribute of the component instead.
139 + </xs:documentation>
140 + </xs:annotation>
141 + <xs:simpleType>
142 + <xs:restriction base="xs:NMTOKEN">
143 + <xs:enumeration value="directory">
144 + <xs:annotation>
145 + <xs:documentation>Saves the parent directory for the component's file key path; other types of key path are returned unmodified.</xs:documentation>
146 + </xs:annotation>
147 + </xs:enumeration>
148 + <xs:enumeration value="state">
149 + <xs:annotation>
150 + <xs:documentation>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)</xs:documentation>
151 + </xs:annotation>
152 + </xs:enumeration>
153 + <xs:enumeration value="keyPath">
154 + <xs:annotation>
155 + <xs:documentation>Saves the key path of the component if installed. This is the default.</xs:documentation>
156 + </xs:annotation>
157 + </xs:enumeration>
158 + </xs:restriction>
159 + </xs:simpleType>
160 + </xs:attribute>
161 + </xs:complexType>
162 + </xs:element>
163 + <xs:element name="ComponentSearchRef">
164 + <xs:annotation>
165 + <xs:documentation>References a ComponentSearch.</xs:documentation>
166 + <xs:appinfo>
167 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Bundle" />
168 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Fragment" />
169 + </xs:appinfo>
170 + </xs:annotation>
171 + <xs:complexType>
172 + <xs:attribute name="Id" type="xs:string" use="required" />
173 + </xs:complexType>
174 + </xs:element>
175 + <xs:element name="DirectorySearch">
176 + <xs:annotation>
177 + <xs:documentation>Describes a directory search.</xs:documentation>
178 + <xs:appinfo>
179 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Bundle" />
180 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Fragment" />
181 + </xs:appinfo>
182 + </xs:annotation>
183 + <xs:complexType>
184 + <xs:attributeGroup ref="SearchCommonAttributes" />
185 + <xs:attribute name="Path" type="xs:string">
186 + <xs:annotation>
187 + <xs:documentation>Directory path to search for.</xs:documentation>
188 + </xs:annotation>
189 + </xs:attribute>
190 + <xs:attribute name="Result">
191 + <xs:annotation>
192 + <xs:documentation>
193 + Rather than saving the matching directory path into the variable, a DirectorySearch can save an
194 + attribute of the matching directory instead.
195 + </xs:documentation>
196 + </xs:annotation>
197 + <xs:simpleType>
198 + <xs:restriction base="xs:NMTOKEN">
199 + <xs:enumeration value="exists">
200 + <xs:annotation>
201 + <xs:documentation>Saves true if a matching directory is found; false otherwise.</xs:documentation>
202 + </xs:annotation>
203 + </xs:enumeration>
204 + </xs:restriction>
205 + </xs:simpleType>
206 + </xs:attribute>
207 + </xs:complexType>
208 + </xs:element>
209 + <xs:element name="DirectorySearchRef">
210 + <xs:annotation>
211 + <xs:documentation>References a DirectorySearch.</xs:documentation>
212 + <xs:appinfo>
213 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Bundle" />
214 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Fragment" />
215 + </xs:appinfo>
216 + </xs:annotation>
217 + <xs:complexType>
218 + <xs:attribute name="Id" type="xs:string" use="required" />
219 + </xs:complexType>
220 + </xs:element>
221 + <xs:element name="EventSource">
222 + <xs:annotation>
223 + <xs:appinfo>
224 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Component" />
225 + </xs:appinfo>
226 + <xs:documentation>Creates an event source.</xs:documentation>
227 + </xs:annotation>
228 + <xs:complexType>
229 + <xs:attribute name="CategoryCount" type="xs:integer">
230 + <xs:annotation>
231 + <xs:documentation>
232 + The number of categories in CategoryMessageFile. CategoryMessageFile
233 + must be specified too.
234 + </xs:documentation>
235 + </xs:annotation>
236 + </xs:attribute>
237 + <xs:attribute name="CategoryMessageFile" type="xs:string">
238 + <xs:annotation>
239 + <xs:documentation>
240 + Name of the category message file. CategoryCount must be specified too.
241 + Note that this is a formatted field, so you can use [#fileId] syntax to
242 + refer to a file being installed. It is also written as a REG_EXPAND_SZ
243 + string, so you can use %environment_variable% syntax to refer to a file
244 + already present on the user's machine.
245 + </xs:documentation>
246 + </xs:annotation>
247 + </xs:attribute>
248 + <xs:attribute name="EventMessageFile" type="xs:string" use="required">
249 + <xs:annotation>
250 + <xs:documentation>
251 + Name of the event message file.
252 + Note that this is a formatted field, so you can use [#fileId] syntax to
253 + refer to a file being installed. It is also written as a REG_EXPAND_SZ
254 + string, so you can use %environment_variable% syntax to refer to a file
255 + already present on the user's machine.
256 + </xs:documentation>
257 + </xs:annotation>
258 + </xs:attribute>
259 + <xs:attribute name="KeyPath" type="YesNoType">
260 + <xs:annotation>
261 + <xs:documentation>
262 + Marks the EventSource registry as the key path of the component it belongs to.
263 + </xs:documentation>
264 + </xs:annotation>
265 + </xs:attribute>
266 + <xs:attribute name="Log" type="xs:string" use="required">
267 + <xs:annotation>
268 + <xs:documentation>Name of the event source's log.</xs:documentation>
269 + </xs:annotation>
270 + </xs:attribute>
271 + <xs:attribute name="Name" type="xs:string" use="required">
272 + <xs:annotation>
273 + <xs:documentation>Name of the event source.</xs:documentation>
274 + </xs:annotation>
275 + </xs:attribute>
276 + <xs:attribute name="ParameterMessageFile" type="xs:string">
277 + <xs:annotation>
278 + <xs:documentation>
279 + Name of the parameter message file.
280 + Note that this is a formatted field, so you can use [#fileId] syntax to
281 + refer to a file being installed. It is also written as a REG_EXPAND_SZ
282 + string, so you can use %environment_variable% syntax to refer to a file
283 + already present on the user's machine.
284 + </xs:documentation>
285 + </xs:annotation>
286 + </xs:attribute>
287 + <xs:attribute name="SupportsErrors" type="YesNoType">
288 + <xs:annotation>
289 + <xs:documentation>
290 + Equivalent to EVENTLOG_ERROR_TYPE.
291 + </xs:documentation>
292 + </xs:annotation>
293 + </xs:attribute>
294 + <xs:attribute name="SupportsFailureAudits" type="YesNoType">
295 + <xs:annotation>
296 + <xs:documentation>
297 + Equivalent to EVENTLOG_AUDIT_FAILURE.
298 + </xs:documentation>
299 + </xs:annotation>
300 + </xs:attribute>
301 + <xs:attribute name="SupportsInformationals" type="YesNoType">
302 + <xs:annotation>
303 + <xs:documentation>
304 + Equivalent to EVENTLOG_INFORMATION_TYPE.
305 + </xs:documentation>
306 + </xs:annotation>
307 + </xs:attribute>
308 + <xs:attribute name="SupportsSuccessAudits" type="YesNoType">
309 + <xs:annotation>
310 + <xs:documentation>
311 + Equivalent to EVENTLOG_AUDIT_SUCCESS.
312 + </xs:documentation>
313 + </xs:annotation>
314 + </xs:attribute>
315 + <xs:attribute name="SupportsWarnings" type="YesNoType">
316 + <xs:annotation>
317 + <xs:documentation>
318 + Equivalent to EVENTLOG_WARNING_TYPE.
319 + </xs:documentation>
320 + </xs:annotation>
321 + </xs:attribute>
322 + </xs:complexType>
323 + </xs:element>
324 + <xs:element name="FileSearch">
325 + <xs:annotation>
326 + <xs:documentation>Describes a file search.</xs:documentation>
327 + <xs:appinfo>
328 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Bundle" />
329 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Fragment" />
330 + </xs:appinfo>
331 + </xs:annotation>
332 + <xs:complexType>
333 + <xs:attributeGroup ref="SearchCommonAttributes" />
334 + <xs:attribute name="Path" type="xs:string">
335 + <xs:annotation>
336 + <xs:documentation>File path to search for.</xs:documentation>
337 + </xs:annotation>
338 + </xs:attribute>
339 + <xs:attribute name="Result">
340 + <xs:annotation>
341 + <xs:documentation>
342 + Rather than saving the matching file path into the variable, a FileSearch can save an attribute of the matching file instead.
343 + </xs:documentation>
344 + </xs:annotation>
345 + <xs:simpleType>
346 + <xs:restriction base="xs:NMTOKEN">
347 + <xs:enumeration value="exists">
348 + <xs:annotation>
349 + <xs:documentation>Saves true if a matching file is found; false otherwise.</xs:documentation>
350 + </xs:annotation>
351 + </xs:enumeration>
352 + <xs:enumeration value="version">
353 + <xs:annotation>
354 + <xs:documentation>Saves the version information for files that have it (.exe, .dll); zero-version (0.0.0.0) otherwise.</xs:documentation>
355 + </xs:annotation>
356 + </xs:enumeration>
357 + </xs:restriction>
358 + </xs:simpleType>
359 + </xs:attribute>
360 + </xs:complexType>
361 + </xs:element>
362 + <xs:element name="FileSearchRef">
363 + <xs:annotation>
364 + <xs:documentation>References a FileSearch.</xs:documentation>
365 + <xs:appinfo>
366 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Bundle" />
367 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Fragment" />
368 + </xs:appinfo>
369 + </xs:annotation>
370 + <xs:complexType>
371 + <xs:attribute name="Id" type="xs:string" use="required" />
372 + </xs:complexType>
373 + </xs:element>
374 + <xs:element name="FileShare">
375 + <xs:annotation>
376 + <xs:appinfo>
377 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Component" />
378 + </xs:appinfo>
379 + <xs:documentation>Creates a file share out of the component's directory.</xs:documentation>
380 + </xs:annotation>
381 + <xs:complexType>
382 + <xs:sequence>
383 + <xs:element ref="FileSharePermission" minOccurs="1" maxOccurs="unbounded">
384 + <xs:annotation>
385 + <xs:documentation>ACL permission</xs:documentation>
386 + </xs:annotation>
387 + </xs:element>
388 + </xs:sequence>
389 + <xs:attribute name="Id" type="xs:string" use="required">
390 + <xs:annotation>
391 + <xs:documentation>Identifier for the file share (primary key).</xs:documentation>
392 + </xs:annotation>
393 + </xs:attribute>
394 + <xs:attribute name="Name" type="xs:string" use="required">
395 + <xs:annotation>
396 + <xs:documentation>Name of the file share.</xs:documentation>
397 + </xs:annotation>
398 + </xs:attribute>
399 + <xs:attribute name="Description" type="xs:string">
400 + <xs:annotation>
401 + <xs:documentation>Description of the file share.</xs:documentation>
402 + </xs:annotation>
403 + </xs:attribute>
404 + </xs:complexType>
405 + </xs:element>
406 + <xs:element name="FileSharePermission">
407 + <xs:annotation>
408 + <xs:documentation>
409 + Sets ACLs on a FileShare. This element has no Id attribute.
410 + The table and key are taken from the parent element.
411 + </xs:documentation>
412 + </xs:annotation>
413 + <xs:complexType>
414 + <xs:attribute name="User" use="required" type="xs:string"></xs:attribute>
415 + <!-- Common ACLs -->
416 + <xs:attribute name="Read" type="YesNoType"></xs:attribute>
417 + <xs:attribute name="Delete" type="YesNoType"></xs:attribute>
418 + <xs:attribute name="ReadPermission" type="YesNoType"></xs:attribute>
419 + <xs:attribute name="ChangePermission" type="YesNoType"></xs:attribute>
420 + <xs:attribute name="TakeOwnership" type="YesNoType"></xs:attribute>
421 + <!-- Folder and File ACLs -->
422 + <xs:attribute name="ReadAttributes" type="YesNoType"></xs:attribute>
423 + <xs:attribute name="WriteAttributes" type="YesNoType"></xs:attribute>
424 + <xs:attribute name="ReadExtendedAttributes" type="YesNoType"></xs:attribute>
425 + <xs:attribute name="WriteExtendedAttributes" type="YesNoType"></xs:attribute>
426 + <xs:attribute name="Synchronize" type="YesNoType"></xs:attribute>
427 + <!-- Folder only ACLs -->
428 + <xs:attribute name="CreateFile" type="YesNoType">
429 + <xs:annotation>
430 + <xs:documentation>For a directory, the right to create a file in the directory. Only valid under a 'CreateFolder' parent.</xs:documentation>
431 + </xs:annotation>
432 + </xs:attribute>
433 + <xs:attribute name="CreateChild" type="YesNoType">
434 + <xs:annotation>
435 + <xs:documentation>For a directory, the right to create a subdirectory. Only valid under a 'CreateFolder' parent.</xs:documentation>
436 + </xs:annotation>
437 + </xs:attribute>
438 + <xs:attribute name="DeleteChild" type="YesNoType">
439 + <xs:annotation>
440 + <xs:documentation>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.</xs:documentation>
441 + </xs:annotation>
442 + </xs:attribute>
443 + <xs:attribute name="Traverse" type="YesNoType">
444 + <xs:annotation>
445 + <xs:documentation>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.</xs:documentation>
446 + </xs:annotation>
447 + </xs:attribute>
448 + <!-- Generic ACLs, mapped by system to appropriate permissions -->
449 + <xs:attribute name="GenericAll" type="YesNoType"></xs:attribute>
450 + <xs:attribute name="GenericExecute" type="YesNoType"></xs:attribute>
451 + <xs:attribute name="GenericWrite" type="YesNoType"></xs:attribute>
452 + <xs:attribute name="GenericRead" type="YesNoType">
453 + <xs:annotation>
454 + <xs:documentation>specifying this will fail to grant read access</xs:documentation>
455 + </xs:annotation>
456 + </xs:attribute>
457 + </xs:complexType>
458 + </xs:element>
459 + <xs:element name="FormatFile">
460 + <xs:annotation>
461 + <xs:appinfo>
462 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="File" />
463 + </xs:appinfo>
464 + <xs:documentation>
465 + Formats a file's contents at install time. The contents are formatted according to the rules of the
466 + <html:a href="http://msdn.microsoft.com/library/aa368609.aspx" target="_blank">Formatted</html:a> data type.
467 + </xs:documentation>
468 + </xs:annotation>
469 + <xs:complexType>
470 + <xs:attribute name="BinaryKey" type="xs:string" use="required">
471 + <xs:annotation>
472 + <xs:documentation>
473 + The id of a Binary row that contains a copy of the file. The file in the Binary table overwrites whatever
474 + file is installed by the parent component.
475 + </xs:documentation>
476 + </xs:annotation>
477 + </xs:attribute>
478 + </xs:complexType>
479 + </xs:element>
480 + <xs:element name="Group">
481 + <xs:annotation>
482 + <xs:appinfo>
483 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Fragment" />
484 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Module" />
485 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Product" />
486 + </xs:appinfo>
487 + <xs:documentation>
488 + Finds user groups on the local machine or specified Active Directory domain. The local machine will be
489 + searched for the group first then fallback to looking in Active Directory. This element is not capable
490 + of creating new groups but can be used to add new or existing users to an existing group.
491 + </xs:documentation>
492 + </xs:annotation>
493 + <xs:complexType>
494 + <xs:attribute name="Id" type="xs:string" use="required">
495 + <xs:annotation>
496 + <xs:documentation>Unique identifier in your installation package for this group.</xs:documentation>
497 + </xs:annotation>
498 + </xs:attribute>
499 + <xs:attribute name="Name" type="xs:string" use="required">
500 + <xs:annotation>
501 + <xs:documentation>A <html:a href="http://msdn.microsoft.com/library/aa368609.aspx" target="_blank">Formatted</html:a> string that contains the name of the group to be found.</xs:documentation>
502 + </xs:annotation>
503 + </xs:attribute>
504 + <xs:attribute name="Domain" type="xs:string">
505 + <xs:annotation>
506 + <xs:documentation>An optional <html:a href="http://msdn.microsoft.com/library/aa368609.aspx" target="_blank">Formatted</html:a> string that specifies the domain for the group.</xs:documentation>
507 + </xs:annotation>
508 + </xs:attribute>
509 + </xs:complexType>
510 + </xs:element>
511 + <xs:element name="GroupRef">
512 + <xs:annotation>
513 + <xs:documentation>Used to join a user to a group</xs:documentation>
514 + </xs:annotation>
515 + <xs:complexType>
516 + <xs:attribute name="Id" type="xs:string" use="required" />
517 + </xs:complexType>
518 + </xs:element>
519 + <xs:element name="InternetShortcut">
520 + <xs:annotation>
521 + <xs:appinfo>
522 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Component" />
523 + <xse:howtoRef href="files_and_registry/create_internet_shortcut.html">How To: Create a shortcut to a webpage</xse:howtoRef>
524 + </xs:appinfo>
525 + <xs:documentation>Creates a shortcut to a URL.</xs:documentation>
526 + </xs:annotation>
527 + <xs:complexType>
528 + <xs:attribute name="Id" type="xs:string" use="required">
529 + <xs:annotation>
530 + <xs:documentation>Unique identifier in your installation package for this Internet shortcut.</xs:documentation>
531 + </xs:annotation>
532 + </xs:attribute>
533 + <xs:attribute name="Directory" type="xs:string">
534 + <xs:annotation>
535 + <xs:documentation>Identifier reference to Directory element where shortcut is to be created. This attribute's value defaults to the parent Component directory.</xs:documentation>
536 + </xs:annotation>
537 + </xs:attribute>
538 + <xs:attribute name="Name" type="xs:string" use="required">
539 + <xs:annotation>
540 + <xs:documentation>
541 + The name of the shortcut file, which is visible to the user. (The .lnk
542 + extension is added automatically and by default, is not shown to the user.)
543 + </xs:documentation>
544 + </xs:annotation>
545 + </xs:attribute>
546 + <xs:attribute name="Target" type="xs:string" use="required">
547 + <xs:annotation>
548 + <xs:documentation>
549 + URL that should be opened when the user selects the shortcut. Windows
550 + opens the URL in the appropriate handler for the protocol specified
551 + in the URL. Note that this is a formatted field, so you can use
552 + [#fileId] syntax to refer to a file being installed (using the file:
553 + protocol).
554 + </xs:documentation>
555 + </xs:annotation>
556 + </xs:attribute>
557 + <xs:attribute name="Type">
558 + <xs:annotation>
559 + <xs:documentation>Which type of shortcut should be created.</xs:documentation>
560 + </xs:annotation>
561 + <xs:simpleType>
562 + <xs:restriction base="xs:NMTOKEN">
563 + <xs:enumeration value="url">
564 + <xs:annotation>
565 + <xs:documentation>Creates .url files using IUniformResourceLocatorW.</xs:documentation>
566 + </xs:annotation>
567 + </xs:enumeration>
568 + <xs:enumeration value="link">
569 + <xs:annotation>
570 + <xs:documentation>Creates .lnk files using IShellLinkW (default).</xs:documentation>
571 + </xs:annotation>
572 + </xs:enumeration>
573 + </xs:restriction>
574 + </xs:simpleType>
575 + </xs:attribute>
576 + <xs:attribute name="IconFile" type="xs:string" use="optional">
577 + <xs:annotation>
578 + <xs:documentation>
579 + Icon file that should be displayed. Note that this is a formatted field, so you can use
580 + [#fileId] syntax to refer to a file being installed (using the file:
581 + protocol).
582 + </xs:documentation>
583 + </xs:annotation>
584 + </xs:attribute>
585 + <xs:attribute name="IconIndex" type="xs:integer" use="optional">
586 + <xs:annotation>
587 + <xs:documentation>
588 + Index of the icon being referenced
589 + </xs:documentation>
590 + </xs:annotation>
591 + </xs:attribute>
592 + </xs:complexType>
593 + </xs:element>
594 + <xs:element name="PerformanceCategory">
595 + <xs:annotation>
596 + <xs:appinfo>
597 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Component" />
598 + </xs:appinfo>
599 + <xs:documentation>Used to create performance categories and configure performance counters.</xs:documentation>
600 + </xs:annotation>
601 + <xs:complexType>
602 + <xs:sequence>
603 + <xs:element ref="PerformanceCounter" minOccurs="0" maxOccurs="unbounded" />
604 + </xs:sequence>
605 + <xs:attribute name="Id" type="xs:string">
606 + <xs:annotation>
607 + <xs:documentation>Unique identifier in your installation package for this performance counter category.</xs:documentation>
608 + </xs:annotation>
609 + </xs:attribute>
610 + <xs:attribute name="Name" type="xs:string" use="optional">
611 + <xs:annotation>
612 + <xs:documentation>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.</xs:documentation>
613 + </xs:annotation>
614 + </xs:attribute>
615 + <xs:attribute name="Help" type="xs:string" use="optional">
616 + <xs:annotation>
617 + <xs:documentation>Optional help text for the performance counter category.</xs:documentation>
618 + </xs:annotation>
619 + </xs:attribute>
620 + <xs:attribute name="MultiInstance" type="YesNoType" use="optional">
621 + <xs:annotation>
622 + <xs:documentation>Flag that specifies whether the performance counter category is multi or single instanced. Default is single instance.</xs:documentation>
623 + </xs:annotation>
624 + </xs:attribute>
625 + <xs:attribute name="Library" type="xs:string" use="optional">
626 + <xs:annotation>
627 + <xs:documentation>DLL that contains the performance counter. The default is "netfxperf.dll" which should be used for all managed code performance counters.</xs:documentation>
628 + </xs:annotation>
629 + </xs:attribute>
630 + <xs:attribute name="Open" type="xs:string" use="optional">
631 + <xs:annotation>
632 + <xs:documentation>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.</xs:documentation>
633 + </xs:annotation>
634 + </xs:attribute>
635 + <xs:attribute name="Close" type="xs:string" use="optional">
636 + <xs:annotation>
637 + <xs:documentation>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.</xs:documentation>
638 + </xs:annotation>
639 + </xs:attribute>
640 + <xs:attribute name="Collect" type="xs:string" use="optional">
641 + <xs:annotation>
642 + <xs:documentation>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.</xs:documentation>
643 + </xs:annotation>
644 + </xs:attribute>
645 + <xs:attribute name="DefaultLanguage" type="PerformanceCounterLanguageType">
646 + <xs:annotation>
647 + <xs:documentation>Default language for the performance category and contained counters' names and help text.</xs:documentation>
648 + </xs:annotation>
649 + </xs:attribute>
650 + </xs:complexType>
651 + </xs:element>
652 + <xs:element name="PerformanceCounter">
653 + <xs:annotation>
654 + <xs:documentation>Creates a performance counter in a performance category.</xs:documentation>
655 + </xs:annotation>
656 + <xs:complexType>
657 + <xs:attribute name="Name" type="xs:string">
658 + <xs:annotation>
659 + <xs:documentation>Name for the performance counter.</xs:documentation>
660 + </xs:annotation>
661 + </xs:attribute>
662 + <xs:attribute name="Help" type="xs:string" use="optional">
663 + <xs:annotation>
664 + <xs:documentation>Optional help text for the performance counter.</xs:documentation>
665 + </xs:annotation>
666 + </xs:attribute>
667 + <xs:attribute name="Type" type="PerformanceCounterTypesType">
668 + <xs:annotation>
669 + <xs:documentation>Type of the performance counter.</xs:documentation>
670 + </xs:annotation>
671 + </xs:attribute>
672 + <xs:attribute name="Language" type="PerformanceCounterLanguageType" use="optional">
673 + <xs:annotation>
674 + <xs:documentation>Language for the peformance counter name and help. The default is to use the parent PerformanceCategory element's DefaultLanguage attribute.</xs:documentation>
675 + </xs:annotation>
676 + </xs:attribute>
677 + </xs:complexType>
678 + </xs:element>
679 + <xs:element name="PerfCounter">
680 + <xs:annotation>
681 + <xs:appinfo>
682 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="File" />
683 + <xse:deprecated ref="PerformanceCounter" />
684 + </xs:appinfo>
685 + <xs:documentation>Used to install Perfmon counters.</xs:documentation>
686 + </xs:annotation>
687 + <xs:complexType>
688 + <xs:attribute name="Name" type="xs:string" />
689 + </xs:complexType>
690 + </xs:element>
691 + <xs:element name="PerfCounterManifest">
692 + <xs:annotation>
693 + <xs:appinfo>
694 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="File" />
695 + </xs:appinfo>
696 + <xs:documentation>
697 + Used to install Perfmon Counter Manifests.
698 + Note that this functionality cannot be used with major upgrades that are scheduled after the InstallExecute,
699 + InstallExecuteAgain, or InstallFinalize actions. For more information on major upgrade scheduling, see
700 + <html:a href="http://msdn.microsoft.com/en-us/library/aa371197.aspx">RemoveExistingProducts Action</html:a>.
701 + </xs:documentation>
702 + </xs:annotation>
703 + <xs:complexType>
704 + <xs:attribute name="ResourceFileDirectory" type="xs:string" use="optional">
705 + <xs:annotation>
706 + <xs:documentation>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.</xs:documentation>
707 + </xs:annotation>
708 + </xs:attribute>
709 + </xs:complexType>
710 + </xs:element>
711 + <xs:element name="EventManifest">
712 + <xs:annotation>
713 + <xs:appinfo>
714 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="File" />
715 + </xs:appinfo>
716 + <xs:documentation>Used to install Event Manifests.</xs:documentation>
717 + </xs:annotation>
718 + <xs:complexType>
719 + <xs:attribute name="MessageFile" type="xs:string" use="optional">
720 + <xs:annotation>
721 + <xs:documentation>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. </xs:documentation>
722 + </xs:annotation>
723 + </xs:attribute>
724 + <xs:attribute name="ParameterFile" type="xs:string" use="optional">
725 + <xs:annotation>
726 + <xs:documentation>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. </xs:documentation>
727 + </xs:annotation>
728 + </xs:attribute>
729 + <xs:attribute name="ResourceFile" type="xs:string" use="optional">
730 + <xs:annotation>
731 + <xs:documentation>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. </xs:documentation>
732 + </xs:annotation>
733 + </xs:attribute>
734 + </xs:complexType>
735 + </xs:element>
736 + <xs:element name="PermissionEx">
737 + <xs:annotation>
738 + <xs:documentation>
739 + Sets ACLs on File, Registry, CreateFolder, or ServiceInstall. When under a Registry element, this cannot be used
740 + if the Action attribute's value is remove or removeKeyOnInstall. This element has no Id attribute.
741 + The table and key are taken from the parent element.
742 + </xs:documentation>
743 + <xs:appinfo>
744 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="CreateFolder" />
745 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="File" />
746 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Registry" />
747 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="RegistryKey" />
748 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="RegistryValue" />
749 + </xs:appinfo>
750 + </xs:annotation>
751 + <xs:complexType>
752 + <xs:attribute name="Domain" type="xs:string"></xs:attribute>
753 + <xs:attribute name="User" use="required" type="xs:string"></xs:attribute>
754 + <!-- Common ACLs -->
755 + <xs:attribute name="Read" type="YesNoType"></xs:attribute>
756 + <xs:attribute name="Delete" type="YesNoType"></xs:attribute>
757 + <xs:attribute name="ReadPermission" type="YesNoType"></xs:attribute>
758 + <xs:attribute name="ChangePermission" type="YesNoType"></xs:attribute>
759 + <xs:attribute name="TakeOwnership" type="YesNoType"></xs:attribute>
760 + <!-- Folder and File ACLs -->
761 + <xs:attribute name="ReadAttributes" type="YesNoType"></xs:attribute>
762 + <xs:attribute name="WriteAttributes" type="YesNoType"></xs:attribute>
763 + <xs:attribute name="ReadExtendedAttributes" type="YesNoType"></xs:attribute>
764 + <xs:attribute name="WriteExtendedAttributes" type="YesNoType"></xs:attribute>
765 + <xs:attribute name="Synchronize" type="YesNoType"></xs:attribute>
766 + <!-- Folder only ACLs -->
767 + <xs:attribute name="CreateFile" type="YesNoType">
768 + <xs:annotation>
769 + <xs:documentation>For a directory, the right to create a file in the directory. Only valid under a 'CreateFolder' parent.</xs:documentation>
770 + </xs:annotation>
771 + </xs:attribute>
772 + <xs:attribute name="CreateChild" type="YesNoType">
773 + <xs:annotation>
774 + <xs:documentation>For a directory, the right to create a subdirectory. Only valid under a 'CreateFolder' parent.</xs:documentation>
775 + </xs:annotation>
776 + </xs:attribute>
777 + <xs:attribute name="DeleteChild" type="YesNoType">
778 + <xs:annotation>
779 + <xs:documentation>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.</xs:documentation>
780 + </xs:annotation>
781 + </xs:attribute>
782 + <xs:attribute name="Traverse" type="YesNoType">
783 + <xs:annotation>
784 + <xs:documentation>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.</xs:documentation>
785 + </xs:annotation>
786 + </xs:attribute>
787 + <!-- File only ACLs -->
788 + <xs:attribute name="Append" type="YesNoType"></xs:attribute>
789 + <xs:attribute name="Execute" type="YesNoType"></xs:attribute>
790 + <!-- File and Registry ACLs -->
791 + <xs:attribute name="Write" type="YesNoType"></xs:attribute>
792 + <!-- Registry only ACLs -->
793 + <xs:attribute name="CreateSubkeys" type="YesNoType"></xs:attribute>
794 + <xs:attribute name="EnumerateSubkeys" type="YesNoType"></xs:attribute>
795 + <xs:attribute name="Notify" type="YesNoType"></xs:attribute>
796 + <xs:attribute name="CreateLink" type="YesNoType"></xs:attribute>
797 + <!-- Generic ACLs, mapped by system to appropriate permissions -->
798 + <xs:attribute name="GenericAll" type="YesNoType"></xs:attribute>
799 + <xs:attribute name="GenericExecute" type="YesNoType"></xs:attribute>
800 + <xs:attribute name="GenericWrite" type="YesNoType"></xs:attribute>
801 + <xs:attribute name="GenericRead" type="YesNoType">
802 + <xs:annotation>
803 + <xs:documentation>specifying this will fail to grant read access</xs:documentation>
804 + </xs:annotation>
805 + </xs:attribute>
806 + <!-- Service only ACLs -->
807 + <xs:attribute name="ServiceQueryConfig" type="YesNoType">
808 + <xs:annotation>
809 + <xs:documentation>Required to call the QueryServiceConfig and QueryServiceConfig2 functions to query the service configuration. Only valid under a 'ServiceInstall' parent.</xs:documentation>
810 + </xs:annotation>
811 + </xs:attribute>
812 + <xs:attribute name="ServiceChangeConfig" type="YesNoType">
813 + <xs:annotation>
814 + <xs:documentation>Required to call the ChangeServiceConfig or ChangeServiceConfig2 function to change the service configuration. Only valid under a 'ServiceInstall' parent.</xs:documentation>
815 + </xs:annotation>
816 + </xs:attribute>
817 + <xs:attribute name="ServiceQueryStatus" type="YesNoType">
818 + <xs:annotation>
819 + <xs:documentation>Required to call the QueryServiceStatus function to ask the service control manager about the status of the service. Only valid under a 'ServiceInstall' parent.</xs:documentation>
820 + </xs:annotation>
821 + </xs:attribute>
822 + <xs:attribute name="ServiceEnumerateDependents" type="YesNoType">
823 + <xs:annotation>
824 + <xs:documentation>Required to call the EnumDependentServices function to enumerate all the services dependent on the service. Only valid under a 'ServiceInstall' parent.</xs:documentation>
825 + </xs:annotation>
826 + </xs:attribute>
827 + <xs:attribute name="ServiceStart" type="YesNoType">
828 + <xs:annotation>
829 + <xs:documentation>Required to call the StartService function to start the service. Only valid under a 'ServiceInstall' parent.</xs:documentation>
830 + </xs:annotation>
831 + </xs:attribute>
832 + <xs:attribute name="ServiceStop" type="YesNoType">
833 + <xs:annotation>
834 + <xs:documentation>Required to call the ControlService function to stop the service. Only valid under a 'ServiceInstall' parent.</xs:documentation>
835 + </xs:annotation>
836 + </xs:attribute>
837 + <xs:attribute name="ServicePauseContinue" type="YesNoType">
838 + <xs:annotation>
839 + <xs:documentation>Required to call the ControlService function to pause or continue the service. Only valid under a 'ServiceInstall' parent.</xs:documentation>
840 + </xs:annotation>
841 + </xs:attribute>
842 + <xs:attribute name="ServiceInterrogate" type="YesNoType">
843 + <xs:annotation>
844 + <xs:documentation>Required to call the ControlService function to ask the service to report its status immediately. Only valid under a 'ServiceInstall' parent.</xs:documentation>
845 + </xs:annotation>
846 + </xs:attribute>
847 + <xs:attribute name="ServiceUserDefinedControl" type="YesNoType">
848 + <xs:annotation>
849 + <xs:documentation>Required to call the ControlService function to specify a user-defined control code. Only valid under a 'ServiceInstall' parent.</xs:documentation>
850 + </xs:annotation>
851 + </xs:attribute>
852 + </xs:complexType>
853 + </xs:element>
854 + <xs:element name="ProductSearch">
855 + <xs:annotation>
856 + <xs:documentation>Describes a product search.</xs:documentation>
857 + <xs:appinfo>
858 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Bundle" />
859 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Fragment" />
860 + </xs:appinfo>
861 + </xs:annotation>
862 + <xs:complexType>
863 + <xs:attributeGroup ref="SearchCommonAttributes" />
864 + <xs:attribute name="Guid" type="xs:string">
865 + <xs:annotation>
866 + <xs:documentation>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.</xs:documentation>
867 + </xs:annotation>
868 + </xs:attribute>
869 + <xs:attribute name="ProductCode" type="xs:string">
870 + <xs:annotation>
871 + <xs:documentation>The ProductCode to use for the search. This attribute must be omitted if UpgradeCode is specified.</xs:documentation>
872 + </xs:annotation>
873 + </xs:attribute>
874 + <xs:attribute name="UpgradeCode" type="xs:string">
875 + <xs:annotation>
876 + <xs:documentation>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.</xs:documentation>
877 + </xs:annotation>
878 + </xs:attribute>
879 + <xs:attribute name="Result">
880 + <xs:annotation>
881 + <xs:documentation>
882 + Rather than saving the product version into the variable, a ProductSearch can save another attribute of the matching product instead.
883 + </xs:documentation>
884 + </xs:annotation>
885 + <xs:simpleType>
886 + <xs:restriction base="xs:NMTOKEN">
887 + <xs:enumeration value="version">
888 + <xs:annotation>
889 + <xs:documentation>Saves the version of a matching product if found; 0.0.0.0 otherwise. This is the default.</xs:documentation>
890 + </xs:annotation>
891 + </xs:enumeration>
892 + <xs:enumeration value="language">
893 + <xs:annotation>
894 + <xs:documentation>Saves the language of a matching product if found; empty otherwise.</xs:documentation>
895 + </xs:annotation>
896 + </xs:enumeration>
897 + <xs:enumeration value="state">
898 + <xs:annotation>
899 + <xs:documentation>Saves the state of the product: advertised (1), absent (2), or locally installed (5).</xs:documentation>
900 + </xs:annotation>
901 + </xs:enumeration>
902 + <xs:enumeration value="assignment">
903 + <xs:annotation>
904 + <xs:documentation>Saves the assignment type of the product: per-user (0), or per-machine (1).</xs:documentation>
905 + </xs:annotation>
906 + </xs:enumeration>
907 + </xs:restriction>
908 + </xs:simpleType>
909 + </xs:attribute>
910 + </xs:complexType>
911 + </xs:element>
912 + <xs:element name="ProductSearchRef">
913 + <xs:annotation>
914 + <xs:documentation>References a ProductSearch.</xs:documentation>
915 + <xs:appinfo>
916 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Bundle" />
917 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Fragment" />
918 + </xs:appinfo>
919 + </xs:annotation>
920 + <xs:complexType>
921 + <xs:attribute name="Id" type="xs:string" use="required" />
922 + </xs:complexType>
923 + </xs:element>
924 + <xs:element name="RemoveFolderEx">
925 + <xs:annotation>
926 + <xs:appinfo>
927 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Component" />
928 + <xse:msiRef table="RemoveFile" href="http://msdn.microsoft.com/library/aa371201.aspx"/>
929 + <xse:remarks>
930 + <html:p>The custom action that implements RemoveFolderEx does so by writing temporary rows to the RemoveFile table
931 + for each subfolder of the root folder you specify. Because it might dramatically affect Windows Installer's
932 + <html:a href="http://msdn.microsoft.com/en-us/library/aa368593.aspx">File Costing</html:a>,
933 + the temporary rows must be written before the CostInitialize standard action. Unfortunately, MSI doesn't
934 + create properties for the Directory hierarchy in your package until later, in the CostFinalize action.</html:p>
935 + <html:p>An easy workaround for a typical use case of removing a folder during uninstall is to write the directory
936 + path to the registry and to load it during uninstall. See
937 + <html:a href="http://robmensching.com/blog/posts/2010/5/2/the-wix-toolsets-remember-property-pattern">The WiX toolset's "Remember Property" pattern</html:a>
938 + for an example.</html:p>
939 + <html:p>If you use custom actions to set properties, ensure that they are scheduled before the WixRemoveFoldersEx custom action.</html:p>
940 + </xse:remarks>
941 + </xs:appinfo>
942 + <xs:documentation>
943 + Remove a folder and all contained files and folders if the parent component is selected for installation or removal.
944 + The folder must be specified in the Property attribute as the name of a property that will have a value that resolves
945 + to the full path of the folder before the CostInitialize action. Note that Directory ids cannot be used.
946 + For more details, see the Remarks.
947 + </xs:documentation>
948 + </xs:annotation>
949 + <xs:complexType>
950 + <xs:attribute name="Id" type="xs:string">
951 + <xs:annotation>
952 + <xs:documentation>Primary key used to identify this particular entry. If this is not specified, a stable identifier
953 + will be generated at compile time based on the other attributes.</xs:documentation>
954 + </xs:annotation>
955 + </xs:attribute>
956 + <xs:attribute name="Property" type="xs:string">
957 + <xs:annotation>
958 + <xs:documentation>
959 + The id of a property that resolves to the full path of the source directory. The property does not have
960 + to exist in the installer database at creation time; it could be created at installation time by a custom
961 + action, on the command line, etc. The property value can contain environment variables surrounded by
962 + percent signs such as from a REG_EXPAND_SZ registry value; environment variables will be expanded before
963 + being evaluated for a full path.
964 + </xs:documentation>
965 + </xs:annotation>
966 + </xs:attribute>
967 + <xs:attribute name="On">
968 + <xs:annotation>
969 + <xs:documentation>
970 + This value determines when the folder may be removed.
971 + </xs:documentation>
972 + </xs:annotation>
973 + <xs:simpleType>
974 + <xs:restriction base="xs:NMTOKEN">
975 + <xs:enumeration value="install">
976 + <xs:annotation>
977 + <xs:documentation>
978 + Removes the folder only when the parent component is being installed (msiInstallStateLocal or msiInstallStateSource).
979 + </xs:documentation>
980 + </xs:annotation>
981 + </xs:enumeration>
982 + <xs:enumeration value="uninstall">
983 + <xs:annotation>
984 + <xs:documentation>
985 + Default: Removes the folder only when the parent component is being removed (msiInstallStateAbsent).
986 + </xs:documentation>
987 + </xs:annotation>
988 + </xs:enumeration>
989 + <xs:enumeration value="both">
990 + <xs:annotation>
991 + <xs:documentation>
992 + Removes the folder when the parent component is being installed or removed.
993 + </xs:documentation>
994 + </xs:annotation>
995 + </xs:enumeration>
996 + </xs:restriction>
997 + </xs:simpleType>
998 + </xs:attribute>
999 + </xs:complexType>
1000 + </xs:element>
1001 + <xs:element name="RestartResource">
1002 + <xs:annotation>
1003 + <xs:documentation>Registers a resource with the Restart Manager.</xs:documentation>
1004 + <xs:appinfo>
1005 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Component" />
1006 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Fragment" />
1007 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Module" />
1008 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Product" />
1009 + </xs:appinfo>
1010 + </xs:annotation>
1011 + <xs:complexType>
1012 + <xs:attribute name="Id" type="xs:string">
1013 + <xs:annotation>
1014 + <xs:documentation>The unique identifier for this resource. A unique identifier will
1015 + be generated automatically if not specified.</xs:documentation>
1016 + </xs:annotation>
1017 + </xs:attribute>
1018 + <xs:attribute name="Path" type="xs:string">
1019 + <xs:annotation>
1020 + <xs:documentation>The full path to the process module to register with the Restart Manager.
1021 + This can be a formatted value that resolves to a full path.</xs:documentation>
1022 + </xs:annotation>
1023 + </xs:attribute>
1024 + <xs:attribute name="ProcessName" type="xs:string">
1025 + <xs:annotation>
1026 + <xs:documentation>The name of a process to register with the Restart Manager.
1027 + This can be a formatted value that resolves to a process name.</xs:documentation>
1028 + </xs:annotation>
1029 + </xs:attribute>
1030 + <xs:attribute name="ServiceName" type="xs:string">
1031 + <xs:annotation>
1032 + <xs:documentation>The name of a Windows service to register with the Restart Manager.
1033 + This can be a formatted value that resolves to a service name.</xs:documentation>
1034 + </xs:annotation>
1035 + </xs:attribute>
1036 + </xs:complexType>
1037 + </xs:element>
1038 + <xs:element name="RegistrySearch">
1039 + <xs:annotation>
1040 + <xs:documentation>Describes a registry search.</xs:documentation>
1041 + <xs:appinfo>
1042 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Bundle" />
1043 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Fragment" />
1044 + </xs:appinfo>
1045 + </xs:annotation>
1046 + <xs:complexType>
1047 + <xs:attributeGroup ref="SearchCommonAttributes" />
1048 + <xs:attribute name="Root" use="required">
1049 + <xs:annotation>
1050 + <xs:documentation>Registry root hive to search under.</xs:documentation>
1051 + </xs:annotation>
1052 + <xs:simpleType>
1053 + <xs:restriction base="xs:NMTOKEN">
1054 + <xs:enumeration value="HKLM">
1055 + <xs:annotation>
1056 + <xs:documentation>HKEY_LOCAL_MACHINE</xs:documentation>
1057 + </xs:annotation>
1058 + </xs:enumeration>
1059 + <xs:enumeration value="HKCU">
1060 + <xs:annotation>
1061 + <xs:documentation>HKEY_CURRENT_USER</xs:documentation>
1062 + </xs:annotation>
1063 + </xs:enumeration>
1064 + <xs:enumeration value="HKCR">
1065 + <xs:annotation>
1066 + <xs:documentation>HKEY_CLASSES_ROOT</xs:documentation>
1067 + </xs:annotation>
1068 + </xs:enumeration>
1069 + <xs:enumeration value="HKU">
1070 + <xs:annotation>
1071 + <xs:documentation>HKEY_USERS</xs:documentation>
1072 + </xs:annotation>
1073 + </xs:enumeration>
1074 + </xs:restriction>
1075 + </xs:simpleType>
1076 + </xs:attribute>
1077 + <xs:attribute name="Key" type="xs:string" use="required">
1078 + <xs:annotation>
1079 + <xs:documentation>Key to search for.</xs:documentation>
1080 + </xs:annotation>
1081 + </xs:attribute>
1082 + <xs:attribute name="Value" type="xs:string">
1083 + <xs:annotation>
1084 + <xs:documentation>Optional value to search for under the given Key.</xs:documentation>
1085 + </xs:annotation>
1086 + </xs:attribute>
1087 + <xs:attribute name="Format">
1088 + <xs:annotation>
1089 + <xs:documentation>What format to return the value in.</xs:documentation>
1090 + </xs:annotation>
1091 + <xs:simpleType>
1092 + <xs:restriction base="xs:NMTOKEN">
1093 + <xs:enumeration value="raw">
1094 + <xs:annotation>
1095 + <xs:documentation>Returns the unformatted value directly from the registry. For example, a REG_DWORD value of '1' is returned as '1', not '#1'.</xs:documentation>
1096 + </xs:annotation>
1097 + </xs:enumeration>
1098 + <xs:enumeration value="compatible">
1099 + <xs:annotation>
1100 + <xs:documentation>Returns the value formatted as Windows Installer would. For example, a REG_DWORD value of '1' is returned as '#1', not '1'.</xs:documentation>
1101 + </xs:annotation>
1102 + </xs:enumeration>
1103 + </xs:restriction>
1104 + </xs:simpleType>
1105 + </xs:attribute>
1106 + <xs:attribute name="ExpandEnvironmentVariables" type="YesNoType">
1107 + <xs:annotation>
1108 + <xs:documentation>Whether to expand any environment variables in REG_SZ, REG_EXPAND_SZ, or REG_MULTI_SZ values.</xs:documentation>
1109 + </xs:annotation>
1110 + </xs:attribute>
1111 + <xs:attribute name="Result">
1112 + <xs:annotation>
1113 + <xs:documentation>
1114 + Rather than saving the matching registry value into the variable, a RegistrySearch can save an attribute of the matching entry instead.
1115 + </xs:documentation>
1116 + </xs:annotation>
1117 + <xs:simpleType>
1118 + <xs:restriction base="xs:NMTOKEN">
1119 + <xs:enumeration value="exists">
1120 + <xs:annotation>
1121 + <xs:documentation>Saves true if a matching registry entry is found; false otherwise.</xs:documentation>
1122 + </xs:annotation>
1123 + </xs:enumeration>
1124 + <xs:enumeration value="value">
1125 + <xs:annotation>
1126 + <xs:documentation>Saves the value of the registry key in the variable. This is the default.</xs:documentation>
1127 + </xs:annotation>
1128 + </xs:enumeration>
1129 + </xs:restriction>
1130 + </xs:simpleType>
1131 + </xs:attribute>
1132 + <xs:attribute name="Win64" type="YesNoType">
1133 + <xs:annotation>
1134 + <xs:documentation>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'.</xs:documentation>
1135 + </xs:annotation>
1136 + </xs:attribute>
1137 + </xs:complexType>
1138 + </xs:element>
1139 + <xs:element name="RegistrySearchRef">
1140 + <xs:annotation>
1141 + <xs:documentation>References a RegistrySearch.</xs:documentation>
1142 + <xs:appinfo>
1143 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Bundle" />
1144 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Fragment" />
1145 + </xs:appinfo>
1146 + </xs:annotation>
1147 + <xs:complexType>
1148 + <xs:attribute name="Id" type="xs:string" use="required" />
1149 + </xs:complexType>
1150 + </xs:element>
1151 + <xs:element name="ServiceConfig">
1152 + <xs:annotation>
1153 + <xs:documentation>Service configuration information for failure actions.</xs:documentation>
1154 + <xs:appinfo>
1155 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Component" />
1156 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="ServiceInstall" />
1157 + <xse:remarks>
1158 + <html:dl>
1159 + <html:dd>Nesting a ServiceConfig element under a ServiceInstall element will result in the service being installed to be configured.</html:dd>
1160 + <html:dd>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.</html:dd>
1161 + </html:dl>
1162 + </xse:remarks>
1163 + </xs:appinfo>
1164 + </xs:annotation>
1165 + <xs:complexType>
1166 + <xs:attribute name="ServiceName" type="xs:string">
1167 + <xs:annotation>
1168 + <xs:documentation>Required if not under a ServiceInstall element.</xs:documentation>
1169 + </xs:annotation>
1170 + </xs:attribute>
1171 + <xs:attribute name="FirstFailureActionType" use="required">
1172 + <xs:annotation>
1173 + <xs:documentation>Action to take on the first failure of the service.</xs:documentation>
1174 + </xs:annotation>
1175 + <xs:simpleType>
1176 + <xs:restriction base="xs:NMTOKEN">
1177 + <xs:enumeration value="none" />
1178 + <xs:enumeration value="reboot" />
1179 + <xs:enumeration value="restart" />
1180 + <xs:enumeration value="runCommand" />
1181 + </xs:restriction>
1182 + </xs:simpleType>
1183 + </xs:attribute>
1184 + <xs:attribute name="SecondFailureActionType" use="required">
1185 + <xs:annotation>
1186 + <xs:documentation>Action to take on the second failure of the service.</xs:documentation>
1187 + </xs:annotation>
1188 + <xs:simpleType>
1189 + <xs:restriction base="xs:NMTOKEN">
1190 + <xs:enumeration value="none" />
1191 + <xs:enumeration value="reboot" />
1192 + <xs:enumeration value="restart" />
1193 + <xs:enumeration value="runCommand" />
1194 + </xs:restriction>
1195 + </xs:simpleType>
1196 + </xs:attribute>
1197 + <xs:attribute name="ThirdFailureActionType" use="required">
1198 + <xs:annotation>
1199 + <xs:documentation>Action to take on the third failure of the service.</xs:documentation>
1200 + </xs:annotation>
1201 + <xs:simpleType>
1202 + <xs:restriction base="xs:NMTOKEN">
1203 + <xs:enumeration value="none" />
1204 + <xs:enumeration value="reboot" />
1205 + <xs:enumeration value="restart" />
1206 + <xs:enumeration value="runCommand" />
1207 + </xs:restriction>
1208 + </xs:simpleType>
1209 + </xs:attribute>
1210 + <xs:attribute name="ResetPeriodInDays" type="xs:integer">
1211 + <xs:annotation>
1212 + <xs:documentation>Number of days after which to reset the failure count to zero if there are no failures.</xs:documentation>
1213 + </xs:annotation>
1214 + </xs:attribute>
1215 + <xs:attribute name="RestartServiceDelayInSeconds" type="xs:integer">
1216 + <xs:annotation>
1217 + <xs:documentation>If any of the three *ActionType attributes is "restart", this specifies the number of seconds to wait before doing so.</xs:documentation>
1218 + </xs:annotation>
1219 + </xs:attribute>
1220 + <xs:attribute name="ProgramCommandLine" type="xs:string">
1221 + <xs:annotation>
1222 + <xs:documentation>If any of the three *ActionType attributes is "runCommand", this specifies the command to run when doing so. This value is formatted.</xs:documentation>
1223 + </xs:annotation>
1224 + </xs:attribute>
1225 + <xs:attribute name="RebootMessage" type="xs:string">
1226 + <xs:annotation>
1227 + <xs:documentation>If any of the three *ActionType attributes is "reboot", this specifies the message to broadcast to server users before doing so.</xs:documentation>
1228 + </xs:annotation>
1229 + </xs:attribute>
1230 + </xs:complexType>
1231 + </xs:element>
1232 + <xs:element name="TouchFile">
1233 + <xs:annotation>
1234 + <xs:documentation>Updates the last modified date/time of a file.</xs:documentation>
1235 + <xs:appinfo>
1236 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Component" />
1237 + </xs:appinfo>
1238 + </xs:annotation>
1239 + <xs:complexType>
1240 + <xs:attribute name="Id" type="xs:string">
1241 + <xs:annotation>
1242 + <xs:documentation>Identifier for the touch file operation. If the identifier is not specified it will be generated.</xs:documentation>
1243 + </xs:annotation>
1244 + </xs:attribute>
1245 + <xs:attribute name="Path" use="required" type="xs:string">
1246 + <xs:annotation>
1247 + <xs:documentation>Path of the file to update. This value is formatted.</xs:documentation>
1248 + </xs:annotation>
1249 + </xs:attribute>
1250 + <xs:attribute name="OnInstall" type="YesNoType">
1251 + <xs:annotation>
1252 + <xs:documentation>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'.</xs:documentation>
1253 + </xs:annotation>
1254 + </xs:attribute>
1255 + <xs:attribute name="OnReinstall" type="YesNoType">
1256 + <xs:annotation>
1257 + <xs:documentation>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'.</xs:documentation>
1258 + </xs:annotation>
1259 + </xs:attribute>
1260 + <xs:attribute name="OnUninstall" type="YesNoType">
1261 + <xs:annotation>
1262 + <xs:documentation>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'.</xs:documentation>
1263 + </xs:annotation>
1264 + </xs:attribute>
1265 + <xs:attribute name="Nonvital" type="YesNoType">
1266 + <xs:annotation>
1267 + <xs:documentation>Indicates the installation will succeed even if the modified time of the file cannot be updated. The default is 'no'.</xs:documentation>
1268 + </xs:annotation>
1269 + </xs:attribute>
1270 + </xs:complexType>
1271 + </xs:element>
1272 + <xs:element name="User">
1273 + <xs:annotation>
1274 + <xs:documentation>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.</xs:documentation>
1275 + <xs:appinfo>
1276 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Component" />
1277 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Fragment" />
1278 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Module" />
1279 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Product" />
1280 + <xse:seeAlso ref="Group" />
1281 + <xse:seeAlso ref="GroupRef" />
1282 + </xs:appinfo>
1283 + </xs:annotation>
1284 + <xs:complexType>
1285 + <xs:sequence>
1286 + <xs:element ref="GroupRef" minOccurs="0" maxOccurs="unbounded" />
1287 + </xs:sequence>
1288 + <xs:attribute name="Id" type="xs:string" use="required" />
1289 + <xs:attribute name="Name" use="required" type="xs:string">
1290 + <xs:annotation>
1291 + <xs:documentation>A <a href="http://msdn.microsoft.com/library/aa368609.aspx" target="_blank">Formatted</a> string that contains the name of the user account.</xs:documentation>
1292 + </xs:annotation>
1293 + </xs:attribute>
1294 + <xs:attribute name="Domain" type="xs:string">
1295 + <xs:annotation>
1296 + <xs:documentation>A <a href="http://msdn.microsoft.com/library/aa368609.aspx" target="_blank">Formatted</a> string that contains the local machine or Active Directory domain for the user.</xs:documentation>
1297 + </xs:annotation>
1298 + </xs:attribute>
1299 + <xs:attribute name="Password" type="xs:string">
1300 + <xs:annotation>
1301 + <xs:documentation>Usually a Property that is passed in on the command-line to keep it more secure.</xs:documentation>
1302 + </xs:annotation>
1303 + </xs:attribute>
1304 + <xs:attribute name="PasswordNeverExpires" type="YesNoType">
1305 + <xs:annotation>
1306 + <xs:documentation>The account's password never expires. Equivalent to UF_DONT_EXPIRE_PASSWD.</xs:documentation>
1307 + </xs:annotation>
1308 + </xs:attribute>
1309 + <xs:attribute name="CanNotChangePassword" type="YesNoType">
1310 + <xs:annotation>
1311 + <xs:documentation>The user cannot change the account's password. Equivalent to UF_PASSWD_CANT_CHANGE.</xs:documentation>
1312 + </xs:annotation>
1313 + </xs:attribute>
1314 + <xs:attribute name="RemoveOnUninstall" type="YesNoType">
1315 + <xs:annotation>
1316 + <xs:documentation>Indicates whether the user account should be removed or left behind on uninstall.</xs:documentation>
1317 + </xs:annotation>
1318 + </xs:attribute>
1319 + <xs:attribute name="FailIfExists" type="YesNoType">
1320 + <xs:annotation>
1321 + <xs:documentation>Indicates if the install should fail if the user already exists.</xs:documentation>
1322 + </xs:annotation>
1323 + </xs:attribute>
1324 + <xs:attribute name="LogonAsService" type="YesNoType">
1325 + <xs:annotation>
1326 + <xs:documentation>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.</xs:documentation>
1327 + </xs:annotation>
1328 + </xs:attribute>
1329 + <xs:attribute name="LogonAsBatchJob" type="YesNoType">
1330 + <xs:annotation>
1331 + <xs:documentation>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.</xs:documentation>
1332 + </xs:annotation>
1333 + </xs:attribute>
1334 + <xs:attribute name="UpdateIfExists" type="YesNoType">
1335 + <xs:annotation>
1336 + <xs:documentation>Indicates if the user account properties should be updated if the user already exists.</xs:documentation>
1337 + </xs:annotation>
1338 + </xs:attribute>
1339 + <xs:attribute name="PasswordExpired" type="YesNoType">
1340 + <xs:annotation>
1341 + <xs:documentation>Indicates whether the user must change their password on their first login.</xs:documentation>
1342 + </xs:annotation>
1343 + </xs:attribute>
1344 + <xs:attribute name="Disabled" type="YesNoType">
1345 + <xs:annotation>
1346 + <xs:documentation>The account is disabled. Equivalent to UF_ACCOUNTDISABLE.</xs:documentation>
1347 + </xs:annotation>
1348 + </xs:attribute>
1349 + <xs:attribute name="CreateUser" type="YesNoType">
1350 + <xs:annotation>
1351 + <xs:documentation>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.</xs:documentation>
1352 + </xs:annotation>
1353 + </xs:attribute>
1354 + <xs:attribute name="Vital" type="YesNoType" default="yes">
1355 + <xs:annotation>
1356 + <xs:documentation>Indicates whether failure to create the user or add the user to a group fails the installation. The default value is "yes".</xs:documentation>
1357 + </xs:annotation>
1358 + </xs:attribute>
1359 + </xs:complexType>
1360 + </xs:element>
1361 + <xs:element name="XmlFile">
1362 + <xs:annotation>
1363 + <xs:documentation>
1364 + Adds or removes .xml file entries. If you use the XmlFile element you must reference WixUtilExtension.dll as it contains the XmlFile custom actions.
1365 + </xs:documentation>
1366 + <xs:appinfo>
1367 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Component" />
1368 + </xs:appinfo>
1369 + </xs:annotation>
1370 + <xs:complexType>
1371 + <xs:attribute name="Id" use="required" type="xs:string">
1372 + <xs:annotation>
1373 + <xs:documentation>Identifier for xml file modification.</xs:documentation>
1374 + </xs:annotation>
1375 + </xs:attribute>
1376 + <xs:attribute name="ElementPath" use="required" type="xs:string">
1377 + <xs:annotation>
1378 + <xs:documentation>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.</xs:documentation>
1379 + </xs:annotation>
1380 + </xs:attribute>
1381 + <xs:attribute name="File" use="required" type="xs:string">
1382 + <xs:annotation>
1383 + <xs:documentation>Path of the .xml file to configure.</xs:documentation>
1384 + </xs:annotation>
1385 + </xs:attribute>
1386 + <xs:attribute name="Name" type="xs:string">
1387 + <xs:annotation>
1388 + <xs:documentation>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.</xs:documentation>
1389 + </xs:annotation>
1390 + </xs:attribute>
1391 + <xs:attribute name="Value" type="xs:string">
1392 + <xs:annotation>
1393 + <xs:documentation>
1394 + The value to be written. See the <html:a href="http://msdn.microsoft.com/library/aa368609(VS.85).aspx" target="_blank">Formatted topic</html:a> for information how to escape square brackets in the value.
1395 + </xs:documentation>
1396 + </xs:annotation>
1397 + </xs:attribute>
1398 + <xs:attribute name="Action" use="required">
1399 + <xs:annotation>
1400 + <xs:documentation>The type of modification to be made to the XML file when the component is installed.</xs:documentation>
1401 + </xs:annotation>
1402 + <xs:simpleType>
1403 + <xs:restriction base="xs:NMTOKEN">
1404 + <xs:enumeration value="createElement">
1405 + <xs:annotation>
1406 + <xs:documentation>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.</xs:documentation>
1407 + </xs:annotation>
1408 + </xs:enumeration>
1409 + <xs:enumeration value="deleteValue">
1410 + <xs:annotation>
1411 + <xs:documentation>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.</xs:documentation>
1412 + </xs:annotation>
1413 + </xs:enumeration>
1414 + <xs:enumeration value="setValue">
1415 + <xs:annotation>
1416 + <xs:documentation>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.</xs:documentation>
1417 + </xs:annotation>
1418 + </xs:enumeration>
1419 + <xs:enumeration value="bulkSetValue">
1420 + <xs:annotation>
1421 + <xs:documentation>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.</xs:documentation>
1422 + </xs:annotation>
1423 + </xs:enumeration>
1424 + </xs:restriction>
1425 + </xs:simpleType>
1426 + </xs:attribute>
1427 + <xs:attribute name="Permanent" type="YesNoType">
1428 + <xs:annotation>
1429 + <xs:documentation>Specifies whether or not the modification should be removed on uninstall. This has no effect on uninstall if the action was deleteValue.</xs:documentation>
1430 + </xs:annotation>
1431 + </xs:attribute>
1432 + <xs:attribute name="PreserveModifiedDate" type="YesNoType">
1433 + <xs:annotation>
1434 + <xs:documentation>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.</xs:documentation>
1435 + </xs:annotation>
1436 + </xs:attribute>
1437 + <xs:attribute name="Sequence" use="optional" type="xs:integer">
1438 + <xs:annotation>
1439 + <xs:documentation>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.</xs:documentation>
1440 + </xs:annotation>
1441 + </xs:attribute>
1442 + <xs:attribute name="SelectionLanguage">
1443 + <xs:annotation>
1444 + <xs:documentation>
1445 + Specify whether the DOM object should use XPath language or the old XSLPattern language (default) as the query language.
1446 + </xs:documentation>
1447 + </xs:annotation>
1448 + <xs:simpleType>
1449 + <xs:restriction base="xs:NMTOKEN">
1450 + <xs:enumeration value="XPath" />
1451 + <xs:enumeration value="XSLPattern" />
1452 + </xs:restriction>
1453 + </xs:simpleType>
1454 + </xs:attribute>
1455 + </xs:complexType>
1456 + </xs:element>
1457 + <xs:element name="XmlConfig">
1458 + <xs:annotation>
1459 + <xs:documentation>
1460 + Adds or removes .xml file entries. If you use the XmlConfig element you must reference WixUtilExtension.dll as it contains the XmlConfig custom actions.
1461 + </xs:documentation>
1462 + <xs:appinfo>
1463 + <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Component" />
1464 + </xs:appinfo>
1465 + </xs:annotation>
1466 + <xs:complexType mixed="true">
1467 + <xs:sequence>
1468 + <xs:element ref="XmlConfig" minOccurs="0" maxOccurs="unbounded" />
1469 + </xs:sequence>
1470 + <xs:attribute name="Id" use="required" type="xs:string">
1471 + <xs:annotation>
1472 + <xs:documentation>Identifier for xml file modification.</xs:documentation>
1473 + </xs:annotation>
1474 + </xs:attribute>
1475 + <xs:attribute name="Action">
1476 + <xs:simpleType>
1477 + <xs:restriction base="xs:NMTOKEN">
1478 + <xs:enumeration value="create" />
1479 + <xs:enumeration value="delete" />
1480 + </xs:restriction>
1481 + </xs:simpleType>
1482 + </xs:attribute>
1483 + <xs:attribute name="ElementId" type="xs:string">
1484 + <xs:annotation>
1485 + <xs:documentation>The Id of another XmlConfig to add attributes to. In this case, the 'ElementPath', 'Action', 'Node', and 'On' attributes must be omitted.</xs:documentation>
1486 + </xs:annotation>
1487 + </xs:attribute>
1488 + <xs:attribute name="ElementPath" type="xs:string">
1489 + <xs:annotation>
1490 + <xs:documentation>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.</xs:documentation>
1491 + </xs:annotation>
1492 + </xs:attribute>
1493 + <xs:attribute name="File" use="required" type="xs:string">
1494 + <xs:annotation>
1495 + <xs:documentation>Path of the .xml file to configure.</xs:documentation>
1496 + </xs:annotation>
1497 + </xs:attribute>
1498 + <xs:attribute name="Name" type="xs:string">
1499 + <xs:annotation>
1500 + <xs:documentation>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.</xs:documentation>
1501 + </xs:annotation>
1502 + </xs:attribute>
1503 + <xs:attribute name="Node">
1504 + <xs:simpleType>
1505 + <xs:restriction base="xs:NMTOKEN">
1506 + <xs:enumeration value="element" />
1507 + <xs:enumeration value="value" />
1508 + <xs:enumeration value="document" />
1509 + </xs:restriction>
1510 + </xs:simpleType>
1511 + </xs:attribute>
1512 + <xs:attribute name="On">
1513 + <xs:simpleType>
1514 + <xs:restriction base="xs:NMTOKEN">
1515 + <xs:enumeration value="install" />
1516 + <xs:enumeration value="uninstall" />
1517 + </xs:restriction>
1518 + </xs:simpleType>
1519 + </xs:attribute>
1520 + <xs:attribute name="PreserveModifiedDate" type="YesNoType">
1521 + <xs:annotation>
1522 + <xs:documentation>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.</xs:documentation>
1523 + </xs:annotation>
1524 + </xs:attribute>
1525 + <xs:attribute name="Sequence" use="optional" type="xs:integer">
1526 + <xs:annotation>
1527 + <xs:documentation>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.</xs:documentation>
1528 + </xs:annotation>
1529 + </xs:attribute>
1530 + <xs:attribute name="Value" type="xs:string">
1531 + <xs:annotation>
1532 + <xs:documentation>
1533 + The value to be written. See the <html:a href="http://msdn.microsoft.com/library/aa368609(VS.85).aspx" target="_blank">Formatted topic</html:a> for information how to escape square brackets in the value.
1534 + </xs:documentation>
1535 + </xs:annotation>
1536 + </xs:attribute>
1537 + <xs:attribute name="VerifyPath" type="xs:string">
1538 + <xs:annotation>
1539 + <xs:documentation>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.</xs:documentation>
1540 + </xs:annotation>
1541 + </xs:attribute>
1542 + </xs:complexType>
1543 + </xs:element>
1544 + <xs:attributeGroup name="SearchCommonAttributes">
1545 + <xs:attribute name="Id" type="xs:string">
1546 + <xs:annotation>
1547 + <xs:documentation>Id of the search for ordering and dependency.</xs:documentation>
1548 + </xs:annotation>
1549 + </xs:attribute>
1550 + <xs:attribute name="Variable" type="xs:string" use="required">
1551 + <xs:annotation>
1552 + <xs:documentation>Name of the variable in which to place the result of the search.</xs:documentation>
1553 + </xs:annotation>
1554 + </xs:attribute>
1555 + <xs:attribute name="Condition" type="xs:string">
1556 + <xs:annotation>
1557 + <xs:documentation>Condition for evaluating the search. If this evaluates to false, the search is not executed at all.</xs:documentation>
1558 + </xs:annotation>
1559 + </xs:attribute>
1560 + <xs:attribute name="After" type="xs:string">
1561 + <xs:annotation>
1562 + <xs:documentation>Id of the search that this one should come after.</xs:documentation>
1563 + </xs:annotation>
1564 + </xs:attribute>
1565 + </xs:attributeGroup>
1566 + <xs:simpleType name="YesNoType">
1567 + <xs:annotation>
1568 + <xs:documentation>Values of this type will either be "yes" or "no".</xs:documentation>
1569 + </xs:annotation>
1570 + <xs:restriction base="xs:NMTOKEN">
1571 + <xs:enumeration value="no" />
1572 + <xs:enumeration value="yes" />
1573 + </xs:restriction>
1574 + </xs:simpleType>
1575 + <xs:simpleType name="PerformanceCounterLanguageType">
1576 + <xs:annotation>
1577 + <xs:documentation>Enumeration of valid languages for performance counters.</xs:documentation>
1578 + </xs:annotation>
1579 + <xs:restriction base="xs:NMTOKEN">
1580 + <xs:enumeration value="afrikaans" />
1581 + <xs:enumeration value="albanian" />
1582 + <xs:enumeration value="arabic" />
1583 + <xs:enumeration value="armenian" />
1584 + <xs:enumeration value="assamese" />
1585 + <xs:enumeration value="azeri" />
1586 + <xs:enumeration value="basque" />
1587 + <xs:enumeration value="belarusian" />
1588 + <xs:enumeration value="bengali" />
1589 + <xs:enumeration value="bulgarian" />
1590 + <xs:enumeration value="catalan" />
1591 + <xs:enumeration value="chinese" />
1592 + <xs:enumeration value="croatian" />
1593 + <xs:enumeration value="czech" />
1594 + <xs:enumeration value="danish" />
1595 + <xs:enumeration value="divehi" />
1596 + <xs:enumeration value="dutch" />
1597 + <xs:enumeration value="english" />
1598 + <xs:enumeration value="estonian" />
1599 + <xs:enumeration value="faeroese" />
1600 + <xs:enumeration value="farsi" />
1601 + <xs:enumeration value="finnish" />
1602 + <xs:enumeration value="french" />
1603 + <xs:enumeration value="galician" />
1604 + <xs:enumeration value="georgian" />
1605 + <xs:enumeration value="german" />
1606 + <xs:enumeration value="greek" />
1607 + <xs:enumeration value="gujarati" />
1608 + <xs:enumeration value="hebrew" />
1609 + <xs:enumeration value="hindi" />
1610 + <xs:enumeration value="hungarian" />
1611 + <xs:enumeration value="icelandic" />
1612 + <xs:enumeration value="indonesian" />
1613 + <xs:enumeration value="italian" />
1614 + <xs:enumeration value="japanese" />
1615 + <xs:enumeration value="kannada" />
1616 + <xs:enumeration value="kashmiri" />
1617 + <xs:enumeration value="kazak" />
1618 + <xs:enumeration value="konkani" />
1619 + <xs:enumeration value="korean" />
1620 + <xs:enumeration value="kyrgyz" />
1621 + <xs:enumeration value="latvian" />
1622 + <xs:enumeration value="lithuanian" />
1623 + <xs:enumeration value="macedonian" />
1624 + <xs:enumeration value="malay" />
1625 + <xs:enumeration value="malayalam" />
1626 + <xs:enumeration value="manipuri" />
1627 + <xs:enumeration value="marathi" />
1628 + <xs:enumeration value="mongolian" />
1629 + <xs:enumeration value="nepali" />
1630 + <xs:enumeration value="norwegian" />
1631 + <xs:enumeration value="oriya" />
1632 + <xs:enumeration value="polish" />
1633 + <xs:enumeration value="portuguese" />
1634 + <xs:enumeration value="punjabi" />
1635 + <xs:enumeration value="romanian" />
1636 + <xs:enumeration value="russian" />
1637 + <xs:enumeration value="sanskrit" />
1638 + <xs:enumeration value="serbian" />
1639 + <xs:enumeration value="sindhi" />
1640 + <xs:enumeration value="slovak" />
1641 + <xs:enumeration value="slovenian" />
1642 + <xs:enumeration value="spanish" />
1643 + <xs:enumeration value="swahili" />
1644 + <xs:enumeration value="swedish" />
1645 + <xs:enumeration value="syriac" />
1646 + <xs:enumeration value="tamil" />
1647 + <xs:enumeration value="tatar" />
1648 + <xs:enumeration value="telugu" />
1649 + <xs:enumeration value="thai" />
1650 + <xs:enumeration value="turkish" />
1651 + <xs:enumeration value="ukrainian" />
1652 + <xs:enumeration value="urdu" />
1653 + <xs:enumeration value="uzbek" />
1654 + <xs:enumeration value="vietnamese" />
1655 + </xs:restriction>
1656 + </xs:simpleType>
1657 + <xs:simpleType name="PerformanceCounterTypesType">
1658 + <xs:annotation>
1659 + <xs:documentation>Enumeration of valid types for performance counters.</xs:documentation>
1660 + </xs:annotation>
1661 + <xs:restriction base="xs:NMTOKEN">
1662 + <xs:enumeration value="averageBase" />
1663 + <xs:enumeration value="averageCount64" />
1664 + <xs:enumeration value="averageTimer32" />
1665 + <xs:enumeration value="counterDelta32" />
1666 + <xs:enumeration value="counterTimerInverse" />
1667 + <xs:enumeration value="sampleFraction" />
1668 + <xs:enumeration value="timer100Ns" />
1669 + <xs:enumeration value="counterTimer" />
1670 + <xs:enumeration value="rawFraction" />
1671 + <xs:enumeration value="timer100NsInverse" />
1672 + <xs:enumeration value="counterMultiTimer" />
1673 + <xs:enumeration value="counterMultiTimer100Ns" />
1674 + <xs:enumeration value="counterMultiTimerInverse" />
1675 + <xs:enumeration value="counterMultiTimer100NsInverse" />
1676 + <xs:enumeration value="elapsedTime" />
1677 + <xs:enumeration value="sampleBase" />
1678 + <xs:enumeration value="rawBase" />
1679 + <xs:enumeration value="counterMultiBase" />
1680 + <xs:enumeration value="rateOfCountsPerSecond64" />
1681 + <xs:enumeration value="rateOfCountsPerSecond32" />
1682 + <xs:enumeration value="countPerTimeInterval64" />
1683 + <xs:enumeration value="countPerTimeInterval32" />
1684 + <xs:enumeration value="sampleCounter" />
1685 + <xs:enumeration value="counterDelta64" />
1686 + <xs:enumeration value="numberOfItems64" />
1687 + <xs:enumeration value="numberOfItems32" />
1688 + <xs:enumeration value="numberOfItemsHEX64" />
1689 + <xs:enumeration value="numberOfItemsHEX32" />
1690 + </xs:restriction>
1691 + </xs:simpleType>
1692 +</xs:schema>
src/wixlib/UtilExtension.wxs new
+430
@@ -0,0 +1,430 @@
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<!-- 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. -->
3 +
4 +
5 +<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
6 + <?include caerr.wxi ?>
7 +
8 + <Fragment>
9 + <UI Id="ConfigureUsersErrorText">
10 + <Error Id="$(var.msierrUSRFailedUserCreate)">!(loc.msierrUSRFailedUserCreate)</Error>
11 + <Error Id="$(var.msierrUSRFailedUserCreatePswd)">!(loc.msierrUSRFailedUserCreatePswd)</Error>
12 + <Error Id="$(var.msierrUSRFailedUserGroupAdd)">!(loc.msierrUSRFailedUserGroupAdd)</Error>
13 + <Error Id="$(var.msierrUSRFailedGrantLogonAsService)">Failed to grant 'logon as service' rights to user. ([2] [3] [4] [5])</Error>
14 + <Error Id="$(var.msierrUSRFailedUserCreateExists)">!(loc.msierrUSRFailedUserCreateExists)</Error>
15 + </UI>
16 + </Fragment>
17 +
18 + <Fragment>
19 + <UI Id="ConfigureSmbErrorsText">
20 + <Error Id="$(var.msierrSMBFailedCreate)">!(loc.msierrSMBFailedCreate)</Error>
21 + <Error Id="$(var.msierrSMBFailedDrop)">!(loc.msierrSMBFailedDrop)</Error>
22 + </UI>
23 + </Fragment>
24 +
25 + <Fragment>
26 + <UI Id="PerCounterDataErrorsText">
27 + <Error Id="$(var.msierrInstallPerfCounterData)">!(loc.msierrInstallPerfCounterData)</Error>
28 + <Error Id="$(var.msierrUninstallPerfCounterData)">!(loc.msierrUninstallPerfCounterData)</Error>
29 + </UI>
30 + </Fragment>
31 +
32 + <Fragment>
33 + <UI Id="ConfigurePerfmonErrorsText">
34 + <Error Id="$(var.msierrPERFMONFailedRegisterDLL)">!(loc.msierrPERFMONFailedRegisterDLL)</Error>
35 + <Error Id="$(var.msierrPERFMONFailedUnregisterDLL)">!(loc.msierrPERFMONFailedUnregisterDLL)</Error>
36 + </UI>
37 + </Fragment>
38 +
39 + <Fragment>
40 + <UI Id="SecureObjectsErrors">
41 + <Error Id="$(var.msierrSecureObjectsFailedCreateSD)">!(loc.msierrSecureObjectsFailedCreateSD)</Error>
42 + <Error Id="$(var.msierrSecureObjectsFailedSet)">!(loc.msierrSecureObjectsFailedSet)</Error>
43 + <Error Id="$(var.msierrSecureObjectsUnknownType)">!(loc.msierrSecureObjectsUnknownType)</Error>
44 + </UI>
45 + </Fragment>
46 +
47 + <Fragment>
48 + <UI Id="XmlFileErrorsText">
49 + <Error Id="$(var.msierrXmlFileFailedRead)">!(loc.msierrXmlFileFailedRead)</Error>
50 + <Error Id="$(var.msierrXmlFileFailedOpen)">!(loc.msierrXmlFileFailedOpen)</Error>
51 + <Error Id="$(var.msierrXmlFileFailedSelect)">!(loc.msierrXmlFileFailedSelect)</Error>
52 + <Error Id="$(var.msierrXmlFileFailedSave)">!(loc.msierrXmlFileFailedSave)</Error>
53 + </UI>
54 + </Fragment>
55 +
56 + <Fragment>
57 + <UI Id="XmlConfigErrorsText">
58 + <Error Id="$(var.msierrXmlConfigFailedRead)">!(loc.msierrXmlConfigFailedRead)</Error>
59 + <Error Id="$(var.msierrXmlConfigFailedOpen)">!(loc.msierrXmlConfigFailedOpen)</Error>
60 + <Error Id="$(var.msierrXmlConfigFailedSelect)">!(loc.msierrXmlConfigFailedSelect)</Error>
61 + <Error Id="$(var.msierrXmlConfigFailedSave)">!(loc.msierrXmlConfigFailedSave)</Error>
62 + </UI>
63 + </Fragment>
64 +
65 + <Fragment>
66 + <CustomAction Id="WixFailWhenDeferred" BinaryKey="WixCA" DllEntry="WixFailWhenDeferred" Execute="deferred" Return="check" SuppressModularization="yes" />
67 +
68 + <InstallExecuteSequence>
69 + <Custom Action="WixFailWhenDeferred" Before="InstallFinalize" Overridable="yes">WIXFAILWHENDEFERRED=1 AND VersionNT &gt; 400</Custom>
70 + </InstallExecuteSequence>
71 + </Fragment>
72 +
73 + <Fragment>
74 + <CustomAction Id="WixWaitForEvent" BinaryKey="WixCA" DllEntry="WixWaitForEvent" Execute="immediate" Return="check" SuppressModularization="yes" />
75 +
76 + <InstallExecuteSequence>
77 + <Custom Action="WixWaitForEvent" Before="InstallFinalize" Overridable="yes" />
78 + </InstallExecuteSequence>
79 + </Fragment>
80 +
81 + <Fragment>
82 + <CustomAction Id="WixWaitForEventDeferred" BinaryKey="WixCA" DllEntry="WixWaitForEvent" Execute="deferred" Return="check" SuppressModularization="yes" />
83 +
84 + <InstallExecuteSequence>
85 + <Custom Action="WixWaitForEventDeferred" After="InstallInitialize" Overridable="yes" />
86 + </InstallExecuteSequence>
87 + </Fragment>
88 +
89 + <Fragment>
90 + <CustomAction Id="WixExitEarlyWithSuccess" BinaryKey="WixCA" DllEntry="WixExitEarlyWithSuccess" Execute="immediate" Return="check" SuppressModularization="yes" />
91 +
92 + <InstallExecuteSequence>
93 + <Custom Action="WixExitEarlyWithSuccess" After="FindRelatedProducts" Overridable="yes">NEWERVERSIONDETECTED AND VersionNT &gt; 400</Custom>
94 + </InstallExecuteSequence>
95 + </Fragment>
96 +
97 + <Fragment>
98 + <CustomAction Id="WixRemoveFoldersEx" BinaryKey="WixCA" DllEntry="WixRemoveFoldersEx" Execute="immediate" Return="ignore" />
99 +
100 + <InstallExecuteSequence>
101 + <Custom Action="WixRemoveFoldersEx" Before="CostInitialize" />
102 + </InstallExecuteSequence>
103 + </Fragment>
104 +
105 + <Fragment>
106 + <CustomAction Id="WixBroadcastSettingChange" BinaryKey="WixCA" DllEntry="WixBroadcastSettingChange" Execute="immediate" Return="ignore" SuppressModularization="yes" />
107 +
108 + <InstallExecuteSequence>
109 + <Custom Action="WixBroadcastSettingChange" After="InstallFinalize" Overridable="yes" />
110 + </InstallExecuteSequence>
111 + </Fragment>
112 +
113 + <Fragment>
114 + <CustomAction Id="WixBroadcastEnvironmentChange" BinaryKey="WixCA" DllEntry="WixBroadcastEnvironmentChange" Execute="immediate" Return="ignore" SuppressModularization="yes" />
115 +
116 + <InstallExecuteSequence>
117 + <Custom Action="WixBroadcastEnvironmentChange" After="InstallFinalize" Overridable="yes" />
118 + </InstallExecuteSequence>
119 + </Fragment>
120 +
121 + <!-- WiX OS-detection properties and custom action -->
122 + <Fragment>
123 + <CustomAction Id="WixQueryOsInfo" BinaryKey="WixCA" DllEntry="WixQueryOsInfo" Execute="firstSequence" Return="check" SuppressModularization="yes" />
124 +
125 + <InstallExecuteSequence>
126 + <Custom Action="WixQueryOsInfo" After="AppSearch" Overridable="yes">VersionNT &gt; 400 OR (VersionNT = 400 AND ServicePackLevel &gt; 3)</Custom>
127 + </InstallExecuteSequence>
128 +
129 + <InstallUISequence>
130 + <Custom Action="WixQueryOsInfo" After="AppSearch" Overridable="yes">VersionNT &gt; 400 OR (VersionNT = 400 AND ServicePackLevel &gt; 3)</Custom>
131 + </InstallUISequence>
132 + </Fragment>
133 +
134 + <Fragment>
135 + <Property Id="WIX_SUITE_BACKOFFICE" Secure="yes" />
136 + <CustomActionRef Id="WixQueryOsInfo" />
137 + </Fragment>
138 + <Fragment>
139 + <Property Id="WIX_SUITE_BLADE" Secure="yes" />
140 + <CustomActionRef Id="WixQueryOsInfo" />
141 + </Fragment>
142 + <Fragment>
143 + <Property Id="WIX_SUITE_COMMUNICATIONS" Secure="yes" />
144 + <CustomActionRef Id="WixQueryOsInfo" />
145 + </Fragment>
146 + <Fragment>
147 + <Property Id="WIX_SUITE_COMPUTE_SERVER" Secure="yes" />
148 + <CustomActionRef Id="WixQueryOsInfo" />
149 + </Fragment>
150 + <Fragment>
151 + <Property Id="WIX_SUITE_DATACENTER" Secure="yes" />
152 + <CustomActionRef Id="WixQueryOsInfo" />
153 + </Fragment>
154 + <Fragment>
155 + <Property Id="WIX_SUITE_EMBEDDED_RESTRICTED" Secure="yes" />
156 + <CustomActionRef Id="WixQueryOsInfo" />
157 + </Fragment>
158 + <Fragment>
159 + <Property Id="WIX_SUITE_EMBEDDEDNT" Secure="yes" />
160 + <CustomActionRef Id="WixQueryOsInfo" />
161 + </Fragment>
162 + <Fragment>
163 + <Property Id="WIX_SUITE_ENTERPRISE" Secure="yes" />
164 + <CustomActionRef Id="WixQueryOsInfo" />
165 + </Fragment>
166 + <Fragment>
167 + <Property Id="WIX_SUITE_MEDIACENTER" Secure="yes" />
168 + <CustomActionRef Id="WixQueryOsInfo" />
169 + </Fragment>
170 + <Fragment>
171 + <Property Id="WIX_SUITE_PERSONAL" Secure="yes" />
172 + <CustomActionRef Id="WixQueryOsInfo" />
173 + </Fragment>
174 + <Fragment>
175 + <Property Id="WIX_SUITE_SECURITY_APPLIANCE" Secure="yes" />
176 + <CustomActionRef Id="WixQueryOsInfo" />
177 + </Fragment>
178 + <Fragment>
179 + <Property Id="WIX_SUITE_SERVERR2" Secure="yes" />
180 + <CustomActionRef Id="WixQueryOsInfo" />
181 + </Fragment>
182 + <Fragment>
183 + <Property Id="WIX_SUITE_SINGLEUSERTS" Secure="yes" />
184 + <CustomActionRef Id="WixQueryOsInfo" />
185 + </Fragment>
186 + <Fragment>
187 + <Property Id="WIX_SUITE_SMALLBUSINESS" Secure="yes" />
188 + <CustomActionRef Id="WixQueryOsInfo" />
189 + </Fragment>
190 + <Fragment>
191 + <Property Id="WIX_SUITE_SMALLBUSINESS_RESTRICTED" Secure="yes" />
192 + <CustomActionRef Id="WixQueryOsInfo" />
193 + </Fragment>
194 + <Fragment>
195 + <Property Id="WIX_SUITE_STARTER" Secure="yes" />
196 + <CustomActionRef Id="WixQueryOsInfo" />
197 + </Fragment>
198 + <Fragment>
199 + <Property Id="WIX_SUITE_STORAGE_SERVER" Secure="yes" />
200 + <CustomActionRef Id="WixQueryOsInfo" />
201 + </Fragment>
202 + <Fragment>
203 + <Property Id="WIX_SUITE_TABLETPC" Secure="yes" />
204 + <CustomActionRef Id="WixQueryOsInfo" />
205 + </Fragment>
206 + <Fragment>
207 + <Property Id="WIX_SUITE_TERMINAL" Secure="yes" />
208 + <CustomActionRef Id="WixQueryOsInfo" />
209 + </Fragment>
210 + <Fragment>
211 + <Property Id="WIX_SUITE_WH_SERVER" Secure="yes" />
212 + <CustomActionRef Id="WixQueryOsInfo" />
213 + </Fragment>
214 +
215 + <Fragment>
216 + <CustomAction Id="WixQueryOsDirs" BinaryKey="WixCA" DllEntry="WixQueryOsDirs" Execute="firstSequence" Return="check" SuppressModularization="yes" />
217 +
218 + <InstallExecuteSequence>
219 + <Custom Action="WixQueryOsDirs" After="AppSearch" Overridable="yes">VersionNT &gt; 400 OR (VersionNT = 400 AND ServicePackLevel &gt; 3)</Custom>
220 + </InstallExecuteSequence>
221 +
222 + <InstallUISequence>
223 + <Custom Action="WixQueryOsDirs" After="AppSearch" Overridable="yes">VersionNT &gt; 400 OR (VersionNT = 400 AND ServicePackLevel &gt; 3)</Custom>
224 + </InstallUISequence>
225 + </Fragment>
226 +
227 + <Fragment>
228 + <Property Id="WIX_DIR_ADMINTOOLS" Secure="yes" />
229 + <CustomActionRef Id="WixQueryOsDirs" />
230 + </Fragment>
231 + <Fragment>
232 + <Property Id="WIX_DIR_ALTSTARTUP" Secure="yes" />
233 + <CustomActionRef Id="WixQueryOsDirs" />
234 + </Fragment>
235 + <Fragment>
236 + <Property Id="WIX_DIR_CDBURN_AREA" Secure="yes" />
237 + <CustomActionRef Id="WixQueryOsDirs" />
238 + </Fragment>
239 + <Fragment>
240 + <Property Id="WIX_DIR_COMMON_ADMINTOOLS" Secure="yes" />
241 + <CustomActionRef Id="WixQueryOsDirs" />
242 + </Fragment>
243 + <Fragment>
244 + <Property Id="WIX_DIR_COMMON_ALTSTARTUP" Secure="yes" />
245 + <CustomActionRef Id="WixQueryOsDirs" />
246 + </Fragment>
247 + <Fragment>
248 + <Property Id="WIX_DIR_COMMON_DOCUMENTS" Secure="yes" />
249 + <CustomActionRef Id="WixQueryOsDirs" />
250 + </Fragment>
251 + <Fragment>
252 + <Property Id="WIX_DIR_COMMON_FAVORITES" Secure="yes" />
253 + <CustomActionRef Id="WixQueryOsDirs" />
254 + </Fragment>
255 + <Fragment>
256 + <Property Id="WIX_DIR_COMMON_MUSIC" Secure="yes" />
257 + <CustomActionRef Id="WixQueryOsDirs" />
258 + </Fragment>
259 + <Fragment>
260 + <Property Id="WIX_DIR_COMMON_PICTURES" Secure="yes" />
261 + <CustomActionRef Id="WixQueryOsDirs" />
262 + </Fragment>
263 + <Fragment>
264 + <Property Id="WIX_DIR_COMMON_VIDEO" Secure="yes" />
265 + <CustomActionRef Id="WixQueryOsDirs" />
266 + </Fragment>
267 + <Fragment>
268 + <Property Id="WIX_DIR_COOKIES" Secure="yes" />
269 + <CustomActionRef Id="WixQueryOsDirs" />
270 + </Fragment>
271 + <Fragment>
272 + <Property Id="WIX_DIR_DESKTOP" Secure="yes" />
273 + <CustomActionRef Id="WixQueryOsDirs" />
274 + </Fragment>
275 + <Fragment>
276 + <Property Id="WIX_DIR_HISTORY" Secure="yes" />
277 + <CustomActionRef Id="WixQueryOsDirs" />
278 + </Fragment>
279 + <Fragment>
280 + <Property Id="WIX_DIR_INTERNET_CACHE" Secure="yes" />
281 + <CustomActionRef Id="WixQueryOsDirs" />
282 + </Fragment>
283 + <Fragment>
284 + <Property Id="WIX_DIR_MYMUSIC" Secure="yes" />
285 + <CustomActionRef Id="WixQueryOsDirs" />
286 + </Fragment>
287 + <Fragment>
288 + <Property Id="WIX_DIR_MYPICTURES" Secure="yes" />
289 + <CustomActionRef Id="WixQueryOsDirs" />
290 + </Fragment>
291 + <Fragment>
292 + <Property Id="WIX_DIR_MYVIDEO" Secure="yes" />
293 + <CustomActionRef Id="WixQueryOsDirs" />
294 + </Fragment>
295 + <Fragment>
296 + <Property Id="WIX_DIR_NETHOOD" Secure="yes" />
297 + <CustomActionRef Id="WixQueryOsDirs" />
298 + </Fragment>
299 + <Fragment>
300 + <Property Id="WIX_DIR_PERSONAL" Secure="yes" />
301 + <CustomActionRef Id="WixQueryOsDirs" />
302 + </Fragment>
303 + <Fragment>
304 + <Property Id="WIX_DIR_PRINTHOOD" Secure="yes" />
305 + <CustomActionRef Id="WixQueryOsDirs" />
306 + </Fragment>
307 + <Fragment>
308 + <Property Id="WIX_DIR_PROFILE" Secure="yes" />
309 + <CustomActionRef Id="WixQueryOsDirs" />
310 + </Fragment>
311 + <Fragment>
312 + <Property Id="WIX_DIR_RECENT" Secure="yes" />
313 + <CustomActionRef Id="WixQueryOsDirs" />
314 + </Fragment>
315 + <Fragment>
316 + <Property Id="WIX_DIR_RESOURCES" Secure="yes" />
317 + <CustomActionRef Id="WixQueryOsDirs" />
318 + </Fragment>
319 +
320 + <Fragment>
321 + <CustomAction Id="WixQueryOsWellKnownSID" BinaryKey="WixCA" DllEntry="WixQueryOsWellKnownSID" Execute="firstSequence" Return="check" SuppressModularization="yes" />
322 +
323 + <InstallExecuteSequence>
324 + <Custom Action="WixQueryOsWellKnownSID" After="AppSearch" Overridable="yes">VersionNT &gt; 400 OR (VersionNT = 400 AND ServicePackLevel &gt; 3)</Custom>
325 + </InstallExecuteSequence>
326 +
327 + <InstallUISequence>
328 + <Custom Action="WixQueryOsWellKnownSID" After="AppSearch" Overridable="yes">VersionNT &gt; 400 OR (VersionNT = 400 AND ServicePackLevel &gt; 3)</Custom>
329 + </InstallUISequence>
330 + </Fragment>
331 +
332 + <Fragment>
333 + <Property Id="WIX_ACCOUNT_LOCALSYSTEM" Secure="yes" />
334 + <CustomActionRef Id="WixQueryOsWellKnownSID" />
335 + </Fragment>
336 + <Fragment>
337 + <Property Id="WIX_ACCOUNT_LOCALSERVICE" Secure="yes" />
338 + <CustomActionRef Id="WixQueryOsWellKnownSID" />
339 + </Fragment>
340 + <Fragment>
341 + <Property Id="WIX_ACCOUNT_NETWORKSERVICE" Secure="yes" />
342 + <CustomActionRef Id="WixQueryOsWellKnownSID" />
343 + </Fragment>
344 + <Fragment>
345 + <Property Id="WIX_ACCOUNT_ADMINISTRATORS" Secure="yes" />
346 + <CustomActionRef Id="WixQueryOsWellKnownSID" />
347 + </Fragment>
348 + <Fragment>
349 + <Property Id="WIX_ACCOUNT_USERS" Secure="yes" />
350 + <CustomActionRef Id="WixQueryOsWellKnownSID" />
351 + </Fragment>
352 + <Fragment>
353 + <Property Id="WIX_ACCOUNT_GUESTS" Secure="yes" />
354 + <CustomActionRef Id="WixQueryOsWellKnownSID" />
355 + </Fragment>
356 + <Fragment>
357 + <Property Id="WIX_ACCOUNT_PERFLOGUSERS" Secure="yes" />
358 + <Property Id="WIX_ACCOUNT_PERFLOGUSERS_NODOMAIN" Secure="yes" />
359 + <CustomActionRef Id="WixQueryOsWellKnownSID" />
360 + </Fragment>
361 +
362 + <Fragment>
363 + <CustomAction Id="WixQueryOsDriverInfo" BinaryKey="WixCA" DllEntry="WixQueryOsDriverInfo" Execute="firstSequence" Return="check" SuppressModularization="yes" />
364 +
365 + <InstallExecuteSequence>
366 + <Custom Action="WixQueryOsDriverInfo" After="AppSearch" Overridable="yes">VersionNT &gt; 400 OR (VersionNT = 400 AND ServicePackLevel &gt; 3)</Custom>
367 + </InstallExecuteSequence>
368 +
369 + <InstallUISequence>
370 + <Custom Action="WixQueryOsDriverInfo" After="AppSearch" Overridable="yes">VersionNT &gt; 400 OR (VersionNT = 400 AND ServicePackLevel &gt; 3)</Custom>
371 + </InstallUISequence>
372 + </Fragment>
373 +
374 + <Fragment>
375 + <Property Id="WIX_WDDM_DRIVER_PRESENT" Secure="yes" />
376 + <CustomActionRef Id="WixQueryOsDriverInfo" />
377 + </Fragment>
378 +
379 + <Fragment>
380 + <Property Id="WIX_DWM_COMPOSITION_ENABLED" Secure="yes" />
381 + <CustomActionRef Id="WixQueryOsDriverInfo" />
382 + </Fragment>
383 +
384 + <!-- ShellExec custom actions (for when only one is needed; multiple executions need their own IDs) -->
385 + <Fragment>
386 + <PropertyRef Id="WixShellExecBinaryId" />
387 + <CustomAction Id="WixShellExecBinary" BinaryKey="WixCA" DllEntry="WixShellExecBinary" Execute="immediate" Return="check" Impersonate="yes" />
388 + </Fragment>
389 +
390 + <Fragment>
391 + <PropertyRef Id="WixShellExecTarget" />
392 + <CustomAction Id="WixShellExec" BinaryKey="WixCA" DllEntry="WixShellExec" Execute="immediate" Return="check" Impersonate="yes" />
393 + </Fragment>
394 +
395 + <Fragment>
396 + <PropertyRef Id="WixUnelevatedShellExecTarget" />
397 + <CustomAction Id="WixUnelevatedShellExec" BinaryKey="WixCA" DllEntry="WixUnelevatedShellExec" Execute="immediate" Return="check" Impersonate="yes" />
398 + </Fragment>
399 +
400 + <Fragment>
401 + <PropertyRef Id="QtExecCmdLine" />
402 + <CustomAction Id="QtExec" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="immediate" Return="check" Impersonate="yes" />
403 + </Fragment>
404 +
405 + <Fragment>
406 + <PropertyRef Id="QtExec64CmdLine" />
407 + <CustomAction Id="QtExec64" BinaryKey="WixCA" DllEntry="CAQuietExec64" Execute="immediate" Return="check" Impersonate="yes" />
408 + </Fragment>
409 +
410 + <Fragment>
411 + <PropertyRef Id="WixQuietExecCmdLine" />
412 + <CustomAction Id="WixQuietExec" BinaryKey="WixCA" DllEntry="WixQuietExec" Execute="immediate" Return="check" Impersonate="yes" />
413 + </Fragment>
414 +
415 + <Fragment>
416 + <PropertyRef Id="WixQuietExec64CmdLine" />
417 + <CustomAction Id="WixQuietExec64" BinaryKey="WixCA" DllEntry="WixQuietExec64" Execute="immediate" Return="check" Impersonate="yes" />
418 + </Fragment>
419 +
420 + <!-- SilentExec custom actions differ from QtExec in that they do not log the commandline or output of the exe -->
421 + <Fragment>
422 + <PropertyRef Id="WixSilentExecCmdLine" />
423 + <CustomAction Id="WixSilentExec" BinaryKey="WixCA" DllEntry="WixSilentExec" Execute="immediate" Return="check" Impersonate="yes" />
424 + </Fragment>
425 +
426 + <Fragment>
427 + <PropertyRef Id="WixSilentExec64CmdLine" />
428 + <CustomAction Id="WixSilentExec64" BinaryKey="WixCA" DllEntry="WixSilentExec64" Execute="immediate" Return="check" Impersonate="yes" />
429 + </Fragment>
430 +</Wix>
src/wixlib/UtilExtension_Platform.wxi new
+224
@@ -0,0 +1,224 @@
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<!-- 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. -->
3 +
4 +
5 +<Include xmlns="http://wixtoolset.org/schemas/v4/wxs">
6 +
7 + <?include caSuffix.wxi ?>
8 +
9 + <!--
10 + The following actions do not support X64.
11 + -->
12 + <?if $(var.platform)!=x64 ?>
13 +
14 + <Fragment>
15 + <CustomAction Id="WixCheckRebootRequired$(var.Suffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="WixCheckRebootRequired" Execute="immediate" Return="ignore" SuppressModularization="yes" />
16 +
17 + <InstallExecuteSequence>
18 + <!-- Condition this so it runs on install and MMode, but not uninstall -->
19 + <Custom Action="WixCheckRebootRequired$(var.Suffix)" After="InstallFinalize" Overridable="yes">NOT REMOVE~="ALL" AND VersionNT &gt; 400</Custom>
20 + </InstallExecuteSequence>
21 + </Fragment>
22 +
23 + <Fragment>
24 + <CustomAction Id="WixCloseApplications$(var.Suffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="WixCloseApplications" Execute="immediate" Return="check" SuppressModularization="yes" />
25 + <CustomAction Id="WixCloseApplicationsDeferred$(var.DeferredSuffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="WixCloseApplicationsDeferred" Impersonate="no" Execute="deferred" Return="check" SuppressModularization="yes" />
26 + <CustomActionRef Id="WixCheckRebootRequired$(var.Suffix)" />
27 +
28 + <InstallExecuteSequence>
29 + <Custom Action="WixCloseApplications$(var.Suffix)" Before="InstallFiles" Overridable="yes">VersionNT &gt; 400</Custom>
30 + </InstallExecuteSequence>
31 + </Fragment>
32 +
33 + <Fragment>
34 + <CustomAction Id="WixRegisterRestartResources$(var.Suffix)" BinaryKey="WixCA" DllEntry="WixRegisterRestartResources$(var.Suffix)" Execute="immediate" Return="check" SuppressModularization="yes" />
35 +
36 + <InstallExecuteSequence>
37 + <Custom Action="WixRegisterRestartResources$(var.Suffix)" Before="InstallValidate" Overridable="yes" />
38 + </InstallExecuteSequence>
39 + </Fragment>
40 +
41 + <Fragment>
42 + <UIRef Id="ConfigureUsersErrorText" />
43 +
44 + <CustomAction Id="ConfigureUsers$(var.Suffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="ConfigureUsers" Execute="immediate" Return="check" SuppressModularization="yes" />
45 + <CustomAction Id="CreateUser$(var.DeferredSuffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="CreateUser" Impersonate="no" Execute="deferred" Return="check" HideTarget="yes" SuppressModularization="yes" />
46 + <CustomAction Id="CreateUserRollback$(var.DeferredSuffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="RemoveUser" Impersonate="no" Execute="rollback" Return="check" HideTarget="yes" SuppressModularization="yes" />
47 + <!-- RemoveUser is a type commit action because it is not possible to rollback the removal of a user -->
48 + <CustomAction Id="RemoveUser$(var.DeferredSuffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="RemoveUser" Impersonate="no" Execute="commit" Return="ignore" HideTarget="yes" SuppressModularization="yes" />
49 +
50 + <InstallExecuteSequence>
51 + <Custom Action="ConfigureUsers$(var.Suffix)" Before="InstallFiles" Overridable="yes">VersionNT &gt; 400</Custom>
52 + </InstallExecuteSequence>
53 + </Fragment>
54 +
55 + <Fragment>
56 + <UIRef Id="ConfigureSmbErrorsText" />
57 +
58 + <CustomAction Id="ConfigureSmbInstall$(var.Suffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="ConfigureSmbInstall" Execute="immediate" Return="check" SuppressModularization="yes" />
59 + <CustomAction Id="ConfigureSmbUninstall$(var.Suffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="ConfigureSmbUninstall" Execute="immediate" Return="check" SuppressModularization="yes" />
60 + <CustomAction Id="CreateSmb$(var.DeferredSuffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="CreateSmb" Impersonate="no" Execute="deferred" Return="check" HideTarget="yes" SuppressModularization="yes" />
61 + <CustomAction Id="CreateSmbRollback$(var.DeferredSuffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="DropSmb" Impersonate="no" Execute="rollback" Return="ignore" HideTarget="yes" SuppressModularization="yes" />
62 + <CustomAction Id="DropSmb$(var.DeferredSuffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="DropSmb" Impersonate="no" Execute="deferred" Return="check" HideTarget="yes" SuppressModularization="yes" />
63 + <CustomAction Id="DropSmbRollback$(var.DeferredSuffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="CreateSmb" Impersonate="no" Execute="rollback" Return="ignore" HideTarget="yes" SuppressModularization="yes" />
64 +
65 + <InstallExecuteSequence>
66 + <Custom Action="ConfigureSmbInstall$(var.Suffix)" After="InstallFiles" Overridable="yes">VersionNT &gt; 400</Custom>
67 + <Custom Action="ConfigureSmbUninstall$(var.Suffix)" After="RemoveFiles" Overridable="yes">VersionNT &gt; 400</Custom>
68 + </InstallExecuteSequence>
69 + </Fragment>
70 +
71 + <Fragment>
72 + <UIRef Id="PerCounterDataErrorsText" />
73 +
74 + <CustomAction Id="InstallPerfCounterData$(var.Suffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="InstallPerfCounterData" Execute="immediate" Return="check" SuppressModularization="yes" />
75 + <CustomAction Id="UninstallPerfCounterData$(var.Suffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="UninstallPerfCounterData" Execute="immediate" Return="check" SuppressModularization="yes" />
76 + <CustomAction Id="RegisterPerfCounterData$(var.DeferredSuffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="RegisterPerfCounterData" Impersonate="no" Execute="deferred" Return="check" HideTarget="yes" SuppressModularization="yes" />
77 + <CustomAction Id="UnregisterPerfCounterData$(var.DeferredSuffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="UnregisterPerfCounterData" Impersonate="no" Execute="deferred" Return="check" HideTarget="yes" SuppressModularization="yes" />
78 + <CustomAction Id="RollbackRegisterPerfCounterData$(var.DeferredSuffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="UnregisterPerfCounterData" Impersonate="no" Execute="rollback" Return="check" HideTarget="yes" SuppressModularization="yes" />
79 + <CustomAction Id="RollbackUnregisterPerfCounterData$(var.DeferredSuffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="RegisterPerfCounterData" Impersonate="no" Execute="rollback" Return="check" HideTarget="yes" SuppressModularization="yes" />
80 +
81 + <InstallExecuteSequence>
82 + <Custom Action="InstallPerfCounterData$(var.Suffix)" After="WriteRegistryValues" Overridable="yes">VersionNT &gt; 400</Custom>
83 + <Custom Action="UninstallPerfCounterData$(var.Suffix)" Before="RemoveRegistryValues" Overridable="yes">VersionNT &gt; 400</Custom>
84 + </InstallExecuteSequence>
85 + </Fragment>
86 +
87 + <Fragment>
88 + <UIRef Id="ConfigurePerfmonErrorsText" />
89 +
90 + <CustomAction Id="ConfigurePerfmonInstall$(var.Suffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="ConfigurePerfmonInstall" Execute="immediate" Return="check" SuppressModularization="yes" />
91 + <CustomAction Id="ConfigurePerfmonUninstall$(var.Suffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="ConfigurePerfmonUninstall" Execute="immediate" Return="check" SuppressModularization="yes" />
92 + <CustomAction Id="RegisterPerfmon$(var.DeferredSuffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="RegisterPerfmon" Impersonate="no" Execute="deferred" Return="check" SuppressModularization="yes" />
93 + <CustomAction Id="UnregisterPerfmon$(var.DeferredSuffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="UnregisterPerfmon" Impersonate="no" Execute="deferred" Return="check" SuppressModularization="yes" />
94 + <CustomAction Id="RollbackRegisterPerfmon$(var.DeferredSuffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="UnregisterPerfmon" Impersonate="no" Execute="rollback" Return="check" SuppressModularization="yes" />
95 + <CustomAction Id="RollbackUnregisterPerfmon$(var.DeferredSuffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="RegisterPerfmon" Impersonate="no" Execute="rollback" Return="check" SuppressModularization="yes" />
96 +
97 + <InstallExecuteSequence>
98 + <Custom Action="ConfigurePerfmonInstall$(var.Suffix)" After="WriteRegistryValues" Overridable="yes">VersionNT &gt; 400</Custom>
99 + <Custom Action="ConfigurePerfmonUninstall$(var.Suffix)" Before="RemoveRegistryValues" Overridable="yes">VersionNT &gt; 400</Custom>
100 + </InstallExecuteSequence>
101 + </Fragment>
102 +
103 + <Fragment>
104 + <CustomAction Id="ConfigurePerfmonManifestRegister$(var.Suffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="ConfigurePerfmonManifestRegister" Execute="immediate" Return="check" SuppressModularization="yes" />
105 + <CustomAction Id="ConfigurePerfmonManifestUnregister$(var.Suffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="ConfigurePerfmonManifestUnregister" Execute="immediate" Return="check" SuppressModularization="yes" />
106 + <CustomAction Id="RegisterPerfmonManifest$(var.DeferredSuffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="CAQuietExec" Impersonate="no" Execute="deferred" Return="check" SuppressModularization="yes" />
107 + <CustomAction Id="UnregisterPerfmonManifest$(var.DeferredSuffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="CAQuietExec" Impersonate="no" Execute="deferred" Return="ignore" SuppressModularization="yes" />
108 + <CustomAction Id="RollbackRegisterPerfmonManifest$(var.DeferredSuffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="CAQuietExec" Impersonate="no" Execute="rollback" Return="ignore" SuppressModularization="yes" />
109 + <CustomAction Id="RollbackUnregisterPerfmonManifest$(var.DeferredSuffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="CAQuietExec" Impersonate="no" Execute="rollback" Return="check" SuppressModularization="yes" />
110 +
111 + <InstallExecuteSequence>
112 + <Custom Action="ConfigurePerfmonManifestRegister$(var.Suffix)" After="InstallFiles" Overridable="yes">VersionNT &gt; 400</Custom>
113 + <Custom Action="ConfigurePerfmonManifestUnregister$(var.Suffix)" After="RemoveRegistryValues" Overridable="yes">VersionNT &gt; 400</Custom>
114 + </InstallExecuteSequence>
115 + </Fragment>
116 +
117 + <Fragment>
118 + <CustomAction Id="ConfigureEventManifestRegister$(var.Suffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="ConfigureEventManifestRegister" Execute="immediate" Return="check" SuppressModularization="yes" />
119 + <CustomAction Id="ConfigureEventManifestUnregister$(var.Suffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="ConfigureEventManifestUnregister" Execute="immediate" Return="check" SuppressModularization="yes" />
120 + <CustomAction Id="RegisterEventManifest$(var.DeferredSuffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="CAQuietExec" Impersonate="no" Execute="deferred" Return="check" SuppressModularization="yes" />
121 + <CustomAction Id="UnregisterEventManifest$(var.DeferredSuffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="CAQuietExec" Impersonate="no" Execute="deferred" Return="ignore" SuppressModularization="yes" />
122 + <CustomAction Id="RollbackRegisterEventManifest$(var.DeferredSuffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="CAQuietExec" Impersonate="no" Execute="rollback" Return="ignore" SuppressModularization="yes" />
123 + <CustomAction Id="RollbackUnregisterEventManifest$(var.DeferredSuffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="CAQuietExec" Impersonate="no" Execute="rollback" Return="check" SuppressModularization="yes" />
124 +
125 + <InstallExecuteSequence>
126 + <Custom Action="ConfigureEventManifestRegister$(var.Suffix)" After="SchedXmlFile" Overridable="yes">VersionNT &gt; 400</Custom>
127 + <Custom Action="ConfigureEventManifestUnregister$(var.Suffix)" After="RemoveRegistryValues" Overridable="yes">VersionNT &gt; 400</Custom>
128 + </InstallExecuteSequence>
129 + </Fragment>
130 +
131 + <Fragment>
132 + <CustomAction Id="SchedServiceConfig$(var.Suffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="SchedServiceConfig" Execute="immediate" Return="check" SuppressModularization="yes" />
133 + <CustomAction Id="ExecServiceConfig$(var.DeferredSuffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="ExecServiceConfig" Execute="deferred" Impersonate="no" Return="check" SuppressModularization="yes" />
134 + <CustomAction Id="RollbackServiceConfig$(var.DeferredSuffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="RollbackServiceConfig" Execute="rollback" Impersonate="no" Return="check" SuppressModularization="yes" />
135 +
136 + <InstallExecuteSequence>
137 + <!-- Condition this so it runs on install and MMode, but not uninstall -->
138 + <Custom Action="SchedServiceConfig$(var.Suffix)" After="InstallServices" Overridable="yes">NOT REMOVE~="ALL" AND VersionNT &gt; 400</Custom>
139 + </InstallExecuteSequence>
140 + </Fragment>
141 +
142 + <Fragment>
143 + <CustomAction Id="WixTouchFileDuringInstall" BinaryKey="UtilCA$(var.Suffix)" DllEntry="WixTouchFileDuringInstall" Execute="immediate" Return="check" SuppressModularization="yes" />
144 + <CustomAction Id="WixTouchFileDuringUninstall" BinaryKey="UtilCA$(var.Suffix)" DllEntry="WixTouchFileDuringUninstall" Execute="immediate" Return="check" SuppressModularization="yes" />
145 + <CustomAction Id="WixExecuteTouchFile" BinaryKey="UtilCA$(var.Suffix)" DllEntry="WixExecuteTouchFile" Execute="deferred" Impersonate="no" Return="check" SuppressModularization="yes" />
146 + <CustomAction Id="WixRollbackTouchFile" BinaryKey="UtilCA$(var.Suffix)" DllEntry="WixExecuteTouchFile" Execute="rollback" Impersonate="no" Return="check" SuppressModularization="yes" />
147 +
148 + <InstallExecuteSequence>
149 + <Custom Action="WixTouchFileDuringUninstall" Before="RemoveFiles" Overridable="yes" />
150 + <Custom Action="WixTouchFileDuringInstall" After="InstallFiles" Overridable="yes" />
151 + </InstallExecuteSequence>
152 + </Fragment>
153 +
154 + <Fragment>
155 + <UIRef Id="XmlFileErrorsText" />
156 +
157 + <CustomAction Id="SchedXmlFile$(var.Suffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="SchedXmlFile" Execute="immediate" Return="check" SuppressModularization="yes" />
158 + <CustomAction Id="ExecXmlFile$(var.DeferredSuffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="ExecXmlFile" Execute="deferred" Impersonate="no" Return="check" HideTarget="yes" SuppressModularization="yes" />
159 + <CustomAction Id="ExecXmlFileRollback$(var.DeferredSuffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="ExecXmlFileRollback" Execute="rollback" Impersonate="no" Return="check" HideTarget="yes" SuppressModularization="yes" />
160 +
161 + <InstallExecuteSequence>
162 + <Custom Action="SchedXmlFile$(var.Suffix)" After="DuplicateFiles" Overridable="yes">VersionNT &gt; 400</Custom>
163 + </InstallExecuteSequence>
164 + </Fragment>
165 +
166 + <Fragment>
167 + <UIRef Id="XmlConfigErrorsText" />
168 +
169 + <CustomAction Id="SchedXmlConfig$(var.Suffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="SchedXmlConfig" Execute="immediate" Return="check" SuppressModularization="yes" />
170 + <CustomAction Id="ExecXmlConfig$(var.DeferredSuffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="ExecXmlConfig" Execute="deferred" Impersonate="no" Return="check" HideTarget="yes" SuppressModularization="yes" />
171 + <CustomAction Id="ExecXmlConfigRollback$(var.DeferredSuffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="ExecXmlConfigRollback" Execute="rollback" Impersonate="no" Return="check" HideTarget="yes" SuppressModularization="yes" />
172 +
173 + <InstallExecuteSequence>
174 + <Custom Action="SchedXmlConfig$(var.Suffix)" After="DuplicateFiles" Overridable="yes">VersionNT &gt; 400</Custom>
175 + </InstallExecuteSequence>
176 + </Fragment>
177 +
178 + <Fragment>
179 + <CustomAction Id="WixSchedInternetShortcuts$(var.Suffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="WixSchedInternetShortcuts" Execute="immediate" Return="check" SuppressModularization="yes" />
180 + <CustomAction Id="WixRollbackInternetShortcuts$(var.DeferredSuffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="WixRollbackInternetShortcuts" Impersonate="no" Execute="rollback" Return="check" SuppressModularization="yes" />
181 + <CustomAction Id="WixCreateInternetShortcuts$(var.DeferredSuffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="WixCreateInternetShortcuts" Impersonate="no" Execute="deferred" Return="check" SuppressModularization="yes" />
182 +
183 + <InstallExecuteSequence>
184 + <Custom Action="WixSchedInternetShortcuts$(var.Suffix)" Before="RemoveFolders" Overridable="yes">VersionNT &gt; 400</Custom>
185 + <Custom Action="WixRollbackInternetShortcuts$(var.DeferredSuffix)" Before="WixCreateInternetShortcuts$(var.DeferredSuffix)" Overridable="yes">VersionNT &gt; 400</Custom>
186 + <Custom Action="WixCreateInternetShortcuts$(var.DeferredSuffix)" After="CreateShortcuts" Overridable="yes">VersionNT &gt; 400</Custom>
187 + </InstallExecuteSequence>
188 + </Fragment>
189 +
190 + <?endif ?>
191 +
192 +
193 + <!--
194 + The following actions do support all platforms.
195 + -->
196 + <Fragment>
197 + <UIRef Id="SecureObjectsErrors" />
198 +
199 + <CustomAction Id="SchedSecureObjects$(var.Suffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="SchedSecureObjects" Execute="immediate" Return="check" SuppressModularization="yes" />
200 + <CustomAction Id="SchedSecureObjectsRollback$(var.Suffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="SchedSecureObjectsRollback" Execute="immediate" Return="check" SuppressModularization="yes" />
201 + <CustomAction Id="ExecSecureObjects$(var.DeferredSuffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="ExecSecureObjects" Execute="deferred" Impersonate="no" Return="check" HideTarget="yes" SuppressModularization="yes" />
202 + <CustomAction Id="ExecSecureObjectsRollback$(var.DeferredSuffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="ExecSecureObjectsRollback" Execute="rollback" Impersonate="no" Return="check" HideTarget="yes" SuppressModularization="yes" />
203 +
204 + <InstallExecuteSequence>
205 + <!-- Condition this so it runs on install and MMode, but not uninstall -->
206 + <Custom Action="SchedSecureObjects$(var.Suffix)" After="InstallServices" Overridable="yes">NOT REMOVE~="ALL" AND VersionNT &gt; 400</Custom>
207 + <Custom Action="SchedSecureObjectsRollback$(var.Suffix)" After="UnpublishFeatures" Overridable="yes">VersionNT &gt; 400</Custom>
208 + </InstallExecuteSequence>
209 + </Fragment>
210 +
211 + <Fragment>
212 + <CustomAction Id="WixSchedFormatFiles$(var.Suffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="WixSchedFormatFiles" Execute="immediate" Return="check" SuppressModularization="yes" />
213 + <CustomAction Id="WixExecFormatFiles$(var.DeferredSuffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="WixExecFormatFiles" Execute="deferred" Impersonate="no" Return="check" SuppressModularization="yes" />
214 + <CustomAction Id="WixRollbackFormatFiles$(var.DeferredSuffix)" BinaryKey="UtilCA$(var.Suffix)" DllEntry="WixExecFormatFiles" Execute="rollback" Impersonate="no" Return="check" SuppressModularization="yes" />
215 +
216 + <InstallExecuteSequence>
217 + <Custom Action="WixSchedFormatFiles$(var.Suffix)" After="InstallFiles" />
218 + </InstallExecuteSequence>
219 + </Fragment>
220 +
221 + <Fragment>
222 + <Binary Id="UtilCA$(var.Suffix)" SourceFile="!(bindpath.$(var.platform))utilca.dll" />
223 + </Fragment>
224 +</Include>
src/wixlib/UtilExtension_x64.wxs new
+8
@@ -0,0 +1,8 @@
1 +<?xml version="1.0"?>
2 +<!-- 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. -->
3 +
4 +
5 +<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
6 + <?define platform=x64 ?>
7 + <?include UtilExtension_Platform.wxi ?>
8 +</Wix>
src/wixlib/UtilExtension_x86.wxs new
+8
@@ -0,0 +1,8 @@
1 +<?xml version="1.0"?>
2 +<!-- 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. -->
3 +
4 +
5 +<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
6 + <?define platform=x86 ?>
7 + <?include UtilExtension_Platform.wxi ?>
8 +</Wix>
src/wixlib/caSuffix.wxi new
+28
@@ -0,0 +1,28 @@
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<!-- 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. -->
3 +
4 +<Include xmlns="http://wixtoolset.org/schemas/v4/wxs">
5 + <?ifndef platform ?>
6 + <?error Required value "platform" not defined in include caSuffix.wxi ?>
7 + <?endif ?>
8 +
9 + <?ifdef Suffix ?>
10 + <?undef Suffix ?>
11 + <?undef DeferredSuffix ?>
12 + <?endif ?>
13 +
14 + <?if $(var.platform)="x86" ?>
15 + <?define Suffix="" ?>
16 + <?define DeferredSuffix="" ?>
17 + <?endif ?>
18 +
19 + <?if $(var.platform)="x64" ?>
20 + <?define Suffix="_x64" ?>
21 + <?define DeferredSuffix="_64" ?>
22 + <?endif ?>
23 +
24 + <?if $(var.platform)="arm" ?>
25 + <?define Suffix="_ARM" ?>
26 + <?define DeferredSuffix="_ARM" ?>
27 + <?endif ?>
28 +</Include>
src/wixlib/caerr.wxi new
+96
@@ -0,0 +1,96 @@
1 +<Include>
2 + <?define msierrSecureObjectsFailedCreateSD = 25520?>
3 + <?define msierrSecureObjectsFailedSet = 25521?>
4 + <?define msierrSecureObjectsUnknownType = 25522?>
5 + <?define msierrXmlFileFailedRead = 25530?>
6 + <?define msierrXmlFileFailedOpen = 25531?>
7 + <?define msierrXmlFileFailedSelect = 25532?>
8 + <?define msierrXmlFileFailedSave = 25533?>
9 + <?define msierrXmlConfigFailedRead = 25540?>
10 + <?define msierrXmlConfigFailedOpen = 25541?>
11 + <?define msierrXmlConfigFailedSelect = 25542?>
12 + <?define msierrXmlConfigFailedSave = 25543?>
13 + <?define msierrFirewallCannotConnect = 25580?>
14 + <?define msierrIISCannotConnect = 26001?>
15 + <?define msierrIISFailedReadWebSite = 26002?>
16 + <?define msierrIISFailedReadWebDirs = 26003?>
17 + <?define msierrIISFailedReadVDirs = 26004?>
18 + <?define msierrIISFailedReadFilters = 26005?>
19 + <?define msierrIISFailedReadAppPool = 26006?>
20 + <?define msierrIISFailedReadMimeMap = 26007?>
21 + <?define msierrIISFailedReadProp = 26008?>
22 + <?define msierrIISFailedReadWebSvcExt = 26009?>
23 + <?define msierrIISFailedReadWebError = 26010?>
24 + <?define msierrIISFailedReadHttpHeader = 26011?>
25 + <?define msierrIISFailedSchedTransaction = 26031?>
26 + <?define msierrIISFailedSchedInstallWebs = 26032?>
27 + <?define msierrIISFailedSchedInstallWebDirs = 26033?>
28 + <?define msierrIISFailedSchedInstallVDirs = 26034?>
29 + <?define msierrIISFailedSchedInstallFilters = 26035?>
30 + <?define msierrIISFailedSchedInstallAppPool = 26036?>
31 + <?define msierrIISFailedSchedInstallProp = 26037?>
32 + <?define msierrIISFailedSchedInstallWebSvcExt = 26038?>
33 + <?define msierrIISFailedSchedUninstallWebs = 26051?>
34 + <?define msierrIISFailedSchedUninstallWebDirs = 26052?>
35 + <?define msierrIISFailedSchedUninstallVDirs = 26053?>
36 + <?define msierrIISFailedSchedUninstallFilters = 26054?>
37 + <?define msierrIISFailedSchedUninstallAppPool = 26055?>
38 + <?define msierrIISFailedSchedUninstallProp = 26056?>
39 + <?define msierrIISFailedSchedUninstallWebSvcExt = 26057?>
40 + <?define msierrIISFailedStartTransaction = 26101?>
41 + <?define msierrIISFailedOpenKey = 26102?>
42 + <?define msierrIISFailedCreateKey = 26103?>
43 + <?define msierrIISFailedWriteData = 26104?>
44 + <?define msierrIISFailedCreateApp = 26105?>
45 + <?define msierrIISFailedDeleteKey = 26106?>
46 + <?define msierrIISFailedDeleteApp = 26107?>
47 + <?define msierrIISFailedDeleteValue = 26108?>
48 + <?define msierrIISFailedCommitInUse = 26109?>
49 + <?define msierrSQLFailedCreateDatabase = 26201?>
50 + <?define msierrSQLFailedDropDatabase = 26202?>
51 + <?define msierrSQLFailedConnectDatabase = 26203?>
52 + <?define msierrSQLFailedExecString = 26204?>
53 + <?define msierrSQLDatabaseAlreadyExists = 26205?>
54 + <?define msierrPERFMONFailedRegisterDLL = 26251?>
55 + <?define msierrPERFMONFailedUnregisterDLL = 26252?>
56 + <?define msierrInstallPerfCounterData = 26253?>
57 + <?define msierrUninstallPerfCounterData = 26254?>
58 + <?define msierrSMBFailedCreate = 26301?>
59 + <?define msierrSMBFailedDrop = 26302?>
60 + <?define msierrCERTFailedOpen = 26351?>
61 + <?define msierrCERTFailedAdd = 26352?>
62 + <?define msierrUSRFailedUserCreate = 26401?>
63 + <?define msierrUSRFailedUserCreatePswd = 26402?>
64 + <?define msierrUSRFailedUserGroupAdd = 26403?>
65 + <?define msierrUSRFailedUserCreateExists = 26404?>
66 + <?define msierrUSRFailedGrantLogonAsService = 26405?>
67 + <?define msierrDependencyMissingDependencies = 26451?>
68 + <?define msierrDependencyHasDependents = 26452?>
69 + <?define msierrDotNetRuntimeRequired = 27000?>
70 + <?define msierrComPlusCannotConnect = 28001?>
71 + <?define msierrComPlusPartitionReadFailed = 28002?>
72 + <?define msierrComPlusPartitionRoleReadFailed = 28003?>
73 + <?define msierrComPlusUserInPartitionRoleReadFailed = 28004?>
74 + <?define msierrComPlusPartitionUserReadFailed = 28005?>
75 + <?define msierrComPlusApplicationReadFailed = 28006?>
76 + <?define msierrComPlusApplicationRoleReadFailed = 28007?>
77 + <?define msierrComPlusUserInApplicationRoleReadFailed = 28008?>
78 + <?define msierrComPlusAssembliesReadFailed = 28009?>
79 + <?define msierrComPlusSubscriptionReadFailed = 28010?>
80 + <?define msierrComPlusPartitionDependency = 28011?>
81 + <?define msierrComPlusPartitionNotFound = 28012?>
82 + <?define msierrComPlusPartitionIdConflict = 28013?>
83 + <?define msierrComPlusPartitionNameConflict = 28014?>
84 + <?define msierrComPlusApplicationDependency = 28015?>
85 + <?define msierrComPlusApplicationNotFound = 28016?>
86 + <?define msierrComPlusApplicationIdConflict = 28017?>
87 + <?define msierrComPlusApplicationNameConflict = 28018?>
88 + <?define msierrComPlusApplicationRoleDependency = 28019?>
89 + <?define msierrComPlusApplicationRoleNotFound = 28020?>
90 + <?define msierrComPlusApplicationRoleConflict = 28021?>
91 + <?define msierrComPlusAssemblyDependency = 28022?>
92 + <?define msierrComPlusSubscriptionIdConflict = 28023?>
93 + <?define msierrComPlusSubscriptionNameConflict = 28024?>
94 + <?define msierrComPlusFailedLookupNames = 28025?>
95 + <?define msierrMsmqCannotConnect = 28101?>
96 +</Include>
\ No newline at end of file
src/wixlib/de-de.wxl new
+33
@@ -0,0 +1,33 @@
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<!-- 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. -->
3 +
4 +
5 +<WixLocalization Culture="de-de" xmlns="http://wixtoolset.org/schemas/v4/wxl">
6 + <String Id="msierrUSRFailedUserCreate" Overridable="yes">Konnte den Benutzer nicht anlegen. ([2] [3] [4] [5])</String>
7 + <String Id="msierrUSRFailedUserCreatePswd" Overridable="yes">Konnte den Benutzer auf Grund eines falschen Passwortes nicht anlegen. ([2] [3] [4] [5])</String>
8 + <String Id="msierrUSRFailedUserGroupAdd" Overridable="yes">Konnte Benutzer nicht zur Gruppe hinzufügen. ([2] [3] [4] [5])</String>
9 + <String Id="msierrUSRFailedUserCreateExists" Overridable="yes">Konnte den Benutzer nicht anlegen, da er bereits existierte. ([2] [3] [4] [5])</String>
10 +
11 + <String Id="msierrSMBFailedCreate" Overridable="yes">Konnte Netzwerkfreigabe nicht anlegen. ([2] [3] [4] [5])</String>
12 + <String Id="msierrSMBFailedDrop" Overridable="yes">Konnte Netzwerkfreigabe nicht entfernen. ([2] [3] [4] [5])</String>
13 +
14 + <String Id="msierrPERFMONFailedRegisterDLL" Overridable="yes">Konnte die DLL nicht für PerfMon registrieren. ([2] [3] [4] [5])</String>
15 + <String Id="msierrPERFMONFailedUnregisterDLL" Overridable="yes">Konnte die DLL nicht für PerfMon deregistrieren. ([2] [3] [4] [5])</String>
16 +
17 + <String Id="msierrInstallPerfCounterData" Overridable="yes">Konnte die Daten der Leistungsüberwachung (performance counters) nicht installieren. ([2] [3] [4] [5])</String>
18 + <String Id="msierrUninstallPerfCounterData" Overridable="yes">Konnte die Daten der Leistungsüberwachung (performance counters) nicht deinstallieren. ([2] [3] [4] [5])</String>
19 +
20 + <String Id="msierrSecureObjectsFailedCreateSD" Overridable="yes">Konnte keinen Security Descriptor für [3]\[4] erstellen, System Fehler: [2]</String>
21 + <String Id="msierrSecureObjectsFailedSet" Overridable="yes">Konnte keinen Security Descriptor für das Objekt [3] erstellen, System Fehler: [2]</String>
22 + <String Id="msierrSecureObjectsUnknownType" Overridable="yes">Unbekannter Objekt Typ [3], System Fehler: [2]</String>
23 +
24 + <String Id="msierrXmlFileFailedRead" Overridable="yes">Beim Lesen der XML Dateien trat ein Fehler auf.</String>
25 + <String Id="msierrXmlFileFailedOpen" Overridable="yes">Konnte XML Datei [3] nicht öffnen, System Fehler: [2]</String>
26 + <String Id="msierrXmlFileFailedSelect" Overridable="yes">Konnte Knoten [3] in der XML Datei [4] nicht finden, System Fehler: [2]</String>
27 + <String Id="msierrXmlFileFailedSave" Overridable="yes">Beim Speichern der Änderungen an der XML Datei [3] trat ein Fehler auf, System Fehler: [2]</String>
28 +
29 + <String Id="msierrXmlConfigFailedRead" Overridable="yes">Bei der Konfiguration der XML Dateien trat ein Fehler auf.</String>
30 + <String Id="msierrXmlConfigFailedOpen" Overridable="yes">Konnte XML Datei [3] nicht öffnen, System Fehler: [2]</String>
31 + <String Id="msierrXmlConfigFailedSelect" Overridable="yes">Konnte Knoten [3] in der XML Datei [4] nicht finden, System Fehler: [2]</String>
32 + <String Id="msierrXmlConfigFailedSave" Overridable="yes">Beim Speichern der Änderungen an der XML Datei [3] trat ein Fehler auf, System Fehler: [2]</String>
33 +</WixLocalization>
src/wixlib/en-us.wxl new
+33
@@ -0,0 +1,33 @@
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<!-- 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. -->
3 +
4 +
5 +<WixLocalization Culture="en-us" xmlns="http://wixtoolset.org/schemas/v4/wxl">
6 + <String Id="msierrUSRFailedUserCreate" Overridable="yes">Failed to create user. ([2] [3] [4] [5])</String>
7 + <String Id="msierrUSRFailedUserCreatePswd" Overridable="yes">Failed to create user due to invalid password. ([2] [3] [4] [5])</String>
8 + <String Id="msierrUSRFailedUserGroupAdd" Overridable="yes">Failed to add user to group. ([2] [3] [4] [5])</String>
9 + <String Id="msierrUSRFailedUserCreateExists" Overridable="yes">Failed to create user because it already exists. ([2] [3] [4] [5])</String>
10 +
11 + <String Id="msierrSMBFailedCreate" Overridable="yes">Failed to create network share. ([2] [3] [4] [5])</String>
12 + <String Id="msierrSMBFailedDrop" Overridable="yes">Failed to drop network share. ([2] [3] [4] [5])</String>
13 +
14 + <String Id="msierrPERFMONFailedRegisterDLL" Overridable="yes">Failed to register DLL with PerfMon. ([2] [3] [4] [5])</String>
15 + <String Id="msierrPERFMONFailedUnregisterDLL" Overridable="yes">Failed to unregister DLL with PerfMon. ([2] [3] [4] [5])</String>
16 +
17 + <String Id="msierrInstallPerfCounterData" Overridable="yes">Failed to install performance counters. ([2] [3] [4] [5])</String>
18 + <String Id="msierrUninstallPerfCounterData" Overridable="yes">Failed to uninstall performance counters. ([2] [3] [4] [5])</String>
19 +
20 + <String Id="msierrSecureObjectsFailedCreateSD" Overridable="yes">Failed to create security descriptor for [3]\[4], system error: [2]</String>
21 + <String Id="msierrSecureObjectsFailedSet" Overridable="yes">Failed to set security descriptor on object [3], system error: [2]</String>
22 + <String Id="msierrSecureObjectsUnknownType" Overridable="yes">Unknown Object Type [3], system error: [2]</String>
23 +
24 + <String Id="msierrXmlFileFailedRead" Overridable="yes">There was a failure while configuring XML files.</String>
25 + <String Id="msierrXmlFileFailedOpen" Overridable="yes">Failed to open XML file [3], system error: [2]</String>
26 + <String Id="msierrXmlFileFailedSelect" Overridable="yes">Failed to find node: [3] in XML file: [4], system error: [2]</String>
27 + <String Id="msierrXmlFileFailedSave" Overridable="yes">Failed to save changes to XML file [3], system error: [2]</String>
28 +
29 + <String Id="msierrXmlConfigFailedRead" Overridable="yes">There was a failure while configuring XML files.</String>
30 + <String Id="msierrXmlConfigFailedOpen" Overridable="yes">Failed to open XML file [3], system error: [2]</String>
31 + <String Id="msierrXmlConfigFailedSelect" Overridable="yes">Failed to find node: [3] in XML file: [4], system error: [2]</String>
32 + <String Id="msierrXmlConfigFailedSave" Overridable="yes">Failed to save changes to XML file [3], system error: [2]</String>
33 +</WixLocalization>
src/wixlib/es-es.wxl new
+32
@@ -0,0 +1,32 @@
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<!-- 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. -->
3 +
4 +<WixLocalization Culture="es-es" xmlns="http://wixtoolset.org/schemas/v4/wxl">
5 + <String Id="msierrUSRFailedUserCreate" Overridable="yes">La creación del usuario ha fracasado. ([2] [3] [4] [5])</String>
6 + <String Id="msierrUSRFailedUserCreatePswd" Overridable="yes">La creación del usuario ha fracasado porque la contraseña es incorrecta. ([2] [3] [4] [5])</String>
7 + <String Id="msierrUSRFailedUserGroupAdd" Overridable="yes">El aditamento del usuario al grupo ha fracasado. ([2] [3] [4] [5])</String>
8 + <String Id="msierrUSRFailedUserCreateExists" Overridable="yes">La creación del usuario ha fracasado porque ya existe. ([2] [3] [4] [5])</String>
9 +
10 + <String Id="msierrSMBFailedCreate" Overridable="yes">La creación de la red compartida ha fracasado. ([2] [3] [4] [5])</String>
11 + <String Id="msierrSMBFailedDrop" Overridable="yes">La eliminación de la red compartida ha fracasado. ([2] [3] [4] [5])</String>
12 +
13 + <String Id="msierrPERFMONFailedRegisterDLL" Overridable="yes">La inscripción al registro de la DLL con PerfMon ha fracasado. ([2] [3] [4] [5])</String>
14 + <String Id="msierrPERFMONFailedUnregisterDLL" Overridable="yes">La cancelación de la inscripción al registro de la DLL con PerfMon ha fracasado. ([2] [3] [4] [5])</String>
15 +
16 + <String Id="msierrInstallPerfCounterData" Overridable="yes">La instalación de los contadores de rendimiento ha fracasado. ([2] [3] [4] [5])</String>
17 + <String Id="msierrUninstallPerfCounterData" Overridable="yes">La desinstalación de los contadores de rendimiento ha fracasado. ([2] [3] [4] [5])</String>
18 +
19 + <String Id="msierrSecureObjectsFailedCreateSD" Overridable="yes">La creación de los ACLs ha fracasado por [3]\[4], error del sistema : [2]</String>
20 + <String Id="msierrSecureObjectsFailedSet" Overridable="yes">El posicionamiento de los ACLs por el objecto [3] ha fracasado, error del sistema: [2]</String>
21 + <String Id="msierrSecureObjectsUnknownType" Overridable="yes">Tipo de objecto no conocido [3], error del sistema: [2]</String>
22 +
23 + <String Id="msierrXmlFileFailedRead" Overridable="yes">Un problema ha aparecido durante la configuración de los ficheros XML.</String>
24 + <String Id="msierrXmlFileFailedOpen" Overridable="yes">Fracaso de la apertura de los ficheros XML [3], error del sistema: [2]</String>
25 + <String Id="msierrXmlFileFailedSelect" Overridable="yes">Fracaso de la búsqueda del nodo: [3] en el fichero XML: [4], error del sistema: [2]</String>
26 + <String Id="msierrXmlFileFailedSave" Overridable="yes">Fracaso durante la salvaguardia de las modificaciones en el fichero XML [3], error del sistema: [2]</String>
27 +
28 + <String Id="msierrXmlConfigFailedRead" Overridable="yes">Un problema ha aparecido durante la configuración de los ficheros XML.</String>
29 + <String Id="msierrXmlConfigFailedOpen" Overridable="yes">Fracaso de la apertura de los ficheros XML [3], error del sistema: [2]</String>
30 + <String Id="msierrXmlConfigFailedSelect" Overridable="yes">Fracaso de la búsqueda del nodo: [3] en el fichero XML: [4], error del sistema: [2]</String>
31 + <String Id="msierrXmlConfigFailedSave" Overridable="yes">Fracaso durante la salvaguardia de las modificaciones en el fichero XML [3], error del sistema: [2]</String>
32 +</WixLocalization>
\ No newline at end of file
src/wixlib/fr-fr.wxl new
+32
@@ -0,0 +1,32 @@
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<!-- 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. -->
3 +
4 +<WixLocalization Culture="fr-fr" xmlns="http://wixtoolset.org/schemas/v4/wxl">
5 + <String Id="msierrUSRFailedUserCreate" Overridable="yes">La création de l'utilisateur a échoué. ([2] [3] [4] [5])</String>
6 + <String Id="msierrUSRFailedUserCreatePswd" Overridable="yes">La création de l'utilisateur a échoué car le mot de passe est invalide. ([2] [3] [4] [5])</String>
7 + <String Id="msierrUSRFailedUserGroupAdd" Overridable="yes">L'ajout de l'utilisateur au groupe a échoué. ([2] [3] [4] [5])</String>
8 + <String Id="msierrUSRFailedUserCreateExists" Overridable="yes">La création de l'utilisateur a échoué car il existe dejà. ([2] [3] [4] [5])</String>
9 +
10 + <String Id="msierrSMBFailedCreate" Overridable="yes">La création du partage reseau a échoué. ([2] [3] [4] [5])</String>
11 + <String Id="msierrSMBFailedDrop" Overridable="yes">La suppression du partage reseau a échoué. ([2] [3] [4] [5])</String>
12 +
13 + <String Id="msierrPERFMONFailedRegisterDLL" Overridable="yes">L'inscription au registre de la DLL avec PerfMon a échoué. ([2] [3] [4] [5])</String>
14 + <String Id="msierrPERFMONFailedUnregisterDLL" Overridable="yes">La desinscription au registre de la DLL avec PerfMon a échoué. ([2] [3] [4] [5])</String>
15 +
16 + <String Id="msierrInstallPerfCounterData" Overridable="yes">L'installation des compteurs de performance a échoué. ([2] [3] [4] [5])</String>
17 + <String Id="msierrUninstallPerfCounterData" Overridable="yes">La desinstallation des compteurs de performance a échoué. ([2] [3] [4] [5])</String>
18 +
19 + <String Id="msierrSecureObjectsFailedCreateSD" Overridable="yes">La création des ACLs a échoué pour [3]\[4], erreur systeme: [2]</String>
20 + <String Id="msierrSecureObjectsFailedSet" Overridable="yes">Le positionnement des ACLs pour l'objet [3] a échoué, erreur systeme: [2]</String>
21 + <String Id="msierrSecureObjectsUnknownType" Overridable="yes">Type d'objet inconnu [3], erreur systeme: [2]</String>
22 +
23 + <String Id="msierrXmlFileFailedRead" Overridable="yes">Un problème est survenu lors de la configuration des fichiers XML.</String>
24 + <String Id="msierrXmlFileFailedOpen" Overridable="yes">Echec de l'ouverture des fichiers XML [3], erreur systeme: [2]</String>
25 + <String Id="msierrXmlFileFailedSelect" Overridable="yes">Echec de la recherche du noeud: [3] dans le fichier XML: [4], erreur systeme: [2]</String>
26 + <String Id="msierrXmlFileFailedSave" Overridable="yes">Echec lors de la sauvegarde des modifications dans le fichier XML [3], erreur systeme: [2]</String>
27 +
28 + <String Id="msierrXmlConfigFailedRead" Overridable="yes">Un problème est survenu lors de la configuration des fichiers XML.</String>
29 + <String Id="msierrXmlConfigFailedOpen" Overridable="yes">Echec de l'ouverture des fichiers XML [3], erreur systeme: [2]</String>
30 + <String Id="msierrXmlConfigFailedSelect" Overridable="yes">Echec de la recherche du noeud: [3] dans le fichier XML: [4], erreur systeme: [2]</String>
31 + <String Id="msierrXmlConfigFailedSave" Overridable="yes">Echec lors de la sauvegarde des modifications dans le fichier XML [3], erreur systeme: [2]</String>
32 +</WixLocalization>
\ No newline at end of file
src/wixlib/it-it.wxl new
+33
@@ -0,0 +1,33 @@
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<!-- 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. -->
3 +
4 +
5 +<WixLocalization Culture="it-it" xmlns="http://wixtoolset.org/schemas/v4/wxl">
6 + <String Id="msierrUSRFailedUserCreate" Overridable="yes">Impossibile creare l'utente. ([2] [3] [4] [5])</String>
7 + <String Id="msierrUSRFailedUserCreatePswd" Overridable="yes">Impossibile creare l'utente perchè la password è errata. ([2] [3] [4] [5])</String>
8 + <String Id="msierrUSRFailedUserGroupAdd" Overridable="yes">Impossibile aggiungere l'utente al gruppo. ([2] [3] [4] [5])</String>
9 + <String Id="msierrUSRFailedUserCreateExists" Overridable="yes">Impossibile creare l'utente perchè già esistente. ([2] [3] [4] [5])</String>
10 +
11 + <String Id="msierrSMBFailedCreate" Overridable="yes">Impossibile creare la risorsa di rete. ([2] [3] [4] [5])</String>
12 + <String Id="msierrSMBFailedDrop" Overridable="yes">Impossibile eliminare la risorsa di rete. ([2] [3] [4] [5])</String>
13 +
14 + <String Id="msierrPERFMONFailedRegisterDLL" Overridable="yes">Impossibile registrare la DLL con PerfMon. ([2] [3] [4] [5])</String>
15 + <String Id="msierrPERFMONFailedUnregisterDLL" Overridable="yes">Impossibile rimuovere la registrazione della DLL con PerfMon. ([2] [3] [4] [5])</String>
16 +
17 + <String Id="msierrInstallPerfCounterData" Overridable="yes">Impossibile installare i contatori delle prestazioni. ([2] [3] [4] [5])</String>
18 + <String Id="msierrUninstallPerfCounterData" Overridable="yes">Impossibile rimuovere i contatori delle prestazioni. ([2] [3] [4] [5])</String>
19 +
20 + <String Id="msierrSecureObjectsFailedCreateSD" Overridable="yes">Impossibile creare i descrittori di sicurezza per [3]\[4], errore di sistema: [2]</String>
21 + <String Id="msierrSecureObjectsFailedSet" Overridable="yes">Impossibile impostare i descrittori di sicurezza sull'oggetto [3], errore di sistema: [2]</String>
22 + <String Id="msierrSecureObjectsUnknownType" Overridable="yes">Tipo di oggetto sconosciuto [3], errore di sistema: [2]</String>
23 +
24 + <String Id="msierrXmlFileFailedRead" Overridable="yes">Si è verificato un errore durante la configurazione dei file XML.</String>
25 + <String Id="msierrXmlFileFailedOpen" Overridable="yes">Impossibile aprire il file XML [3], errore di sistema: [2]</String>
26 + <String Id="msierrXmlFileFailedSelect" Overridable="yes">Impossibile trovare il nodo: [3] nel file XML: [4], errore di sistema: [2]</String>
27 + <String Id="msierrXmlFileFailedSave" Overridable="yes">Impossible salvare le modifiche al file XML [3], errore di sistema: [2]</String>
28 +
29 + <String Id="msierrXmlConfigFailedRead" Overridable="yes">Si è verificato un errore durante la configurazione dei file XML.</String>
30 + <String Id="msierrXmlConfigFailedOpen" Overridable="yes">Impossibile aprire il file XML [3], errore di sistema: [2]</String>
31 + <String Id="msierrXmlConfigFailedSelect" Overridable="yes">Impossibile trovare il nodo: [3] nel file XML: [4], errore di sistema: [2]</String>
32 + <String Id="msierrXmlConfigFailedSave" Overridable="yes">Impossibile salvare le modifiche al file XML [3], errore di sitema: [2]</String>
33 +</WixLocalization>
src/wixlib/ja-jp.wxl new
+33
@@ -0,0 +1,33 @@
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<!-- 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. -->
3 +
4 +
5 +<WixLocalization Culture="ja-jp" xmlns="http://wixtoolset.org/schemas/v4/wxl">
6 + <String Id="msierrUSRFailedUserCreate" Overridable="yes">ユーザー作成に失敗しました。 ([2] [3] [4] [5])</String>
7 + <String Id="msierrUSRFailedUserCreatePswd" Overridable="yes">パスワードが無効のためユーザー作成に失敗しました。 ([2] [3] [4] [5])</String>
8 + <String Id="msierrUSRFailedUserGroupAdd" Overridable="yes">ユーザーをグループに追加でいませんでした。 ([2] [3] [4] [5])</String>
9 + <String Id="msierrUSRFailedUserCreateExists" Overridable="yes">ユーザーが既に存在するため作成できませんでした。 ([2] [3] [4] [5])</String>
10 +
11 + <String Id="msierrSMBFailedCreate" Overridable="yes">ネットワーク共有の作成に失敗しました。 ([2] [3] [4] [5])</String>
12 + <String Id="msierrSMBFailedDrop" Overridable="yes">ネットワーク共有の削除に失敗しました。 ([2] [3] [4] [5])</String>
13 +
14 + <String Id="msierrPERFMONFailedRegisterDLL" Overridable="yes">DLL を PerfMon に登録でいませんでした。 ([2] [3] [4] [5])</String>
15 + <String Id="msierrPERFMONFailedUnregisterDLL" Overridable="yes">DLL を PerfMon より登録解除できませんでした。 ([2] [3] [4] [5])</String>
16 +
17 + <String Id="msierrInstallPerfCounterData" Overridable="yes">パフォーマンス カウンタをインストールできませんでした。 ([2] [3] [4] [5])</String>
18 + <String Id="msierrUninstallPerfCounterData" Overridable="yes">パフォーマンス カウンタをアンインストールできませんでした。 ([2] [3] [4] [5])</String>
19 +
20 + <String Id="msierrSecureObjectsFailedCreateSD" Overridable="yes">[3]\[4] 用セキュリティ ディスクリプターを作成できませんでした、システム エラー: [2]</String>
21 + <String Id="msierrSecureObjectsFailedSet" Overridable="yes">オブジェクト [3] 上のセキュリティ ディスクリプターを設定できませんでした、システム エラー: [2]</String>
22 + <String Id="msierrSecureObjectsUnknownType" Overridable="yes">不明なオブジェクト種別 [3]、システム エラー: [2]</String>
23 +
24 + <String Id="msierrXmlFileFailedRead" Overridable="yes">XML ファイル構成中に失敗しました。</String>
25 + <String Id="msierrXmlFileFailedOpen" Overridable="yes">XML ファイル [3] を開けませんでした、システム エラー: [2]</String>
26 + <String Id="msierrXmlFileFailedSelect" Overridable="yes">XML ファイル [4] 内にノード [3] が見つかりませんでした、システム エラー: [2]</String>
27 + <String Id="msierrXmlFileFailedSave" Overridable="yes">XML ファイル [3] へ変更を保存できませんでした、システム エラー: [2]</String>
28 +
29 + <String Id="msierrXmlConfigFailedRead" Overridable="yes">XML ファイル構成中に失敗しました。</String>
30 + <String Id="msierrXmlConfigFailedOpen" Overridable="yes">XML ファイル [3] を開けませんでした、システム エラー: [2]</String>
31 + <String Id="msierrXmlConfigFailedSelect" Overridable="yes">XML ファイル [4] 内にノード [3] が見つかりませんでした、システム エラー: [2]</String>
32 + <String Id="msierrXmlConfigFailedSave" Overridable="yes">XML ファイル [3] へ変更を保存できませんでした、システム エラー: [2]</String>
33 +</WixLocalization>
src/wixlib/packages.config new
+5
@@ -0,0 +1,5 @@
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<packages>
3 + <package id="Nerdbank.GitVersioning" version="2.1.7" developmentDependency="true" targetFramework="net40" />
4 + <package id="WixToolset.Core.InternalPackage" version="4.0.60" targetFramework="net40" developmentDependency="true" />
5 +</packages>
\ No newline at end of file
src/wixlib/pt-br.wxl new
+27
@@ -0,0 +1,27 @@
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<!-- 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. -->
3 +
4 +
5 +<WixLocalization Culture="pt-br" xmlns="http://wixtoolset.org/schemas/v4/wxl">
6 + <String Id="msierrUSRFailedUserCreate" Overridable="yes">Falha ao criar usuário. ([2] [3] [4] [5])</String>
7 + <String Id="msierrUSRFailedUserCreatePswd" Overridable="yes">Falha ao criar usuário devido a senha inválida. ([2] [3] [4] [5])</String>
8 + <String Id="msierrUSRFailedUserGroupAdd" Overridable="yes">Falha ao adicionar o usuário ao grupo. ([2] [3] [4] [5])</String>
9 + <String Id="msierrUSRFailedUserCreateExists" Overridable="yes">Falha ao criar o usuário, porque ele já existe. ([2] [3] [4] [5])</String>
10 + <String Id="msierrSMBFailedCreate" Overridable="yes">Falha ao criar o compartilhamento de rede. ([2] [3] [4] [5])</String>
11 + <String Id="msierrSMBFailedDrop" Overridable="yes">Falha ao cair compartilhamento de rede. ([2] [3] [4] [5])</String>
12 + <String Id="msierrPERFMONFailedRegisterDLL" Overridable="yes">Falha ao registrar DLL com PerfMon. ([2] [3] [4] [5])</String>
13 + <String Id="msierrPERFMONFailedUnregisterDLL" Overridable="yes">Falha ao cancelar o registro de DLL com PerfMon. ([2] [3] [4] [5])</String>
14 + <String Id="msierrInstallPerfCounterData" Overridable="yes">Falha ao instalar contadores de desempenho. ([2] [3] [4] [5])</String>
15 + <String Id="msierrUninstallPerfCounterData" Overridable="yes">Falha ao desinstalar contadores de desempenho. ([2] [3] [4] [5])</String>
16 + <String Id="msierrSecureObjectsFailedCreateSD" Overridable="yes">Falha ao criar o descritor de segurança [3] \ [4], erro do sistema: [2]</String>
17 + <String Id="msierrSecureObjectsFailedSet" Overridable="yes">Falha ao definir o descritor de segurança sobre o objeto [3], erro do sistema: [2]</String>
18 + <String Id="msierrSecureObjectsUnknownType" Overridable="yes">Objeto Desconhecido Tipo [3], erro do sistema: [2]</String>
19 + <String Id="msierrXmlFileFailedRead" Overridable="yes">Houve uma falha ao configurar arquivos XML.</String>
20 + <String Id="msierrXmlFileFailedOpen" Overridable="yes">Falha ao abrir o arquivo XML [3], erro do sistema: [2]</String>
21 + <String Id="msierrXmlFileFailedSelect" Overridable="yes">Falha ao localizar nó: [3] no arquivo XML: [4], erro do sistema: [2]</String>
22 + <String Id="msierrXmlFileFailedSave" Overridable="yes">Falha ao salvar as alterações para o arquivo XML [3], erro do sistema: [2]</String>
23 + <String Id="msierrXmlConfigFailedRead" Overridable="yes">Houve uma falha ao configurar arquivos XML.</String>
24 + <String Id="msierrXmlConfigFailedOpen" Overridable="yes">Falha ao abrir o arquivo XML [3], erro do sistema: [2]</String>
25 + <String Id="msierrXmlConfigFailedSelect" Overridable="yes">Falha ao localizar nó: [3] no arquivo XML: [4], erro do sistema: [2]</String>
26 + <String Id="msierrXmlConfigFailedSave" Overridable="yes">Falha ao salvar as alterações para o arquivo XML [3], erro do sistema: [2]</String>
27 +</WixLocalization>
src/wixlib/util.wixproj new
+52
@@ -0,0 +1,52 @@
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<!-- 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. -->
3 +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="15.0">
4 + <Import Project="..\..\packages\WixToolset.Core.InternalPackage.4.0.60\build\WixToolset.Core.InternalPackage.props" Condition="Exists('..\..\packages\WixToolset.Core.InternalPackage.4.0.60\build\WixToolset.Core.InternalPackage.props')" />
5 + <Import Project="..\FindLocalWix.props" />
6 + <PropertyGroup>
7 + <ProjectGuid>{1ACFFEFD-505A-41A5-ACBF-A02B7B473AA2}</ProjectGuid>
8 + <OutputName>util</OutputName>
9 + <OutputType>Library</OutputType>
10 + <BindFiles>true</BindFiles>
11 + <Pedantic>true</Pedantic>
12 + </PropertyGroup>
13 + <ItemGroup>
14 + <Compile Include="UtilExtension.wxs" />
15 + <Compile Include="UtilExtension_x86.wxs" />
16 + <Compile Include="UtilExtension_x64.wxs" />
17 + <EmbeddedResource Include="en-us.wxl" />
18 + <EmbeddedResource Include="de-de.wxl" />
19 + <EmbeddedResource Include="es-es.wxl" />
20 + <EmbeddedResource Include="fr-fr.wxl" />
21 + <EmbeddedResource Include="ja-jp.wxl" />
22 + <EmbeddedResource Include="pt-br.wxl" />
23 + <EmbeddedResource Include="it-it.wxl" />
24 + </ItemGroup>
25 + <ItemGroup>
26 + <None Include="packages.config" />
27 + </ItemGroup>
28 + <ItemGroup>
29 + <ProjectReference Include="..\ca\utilca.vcxproj">
30 + <Name>utilca</Name>
31 + <Project>{076018F7-19BD-423A-ABBF-229273DA08D8}</Project>
32 + </ProjectReference>
33 + </ItemGroup>
34 + <ItemGroup>
35 + <None Include="caerr.wxi" />
36 + <None Include="caSuffix.wxi" />
37 + <None Include="UtilExtension_Platform.wxi" />
38 + </ItemGroup>
39 + <Import Project="$(WixTargetsPath)" Condition=" '$(WixTargetsPath)' != '' AND Exists('$(WixTargetsPath)') " />
40 + <Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\wix.targets" Condition=" '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\wix.targets') " />
41 + <Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixTargetsImported)' != 'true' ">
42 + <Error Text="FG-WiX or WiX Toolset build tools (v3.11 or later) must be installed to build this project. To download FG-WiX, go to https://www.firegiant.com/downloads/. To download the WiX Toolset, go to http://wixtoolset.org/releases/." />
43 + </Target>
44 + <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
45 + <PropertyGroup>
46 + <ErrorText>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}.</ErrorText>
47 + </PropertyGroup>
48 + <Error Condition="!Exists('..\..\packages\Nerdbank.GitVersioning.2.1.7\build\Nerdbank.GitVersioning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Nerdbank.GitVersioning.2.1.7\build\Nerdbank.GitVersioning.targets'))" />
49 + <Error Condition="!Exists('..\..\packages\WixToolset.Core.InternalPackage.4.0.60\build\WixToolset.Core.InternalPackage.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.Core.InternalPackage.4.0.60\build\WixToolset.Core.InternalPackage.props'))" />
50 + </Target>
51 + <Import Project="..\..\packages\Nerdbank.GitVersioning.2.1.7\build\Nerdbank.GitVersioning.targets" Condition="Exists('..\..\packages\Nerdbank.GitVersioning.2.1.7\build\Nerdbank.GitVersioning.targets')" />
52 +</Project>
\ No newline at end of file
version.json new
+11
@@ -0,0 +1,11 @@
1 +{
2 + "version": "4.0",
3 + "publicReleaseRefSpec": [
4 + "^refs/heads/master$"
5 + ],
6 + "cloudBuild": {
7 + "buildNumber": {
8 + "enabled": true
9 + }
10 + }
11 +}