aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.editorconfig37
-rw-r--r--Dependency.wixext.sln61
-rw-r--r--appveyor.cmd13
-rw-r--r--appveyor.yml42
-rw-r--r--nuget.config16
-rw-r--r--src/Cpp.Build.props104
-rw-r--r--src/Directory.Build.props28
-rw-r--r--src/Directory.Build.targets48
-rw-r--r--src/FindLocalWix.props8
-rw-r--r--src/ca/custommsierrors.h5
-rw-r--r--src/ca/dependencyca.vcxproj61
-rw-r--r--src/ca/dependencyca.vcxproj.filters (renamed from src/ca/wixdepca.vcxproj.filters)5
-rw-r--r--src/ca/packages.config5
-rw-r--r--src/ca/wixdepca.def2
-rw-r--r--src/ca/wixdepca.vcxproj57
-rw-r--r--src/test/WixToolsetTest.Dependency/DependencyExtensionFixture.cs32
-rw-r--r--src/test/WixToolsetTest.Dependency/TestData/UsingProvides/Package.en-us.wxl11
-rw-r--r--src/test/WixToolsetTest.Dependency/TestData/UsingProvides/Package.wxs22
-rw-r--r--src/test/WixToolsetTest.Dependency/TestData/UsingProvides/PackageComponents.wxs12
-rw-r--r--src/test/WixToolsetTest.Dependency/TestData/UsingProvides/example.txt1
-rw-r--r--src/test/WixToolsetTest.Dependency/WixToolsetTest.Dependency.csproj38
-rw-r--r--src/wixext/DependencyCommon.cs2
-rw-r--r--src/wixext/DependencyCompiler.cs263
-rw-r--r--src/wixext/DependencyDecompiler.cs4
-rw-r--r--src/wixext/DependencyErrors.cs37
-rw-r--r--src/wixext/DependencyExtension.csproj50
-rw-r--r--src/wixext/DependencyExtensionData.cs52
-rw-r--r--src/wixext/DependencyExtensionFactory.cs18
-rw-r--r--src/wixext/DependencyWarnings.cs60
-rw-r--r--src/wixext/DependencyWindowsInstallerBackendBinderExtension.cs (renamed from src/wixext/DependencyBinder.cs)32
-rw-r--r--src/wixext/Tuples/DependencyTupleDefinitions.cs47
-rw-r--r--src/wixext/Tuples/WixDependencyProviderTuple.cs87
-rw-r--r--src/wixext/Tuples/WixDependencyRefTuple.cs55
-rw-r--r--src/wixext/Tuples/WixDependencyTuple.cs79
-rw-r--r--src/wixext/WixToolset.Dependency.wixext.csproj33
-rw-r--r--src/wixext/WixToolset.Dependency.wixext.targets11
-rw-r--r--src/wixext/messages.xml60
-rw-r--r--src/wixlib/DependencyExtension.wixproj27
-rw-r--r--src/wixlib/DependencyExtension_Platform.wxi6
-rw-r--r--src/wixlib/caSuffix.wxi28
-rw-r--r--src/wixlib/caerr.wxi96
-rw-r--r--src/wixlib/dependency.wixproj43
-rw-r--r--src/wixlib/packages.config5
-rw-r--r--version.json11
44 files changed, 1323 insertions, 391 deletions
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 00000000..1d72e683
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,37 @@
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# Do NOT modify this file. Update the canonical version in Home\repo-template\src\.editorconfig
4# then update all of the repos.
5
6root = true
7
8[*]
9charset = utf-8
10indent_style = space
11indent_size = 4
12trim_trailing_whitespace = true
13
14[*.{cs,vb}]
15dotnet_sort_system_directives_first = true
16
17[*.cs]
18csharp_indent_case_contents = true : error
19csharp_indent_switch_labels = true : error
20csharp_new_line_before_open_brace = all
21csharp_prefer_braces = true : error
22csharp_style_expression_bodied_methods = when_on_single_line : suggestion
23csharp_style_expression_bodied_constructors = when_on_single_line : suggestion
24csharp_style_expression_bodied_operators = when_on_single_line : suggestion
25csharp_style_expression_bodied_properties = when_on_single_line : suggestion
26csharp_style_expression_bodied_indexers = when_on_single_line : suggestion
27csharp_style_expression_bodied_accessors = when_on_single_line : suggestion
28csharp_style_var_elsewhere = true : suggestion
29csharp_style_var_for_built_in_types = true : suggestion
30csharp_style_var_when_type_is_apparent = true : suggestion
31dotnet_style_qualification_for_event = true : error
32dotnet_style_qualification_for_field = true : error
33dotnet_style_qualification_for_method = true : error
34dotnet_style_qualification_for_property = true : error
35
36[*.targets]
37indent_size = 2
diff --git a/Dependency.wixext.sln b/Dependency.wixext.sln
new file mode 100644
index 00000000..c69a467b
--- /dev/null
+++ b/Dependency.wixext.sln
@@ -0,0 +1,61 @@
1
2Microsoft Visual Studio Solution File, Format Version 12.00
3# Visual Studio 15
4VisualStudioVersion = 15.0.28010.2016
5MinimumVisualStudioVersion = 10.0.40219.1
6Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dependencyca", "src\ca\dependencyca.vcxproj", "{B86AF46C-0F90-49CC-923F-A800B088D015}"
7EndProject
8Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "dependency", "src\wixlib\dependency.wixproj", "{58ED0EC8-73F8-4EE1-8664-A53486D38EC8}"
9EndProject
10Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolset.Dependency.wixext", "src\wixext\WixToolset.Dependency.wixext.csproj", "{A0B6D3F1-AE5E-423B-BA92-60C9926CA498}"
11EndProject
12Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolsetTest.Dependency", "src\test\WixToolsetTest.Dependency\WixToolsetTest.Dependency.csproj", "{E2AB6AA2-359D-4305-92B0-D90C8F87AF9B}"
13EndProject
14Global
15 GlobalSection(SolutionConfigurationPlatforms) = preSolution
16 Debug|Any CPU = Debug|Any CPU
17 Debug|x86 = Debug|x86
18 Release|Any CPU = Release|Any CPU
19 Release|x86 = Release|x86
20 EndGlobalSection
21 GlobalSection(ProjectConfigurationPlatforms) = postSolution
22 {B86AF46C-0F90-49CC-923F-A800B088D015}.Debug|Any CPU.ActiveCfg = Debug|Win32
23 {B86AF46C-0F90-49CC-923F-A800B088D015}.Debug|Any CPU.Build.0 = Debug|Win32
24 {B86AF46C-0F90-49CC-923F-A800B088D015}.Debug|x86.ActiveCfg = Debug|Win32
25 {B86AF46C-0F90-49CC-923F-A800B088D015}.Debug|x86.Build.0 = Debug|Win32
26 {B86AF46C-0F90-49CC-923F-A800B088D015}.Release|Any CPU.ActiveCfg = Release|Win32
27 {B86AF46C-0F90-49CC-923F-A800B088D015}.Release|Any CPU.Build.0 = Release|Win32
28 {B86AF46C-0F90-49CC-923F-A800B088D015}.Release|x86.ActiveCfg = Release|Win32
29 {B86AF46C-0F90-49CC-923F-A800B088D015}.Release|x86.Build.0 = Release|Win32
30 {58ED0EC8-73F8-4EE1-8664-A53486D38EC8}.Debug|Any CPU.ActiveCfg = Debug|x86
31 {58ED0EC8-73F8-4EE1-8664-A53486D38EC8}.Debug|Any CPU.Build.0 = Debug|x86
32 {58ED0EC8-73F8-4EE1-8664-A53486D38EC8}.Debug|x86.ActiveCfg = Debug|x86
33 {58ED0EC8-73F8-4EE1-8664-A53486D38EC8}.Debug|x86.Build.0 = Debug|x86
34 {58ED0EC8-73F8-4EE1-8664-A53486D38EC8}.Release|Any CPU.ActiveCfg = Release|x86
35 {58ED0EC8-73F8-4EE1-8664-A53486D38EC8}.Release|Any CPU.Build.0 = Release|x86
36 {58ED0EC8-73F8-4EE1-8664-A53486D38EC8}.Release|x86.ActiveCfg = Release|x86
37 {58ED0EC8-73F8-4EE1-8664-A53486D38EC8}.Release|x86.Build.0 = Release|x86
38 {A0B6D3F1-AE5E-423B-BA92-60C9926CA498}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
39 {A0B6D3F1-AE5E-423B-BA92-60C9926CA498}.Debug|Any CPU.Build.0 = Debug|Any CPU
40 {A0B6D3F1-AE5E-423B-BA92-60C9926CA498}.Debug|x86.ActiveCfg = Debug|Any CPU
41 {A0B6D3F1-AE5E-423B-BA92-60C9926CA498}.Debug|x86.Build.0 = Debug|Any CPU
42 {A0B6D3F1-AE5E-423B-BA92-60C9926CA498}.Release|Any CPU.ActiveCfg = Release|Any CPU
43 {A0B6D3F1-AE5E-423B-BA92-60C9926CA498}.Release|Any CPU.Build.0 = Release|Any CPU
44 {A0B6D3F1-AE5E-423B-BA92-60C9926CA498}.Release|x86.ActiveCfg = Release|Any CPU
45 {A0B6D3F1-AE5E-423B-BA92-60C9926CA498}.Release|x86.Build.0 = Release|Any CPU
46 {E2AB6AA2-359D-4305-92B0-D90C8F87AF9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
47 {E2AB6AA2-359D-4305-92B0-D90C8F87AF9B}.Debug|Any CPU.Build.0 = Debug|Any CPU
48 {E2AB6AA2-359D-4305-92B0-D90C8F87AF9B}.Debug|x86.ActiveCfg = Debug|Any CPU
49 {E2AB6AA2-359D-4305-92B0-D90C8F87AF9B}.Debug|x86.Build.0 = Debug|Any CPU
50 {E2AB6AA2-359D-4305-92B0-D90C8F87AF9B}.Release|Any CPU.ActiveCfg = Release|Any CPU
51 {E2AB6AA2-359D-4305-92B0-D90C8F87AF9B}.Release|Any CPU.Build.0 = Release|Any CPU
52 {E2AB6AA2-359D-4305-92B0-D90C8F87AF9B}.Release|x86.ActiveCfg = Release|Any CPU
53 {E2AB6AA2-359D-4305-92B0-D90C8F87AF9B}.Release|x86.Build.0 = Release|Any CPU
54 EndGlobalSection
55 GlobalSection(SolutionProperties) = preSolution
56 HideSolutionNode = FALSE
57 EndGlobalSection
58 GlobalSection(ExtensibilityGlobals) = postSolution
59 SolutionGuid = {77F012B1-8E94-4F85-9450-066C6BD15000}
60 EndGlobalSection
61EndGlobal
diff --git a/appveyor.cmd b/appveyor.cmd
new file mode 100644
index 00000000..73674296
--- /dev/null
+++ b/appveyor.cmd
@@ -0,0 +1,13 @@
1@setlocal
2@pushd %~dp0
3
4nuget restore
5
6msbuild -p:Configuration=Release -t:Restore
7
8msbuild -p:Configuration=Release src\test\WixToolsetTest.Dependency\WixToolsetTest.Dependency.csproj
9
10msbuild -p:Configuration=Release -t:Pack src\wixext\WixToolset.Dependency.wixext.csproj
11
12@popd
13@endlocal \ No newline at end of file
diff --git a/appveyor.yml b/appveyor.yml
new file mode 100644
index 00000000..8d80c6af
--- /dev/null
+++ b/appveyor.yml
@@ -0,0 +1,42 @@
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# Do NOT modify this file. Update the canonical version in Home\repo-template\src\appveyor.yml
4# then update all of the repos.
5
6branches:
7 only:
8 - master
9 - develop
10
11image: Visual Studio 2017
12
13version: 0.0.0.{build}
14configuration: Release
15
16environment:
17 DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
18 DOTNET_CLI_TELEMETRY_OPTOUT: 1
19 NUGET_XMLDOC_MODE: skip
20
21build_script:
22 - appveyor.cmd
23
24pull_requests:
25 do_not_increment_build_number: true
26
27nuget:
28 disable_publish_on_pr: true
29
30skip_branch_with_pr: true
31skip_tags: true
32
33artifacts:
34- path: build\Release\**\*.nupkg
35 name: nuget
36- path: build\Release\**\*.msi
37 name: msi
38
39notifications:
40- provider: Slack
41 incoming_webhook:
42 secure: p5xuu+4x2JHfwGDMDe5KcG1k7gZxqYc4jWVwvyNZv5cvkubPD2waJs5yXMAXZNN7Z63/3PWHb7q4KoY/99AjauYa1nZ4c5qYqRPFRBKTHfA=
diff --git a/nuget.config b/nuget.config
new file mode 100644
index 00000000..aaee3228
--- /dev/null
+++ b/nuget.config
@@ -0,0 +1,16 @@
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="wixtoolset-tools" value="https://ci.appveyor.com/nuget/wixtoolset-tools" />
13 <add key="wixbuildtools" value="https://ci.appveyor.com/nuget/wixbuildtools" />
14 <add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
15 </packageSources>
16</configuration> \ No newline at end of file
diff --git a/src/Cpp.Build.props b/src/Cpp.Build.props
new file mode 100644
index 00000000..0e00132b
--- /dev/null
+++ b/src/Cpp.Build.props
@@ -0,0 +1,104 @@
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)' == '' OR '$(Platform)' == 'AnyCPU' ">Win32</Platform>
7 <IntDir>$(BaseIntermediateOutputPath)$(Configuration)\$(Platform)\</IntDir>
8 <OutDir>$(OutputPath)$(Platform)\</OutDir>
9 </PropertyGroup>
10
11 <PropertyGroup Condition="'$(WindowsTargetPlatformVersion)'=='' AND '$(VisualStudioVersion)'=='15.0'">
12 <WindowsTargetPlatformVersion>$([Microsoft.Build.Utilities.ToolLocationHelper]::GetLatestSDKTargetPlatformVersion('Windows', '10.0'))</WindowsTargetPlatformVersion>
13 </PropertyGroup>
14
15 <ItemDefinitionGroup>
16 <ClCompile>
17 <DisableSpecificWarnings>$(DisableSpecificCompilerWarnings)</DisableSpecificWarnings>
18 <WarningLevel>Level4</WarningLevel>
19 <AdditionalIncludeDirectories>$(ProjectDir)inc;$(MSBuildProjectDirectory);$(IntDir);$(SqlCESdkIncludePath);$(ProjectAdditionalIncludeDirectories);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
20 <PreprocessorDefinitions>WIN32;_WINDOWS;_WIN32_MSI=500;_WIN32_WINNT=0x0501;$(ArmPreprocessorDefinitions);$(UnicodePreprocessorDefinitions);_CRT_STDIO_LEGACY_WIDE_SPECIFIERS;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
21 <PrecompiledHeader>Use</PrecompiledHeader>
22 <PrecompiledHeaderFile>precomp.h</PrecompiledHeaderFile>
23 <CallingConvention Condition="'$(Platform)'=='Win32'">StdCall</CallingConvention>
24 <TreatWarningAsError>true</TreatWarningAsError>
25 <ExceptionHandling>false</ExceptionHandling>
26 <AdditionalOptions>-YlprecompDefine</AdditionalOptions>
27 <AdditionalOptions Condition=" $(PlatformToolset.StartsWith('v14')) ">/Zc:threadSafeInit- %(AdditionalOptions)</AdditionalOptions>
28 <MultiProcessorCompilation Condition=" $(NUMBER_OF_PROCESSORS) &gt; 4 ">true</MultiProcessorCompilation>
29 </ClCompile>
30 <ResourceCompile>
31 <PreprocessorDefinitions>$(ArmPreprocessorDefinitions);%(PreprocessorDefinitions)</PreprocessorDefinitions>
32 <AdditionalIncludeDirectories>$(ProjectAdditionalResourceIncludeDirectories);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
33 </ResourceCompile>
34 <Lib>
35 <AdditionalLibraryDirectories>$(OutDir);$(AdditionalMultiTargetLibraryPath);$(ProjectAdditionalLibraryDirectories);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
36 </Lib>
37 <Link>
38 <SubSystem>$(ProjectSubSystem)</SubSystem>
39 <ModuleDefinitionFile>$(ProjectModuleDefinitionFile)</ModuleDefinitionFile>
40 <NoEntryPoint>$(ResourceOnlyDll)</NoEntryPoint>
41 <GenerateDebugInformation>true</GenerateDebugInformation>
42 <AdditionalDependencies>$(ProjectAdditionalLinkLibraries);advapi32.lib;comdlg32.lib;user32.lib;oleaut32.lib;gdi32.lib;shell32.lib;ole32.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
43 <AdditionalLibraryDirectories>$(OutDir);$(AdditionalMultiTargetLibraryPath);$(ArmLibraryDirectories);$(ProjectAdditionalLinkLibraryDirectories);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
44 <AdditionalOptions Condition=" $(PlatformToolset.StartsWith('v14')) ">/IGNORE:4099 %(AdditionalOptions)</AdditionalOptions>
45 </Link>
46 </ItemDefinitionGroup>
47
48 <ItemDefinitionGroup Condition=" '$(Platform)'=='Win32' and '$(PlatformToolset)'!='v100'">
49 <ClCompile>
50 <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
51 </ClCompile>
52 </ItemDefinitionGroup>
53 <ItemDefinitionGroup Condition=" '$(Platform)'=='arm' ">
54 <ClCompile>
55 <CallingConvention>CDecl</CallingConvention>
56 </ClCompile>
57 </ItemDefinitionGroup>
58 <ItemDefinitionGroup Condition=" '$(ConfigurationType)'=='StaticLibrary' ">
59 <ClCompile>
60 <DebugInformationFormat>OldStyle</DebugInformationFormat>
61 <OmitDefaultLibName>true</OmitDefaultLibName>
62 <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
63 </ClCompile>
64 </ItemDefinitionGroup>
65 <ItemDefinitionGroup Condition=" '$(Configuration)'=='Debug' ">
66 <ClCompile>
67 <Optimization>Disabled</Optimization>
68 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
69 <PreprocessorDefinitions>_DEBUG;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
70 <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
71 </ClCompile>
72 </ItemDefinitionGroup>
73 <ItemDefinitionGroup Condition=" '$(Configuration)'=='Debug' and '$(CLRSupport)'=='true' ">
74 <ClCompile>
75 <BasicRuntimeChecks></BasicRuntimeChecks>
76 <RuntimeLibrary>MultiThreadedDebugDll</RuntimeLibrary>
77 </ClCompile>
78 </ItemDefinitionGroup>
79 <ItemDefinitionGroup Condition=" '$(Configuration)'=='Release' ">
80 <ClCompile>
81 <Optimization>MinSpace</Optimization>
82 <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
83 <FunctionLevelLinking>true</FunctionLevelLinking>
84 <IntrinsicFunctions>true</IntrinsicFunctions>
85 <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
86 </ClCompile>
87 <Link>
88 <EnableCOMDATFolding>true</EnableCOMDATFolding>
89 <OptimizeReferences>true</OptimizeReferences>
90 </Link>
91 </ItemDefinitionGroup>
92 <ItemDefinitionGroup Condition=" '$(Configuration)'=='Release' and '$(CLRSupport)'=='true' ">
93 <ClCompile>
94 <BasicRuntimeChecks></BasicRuntimeChecks>
95 <RuntimeLibrary>MultiThreadedDll</RuntimeLibrary>
96 </ClCompile>
97 </ItemDefinitionGroup>
98 <ItemDefinitionGroup Condition=" '$(CLRSupport)'=='true' ">
99 <Link>
100 <KeyFile>$(LinkKeyFile)</KeyFile>
101 <DelaySign>$(LinkDelaySign)</DelaySign>
102 </Link>
103 </ItemDefinitionGroup>
104</Project>
diff --git a/src/Directory.Build.props b/src/Directory.Build.props
new file mode 100644
index 00000000..a22f4470
--- /dev/null
+++ b/src/Directory.Build.props
@@ -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 Do NOT modify this file. Update the canonical version in Home\repo-template\src\Directory.Build.props
5 then update all of the repos.
6-->
7<Project>
8 <PropertyGroup>
9 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
10 <EnableSourceLink Condition=" '$(NCrunch)' == '1' ">false</EnableSourceLink>
11 <MSBuildWarningsAsMessages>MSB3246</MSBuildWarningsAsMessages>
12
13 <ProjectName Condition=" '$(ProjectName)' == '' ">$(MSBuildProjectName)</ProjectName>
14 <BaseOutputPath>$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\build\))</BaseOutputPath>
15 <BaseIntermediateOutputPath>$(BaseOutputPath)obj\$(ProjectName)\</BaseIntermediateOutputPath>
16 <OutputPath>$(BaseOutputPath)$(Configuration)\</OutputPath>
17
18 <Authors>WiX Toolset Team</Authors>
19 <Company>WiX Toolset</Company>
20 <Copyright>Copyright (c) .NET Foundation and contributors. All rights reserved.</Copyright>
21 <PackageLicenseExpression>MS-RL</PackageLicenseExpression>
22 <Product>WiX Toolset</Product>
23 </PropertyGroup>
24
25 <Import Project="Cpp.Build.props" Condition=" Exists('Cpp.Build.props') And '$(MSBuildProjectExtension)'=='.vcxproj' " />
26 <Import Project="Wix.Build.props" Condition=" Exists('Wix.Build.props') And '$(MSBuildProjectExtension)'=='.wixproj' " />
27 <Import Project="Custom.Build.props" Condition=" Exists('Custom.Build.props') " />
28</Project>
diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets
new file mode 100644
index 00000000..dac7452a
--- /dev/null
+++ b/src/Directory.Build.targets
@@ -0,0 +1,48 @@
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 Do NOT modify this file. Update the canonical version in Home\repo-template\src\Directory.Build.targets
5 then update all of the repos.
6-->
7<!--
8 Replace PackageReferences with ProjectReferences when the projects can be found in .sln.
9 See the original here: https://github.com/dotnet/sdk/issues/1151#issuecomment-385133284
10-->
11<Project>
12 <PropertyGroup>
13 <ReplacePackageReferences>true</ReplacePackageReferences>
14 <TheSolutionPath Condition=" '$(NCrunch)'=='' ">$(SolutionPath)</TheSolutionPath>
15 <TheSolutionPath Condition=" '$(NCrunch)'=='1' ">$(NCrunchOriginalSolutionPath)</TheSolutionPath>
16 </PropertyGroup>
17
18 <Choose>
19 <When Condition="$(ReplacePackageReferences) AND '$(TheSolutionPath)' != '' AND '$(TheSolutionPath)' != '*undefined*' AND Exists('$(TheSolutionPath)')">
20
21 <PropertyGroup>
22 <SolutionFileContent>$([System.IO.File]::ReadAllText($(TheSolutionPath)))</SolutionFileContent>
23 <SmartSolutionDir>$([System.IO.Path]::GetDirectoryName( $(TheSolutionPath) ))</SmartSolutionDir>
24 <RegexPattern>(?&lt;="[PackageName]", ")(.*)(?=", ")</RegexPattern>
25 </PropertyGroup>
26
27 <ItemGroup>
28 <!-- Keep the identity of the PackageReference -->
29 <SmartPackageReference Include="@(PackageReference)">
30 <PackageName>%(Identity)</PackageName>
31 <InSolution>$(SolutionFileContent.Contains('\%(Identity).csproj'))</InSolution>
32 </SmartPackageReference>
33
34 <!-- Filter them by mapping them to another ItemGroup using the WithMetadataValue item function -->
35 <PackageInSolution Include="@(SmartPackageReference->WithMetadataValue('InSolution', True))">
36 <Pattern>$(RegexPattern.Replace('[PackageName]','%(PackageName)') )</Pattern>
37 <SmartPath>$([System.Text.RegularExpressions.Regex]::Match('$(SolutionFileContent)', '%(Pattern)'))</SmartPath>
38 </PackageInSolution>
39
40 <ProjectReference Include="@(PackageInSolution->'$(SmartSolutionDir)\%(SmartPath)' )"/>
41
42 <!-- Remove the package references that are now referenced as projects -->
43 <PackageReference Remove="@(PackageInSolution->'%(PackageName)' )"/>
44 </ItemGroup>
45
46 </When>
47 </Choose>
48</Project>
diff --git a/src/FindLocalWix.props b/src/FindLocalWix.props
new file mode 100644
index 00000000..a784e352
--- /dev/null
+++ b/src/FindLocalWix.props
@@ -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)' == 'Debug' And Exists('$(MSBuildThisFileDirectory)..\..\Tools\README.md') ">$(MSBuildThisFileDirectory)..\..\Tools\build\Debug\net461\wix.targets</WixTargetsPath>
7 </PropertyGroup>
8</Project>
diff --git a/src/ca/custommsierrors.h b/src/ca/custommsierrors.h
new file mode 100644
index 00000000..26450452
--- /dev/null
+++ b/src/ca/custommsierrors.h
@@ -0,0 +1,5 @@
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#define msierrDependencyMissingDependencies 26451
5#define msierrDependencyHasDependents 26452
diff --git a/src/ca/dependencyca.vcxproj b/src/ca/dependencyca.vcxproj
new file mode 100644
index 00000000..480a1861
--- /dev/null
+++ b/src/ca/dependencyca.vcxproj
@@ -0,0 +1,61 @@
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.16\build\WixToolset.DUtil.props" Condition="Exists('..\..\packages\WixToolset.DUtil.4.0.16\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>{B86AF46C-0F90-49CC-923F-A800B088D015}</ProjectGuid>
21 <ConfigurationType>DynamicLibrary</ConfigurationType>
22 <PlatformToolset>v141</PlatformToolset>
23 <CharacterSet>Unicode</CharacterSet>
24 <TargetName>dependencyca</TargetName>
25 <ProjectModuleDefinitionFile>wixdepca.def</ProjectModuleDefinitionFile>
26 <Description>WiX Toolset Dependency CustomAction</Description>
27 </PropertyGroup>
28
29 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
30 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
31
32 <PropertyGroup>
33 <ProjectAdditionalLinkLibraries>msi.lib</ProjectAdditionalLinkLibraries>
34 </PropertyGroup>
35
36 <ItemGroup>
37 <ClCompile Include="dllmain.cpp">
38 <PrecompiledHeader>Create</PrecompiledHeader>
39 </ClCompile>
40 <ClCompile Include="wixdepca.cpp" />
41 </ItemGroup>
42
43 <ItemGroup>
44 <ClInclude Include="precomp.h" />
45 </ItemGroup>
46
47 <ItemGroup>
48 <None Include="packages.config" />
49 <None Include="wixdepca.def" />
50 </ItemGroup>
51
52 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
53
54 <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
55 <PropertyGroup>
56 <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>
57 </PropertyGroup>
58 <Error Condition="!Exists('..\..\packages\WixToolset.DUtil.4.0.16\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.DUtil.4.0.16\build\WixToolset.DUtil.props'))" />
59 <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'))" />
60 </Target>
61</Project>
diff --git a/src/ca/wixdepca.vcxproj.filters b/src/ca/dependencyca.vcxproj.filters
index 1fdb0236..d4931f32 100644
--- a/src/ca/wixdepca.vcxproj.filters
+++ b/src/ca/dependencyca.vcxproj.filters
@@ -28,11 +28,6 @@
28 </ClInclude> 28 </ClInclude>
29 </ItemGroup> 29 </ItemGroup>
30 <ItemGroup> 30 <ItemGroup>
31 <ResourceCompile Include="wixdepca.rc">
32 <Filter>Resource Files</Filter>
33 </ResourceCompile>
34 </ItemGroup>
35 <ItemGroup>
36 <None Include="wixdepca.def"> 31 <None Include="wixdepca.def">
37 <Filter>Source Files</Filter> 32 <Filter>Source Files</Filter>
38 </None> 33 </None>
diff --git a/src/ca/packages.config b/src/ca/packages.config
new file mode 100644
index 00000000..ab964d2c
--- /dev/null
+++ b/src/ca/packages.config
@@ -0,0 +1,5 @@
1<?xml version="1.0" encoding="utf-8"?>
2<packages>
3 <package id="WixToolset.DUtil" version="4.0.16" targetFramework="native" />
4 <package id="WixToolset.WcaUtil" version="4.0.2" targetFramework="native" />
5</packages> \ No newline at end of file
diff --git a/src/ca/wixdepca.def b/src/ca/wixdepca.def
index df50e992..651c6373 100644
--- a/src/ca/wixdepca.def
+++ b/src/ca/wixdepca.def
@@ -1,7 +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. 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 2
3 3
4LIBRARY "wixdepca" 4LIBRARY "dependencyca"
5 5
6EXPORTS 6EXPORTS
7 WixDependencyRequire 7 WixDependencyRequire
diff --git a/src/ca/wixdepca.vcxproj b/src/ca/wixdepca.vcxproj
deleted file mode 100644
index b757a35f..00000000
--- a/src/ca/wixdepca.vcxproj
+++ /dev/null
@@ -1,57 +0,0 @@
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<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
6 <ItemGroup Label="ProjectConfigurations">
7 <ProjectConfiguration Include="Debug|Win32">
8 <Configuration>Debug</Configuration>
9 <Platform>Win32</Platform>
10 </ProjectConfiguration>
11 <ProjectConfiguration Include="Release|Win32">
12 <Configuration>Release</Configuration>
13 <Platform>Win32</Platform>
14 </ProjectConfiguration>
15 </ItemGroup>
16 <ItemGroup Label="ProjectConfigurations">
17 <ProjectConfiguration Include="Debug|ARM">
18 <Configuration>Debug</Configuration>
19 <Platform>ARM</Platform>
20 </ProjectConfiguration>
21 <ProjectConfiguration Include="Release|ARM">
22 <Configuration>Release</Configuration>
23 <Platform>ARM</Platform>
24 </ProjectConfiguration>
25 </ItemGroup>
26
27 <PropertyGroup Label="Globals">
28 <ProjectGuid>{B86AF46C-0F90-49CC-923F-A800B088D015}</ProjectGuid>
29 <ConfigurationType>DynamicLibrary</ConfigurationType>
30 <CharacterSet>Unicode</CharacterSet>
31 <TargetName>WixDepCA</TargetName>
32 <ProjectModuleDefinitionFile>wixdepca.def</ProjectModuleDefinitionFile>
33 </PropertyGroup>
34
35 <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), wix.proj))\tools\WixBuild.props" />
36
37 <PropertyGroup>
38 <ProjectAdditionalIncludeDirectories>$(WixRoot)src\libs\dutil\inc;$(WixRoot)src\libs\wcautil;$(WixRoot)src\libs\deputil\inc</ProjectAdditionalIncludeDirectories>
39 <ProjectAdditionalLinkLibraries>msi.lib;dutil.lib;deputil.lib;wcautil.lib</ProjectAdditionalLinkLibraries>
40 </PropertyGroup>
41
42 <ItemGroup>
43 <ClCompile Include="dllmain.cpp" />
44 <ClCompile Include="wixdepca.cpp" />
45 </ItemGroup>
46 <ItemGroup>
47 <ClInclude Include="precomp.h" />
48 </ItemGroup>
49 <ItemGroup>
50 <None Include="wixdepca.def" />
51 </ItemGroup>
52 <ItemGroup>
53 <ResourceCompile Include="wixdepca.rc" />
54 </ItemGroup>
55
56 <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), wix.proj))\tools\WixBuild.targets" />
57</Project>
diff --git a/src/test/WixToolsetTest.Dependency/DependencyExtensionFixture.cs b/src/test/WixToolsetTest.Dependency/DependencyExtensionFixture.cs
new file mode 100644
index 00000000..07d6228e
--- /dev/null
+++ b/src/test/WixToolsetTest.Dependency/DependencyExtensionFixture.cs
@@ -0,0 +1,32 @@
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
3namespace WixToolsetTest.Dependency
4{
5 using System.Linq;
6 using WixBuildTools.TestSupport;
7 using WixToolset.Core.TestPackage;
8 using WixToolset.Dependency;
9 using Xunit;
10
11 public class DependencyExtensionFixture
12 {
13 [Fact]
14 public void CanBuildUsingProvides()
15 {
16 var folder = TestData.Get(@"TestData\UsingProvides");
17 var build = new Builder(folder, typeof(DependencyExtensionFactory), new[] { folder });
18
19 var results = build.BuildAndQuery(Build, "WixDependencyProvider");
20 Assert.Equal(new[]
21 {
22 "WixDependencyProvider:depJQsOasf1FRUsKxq8THB9sXk8yws\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tUsingProvides\t\t\t0",
23 }, results.OrderBy(s => s).ToArray());
24 }
25
26 private static void Build(string[] args)
27 {
28 var result = WixRunner.Execute(args)
29 .AssertSuccess();
30 }
31 }
32}
diff --git a/src/test/WixToolsetTest.Dependency/TestData/UsingProvides/Package.en-us.wxl b/src/test/WixToolsetTest.Dependency/TestData/UsingProvides/Package.en-us.wxl
new file mode 100644
index 00000000..38c12ac1
--- /dev/null
+++ b/src/test/WixToolsetTest.Dependency/TestData/UsingProvides/Package.en-us.wxl
@@ -0,0 +1,11 @@
1<?xml version="1.0" encoding="utf-8"?>
2
3<!--
4This 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>
diff --git a/src/test/WixToolsetTest.Dependency/TestData/UsingProvides/Package.wxs b/src/test/WixToolsetTest.Dependency/TestData/UsingProvides/Package.wxs
new file mode 100644
index 00000000..68ff98fd
--- /dev/null
+++ b/src/test/WixToolsetTest.Dependency/TestData/UsingProvides/Package.wxs
@@ -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>
diff --git a/src/test/WixToolsetTest.Dependency/TestData/UsingProvides/PackageComponents.wxs b/src/test/WixToolsetTest.Dependency/TestData/UsingProvides/PackageComponents.wxs
new file mode 100644
index 00000000..e241fb17
--- /dev/null
+++ b/src/test/WixToolsetTest.Dependency/TestData/UsingProvides/PackageComponents.wxs
@@ -0,0 +1,12 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
3 xmlns:dep="http://wixtoolset.org/schemas/v4/wxs/dependency">
4 <Fragment>
5 <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
6 <Component>
7 <File Source="example.txt" />
8 <dep:Provides Key="UsingProvides" />
9 </Component>
10 </ComponentGroup>
11 </Fragment>
12</Wix>
diff --git a/src/test/WixToolsetTest.Dependency/TestData/UsingProvides/example.txt b/src/test/WixToolsetTest.Dependency/TestData/UsingProvides/example.txt
new file mode 100644
index 00000000..1b4ffe8a
--- /dev/null
+++ b/src/test/WixToolsetTest.Dependency/TestData/UsingProvides/example.txt
@@ -0,0 +1 @@
This is example.txt. \ No newline at end of file
diff --git a/src/test/WixToolsetTest.Dependency/WixToolsetTest.Dependency.csproj b/src/test/WixToolsetTest.Dependency/WixToolsetTest.Dependency.csproj
new file mode 100644
index 00000000..342325df
--- /dev/null
+++ b/src/test/WixToolsetTest.Dependency/WixToolsetTest.Dependency.csproj
@@ -0,0 +1,38 @@
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.1</TargetFramework>
7 <IsPackable>false</IsPackable>
8 </PropertyGroup>
9
10 <PropertyGroup>
11 <NoWarn>NU1701</NoWarn>
12 </PropertyGroup>
13
14 <ItemGroup>
15 <Content Include="TestData\UsingProvides\example.txt" CopyToOutputDirectory="PreserveNewest" />
16 <Content Include="TestData\UsingProvides\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" />
17 <Content Include="TestData\UsingProvides\Package.wxs" CopyToOutputDirectory="PreserveNewest" />
18 <Content Include="TestData\UsingProvides\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" />
19 </ItemGroup>
20
21 <ItemGroup>
22 <ProjectReference Include="..\..\wixext\WixToolset.Dependency.wixext.csproj" />
23 </ItemGroup>
24
25 <ItemGroup>
26 <PackageReference Include="WixToolset.Core.TestPackage" Version="4.0.*" PrivateAssets="all" />
27 </ItemGroup>
28
29 <ItemGroup>
30 <PackageReference Include="WixBuildTools.TestSupport" Version="4.0.*" />
31 </ItemGroup>
32
33 <ItemGroup>
34 <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
35 <PackageReference Include="xunit" Version="2.4.0" />
36 <PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
37 </ItemGroup>
38</Project>
diff --git a/src/wixext/DependencyCommon.cs b/src/wixext/DependencyCommon.cs
index 4826d8b0..cb36be36 100644
--- a/src/wixext/DependencyCommon.cs
+++ b/src/wixext/DependencyCommon.cs
@@ -1,6 +1,6 @@
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. 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 2
3namespace WixToolset.Extensions 3namespace WixToolset.Dependency
4{ 4{
5 using System; 5 using System;
6 using WixToolset; 6 using WixToolset;
diff --git a/src/wixext/DependencyCompiler.cs b/src/wixext/DependencyCompiler.cs
index a138c047..f866b589 100644
--- a/src/wixext/DependencyCompiler.cs
+++ b/src/wixext/DependencyCompiler.cs
@@ -1,6 +1,6 @@
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. 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 2
3namespace WixToolset.Extensions 3namespace WixToolset.Dependency
4{ 4{
5 using System; 5 using System;
6 using System.Collections.Generic; 6 using System.Collections.Generic;
@@ -9,11 +9,12 @@ namespace WixToolset.Extensions
9 using System.Xml.Linq; 9 using System.Xml.Linq;
10 using WixToolset.Data; 10 using WixToolset.Data;
11 using WixToolset.Extensibility; 11 using WixToolset.Extensibility;
12 using WixToolset.Extensibility.Data;
12 13
13 /// <summary> 14 /// <summary>
14 /// The compiler for the WiX toolset dependency extension. 15 /// The compiler for the WiX Toolset Dependency Extension.
15 /// </summary> 16 /// </summary>
16 public sealed class DependencyCompiler : CompilerExtension 17 public sealed class DependencyCompiler : BaseCompilerExtension
17 { 18 {
18 /// <summary> 19 /// <summary>
19 /// Package type when parsing the Provides element. 20 /// Package type when parsing the Provides element.
@@ -27,10 +28,7 @@ namespace WixToolset.Extensions
27 MsuPackage 28 MsuPackage
28 } 29 }
29 30
30 public DependencyCompiler() 31 public override XNamespace Namespace => "http://wixtoolset.org/schemas/v4/wxs/dependency";
31 {
32 this.Namespace = "http://wixtoolset.org/schemas/v4/wxs/dependency";
33 }
34 32
35 /// <summary> 33 /// <summary>
36 /// Processes an attribute for the Compiler. 34 /// Processes an attribute for the Compiler.
@@ -38,24 +36,24 @@ namespace WixToolset.Extensions
38 /// <param name="sourceLineNumbers">Source line number for the parent element.</param> 36 /// <param name="sourceLineNumbers">Source line number for the parent element.</param>
39 /// <param name="parentElement">Parent element of attribute.</param> 37 /// <param name="parentElement">Parent element of attribute.</param>
40 /// <param name="attribute">Attribute to process.</param> 38 /// <param name="attribute">Attribute to process.</param>
41 public override void ParseAttribute(XElement parentElement, XAttribute attribute, IDictionary<string, string> context) 39 public override void ParseAttribute(Intermediate intermediate, IntermediateSection section, XElement parentElement, XAttribute attribute, IDictionary<string, string> context)
42 { 40 {
43 SourceLineNumber sourceLineNumbers = Preprocessor.GetSourceLineNumbers(parentElement); 41 SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(parentElement);
44 switch (parentElement.Name.LocalName) 42 switch (parentElement.Name.LocalName)
45 { 43 {
46 case "Bundle": 44 case "Bundle":
47 switch (attribute.Name.LocalName) 45 switch (attribute.Name.LocalName)
48 { 46 {
49 case "ProviderKey": 47 case "ProviderKey":
50 this.ParseProviderKeyAttribute(sourceLineNumbers, parentElement, attribute); 48 this.ParseProviderKeyAttribute(section, sourceLineNumbers, parentElement, attribute);
51 break; 49 break;
52 default: 50 default:
53 this.Core.UnexpectedAttribute(parentElement, attribute); 51 this.ParseHelper.UnexpectedAttribute(parentElement, attribute);
54 break; 52 break;
55 } 53 }
56 break; 54 break;
57 default: 55 default:
58 this.Core.UnexpectedAttribute(parentElement, attribute); 56 this.ParseHelper.UnexpectedAttribute(parentElement, attribute);
59 break; 57 break;
60 } 58 }
61 } 59 }
@@ -67,7 +65,7 @@ namespace WixToolset.Extensions
67 /// <param name="parentElement">Parent element of element to process.</param> 65 /// <param name="parentElement">Parent element of element to process.</param>
68 /// <param name="element">Element to process.</param> 66 /// <param name="element">Element to process.</param>
69 /// <param name="contextValues">Extra information about the context in which this element is being parsed.</param> 67 /// <param name="contextValues">Extra information about the context in which this element is being parsed.</param>
70 public override void ParseElement(XElement parentElement, XElement element, IDictionary<string, string> context) 68 public override void ParseElement(Intermediate intermediate, IntermediateSection section, XElement parentElement, XElement element, IDictionary<string, string> context)
71 { 69 {
72 PackageType packageType = PackageType.None; 70 PackageType packageType = PackageType.None;
73 71
@@ -80,10 +78,10 @@ namespace WixToolset.Extensions
80 switch (element.Name.LocalName) 78 switch (element.Name.LocalName)
81 { 79 {
82 case "Requires": 80 case "Requires":
83 this.ParseRequiresElement(element, null, false); 81 this.ParseRequiresElement(intermediate, section, element, null, false);
84 break; 82 break;
85 default: 83 default:
86 this.Core.UnexpectedElement(parentElement, element); 84 this.ParseHelper.UnexpectedElement(parentElement, element);
87 break; 85 break;
88 } 86 }
89 break; 87 break;
@@ -100,7 +98,7 @@ namespace WixToolset.Extensions
100 packageType = PackageType.MsuPackage; 98 packageType = PackageType.MsuPackage;
101 break; 99 break;
102 default: 100 default:
103 this.Core.UnexpectedElement(parentElement, element); 101 this.ParseHelper.UnexpectedElement(parentElement, element);
104 break; 102 break;
105 } 103 }
106 104
@@ -111,10 +109,10 @@ namespace WixToolset.Extensions
111 switch (element.Name.LocalName) 109 switch (element.Name.LocalName)
112 { 110 {
113 case "Provides": 111 case "Provides":
114 this.ParseProvidesElement(element, packageType, packageId); 112 this.ParseProvidesElement(intermediate, section, element, packageType, packageId);
115 break; 113 break;
116 default: 114 default:
117 this.Core.UnexpectedElement(parentElement, element); 115 this.ParseHelper.UnexpectedElement(parentElement, element);
118 break; 116 break;
119 } 117 }
120 } 118 }
@@ -127,9 +125,9 @@ namespace WixToolset.Extensions
127 /// <param name="element">Element to process.</param> 125 /// <param name="element">Element to process.</param>
128 /// <param name="context">Extra information about the context in which this element is being parsed.</param> 126 /// <param name="context">Extra information about the context in which this element is being parsed.</param>
129 /// <returns>The component key path type if set.</returns> 127 /// <returns>The component key path type if set.</returns>
130 public override ComponentKeyPath ParsePossibleKeyPathElement(XElement parentElement, XElement element, IDictionary<string, string> context) 128 public override ComponentKeyPath ParsePossibleKeyPathElement(Intermediate intermediate, IntermediateSection section, XElement parentElement, XElement element, IDictionary<string, string> context)
131 { 129 {
132 SourceLineNumber sourceLineNumbers = Preprocessor.GetSourceLineNumbers(parentElement); 130 SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(parentElement);
133 ComponentKeyPath keyPath = null; 131 ComponentKeyPath keyPath = null;
134 132
135 switch (parentElement.Name.LocalName) 133 switch (parentElement.Name.LocalName)
@@ -146,18 +144,18 @@ namespace WixToolset.Extensions
146 case "Provides": 144 case "Provides":
147 if (win64) 145 if (win64)
148 { 146 {
149 this.Core.OnMessage(DependencyWarnings.Win64Component(sourceLineNumbers, componentId)); 147 this.Messaging.Write(DependencyWarnings.Win64Component(sourceLineNumbers, componentId));
150 } 148 }
151 149
152 keyPath = this.ParseProvidesElement(element, PackageType.None, componentId); 150 keyPath = this.ParseProvidesElement(intermediate, section, element, PackageType.None, componentId);
153 break; 151 break;
154 default: 152 default:
155 this.Core.UnexpectedElement(parentElement, element); 153 this.ParseHelper.UnexpectedElement(parentElement, element);
156 break; 154 break;
157 } 155 }
158 break; 156 break;
159 default: 157 default:
160 this.Core.UnexpectedElement(parentElement, element); 158 this.ParseHelper.UnexpectedElement(parentElement, element);
161 break; 159 break;
162 } 160 }
163 161
@@ -170,7 +168,7 @@ namespace WixToolset.Extensions
170 /// <param name="sourceLineNumbers">Source line number for the parent element.</param> 168 /// <param name="sourceLineNumbers">Source line number for the parent element.</param>
171 /// <param name="parentElement">Parent element of attribute.</param> 169 /// <param name="parentElement">Parent element of attribute.</param>
172 /// <param name="attribute">The XML attribute for the ProviderKey attribute.</param> 170 /// <param name="attribute">The XML attribute for the ProviderKey attribute.</param>
173 private void ParseProviderKeyAttribute(SourceLineNumber sourceLineNumbers, XElement parentElement, XAttribute attribute) 171 private void ParseProviderKeyAttribute(IntermediateSection section, SourceLineNumber sourceLineNumbers, XElement parentElement, XAttribute attribute)
174 { 172 {
175 Identifier id = null; 173 Identifier id = null;
176 string providerKey = null; 174 string providerKey = null;
@@ -179,41 +177,41 @@ namespace WixToolset.Extensions
179 switch (attribute.Name.LocalName) 177 switch (attribute.Name.LocalName)
180 { 178 {
181 case "ProviderKey": 179 case "ProviderKey":
182 providerKey = this.Core.GetAttributeValue(sourceLineNumbers, attribute); 180 providerKey = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attribute);
183 break; 181 break;
184 default: 182 default:
185 this.Core.UnexpectedAttribute(parentElement, attribute); 183 this.ParseHelper.UnexpectedAttribute(parentElement, attribute);
186 break; 184 break;
187 } 185 }
188 186
189 // Make sure the key does not contain any illegal characters or values. 187 // Make sure the key does not contain any illegal characters or values.
190 if (String.IsNullOrEmpty(providerKey)) 188 if (String.IsNullOrEmpty(providerKey))
191 { 189 {
192 this.Core.OnMessage(WixErrors.IllegalEmptyAttributeValue(sourceLineNumbers, parentElement.Name.LocalName, attribute.Name.LocalName)); 190 this.Messaging.Write(ErrorMessages.IllegalEmptyAttributeValue(sourceLineNumbers, parentElement.Name.LocalName, attribute.Name.LocalName));
193 } 191 }
194 else if (0 <= (illegalChar = providerKey.IndexOfAny(DependencyCommon.InvalidCharacters))) 192 else if (0 <= (illegalChar = providerKey.IndexOfAny(DependencyCommon.InvalidCharacters)))
195 { 193 {
196 StringBuilder sb = new StringBuilder(DependencyCommon.InvalidCharacters.Length * 2); 194 StringBuilder sb = new StringBuilder(DependencyCommon.InvalidCharacters.Length * 2);
197 Array.ForEach<char>(DependencyCommon.InvalidCharacters, c => sb.Append(c).Append(" ")); 195 Array.ForEach<char>(DependencyCommon.InvalidCharacters, c => sb.Append(c).Append(" "));
198 196
199 this.Core.OnMessage(DependencyErrors.IllegalCharactersInProvider(sourceLineNumbers, "ProviderKey", providerKey[illegalChar], sb.ToString())); 197 this.Messaging.Write(DependencyErrors.IllegalCharactersInProvider(sourceLineNumbers, "ProviderKey", providerKey[illegalChar], sb.ToString()));
200 } 198 }
201 else if ("ALL" == providerKey) 199 else if ("ALL" == providerKey)
202 { 200 {
203 this.Core.OnMessage(DependencyErrors.ReservedValue(sourceLineNumbers, parentElement.Name.LocalName, "ProviderKey", providerKey)); 201 this.Messaging.Write(DependencyErrors.ReservedValue(sourceLineNumbers, parentElement.Name.LocalName, "ProviderKey", providerKey));
204 } 202 }
205 203
206 // Generate the primary key for the row. 204 // Generate the primary key for the row.
207 id = this.Core.CreateIdentifier("dep", attribute.Name.LocalName, providerKey); 205 id = this.ParseHelper.CreateIdentifier("dep", attribute.Name.LocalName, providerKey);
208 206
209 if (!this.Core.EncounteredError) 207 if (!this.Messaging.EncounteredError)
210 { 208 {
211 // Create the provider row for the bundle. The Component_ field is required 209 // Create the provider row for the bundle. The Component_ field is required
212 // in the table definition but unused for bundles, so just set it to the valid ID. 210 // in the table definition but unused for bundles, so just set it to the valid ID.
213 Row row = this.Core.CreateRow(sourceLineNumbers, "WixDependencyProvider", id); 211 var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixDependencyProvider", id);
214 row[1] = id.Id; 212 row.Set(1, id.Id);
215 row[2] = providerKey; 213 row.Set(2, providerKey);
216 row[5] = DependencyCommon.ProvidesAttributesBundle; 214 row.Set(5, DependencyCommon.ProvidesAttributesBundle);
217 } 215 }
218 } 216 }
219 217
@@ -225,9 +223,9 @@ namespace WixToolset.Extensions
225 /// <param name="keyPath">Explicit key path.</param> 223 /// <param name="keyPath">Explicit key path.</param>
226 /// <param name="parentId">The identifier of the parent component or package.</param> 224 /// <param name="parentId">The identifier of the parent component or package.</param>
227 /// <returns>The type of key path if set.</returns> 225 /// <returns>The type of key path if set.</returns>
228 private ComponentKeyPath ParseProvidesElement(XElement node, PackageType packageType, string parentId) 226 private ComponentKeyPath ParseProvidesElement(Intermediate intermediate, IntermediateSection section, XElement node, PackageType packageType, string parentId)
229 { 227 {
230 SourceLineNumber sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); 228 SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node);
231 ComponentKeyPath keyPath = null; 229 ComponentKeyPath keyPath = null;
232 Identifier id = null; 230 Identifier id = null;
233 string key = null; 231 string key = null;
@@ -243,25 +241,25 @@ namespace WixToolset.Extensions
243 switch (attrib.Name.LocalName) 241 switch (attrib.Name.LocalName)
244 { 242 {
245 case "Id": 243 case "Id":
246 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); 244 id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib);
247 break; 245 break;
248 case "Key": 246 case "Key":
249 key = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 247 key = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
250 break; 248 break;
251 case "Version": 249 case "Version":
252 version = this.Core.GetAttributeVersionValue(sourceLineNumbers, attrib); 250 version = this.ParseHelper.GetAttributeVersionValue(sourceLineNumbers, attrib);
253 break; 251 break;
254 case "DisplayName": 252 case "DisplayName":
255 displayName = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 253 displayName = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
256 break; 254 break;
257 default: 255 default:
258 this.Core.UnexpectedAttribute(node, attrib); 256 this.ParseHelper.UnexpectedAttribute(node, attrib);
259 break; 257 break;
260 } 258 }
261 } 259 }
262 else 260 else
263 { 261 {
264 this.Core.ParseExtensionAttribute(node, attrib); 262 this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, node, attrib);
265 } 263 }
266 } 264 }
267 265
@@ -275,22 +273,22 @@ namespace WixToolset.Extensions
275 StringBuilder sb = new StringBuilder(DependencyCommon.InvalidCharacters.Length * 2); 273 StringBuilder sb = new StringBuilder(DependencyCommon.InvalidCharacters.Length * 2);
276 Array.ForEach<char>(DependencyCommon.InvalidCharacters, c => sb.Append(c).Append(" ")); 274 Array.ForEach<char>(DependencyCommon.InvalidCharacters, c => sb.Append(c).Append(" "));
277 275
278 this.Core.OnMessage(DependencyErrors.IllegalCharactersInProvider(sourceLineNumbers, "Key", key[illegalChar], sb.ToString())); 276 this.Messaging.Write(DependencyErrors.IllegalCharactersInProvider(sourceLineNumbers, "Key", key[illegalChar], sb.ToString()));
279 } 277 }
280 else if ("ALL" == key) 278 else if ("ALL" == key)
281 { 279 {
282 this.Core.OnMessage(DependencyErrors.ReservedValue(sourceLineNumbers, node.Name.LocalName, "Key", key)); 280 this.Messaging.Write(DependencyErrors.ReservedValue(sourceLineNumbers, node.Name.LocalName, "Key", key));
283 } 281 }
284 } 282 }
285 else if (PackageType.ExePackage == packageType || PackageType.MsuPackage == packageType) 283 else if (PackageType.ExePackage == packageType || PackageType.MsuPackage == packageType)
286 { 284 {
287 // Must specify the provider key when authored for a package. 285 // Must specify the provider key when authored for a package.
288 this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Key")); 286 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Key"));
289 } 287 }
290 else if (PackageType.None == packageType) 288 else if (PackageType.None == packageType)
291 { 289 {
292 // Make sure the ProductCode is authored and set the key. 290 // Make sure the ProductCode is authored and set the key.
293 this.Core.CreateSimpleReference(sourceLineNumbers, "Property", "ProductCode"); 291 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "Property", "ProductCode");
294 key = "!(bind.property.ProductCode)"; 292 key = "!(bind.property.ProductCode)";
295 } 293 }
296 294
@@ -300,23 +298,23 @@ namespace WixToolset.Extensions
300 switch (packageType) 298 switch (packageType)
301 { 299 {
302 case PackageType.None: 300 case PackageType.None:
303 this.Core.OnMessage(DependencyWarnings.DiscouragedVersionAttribute(sourceLineNumbers)); 301 this.Messaging.Write(DependencyWarnings.DiscouragedVersionAttribute(sourceLineNumbers));
304 break; 302 break;
305 case PackageType.MsiPackage: 303 case PackageType.MsiPackage:
306 this.Core.OnMessage(DependencyWarnings.DiscouragedVersionAttribute(sourceLineNumbers, parentId)); 304 this.Messaging.Write(DependencyWarnings.DiscouragedVersionAttribute(sourceLineNumbers, parentId));
307 break; 305 break;
308 } 306 }
309 } 307 }
310 else if (PackageType.MspPackage == packageType || PackageType.MsuPackage == packageType) 308 else if (PackageType.MspPackage == packageType || PackageType.MsuPackage == packageType)
311 { 309 {
312 // Must specify the Version when authored for packages that do not contain a version. 310 // Must specify the Version when authored for packages that do not contain a version.
313 this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Version")); 311 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Version"));
314 } 312 }
315 313
316 // Need the element ID for child element processing, so generate now if not authored. 314 // Need the element ID for child element processing, so generate now if not authored.
317 if (null == id) 315 if (null == id)
318 { 316 {
319 id = this.Core.CreateIdentifier("dep", node.Name.LocalName, parentId, key); 317 id = this.ParseHelper.CreateIdentifier("dep", node.Name.LocalName, parentId, key);
320 } 318 }
321 319
322 foreach (XElement child in node.Elements()) 320 foreach (XElement child in node.Elements())
@@ -326,94 +324,93 @@ namespace WixToolset.Extensions
326 switch (child.Name.LocalName) 324 switch (child.Name.LocalName)
327 { 325 {
328 case "Requires": 326 case "Requires":
329 this.ParseRequiresElement(child, id.Id, PackageType.None == packageType); 327 this.ParseRequiresElement(intermediate, section, child, id.Id, PackageType.None == packageType);
330 break; 328 break;
331 case "RequiresRef": 329 case "RequiresRef":
332 this.ParseRequiresRefElement(child, id.Id, PackageType.None == packageType); 330 this.ParseRequiresRefElement(intermediate, section, child, id.Id, PackageType.None == packageType);
333 break; 331 break;
334 default: 332 default:
335 this.Core.UnexpectedElement(node, child); 333 this.ParseHelper.UnexpectedElement(node, child);
336 break; 334 break;
337 } 335 }
338 } 336 }
339 else 337 else
340 { 338 {
341 this.Core.ParseExtensionElement(node, child); 339 this.ParseHelper.ParseExtensionElement(this.Context.Extensions, intermediate, section, node, child);
342 } 340 }
343 } 341 }
344 342
345 if (!this.Core.EncounteredError) 343 if (!this.Messaging.EncounteredError)
346 { 344 {
347 // Create the row in the provider table. 345 // Create the row in the provider table.
348 Row row = this.Core.CreateRow(sourceLineNumbers, "WixDependencyProvider", id); 346 var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixDependencyProvider", id);
349 row[1] = parentId; 347 row.Set(1, parentId);
350 row[2] = key; 348 row.Set(2, key);
351 349
352 if (!String.IsNullOrEmpty(version)) 350 if (!String.IsNullOrEmpty(version))
353 { 351 {
354 row[3] = version; 352 row.Set(3, version);
355 } 353 }
356 354
357 if (!String.IsNullOrEmpty(displayName)) 355 if (!String.IsNullOrEmpty(displayName))
358 { 356 {
359 row[4] = displayName; 357 row.Set(4, displayName);
360 } 358 }
361 359
362 if (0 != attributes) 360 if (0 != attributes)
363 { 361 {
364 row[5] = attributes; 362 row.Set(5, attributes);
365 } 363 }
366 364
367 if (PackageType.None == packageType) 365 if (PackageType.None == packageType)
368 { 366 {
369 // Reference the Check custom action to check for dependencies on the current provider. 367 // Reference the Check custom action to check for dependencies on the current provider.
370 if (Platform.ARM == this.Core.CurrentPlatform) 368 if (Platform.ARM == this.Context.Platform)
371 { 369 {
372 // Ensure the ARM version of the CA is referenced. 370 // Ensure the ARM version of the CA is referenced.
373 this.Core.CreateSimpleReference(sourceLineNumbers, "CustomAction", "WixDependencyCheck_ARM"); 371 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixDependencyCheck_ARM");
374 } 372 }
375 else 373 else
376 { 374 {
377 // All other supported platforms use x86. 375 // All other supported platforms use x86.
378 this.Core.CreateSimpleReference(sourceLineNumbers, "CustomAction", "WixDependencyCheck"); 376 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixDependencyCheck");
379 } 377 }
380 378
381 // Generate registry rows for the provider using binder properties. 379 // Generate registry rows for the provider using binder properties.
382 string keyProvides = String.Concat(DependencyCommon.RegistryRoot, key); 380 string keyProvides = String.Concat(DependencyCommon.RegistryRoot, key);
383 381
384 row = this.Core.CreateRow(sourceLineNumbers, "Registry", this.Core.CreateIdentifier("reg", id.Id, "(Default)")); 382 row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "Registry", this.ParseHelper.CreateIdentifier("reg", id.Id, "(Default)"));
385 row[1] = -1; 383 row.Set(1, -1);
386 row[2] = keyProvides; 384 row.Set(2, keyProvides);
387 row[3] = null; 385 row.Set(4, "[ProductCode]");
388 row[4] = "[ProductCode]"; 386 row.Set(5, parentId);
389 row[5] = parentId;
390 387
391 // Use the Version registry value and use that as a potential key path. 388 // Use the Version registry value and use that as a potential key path.
392 Identifier idVersion = this.Core.CreateIdentifier("reg", id.Id, "Version"); 389 Identifier idVersion = this.ParseHelper.CreateIdentifier("reg", id.Id, "Version");
393 keyPath = new ComponentKeyPath() { Id = idVersion.Id, Explicit = false, Type = ComponentKeyPathType.Registry }; 390 keyPath = new ComponentKeyPath() { Id = idVersion.Id, Explicit = false, Type = ComponentKeyPathType.Registry };
394 391
395 row = this.Core.CreateRow(sourceLineNumbers, "Registry", idVersion); 392 row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "Registry", idVersion);
396 row[1] = -1; 393 row.Set(1, -1);
397 row[2] = keyProvides; 394 row.Set(2, keyProvides);
398 row[3] = "Version"; 395 row.Set(3, "Version");
399 row[4] = !String.IsNullOrEmpty(version) ? version : "[ProductVersion]"; 396 row.Set(4, !String.IsNullOrEmpty(version) ? version : "[ProductVersion]");
400 row[5] = parentId; 397 row.Set(5, parentId);
401 398
402 row = this.Core.CreateRow(sourceLineNumbers, "Registry", this.Core.CreateIdentifier("reg", id.Id, "DisplayName")); 399 row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "Registry", this.ParseHelper.CreateIdentifier("reg", id.Id, "DisplayName"));
403 row[1] = -1; 400 row.Set(1, -1);
404 row[2] = keyProvides; 401 row.Set(2, keyProvides);
405 row[3] = "DisplayName"; 402 row.Set(3, "DisplayName");
406 row[4] = !String.IsNullOrEmpty(displayName) ? displayName : "[ProductName]"; 403 row.Set(4, !String.IsNullOrEmpty(displayName) ? displayName : "[ProductName]");
407 row[5] = parentId; 404 row.Set(5, parentId);
408 405
409 if (0 != attributes) 406 if (0 != attributes)
410 { 407 {
411 row = this.Core.CreateRow(sourceLineNumbers, "Registry", this.Core.CreateIdentifier("reg", id.Id, "Attributes")); 408 row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "Registry", this.ParseHelper.CreateIdentifier("reg", id.Id, "Attributes"));
412 row[1] = -1; 409 row.Set(1, -1);
413 row[2] = keyProvides; 410 row.Set(2, keyProvides);
414 row[3] = "Attributes"; 411 row.Set(3, "Attributes");
415 row[4] = String.Concat("#", attributes.ToString(CultureInfo.InvariantCulture.NumberFormat)); 412 row.Set(4, String.Concat("#", attributes.ToString(CultureInfo.InvariantCulture.NumberFormat)));
416 row[5] = parentId; 413 row.Set(5, parentId);
417 } 414 }
418 } 415 }
419 } 416 }
@@ -427,9 +424,9 @@ namespace WixToolset.Extensions
427 /// <param name="node">The XML node for the Requires element.</param> 424 /// <param name="node">The XML node for the Requires element.</param>
428 /// <param name="providerId">The parent provider identifier.</param> 425 /// <param name="providerId">The parent provider identifier.</param>
429 /// <param name="requiresAction">Whether the Requires custom action should be referenced.</param> 426 /// <param name="requiresAction">Whether the Requires custom action should be referenced.</param>
430 private void ParseRequiresElement(XElement node, string providerId, bool requiresAction) 427 private void ParseRequiresElement(Intermediate intermediate, IntermediateSection section, XElement node, string providerId, bool requiresAction)
431 { 428 {
432 SourceLineNumber sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); 429 SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node);
433 Identifier id = null; 430 Identifier id = null;
434 string providerKey = null; 431 string providerKey = null;
435 string minVersion = null; 432 string minVersion = null;
@@ -444,41 +441,41 @@ namespace WixToolset.Extensions
444 switch (attrib.Name.LocalName) 441 switch (attrib.Name.LocalName)
445 { 442 {
446 case "Id": 443 case "Id":
447 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); 444 id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib);
448 break; 445 break;
449 case "ProviderKey": 446 case "ProviderKey":
450 providerKey = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 447 providerKey = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
451 break; 448 break;
452 case "Minimum": 449 case "Minimum":
453 minVersion = this.Core.GetAttributeVersionValue(sourceLineNumbers, attrib); 450 minVersion = this.ParseHelper.GetAttributeVersionValue(sourceLineNumbers, attrib);
454 break; 451 break;
455 case "Maximum": 452 case "Maximum":
456 maxVersion = this.Core.GetAttributeVersionValue(sourceLineNumbers, attrib); 453 maxVersion = this.ParseHelper.GetAttributeVersionValue(sourceLineNumbers, attrib);
457 break; 454 break;
458 case "IncludeMinimum": 455 case "IncludeMinimum":
459 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) 456 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
460 { 457 {
461 attributes |= DependencyCommon.RequiresAttributesMinVersionInclusive; 458 attributes |= DependencyCommon.RequiresAttributesMinVersionInclusive;
462 } 459 }
463 break; 460 break;
464 case "IncludeMaximum": 461 case "IncludeMaximum":
465 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) 462 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
466 { 463 {
467 attributes |= DependencyCommon.RequiresAttributesMaxVersionInclusive; 464 attributes |= DependencyCommon.RequiresAttributesMaxVersionInclusive;
468 } 465 }
469 break; 466 break;
470 default: 467 default:
471 this.Core.UnexpectedAttribute(node, attrib); 468 this.ParseHelper.UnexpectedAttribute(node, attrib);
472 break; 469 break;
473 } 470 }
474 } 471 }
475 else 472 else
476 { 473 {
477 this.Core.ParseExtensionAttribute(node, attrib); 474 this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, node, attrib);
478 } 475 }
479 } 476 }
480 477
481 this.Core.ParseForExtensionElements(node); 478 this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, node);
482 479
483 if (null == id) 480 if (null == id)
484 { 481 {
@@ -486,18 +483,18 @@ namespace WixToolset.Extensions
486 // element will be necessary and the Id attribute will be required. 483 // element will be necessary and the Id attribute will be required.
487 if (!String.IsNullOrEmpty(providerId)) 484 if (!String.IsNullOrEmpty(providerId))
488 { 485 {
489 id = this.Core.CreateIdentifier("dep", node.Name.LocalName, providerKey); 486 id = this.ParseHelper.CreateIdentifier("dep", node.Name.LocalName, providerKey);
490 } 487 }
491 else 488 else
492 { 489 {
493 this.Core.OnMessage(WixErrors.ExpectedAttributeWhenElementNotUnderElement(sourceLineNumbers, node.Name.LocalName, "Id", "Provides")); 490 this.Messaging.Write(ErrorMessages.ExpectedAttributeWhenElementNotUnderElement(sourceLineNumbers, node.Name.LocalName, "Id", "Provides"));
494 id = Identifier.Invalid; 491 id = Identifier.Invalid;
495 } 492 }
496 } 493 }
497 494
498 if (String.IsNullOrEmpty(providerKey)) 495 if (String.IsNullOrEmpty(providerKey))
499 { 496 {
500 this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "ProviderKey")); 497 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "ProviderKey"));
501 } 498 }
502 // Make sure the key does not contain any illegal characters. 499 // Make sure the key does not contain any illegal characters.
503 else if (0 <= (illegalChar = providerKey.IndexOfAny(DependencyCommon.InvalidCharacters))) 500 else if (0 <= (illegalChar = providerKey.IndexOfAny(DependencyCommon.InvalidCharacters)))
@@ -505,44 +502,44 @@ namespace WixToolset.Extensions
505 StringBuilder sb = new StringBuilder(DependencyCommon.InvalidCharacters.Length * 2); 502 StringBuilder sb = new StringBuilder(DependencyCommon.InvalidCharacters.Length * 2);
506 Array.ForEach<char>(DependencyCommon.InvalidCharacters, c => sb.Append(c).Append(" ")); 503 Array.ForEach<char>(DependencyCommon.InvalidCharacters, c => sb.Append(c).Append(" "));
507 504
508 this.Core.OnMessage(DependencyErrors.IllegalCharactersInProvider(sourceLineNumbers, "ProviderKey", providerKey[illegalChar], sb.ToString())); 505 this.Messaging.Write(DependencyErrors.IllegalCharactersInProvider(sourceLineNumbers, "ProviderKey", providerKey[illegalChar], sb.ToString()));
509 } 506 }
510 507
511 508
512 if (!this.Core.EncounteredError) 509 if (!this.Messaging.EncounteredError)
513 { 510 {
514 // Reference the Require custom action if required. 511 // Reference the Require custom action if required.
515 if (requiresAction) 512 if (requiresAction)
516 { 513 {
517 if (Platform.ARM == this.Core.CurrentPlatform) 514 if (Platform.ARM == this.Context.Platform)
518 { 515 {
519 // Ensure the ARM version of the CA is referenced. 516 // Ensure the ARM version of the CA is referenced.
520 this.Core.CreateSimpleReference(sourceLineNumbers, "CustomAction", "WixDependencyRequire_ARM"); 517 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixDependencyRequire_ARM");
521 } 518 }
522 else 519 else
523 { 520 {
524 // All other supported platforms use x86. 521 // All other supported platforms use x86.
525 this.Core.CreateSimpleReference(sourceLineNumbers, "CustomAction", "WixDependencyRequire"); 522 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixDependencyRequire");
526 } 523 }
527 } 524 }
528 525
529 Row row = this.Core.CreateRow(sourceLineNumbers, "WixDependency", id); 526 var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixDependency", id);
530 row[1] = providerKey; 527 row.Set(1, providerKey);
531 row[2] = minVersion; 528 row.Set(2, minVersion);
532 row[3] = maxVersion; 529 row.Set(3, maxVersion);
533 530
534 if (0 != attributes) 531 if (0 != attributes)
535 { 532 {
536 row[4] = attributes; 533 row.Set(4, attributes);
537 } 534 }
538 535
539 // Create the relationship between this WixDependency row and the WixDependencyProvider row. 536 // Create the relationship between this WixDependency row and the WixDependencyProvider row.
540 if (!String.IsNullOrEmpty(providerId)) 537 if (!String.IsNullOrEmpty(providerId))
541 { 538 {
542 // Create the relationship between the WixDependency row and the parent WixDependencyProvider row. 539 // Create the relationship between the WixDependency row and the parent WixDependencyProvider row.
543 row = this.Core.CreateRow(sourceLineNumbers, "WixDependencyRef"); 540 row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixDependencyRef");
544 row[0] = providerId; 541 row.Set(0, providerId);
545 row[1] = id.Id; 542 row.Set(1, id.Id);
546 } 543 }
547 } 544 }
548 } 545 }
@@ -553,9 +550,9 @@ namespace WixToolset.Extensions
553 /// <param name="node">The XML node for the RequiresRef element.</param> 550 /// <param name="node">The XML node for the RequiresRef element.</param>
554 /// <param name="providerId">The parent provider identifier.</param> 551 /// <param name="providerId">The parent provider identifier.</param>
555 /// <param name="requiresAction">Whether the Requires custom action should be referenced.</param> 552 /// <param name="requiresAction">Whether the Requires custom action should be referenced.</param>
556 private void ParseRequiresRefElement(XElement node, string providerId, bool requiresAction) 553 private void ParseRequiresRefElement(Intermediate intermediate, IntermediateSection section, XElement node, string providerId, bool requiresAction)
557 { 554 {
558 SourceLineNumber sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); 555 SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node);
559 string id = null; 556 string id = null;
560 557
561 foreach (XAttribute attrib in node.Attributes()) 558 foreach (XAttribute attrib in node.Attributes())
@@ -565,50 +562,50 @@ namespace WixToolset.Extensions
565 switch (attrib.Name.LocalName) 562 switch (attrib.Name.LocalName)
566 { 563 {
567 case "Id": 564 case "Id":
568 id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); 565 id = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
569 break; 566 break;
570 default: 567 default:
571 this.Core.UnexpectedAttribute(node, attrib); 568 this.ParseHelper.UnexpectedAttribute(node, attrib);
572 break; 569 break;
573 } 570 }
574 } 571 }
575 else 572 else
576 { 573 {
577 this.Core.ParseExtensionAttribute(node, attrib); 574 this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, node, attrib);
578 } 575 }
579 } 576 }
580 577
581 this.Core.ParseForExtensionElements(node); 578 this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, node);
582 579
583 if (String.IsNullOrEmpty(id)) 580 if (String.IsNullOrEmpty(id))
584 { 581 {
585 this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); 582 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id"));
586 } 583 }
587 584
588 if (!this.Core.EncounteredError) 585 if (!this.Messaging.EncounteredError)
589 { 586 {
590 // Reference the Require custom action if required. 587 // Reference the Require custom action if required.
591 if (requiresAction) 588 if (requiresAction)
592 { 589 {
593 if (Platform.ARM == this.Core.CurrentPlatform) 590 if (Platform.ARM == this.Context.Platform)
594 { 591 {
595 // Ensure the ARM version of the CA is referenced. 592 // Ensure the ARM version of the CA is referenced.
596 this.Core.CreateSimpleReference(sourceLineNumbers, "CustomAction", "WixDependencyRequire_ARM"); 593 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixDependencyRequire_ARM");
597 } 594 }
598 else 595 else
599 { 596 {
600 // All other supported platforms use x86. 597 // All other supported platforms use x86.
601 this.Core.CreateSimpleReference(sourceLineNumbers, "CustomAction", "WixDependencyRequire"); 598 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixDependencyRequire");
602 } 599 }
603 } 600 }
604 601
605 // Create a link dependency on the row that contains information we'll need during bind. 602 // Create a link dependency on the row that contains information we'll need during bind.
606 this.Core.CreateSimpleReference(sourceLineNumbers, "WixDependency", id); 603 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "WixDependency", id);
607 604
608 // Create the relationship between the WixDependency row and the parent WixDependencyProvider row. 605 // Create the relationship between the WixDependency row and the parent WixDependencyProvider row.
609 Row row = this.Core.CreateRow(sourceLineNumbers, "WixDependencyRef"); 606 var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixDependencyRef");
610 row[0] = providerId; 607 row.Set(0, providerId);
611 row[1] = id; 608 row.Set(1, id);
612 } 609 }
613 } 610 }
614 } 611 }
diff --git a/src/wixext/DependencyDecompiler.cs b/src/wixext/DependencyDecompiler.cs
index 3013cf7c..31de3097 100644
--- a/src/wixext/DependencyDecompiler.cs
+++ b/src/wixext/DependencyDecompiler.cs
@@ -1,7 +1,8 @@
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. 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 2
3namespace WixToolset.Extensions 3namespace WixToolset.Dependency
4{ 4{
5#if TODO_CONSIDER_DECOMPILER
5 using System; 6 using System;
6 using System.Collections.Generic; 7 using System.Collections.Generic;
7 using System.Collections.ObjectModel; 8 using System.Collections.ObjectModel;
@@ -342,4 +343,5 @@ namespace WixToolset.Extensions
342 } 343 }
343 } 344 }
344 } 345 }
346#endif
345} 347}
diff --git a/src/wixext/DependencyErrors.cs b/src/wixext/DependencyErrors.cs
new file mode 100644
index 00000000..83c0986a
--- /dev/null
+++ b/src/wixext/DependencyErrors.cs
@@ -0,0 +1,37 @@
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
3namespace WixToolset.Dependency
4{
5 using System;
6 using System.Resources;
7 using WixToolset.Data;
8
9 public static class DependencyErrors
10 {
11 public static Message IllegalCharactersInProvider(SourceLineNumber sourceLineNumbers, string attributeName, Char illegalChar, string illegalChars)
12 {
13 return Message(sourceLineNumbers, Ids.IllegalCharactersInProvider, "The provider key authored into the {0} attribute contains an illegal character, '{1}'. Please author the provider key without any of the following characters: {2}", attributeName, illegalChar, illegalChars);
14 }
15
16 public static Message ReservedValue(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string attributeValue)
17 {
18 return Message(sourceLineNumbers, Ids.ReservedValue, "The {0}/@{1} attribute value '{2}' is reserved and cannot be used here. Please choose a different value.", elementName, attributeName, attributeValue);
19 }
20
21 private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args)
22 {
23 return new Message(sourceLineNumber, MessageLevel.Error, (int)id, format, args);
24 }
25
26 private static Message Message(SourceLineNumber sourceLineNumber, Ids id, ResourceManager resourceManager, string resourceName, params object[] args)
27 {
28 return new Message(sourceLineNumber, MessageLevel.Error, (int)id, resourceManager, resourceName, args);
29 }
30
31 public enum Ids
32 {
33 IllegalCharactersInProvider = 5400,
34 ReservedValue = 5401,
35 }
36 }
37}
diff --git a/src/wixext/DependencyExtension.csproj b/src/wixext/DependencyExtension.csproj
deleted file mode 100644
index 050e8662..00000000
--- a/src/wixext/DependencyExtension.csproj
+++ /dev/null
@@ -1,50 +0,0 @@
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<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
6 <PropertyGroup>
7 <ProjectGuid>{A0B6D3F1-AE5E-423B-BA92-60C9926CA498}</ProjectGuid>
8 <AssemblyName>WixDependencyExtension</AssemblyName>
9 <OutputType>Library</OutputType>
10 <RootNamespace>WixToolset.Extensions</RootNamespace>
11 </PropertyGroup>
12 <ItemGroup>
13 <Compile Include="AssemblyInfo.cs" />
14 <Compile Include="DependencyBinder.cs" />
15 <Compile Include="DependencyCommon.cs" />
16 <Compile Include="DependencyCompiler.cs" />
17 <Compile Include="DependencyDecompiler.cs" />
18 <Compile Include="DependencyExtensionData.cs" />
19 <EmbeddedFlattenedResource Include="Data\tables.xml">
20 <LogicalName>$(RootNamespace).Data.tables.xml</LogicalName>
21 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
22 </EmbeddedFlattenedResource>
23 <MsgGenSource Include="Data\messages.xml">
24 <ResourcesLogicalName>$(RootNamespace).Data.Messages.resources</ResourcesLogicalName>
25 </MsgGenSource>
26 <EmbeddedFlattenedResource Include="Xsd\Dependency.xsd">
27 <LogicalName>$(RootNamespace).Xsd.Dependency.xsd</LogicalName>
28 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
29 </EmbeddedFlattenedResource>
30 <XsdGenSource Include="Xsd\Dependency.xsd">
31 <CommonNamespace>WixToolset.Data.Serialize</CommonNamespace>
32 <Namespace>WixToolset.Extensions.Serialize.Dependency</Namespace>
33 </XsdGenSource>
34 <EmbeddedResource Include="$(OutputPath)Dependency.wixlib">
35 <Link>Data\Dependency.wixlib</Link>
36 </EmbeddedResource>
37 </ItemGroup>
38 <ItemGroup>
39 <Reference Include="System" />
40 <Reference Include="System.Xml" />
41 <Reference Include="System.Xml.Linq" />
42 <ProjectReference Include="..\..\..\libs\WixToolset.Data\WixToolset.Data.csproj" />
43 <ProjectReference Include="..\..\..\libs\WixToolset.Extensibility\WixToolset.Extensibility.csproj" />
44 <ProjectReference Include="..\..\..\tools\wix\Wix.csproj" />
45 <ProjectReference Include="..\wixlib\DependencyExtension.wixproj">
46 <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
47 </ProjectReference>
48 </ItemGroup>
49 <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), wix.proj))\tools\WixBuild.targets" />
50</Project>
diff --git a/src/wixext/DependencyExtensionData.cs b/src/wixext/DependencyExtensionData.cs
index da2215ce..e92aeff1 100644
--- a/src/wixext/DependencyExtensionData.cs
+++ b/src/wixext/DependencyExtensionData.cs
@@ -1,64 +1,30 @@
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. 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 2
3namespace WixToolset.Extensions 3namespace WixToolset.Dependency
4{ 4{
5 using System;
6 using System.Reflection;
7 using WixToolset.Data; 5 using WixToolset.Data;
8 using WixToolset.Extensibility; 6 using WixToolset.Extensibility;
9 7
10 /// <summary> 8 /// <summary>
11 /// The WiX toolset dependency extension. 9 /// The WiX Toolset Dependency Extension.
12 /// </summary> 10 /// </summary>
13 public sealed class DependencyExtensionData : ExtensionData 11 public sealed class DependencyExtensionData : BaseExtensionData
14 { 12 {
15 /// <summary> 13 /// <summary>
16 /// Gets the default culture. 14 /// Gets the default culture.
17 /// </summary> 15 /// </summary>
18 /// <value>The default culture.</value> 16 /// <value>The default culture.</value>
19 public override string DefaultCulture 17 public override string DefaultCulture => "en-US";
20 {
21 get { return "en-us"; }
22 }
23
24 /// <summary>
25 /// Gets the optional table definitions for this extension.
26 /// </summary>
27 /// <value>The optional table definitions for this extension.</value>
28 public override TableDefinitionCollection TableDefinitions
29 {
30 get
31 {
32 return DependencyExtensionData.GetExtensionTableDefinitions();
33 }
34 }
35
36 /// <summary>
37 /// Gets the library associated with this extension.
38 /// </summary>
39 /// <param name="tableDefinitions">The table definitions to use while loading the library.</param>
40 /// <returns>The loaded library.</returns>
41 public override Library GetLibrary(TableDefinitionCollection tableDefinitions)
42 {
43 return DependencyExtensionData.GetExtensionLibrary(tableDefinitions);
44 }
45 18
46 /// <summary> 19 public override bool TryGetTupleDefinitionByName(string name, out IntermediateTupleDefinition tupleDefinition)
47 /// Internal mechanism to access the extension's table definitions.
48 /// </summary>
49 /// <returns>Extension's table definitions.</returns>
50 internal static TableDefinitionCollection GetExtensionTableDefinitions()
51 { 20 {
52 return ExtensionData.LoadTableDefinitionHelper(Assembly.GetExecutingAssembly(), "WixToolset.Extensions.Data.tables.xml"); 21 tupleDefinition = DependencyTupleDefinitions.ByName(name);
22 return tupleDefinition != null;
53 } 23 }
54 24
55 /// <summary> 25 public override Intermediate GetLibrary(ITupleDefinitionCreator tupleDefinitions)
56 /// Internal mechanism to access the extension's library.
57 /// </summary>
58 /// <returns>Extension's library.</returns>
59 internal static Library GetExtensionLibrary(TableDefinitionCollection tableDefinitions)
60 { 26 {
61 return ExtensionData.LoadLibraryHelper(Assembly.GetExecutingAssembly(), "WixToolset.Extensions.Data.Dependency.wixlib", tableDefinitions); 27 return Intermediate.Load(typeof(DependencyExtensionData).Assembly, "WixToolset.Dependency.dependency.wixlib", tupleDefinitions);
62 } 28 }
63 } 29 }
64} 30}
diff --git a/src/wixext/DependencyExtensionFactory.cs b/src/wixext/DependencyExtensionFactory.cs
new file mode 100644
index 00000000..c5b89658
--- /dev/null
+++ b/src/wixext/DependencyExtensionFactory.cs
@@ -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
3namespace WixToolset.Dependency
4{
5 using System;
6 using System.Collections.Generic;
7 using WixToolset.Extensibility;
8
9 public class DependencyExtensionFactory : BaseExtensionFactory
10 {
11 protected override IEnumerable<Type> ExtensionTypes => new[]
12 {
13 typeof(DependencyCompiler),
14 typeof(DependencyExtensionData),
15 typeof(DependencyWindowsInstallerBackendBinderExtension),
16 };
17 }
18}
diff --git a/src/wixext/DependencyWarnings.cs b/src/wixext/DependencyWarnings.cs
new file mode 100644
index 00000000..802edc22
--- /dev/null
+++ b/src/wixext/DependencyWarnings.cs
@@ -0,0 +1,60 @@
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
3namespace WixToolset.Dependency
4{
5 using System;
6 using System.Resources;
7 using WixToolset.Data;
8
9 public static class DependencyWarnings
10 {
11 public static Message DiscouragedVersionAttribute(SourceLineNumber sourceLineNumbers)
12 {
13 return Message(sourceLineNumbers, Ids.DiscouragedVersionAttribute, "The Provides/@Version attribute should not be specified in an MSI package. The ProductVersion will be used by default.");
14 }
15
16 public static Message DiscouragedVersionAttribute(SourceLineNumber sourceLineNumbers, string id)
17 {
18 return Message(sourceLineNumbers, Ids.DiscouragedVersionAttribute, "The Provides/@Version attribute should not be specified for MSI package {0}. The ProductVersion will be used by default.", id);
19 }
20
21 public static Message PropertyRemoved(string name)
22 {
23 return Message(null, Ids.PropertyRemoved, "The property {0} was authored in the package with a value and will be removed. The property should not be authored.", name);
24 }
25
26 public static Message ProvidesKeyNotFound(SourceLineNumber sourceLineNumbers, string id)
27 {
28 return Message(sourceLineNumbers, Ids.ProvidesKeyNotFound, "The provider key with identifier {0} was not found in the WixDependencyProvider table. Related registry rows will not be removed from authoring.", id);
29 }
30
31 public static Message RequiresKeyNotFound(SourceLineNumber sourceLineNumbers, string id)
32 {
33 return Message(sourceLineNumbers, Ids.RequiresKeyNotFound, "The dependency key with identifier {0} was not found in the WixDependency table. Related registry rows will not be removed from authoring.", id);
34 }
35
36 public static Message Win64Component(SourceLineNumber sourceLineNumbers, string componentId)
37 {
38 return Message(sourceLineNumbers, Ids.Win64Component, "The Provides element should not be authored in the 64-bit component with identifier {0}. The dependency feature may not work if installing this package on 64-bit Windows operating systems prior to Windows 7 and Windows Server 2008 R2. Set the Component/@Win64 attribute to \"no\" to make sure the dependency feature works correctly on all supported operating systems.", componentId);
39 }
40
41 private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args)
42 {
43 return new Message(sourceLineNumber, MessageLevel.Warning, (int)id, format, args);
44 }
45
46 private static Message Message(SourceLineNumber sourceLineNumber, Ids id, ResourceManager resourceManager, string resourceName, params object[] args)
47 {
48 return new Message(sourceLineNumber, MessageLevel.Warning, (int)id, resourceManager, resourceName, args);
49 }
50
51 public enum Ids
52 {
53 ProvidesKeyNotFound = 5431,
54 RequiresKeyNotFound = 5432,
55 PropertyRemoved = 5433,
56 DiscouragedVersionAttribute = 5434,
57 Win64Component = 5435,
58 }
59 }
60}
diff --git a/src/wixext/DependencyBinder.cs b/src/wixext/DependencyWindowsInstallerBackendBinderExtension.cs
index 13fea203..485453a1 100644
--- a/src/wixext/DependencyBinder.cs
+++ b/src/wixext/DependencyWindowsInstallerBackendBinderExtension.cs
@@ -1,24 +1,35 @@
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. 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 2
3namespace WixToolset.Extensions 3namespace WixToolset.Dependency
4{ 4{
5 using System; 5 using System.Linq;
6 using System.Collections.ObjectModel; 6 using System.Xml;
7 using System.Globalization; 7 using WixToolset.Data.WindowsInstaller;
8 using WixToolset.Data;
9 using WixToolset.Extensibility; 8 using WixToolset.Extensibility;
10 9
11 /// <summary> 10 public class DependencyWindowsInstallerBackendBinderExtension : BaseWindowsInstallerBackendBinderExtension
12 /// The compiler for the WiX toolset dependency extension.
13 /// </summary>
14 public sealed class DependencyBinder : BinderExtension
15 { 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(DependencyWindowsInstallerBackendBinderExtension).Assembly.GetManifestResourceStream("WixToolset.Dependency.tables.xml"))
19 using (var reader = XmlReader.Create(resourceStream))
20 {
21 var tables = TableDefinitionCollection.Load(reader);
22 return tables.ToArray();
23 }
24 }
25
26#if TODO_TAG_BINDER_EXTENSION
16 private Output output; 27 private Output output;
17 28
18 /// <summary> 29 /// <summary>
19 /// Called after all output changes occur and right before the output is bound into its final format. 30 /// Called after all output changes occur and right before the output is bound into its final format.
20 /// </summary> 31 /// </summary>
21 public override void Finish(Output output) 32 public void Finish(Output output)
22 { 33 {
23 // Only process MSI packages. 34 // Only process MSI packages.
24 if (OutputType.Product != output.Type) 35 if (OutputType.Product != output.Type)
@@ -165,5 +176,6 @@ namespace WixToolset.Extensions
165 return row.GetPrimaryKey('/'); 176 return row.GetPrimaryKey('/');
166 } 177 }
167 } 178 }
179#endif
168 } 180 }
169} 181}
diff --git a/src/wixext/Tuples/DependencyTupleDefinitions.cs b/src/wixext/Tuples/DependencyTupleDefinitions.cs
new file mode 100644
index 00000000..fdd3f0b5
--- /dev/null
+++ b/src/wixext/Tuples/DependencyTupleDefinitions.cs
@@ -0,0 +1,47 @@
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
3namespace WixToolset.Dependency
4{
5 using System;
6 using WixToolset.Data;
7
8 public enum DependencyTupleDefinitionType
9 {
10 WixDependency,
11 WixDependencyProvider,
12 WixDependencyRef,
13 }
14
15 public static partial class DependencyTupleDefinitions
16 {
17 public static readonly Version Version = new Version("4.0.0");
18
19 public static IntermediateTupleDefinition ByName(string name)
20 {
21 if (!Enum.TryParse(name, out DependencyTupleDefinitionType type))
22 {
23 return null;
24 }
25
26 return ByType(type);
27 }
28
29 public static IntermediateTupleDefinition ByType(DependencyTupleDefinitionType type)
30 {
31 switch (type)
32 {
33 case DependencyTupleDefinitionType.WixDependency:
34 return DependencyTupleDefinitions.WixDependency;
35
36 case DependencyTupleDefinitionType.WixDependencyProvider:
37 return DependencyTupleDefinitions.WixDependencyProvider;
38
39 case DependencyTupleDefinitionType.WixDependencyRef:
40 return DependencyTupleDefinitions.WixDependencyRef;
41
42 default:
43 throw new ArgumentOutOfRangeException(nameof(type));
44 }
45 }
46 }
47}
diff --git a/src/wixext/Tuples/WixDependencyProviderTuple.cs b/src/wixext/Tuples/WixDependencyProviderTuple.cs
new file mode 100644
index 00000000..2fd6a805
--- /dev/null
+++ b/src/wixext/Tuples/WixDependencyProviderTuple.cs
@@ -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
3namespace WixToolset.Dependency
4{
5 using WixToolset.Data;
6 using WixToolset.Dependency.Tuples;
7
8 public static partial class DependencyTupleDefinitions
9 {
10 public static readonly IntermediateTupleDefinition WixDependencyProvider = new IntermediateTupleDefinition(
11 DependencyTupleDefinitionType.WixDependencyProvider.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(WixDependencyProviderTupleFields.WixDependencyProvider), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(WixDependencyProviderTupleFields.Component_), IntermediateFieldType.String),
16 new IntermediateFieldDefinition(nameof(WixDependencyProviderTupleFields.ProviderKey), IntermediateFieldType.String),
17 new IntermediateFieldDefinition(nameof(WixDependencyProviderTupleFields.Version), IntermediateFieldType.String),
18 new IntermediateFieldDefinition(nameof(WixDependencyProviderTupleFields.DisplayName), IntermediateFieldType.String),
19 new IntermediateFieldDefinition(nameof(WixDependencyProviderTupleFields.Attributes), IntermediateFieldType.Number),
20 },
21 typeof(WixDependencyProviderTuple));
22 }
23}
24
25namespace WixToolset.Dependency.Tuples
26{
27 using WixToolset.Data;
28
29 public enum WixDependencyProviderTupleFields
30 {
31 WixDependencyProvider,
32 Component_,
33 ProviderKey,
34 Version,
35 DisplayName,
36 Attributes,
37 }
38
39 public class WixDependencyProviderTuple : IntermediateTuple
40 {
41 public WixDependencyProviderTuple() : base(DependencyTupleDefinitions.WixDependencyProvider, null, null)
42 {
43 }
44
45 public WixDependencyProviderTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(DependencyTupleDefinitions.WixDependencyProvider, sourceLineNumber, id)
46 {
47 }
48
49 public IntermediateField this[WixDependencyProviderTupleFields index] => this.Fields[(int)index];
50
51 public string WixDependencyProvider
52 {
53 get => this.Fields[(int)WixDependencyProviderTupleFields.WixDependencyProvider].AsString();
54 set => this.Set((int)WixDependencyProviderTupleFields.WixDependencyProvider, value);
55 }
56
57 public string Component_
58 {
59 get => this.Fields[(int)WixDependencyProviderTupleFields.Component_].AsString();
60 set => this.Set((int)WixDependencyProviderTupleFields.Component_, value);
61 }
62
63 public string ProviderKey
64 {
65 get => this.Fields[(int)WixDependencyProviderTupleFields.ProviderKey].AsString();
66 set => this.Set((int)WixDependencyProviderTupleFields.ProviderKey, value);
67 }
68
69 public string Version
70 {
71 get => this.Fields[(int)WixDependencyProviderTupleFields.Version].AsString();
72 set => this.Set((int)WixDependencyProviderTupleFields.Version, value);
73 }
74
75 public string DisplayName
76 {
77 get => this.Fields[(int)WixDependencyProviderTupleFields.DisplayName].AsString();
78 set => this.Set((int)WixDependencyProviderTupleFields.DisplayName, value);
79 }
80
81 public int Attributes
82 {
83 get => this.Fields[(int)WixDependencyProviderTupleFields.Attributes].AsNumber();
84 set => this.Set((int)WixDependencyProviderTupleFields.Attributes, value);
85 }
86 }
87} \ No newline at end of file
diff --git a/src/wixext/Tuples/WixDependencyRefTuple.cs b/src/wixext/Tuples/WixDependencyRefTuple.cs
new file mode 100644
index 00000000..3e996f5f
--- /dev/null
+++ b/src/wixext/Tuples/WixDependencyRefTuple.cs
@@ -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
3namespace WixToolset.Dependency
4{
5 using WixToolset.Data;
6 using WixToolset.Dependency.Tuples;
7
8 public static partial class DependencyTupleDefinitions
9 {
10 public static readonly IntermediateTupleDefinition WixDependencyRef = new IntermediateTupleDefinition(
11 DependencyTupleDefinitionType.WixDependencyRef.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(WixDependencyRefTupleFields.WixDependencyProvider_), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(WixDependencyRefTupleFields.WixDependency_), IntermediateFieldType.String),
16 },
17 typeof(WixDependencyRefTuple));
18 }
19}
20
21namespace WixToolset.Dependency.Tuples
22{
23 using WixToolset.Data;
24
25 public enum WixDependencyRefTupleFields
26 {
27 WixDependencyProvider_,
28 WixDependency_,
29 }
30
31 public class WixDependencyRefTuple : IntermediateTuple
32 {
33 public WixDependencyRefTuple() : base(DependencyTupleDefinitions.WixDependencyRef, null, null)
34 {
35 }
36
37 public WixDependencyRefTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(DependencyTupleDefinitions.WixDependencyRef, sourceLineNumber, id)
38 {
39 }
40
41 public IntermediateField this[WixDependencyRefTupleFields index] => this.Fields[(int)index];
42
43 public string WixDependencyProvider_
44 {
45 get => this.Fields[(int)WixDependencyRefTupleFields.WixDependencyProvider_].AsString();
46 set => this.Set((int)WixDependencyRefTupleFields.WixDependencyProvider_, value);
47 }
48
49 public string WixDependency_
50 {
51 get => this.Fields[(int)WixDependencyRefTupleFields.WixDependency_].AsString();
52 set => this.Set((int)WixDependencyRefTupleFields.WixDependency_, value);
53 }
54 }
55} \ No newline at end of file
diff --git a/src/wixext/Tuples/WixDependencyTuple.cs b/src/wixext/Tuples/WixDependencyTuple.cs
new file mode 100644
index 00000000..81e05ad1
--- /dev/null
+++ b/src/wixext/Tuples/WixDependencyTuple.cs
@@ -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
3namespace WixToolset.Dependency
4{
5 using WixToolset.Data;
6 using WixToolset.Dependency.Tuples;
7
8 public static partial class DependencyTupleDefinitions
9 {
10 public static readonly IntermediateTupleDefinition WixDependency = new IntermediateTupleDefinition(
11 DependencyTupleDefinitionType.WixDependency.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(WixDependencyTupleFields.WixDependency), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(WixDependencyTupleFields.ProviderKey), IntermediateFieldType.String),
16 new IntermediateFieldDefinition(nameof(WixDependencyTupleFields.MinVersion), IntermediateFieldType.String),
17 new IntermediateFieldDefinition(nameof(WixDependencyTupleFields.MaxVersion), IntermediateFieldType.String),
18 new IntermediateFieldDefinition(nameof(WixDependencyTupleFields.Attributes), IntermediateFieldType.Number),
19 },
20 typeof(WixDependencyTuple));
21 }
22}
23
24namespace WixToolset.Dependency.Tuples
25{
26 using WixToolset.Data;
27
28 public enum WixDependencyTupleFields
29 {
30 WixDependency,
31 ProviderKey,
32 MinVersion,
33 MaxVersion,
34 Attributes,
35 }
36
37 public class WixDependencyTuple : IntermediateTuple
38 {
39 public WixDependencyTuple() : base(DependencyTupleDefinitions.WixDependency, null, null)
40 {
41 }
42
43 public WixDependencyTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(DependencyTupleDefinitions.WixDependency, sourceLineNumber, id)
44 {
45 }
46
47 public IntermediateField this[WixDependencyTupleFields index] => this.Fields[(int)index];
48
49 public string WixDependency
50 {
51 get => this.Fields[(int)WixDependencyTupleFields.WixDependency].AsString();
52 set => this.Set((int)WixDependencyTupleFields.WixDependency, value);
53 }
54
55 public string ProviderKey
56 {
57 get => this.Fields[(int)WixDependencyTupleFields.ProviderKey].AsString();
58 set => this.Set((int)WixDependencyTupleFields.ProviderKey, value);
59 }
60
61 public string MinVersion
62 {
63 get => this.Fields[(int)WixDependencyTupleFields.MinVersion].AsString();
64 set => this.Set((int)WixDependencyTupleFields.MinVersion, value);
65 }
66
67 public string MaxVersion
68 {
69 get => this.Fields[(int)WixDependencyTupleFields.MaxVersion].AsString();
70 set => this.Set((int)WixDependencyTupleFields.MaxVersion, value);
71 }
72
73 public int Attributes
74 {
75 get => this.Fields[(int)WixDependencyTupleFields.Attributes].AsNumber();
76 set => this.Set((int)WixDependencyTupleFields.Attributes, value);
77 }
78 }
79} \ No newline at end of file
diff --git a/src/wixext/WixToolset.Dependency.wixext.csproj b/src/wixext/WixToolset.Dependency.wixext.csproj
new file mode 100644
index 00000000..7e9f1e3a
--- /dev/null
+++ b/src/wixext/WixToolset.Dependency.wixext.csproj
@@ -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<Project Sdk="Microsoft.NET.Sdk">
5 <PropertyGroup>
6 <TargetFramework>netstandard2.0</TargetFramework>
7 <RootNamespace>WixToolset.Dependency</RootNamespace>
8 <Description>WiX Toolset Dependency Extension</Description>
9 <Title>WiX Toolset Dependency Extension</Title>
10 <IsTool>true</IsTool>
11 <ContentTargetFolders>build</ContentTargetFolders>
12 </PropertyGroup>
13
14 <ItemGroup>
15 <Content Include="$(MSBuildThisFileName).targets" />
16 <Content Include="dependency.xsd" PackagePath="tools" />
17 <EmbeddedResource Include="tables.xml" />
18 <EmbeddedResource Include="$(OutputPath)..\dependency.wixlib" />
19 </ItemGroup>
20
21 <ItemGroup>
22 <PackageReference Include="WixToolset.Data" Version="4.0.*" PrivateAssets="all" />
23 <PackageReference Include="WixToolset.Extensibility" Version="4.0.*" PrivateAssets="all" />
24 </ItemGroup>
25
26 <ItemGroup>
27 <ProjectReference Include="..\wixlib\dependency.wixproj" ReferenceOutputAssembly="false" Condition=" '$(NCrunch)'=='' " />
28 </ItemGroup>
29
30 <ItemGroup>
31 <PackageReference Include="Nerdbank.GitVersioning" Version="2.1.65" PrivateAssets="all" />
32 </ItemGroup>
33</Project>
diff --git a/src/wixext/WixToolset.Dependency.wixext.targets b/src/wixext/WixToolset.Dependency.wixext.targets
new file mode 100644
index 00000000..494c0184
--- /dev/null
+++ b/src/wixext/WixToolset.Dependency.wixext.targets
@@ -0,0 +1,11 @@
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 <PropertyGroup>
6 <WixToolsetDepedencyWixextPath Condition=" '$(WixToolsetDepedencyWixextPath)' == '' ">$(MSBuildThisFileDirectory)..\tools\WixToolset.Depedency.wixext.dll</WixToolsetDepedencyWixextPath>
7 </PropertyGroup>
8 <ItemGroup>
9 <WixExtension Include="$(WixToolsetDepedencyWixextPath)" />
10 </ItemGroup>
11</Project>
diff --git a/src/wixext/messages.xml b/src/wixext/messages.xml
deleted file mode 100644
index bd6eb602..00000000
--- a/src/wixext/messages.xml
+++ /dev/null
@@ -1,60 +0,0 @@
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<Messages Namespace="WixToolset.Extensions" Resources="Data.Messages" xmlns="http://schemas.microsoft.com/genmsgs/2004/07/messages">
6 <Class Name="DependencyErrors" ContainerName="DependencyErrorEventArgs" BaseContainerName="MessageEventArgs">
7 <Message Id="IllegalCharactersInProvider" Number="5400">
8 <Instance>
9 The provider key authored into the {0} attribute contains an illegal character, '{1}'. Please author the provider key without any of the following characters: {2}
10 <Parameter Type="System.String" Name="attributeName" />
11 <Parameter Type="System.Char" Name="illegalChar" />
12 <Parameter Type="System.String" Name="illegalChars" />
13 </Instance>
14 </Message>
15 <Message Id="ReservedValue" Number="5401">
16 <Instance>
17 The {0}/@{1} attribute value '{2}' is reserved and cannot be used here. Please choose a different value.
18 <Parameter Type="System.String" Name="elementName" />
19 <Parameter Type="System.String" Name="attributeName" />
20 <Parameter Type="System.String" Name="attributeValue" />
21 </Instance>
22 </Message>
23 </Class>
24 <Class Name="DependencyWarnings" ContainerName="DependencyWarningEventArgs" BaseContainerName="MessageEventArgs">
25 <Message Id="ProvidesKeyNotFound" Number="5431">
26 <Instance>
27 The provider key with identifier {0} was not found in the WixDependencyProvider table. Related registry rows will not be removed from authoring.
28 <Parameter Type="System.String" Name="id" />
29 </Instance>
30 </Message>
31 <Message Id="RequiresKeyNotFound" Number="5432">
32 <Instance>
33 The dependency key with identifier {0} was not found in the WixDependency table. Related registry rows will not be removed from authoring.
34 <Parameter Type="System.String" Name="id" />
35 </Instance>
36 </Message>
37 <Message Id="PropertyRemoved" Number="5433" SourceLineNumbers="no">
38 <Instance>
39 The property {0} was authored in the package with a value and will be removed. The property should not be authored.
40 <Parameter Type="System.String" Name="name" />
41 </Instance>
42 </Message>
43 <Message Id="DiscouragedVersionAttribute" Number="5434">
44 <Instance>
45 The Provides/@Version attribute should not be specified in an MSI package. The ProductVersion will be used by default.
46 </Instance>
47 <Instance>
48 The Provides/@Version attribute should not be specified for MSI package {0}. The ProductVersion will be used by default.
49 <Parameter Type="System.String" Name="id" />
50 </Instance>
51 </Message>
52 <Message Id="Win64Component" Number="5435">
53 <Instance>
54 The Provides element should not be authored in the 64-bit component with identifier {0}. The dependency feature may not work if installing this package on 64-bit Windows operating systems prior to Windows 7 and Windows Server 2008 R2. Set the Component/@Win64 attribute to "no" to make sure the dependency feature works correctly on all supported operating systems.
55 <Parameter Type="System.String" Name="componentId" />
56 </Instance>
57 </Message>
58 </Class>
59 <Class Name="DependencyVerboses" ContainerName="DependencyVerboseEventArgs" BaseContainerName="MessageEventArgs" />
60</Messages>
diff --git a/src/wixlib/DependencyExtension.wixproj b/src/wixlib/DependencyExtension.wixproj
deleted file mode 100644
index e52218ed..00000000
--- a/src/wixlib/DependencyExtension.wixproj
+++ /dev/null
@@ -1,27 +0,0 @@
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<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
6 <PropertyGroup>
7 <ProjectGuid>{58ED0EC8-73F8-4EE1-8664-A53486D38EC8}</ProjectGuid>
8 <OutputName>dependency</OutputName>
9 <OutputType>Library</OutputType>
10 <BindFiles>true</BindFiles>
11 <Pedantic>true</Pedantic>
12 <SuppressSpecificWarnings>1086</SuppressSpecificWarnings>
13 <Cultures>en-us</Cultures>
14 </PropertyGroup>
15
16 <ItemGroup>
17 <Compile Include="DependencyExtension.wxs" />
18 <Compile Include="DependencyExtension_x86.wxs" />
19 <EmbeddedResource Include="en-us.wxl" />
20 </ItemGroup>
21
22 <ItemGroup>
23 <ProjectReference Include="..\ca\wixdepca.vcxproj" />
24 </ItemGroup>
25
26 <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), wix.proj))\tools\WixBuild.targets" />
27</Project>
diff --git a/src/wixlib/DependencyExtension_Platform.wxi b/src/wixlib/DependencyExtension_Platform.wxi
index d06b0055..7cd7ad96 100644
--- a/src/wixlib/DependencyExtension_Platform.wxi
+++ b/src/wixlib/DependencyExtension_Platform.wxi
@@ -5,7 +5,7 @@
5<Include xmlns="http://wixtoolset.org/schemas/v4/wxs"> 5<Include xmlns="http://wixtoolset.org/schemas/v4/wxs">
6 <?include caSuffix.wxi ?> 6 <?include caSuffix.wxi ?>
7 <Fragment> 7 <Fragment>
8 <CustomAction Id="WixDependencyRequire$(var.Suffix)" BinaryKey="WixDepCA$(var.Suffix)" DllEntry="WixDependencyRequire" Execute="immediate" Return="check" SuppressModularization="yes"/> 8 <CustomAction Id="WixDependencyRequire$(var.Suffix)" BinaryKey="DependencyCA$(var.Suffix)" DllEntry="WixDependencyRequire" Execute="immediate" Return="check" SuppressModularization="yes"/>
9 <InstallExecuteSequence> 9 <InstallExecuteSequence>
10 <Custom Action="WixDependencyRequire$(var.Suffix)" Before="WixDependencyCheck$(var.Suffix)" Overridable="yes"><![CDATA[NOT DISABLEDEPENDENCYCHECK]]></Custom> 10 <Custom Action="WixDependencyRequire$(var.Suffix)" Before="WixDependencyCheck$(var.Suffix)" Overridable="yes"><![CDATA[NOT DISABLEDEPENDENCYCHECK]]></Custom>
11 </InstallExecuteSequence> 11 </InstallExecuteSequence>
@@ -13,7 +13,7 @@
13 <PropertyRef Id="DISABLEDEPENDENCYCHECK"/> 13 <PropertyRef Id="DISABLEDEPENDENCYCHECK"/>
14 </Fragment> 14 </Fragment>
15 <Fragment> 15 <Fragment>
16 <CustomAction Id="WixDependencyCheck$(var.Suffix)" BinaryKey="WixDepCA$(var.Suffix)" DllEntry="WixDependencyCheck" Execute="immediate" Return="check" SuppressModularization="yes"/> 16 <CustomAction Id="WixDependencyCheck$(var.Suffix)" BinaryKey="DependencyCA$(var.Suffix)" DllEntry="WixDependencyCheck" Execute="immediate" Return="check" SuppressModularization="yes"/>
17 <InstallExecuteSequence> 17 <InstallExecuteSequence>
18 <Custom Action="WixDependencyCheck$(var.Suffix)" Before="InstallInitialize" Overridable="yes"><![CDATA[(REMOVE OR MsiPatchRemovalList) AND NOT (UPGRADINGPRODUCTCODE OR IGNOREDEPENDENCIES="ALL")]]></Custom> 18 <Custom Action="WixDependencyCheck$(var.Suffix)" Before="InstallInitialize" Overridable="yes"><![CDATA[(REMOVE OR MsiPatchRemovalList) AND NOT (UPGRADINGPRODUCTCODE OR IGNOREDEPENDENCIES="ALL")]]></Custom>
19 </InstallExecuteSequence> 19 </InstallExecuteSequence>
@@ -21,6 +21,6 @@
21 <PropertyRef Id="IGNOREDEPENDENCIES"/> 21 <PropertyRef Id="IGNOREDEPENDENCIES"/>
22 </Fragment> 22 </Fragment>
23 <Fragment> 23 <Fragment>
24 <Binary Id="WixDepCA$(var.Suffix)" SourceFile="!(bindpath.$(var.platform))wixdepca.dll"/> 24 <Binary Id="DependencyCA$(var.Suffix)" SourceFile="!(bindpath.$(var.platform))dependencyca.dll"/>
25 </Fragment> 25 </Fragment>
26</Include> 26</Include>
diff --git a/src/wixlib/caSuffix.wxi b/src/wixlib/caSuffix.wxi
new file mode 100644
index 00000000..a56a2393
--- /dev/null
+++ b/src/wixlib/caSuffix.wxi
@@ -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>
diff --git a/src/wixlib/caerr.wxi b/src/wixlib/caerr.wxi
new file mode 100644
index 00000000..141942f2
--- /dev/null
+++ b/src/wixlib/caerr.wxi
@@ -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
diff --git a/src/wixlib/dependency.wixproj b/src/wixlib/dependency.wixproj
new file mode 100644
index 00000000..6fa70e3d
--- /dev/null
+++ b/src/wixlib/dependency.wixproj
@@ -0,0 +1,43 @@
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" InitialTargets="EnsureWixToolsetInstalled" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="15.0">
4 <Import Project="..\..\packages\WixToolset.MSBuild.4.0.0-build-0005\build\WixToolset.MSBuild.props" Condition="Exists('..\..\packages\WixToolset.MSBuild.4.0.0-build-0005\build\WixToolset.MSBuild.props')" />
5 <Import Project="..\FindLocalWix.props" />
6 <PropertyGroup>
7 <ProjectGuid>{58ED0EC8-73F8-4EE1-8664-A53486D38EC8}</ProjectGuid>
8 <OutputName>dependency</OutputName>
9 <OutputType>Library</OutputType>
10 <BindFiles>true</BindFiles>
11 <Pedantic>true</Pedantic>
12 <SuppressSpecificWarnings>1086</SuppressSpecificWarnings>
13 <Cultures>en-us</Cultures>
14 </PropertyGroup>
15
16 <ItemGroup>
17 <Compile Include="DependencyExtension.wxs" />
18 <Compile Include="DependencyExtension_x86.wxs" />
19 <EmbeddedResource Include="en-us.wxl" />
20 </ItemGroup>
21 <ItemGroup>
22 <None Include="packages.config" />
23 </ItemGroup>
24 <ItemGroup>
25 <ProjectReference Include="..\ca\dependencyca.vcxproj">
26 <Name>dependencyca</Name>
27 <Project>{B86AF46C-0F90-49CC-923F-A800B088D015}</Project>
28 </ProjectReference>
29 </ItemGroup>
30 <Import Project="$(WixTargetsPath)" Condition=" '$(WixTargetsPath)' != '' AND Exists('$(WixTargetsPath)') " />
31 <Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\wix.targets" Condition=" '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\wix.targets') " />
32 <Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixTargetsImported)' != 'true' ">
33 <Error Text="WiX Toolset build tools (v4.0 or later) must be installed to build this project. To download the WiX Toolset, go to http://wixtoolset.org/releases/." />
34 </Target>
35 <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
36 <PropertyGroup>
37 <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>
38 </PropertyGroup>
39 <Error Condition="!Exists('..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets'))" />
40 <Error Condition="!Exists('..\..\packages\WixToolset.MSBuild.4.0.0-build-0005\build\WixToolset.MSBuild.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.MSBuild.4.0.0-build-0005\build\WixToolset.MSBuild.props'))" />
41 </Target>
42 <Import Project="..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets" Condition="Exists('..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets')" />
43</Project>
diff --git a/src/wixlib/packages.config b/src/wixlib/packages.config
new file mode 100644
index 00000000..f3d424e1
--- /dev/null
+++ b/src/wixlib/packages.config
@@ -0,0 +1,5 @@
1<?xml version="1.0" encoding="utf-8"?>
2<packages>
3 <package id="Nerdbank.GitVersioning" version="2.1.65" developmentDependency="true" targetFramework="net40" />
4 <package id="WixToolset.MSBuild" version="4.0.0-build-0005" developmentDependency="true" targetFramework="net40" />
5</packages> \ No newline at end of file
diff --git a/version.json b/version.json
new file mode 100644
index 00000000..5f857771
--- /dev/null
+++ b/version.json
@@ -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}