aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2019-01-20 11:09:10 -0600
committerSean Hall <r.sean.hall@gmail.com>2019-01-20 11:15:09 -0600
commit87527d58d18fa719dc7a5ce512369485d907cba4 (patch)
tree9bcfd603f11b73846fd1985c2b732920b209fcaf /src
parent4d30ab70573f9734d7fd3cd4d54c02173fa281db (diff)
downloadwix-87527d58d18fa719dc7a5ce512369485d907cba4.tar.gz
wix-87527d58d18fa719dc7a5ce512369485d907cba4.tar.bz2
wix-87527d58d18fa719dc7a5ce512369485d907cba4.zip
Integrate into latest v4.
Diffstat (limited to 'src')
-rw-r--r--src/Cpp.Build.props104
-rw-r--r--src/Directory.Build.props26
-rw-r--r--src/Directory.Build.targets48
-rw-r--r--src/FindLocalWix.props8
-rw-r--r--src/ca/httpca.vcxproj62
-rw-r--r--src/ca/httpca.vcxproj.filters (renamed from src/ca/wixhttpca.vcxproj.filters)5
-rw-r--r--src/ca/packages.config5
-rw-r--r--src/ca/precomp.h1
-rw-r--r--src/ca/wixhttpca.def2
-rw-r--r--src/ca/wixhttpca.vcxproj58
-rw-r--r--src/test/WixToolsetTest.Http/HttpExtensionFixture.cs33
-rw-r--r--src/test/WixToolsetTest.Http/TestData/UsingUrlReservation/Package.en-us.wxl11
-rw-r--r--src/test/WixToolsetTest.Http/TestData/UsingUrlReservation/Package.wxs22
-rw-r--r--src/test/WixToolsetTest.Http/TestData/UsingUrlReservation/PackageComponents.wxs16
-rw-r--r--src/test/WixToolsetTest.Http/TestData/UsingUrlReservation/example.txt1
-rw-r--r--src/test/WixToolsetTest.Http/WixToolsetTest.Http.csproj38
-rw-r--r--src/wixext/HttpCompiler.cs114
-rw-r--r--src/wixext/HttpConstants.cs2
-rw-r--r--src/wixext/HttpDecompiler.cs4
-rw-r--r--src/wixext/HttpErrors.cs31
-rw-r--r--src/wixext/HttpExtensionData.cs50
-rw-r--r--src/wixext/HttpExtensionFactory.cs18
-rw-r--r--src/wixext/HttpWindowsInstallerBackendBinderExtension.cs26
-rw-r--r--src/wixext/Tuples/HttpTupleDefinitions.cs43
-rw-r--r--src/wixext/Tuples/WixHttpUrlAceTuple.cs71
-rw-r--r--src/wixext/Tuples/WixHttpUrlReservationTuple.cs79
-rw-r--r--src/wixext/WixHttpExtension.csproj48
-rw-r--r--src/wixext/WixToolset.Http.wixext.csproj33
-rw-r--r--src/wixext/WixToolset.Http.wixext.targets11
-rw-r--r--src/wixext/messages.xml13
-rw-r--r--src/wixlib/HttpExtension.wixproj26
-rw-r--r--src/wixlib/HttpExtension_Platform.wxi14
-rw-r--r--src/wixlib/caSuffix.wxi28
-rw-r--r--src/wixlib/caerr.wxi96
-rw-r--r--src/wixlib/http.wixproj42
-rw-r--r--src/wixlib/packages.config5
36 files changed, 930 insertions, 264 deletions
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..e853e22d
--- /dev/null
+++ b/src/Directory.Build.props
@@ -0,0 +1,26 @@
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
12 <ProjectName Condition=" '$(ProjectName)' == '' ">$(MSBuildProjectName)</ProjectName>
13 <BaseOutputPath>$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\build\))</BaseOutputPath>
14 <BaseIntermediateOutputPath>$(BaseOutputPath)obj\$(ProjectName)\</BaseIntermediateOutputPath>
15 <OutputPath>$(BaseOutputPath)$(Configuration)\</OutputPath>
16
17 <Authors>WiX Toolset Team</Authors>
18 <Company>WiX Toolset</Company>
19 <Copyright>Copyright (c) .NET Foundation and contributors. All rights reserved.</Copyright>
20 <PackageLicenseExpression>MS-RL</PackageLicenseExpression>
21 <Product>WiX Toolset</Product>
22 </PropertyGroup>
23
24 <Import Project="Cpp.Build.props" Condition=" '$(MSBuildProjectExtension)'=='.vcxproj' " />
25 <Import Project="Custom.Build.props" Condition=" Exists('Custom.Build.props') " />
26</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/httpca.vcxproj b/src/ca/httpca.vcxproj
new file mode 100644
index 00000000..0aa1da1f
--- /dev/null
+++ b/src/ca/httpca.vcxproj
@@ -0,0 +1,62 @@
1<?xml version="1.0" encoding="utf-8"?>
2<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3
4<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
5 <Import Project="..\..\packages\WixToolset.DUtil.4.0.6\build\WixToolset.DUtil.props" Condition="Exists('..\..\packages\WixToolset.DUtil.4.0.6\build\WixToolset.DUtil.props')" />
6 <Import Project="..\..\packages\WixToolset.WcaUtil.4.0.2\build\WixToolset.WcaUtil.props" Condition="Exists('..\..\packages\WixToolset.WcaUtil.4.0.2\build\WixToolset.WcaUtil.props')" />
7
8 <ItemGroup Label="ProjectConfigurations">
9 <ProjectConfiguration Include="Debug|Win32">
10 <Configuration>Debug</Configuration>
11 <Platform>Win32</Platform>
12 </ProjectConfiguration>
13 <ProjectConfiguration Include="Release|Win32">
14 <Configuration>Release</Configuration>
15 <Platform>Win32</Platform>
16 </ProjectConfiguration>
17 </ItemGroup>
18
19 <PropertyGroup Label="Globals">
20 <ProjectGuid>{90743805-C043-47C7-B5FF-8F5EE5C8A2DE}</ProjectGuid>
21 <ConfigurationType>DynamicLibrary</ConfigurationType>
22 <PlatformToolset>v141</PlatformToolset>
23 <CharacterSet>Unicode</CharacterSet>
24 <TargetName>httpca</TargetName>
25 <ProjectModuleDefinitionFile>wixhttpca.def</ProjectModuleDefinitionFile>
26 <Description>WiX Toolset Http 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>crypt32.lib;httpapi.lib;msi.lib</ProjectAdditionalLinkLibraries>
34 </PropertyGroup>
35
36 <ItemGroup>
37 <ClCompile Include="dllmain.cpp">
38 <PrecompiledHeader>Create</PrecompiledHeader>
39 </ClCompile>
40 <ClCompile Include="wixhttpca.cpp" />
41 </ItemGroup>
42
43 <ItemGroup>
44 <ClInclude Include="cost.h" />
45 <ClInclude Include="precomp.h" />
46 </ItemGroup>
47
48 <ItemGroup>
49 <None Include="packages.config" />
50 <None Include="wixhttpca.def" />
51 </ItemGroup>
52
53 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
54
55 <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
56 <PropertyGroup>
57 <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>
58 </PropertyGroup>
59 <Error Condition="!Exists('..\..\packages\WixToolset.DUtil.4.0.6\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.DUtil.4.0.6\build\WixToolset.DUtil.props'))" />
60 <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'))" />
61 </Target>
62</Project>
diff --git a/src/ca/wixhttpca.vcxproj.filters b/src/ca/httpca.vcxproj.filters
index 354653c1..d2ab3287 100644
--- a/src/ca/wixhttpca.vcxproj.filters
+++ b/src/ca/httpca.vcxproj.filters
@@ -28,11 +28,6 @@
28 </ClInclude> 28 </ClInclude>
29 </ItemGroup> 29 </ItemGroup>
30 <ItemGroup> 30 <ItemGroup>
31 <ResourceCompile Include="wixhttpca.rc">
32 <Filter>Resource Files</Filter>
33 </ResourceCompile>
34 </ItemGroup>
35 <ItemGroup>
36 <None Include="wixhttpca.def"> 31 <None Include="wixhttpca.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..b87f9ab4
--- /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.6" 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/precomp.h b/src/ca/precomp.h
index ec74006b..85aeb70e 100644
--- a/src/ca/precomp.h
+++ b/src/ca/precomp.h
@@ -13,5 +13,4 @@
13#include "strutil.h" 13#include "strutil.h"
14#include "aclutil.h" 14#include "aclutil.h"
15 15
16#include "CustomMsiErrors.h"
17#include "cost.h" 16#include "cost.h"
diff --git a/src/ca/wixhttpca.def b/src/ca/wixhttpca.def
index 5368c946..f7e3e004 100644
--- a/src/ca/wixhttpca.def
+++ b/src/ca/wixhttpca.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 "wixhttpca" 4LIBRARY "httpca"
5 5
6EXPORTS 6EXPORTS
7 SchedHttpUrlReservationsInstall 7 SchedHttpUrlReservationsInstall
diff --git a/src/ca/wixhttpca.vcxproj b/src/ca/wixhttpca.vcxproj
deleted file mode 100644
index 89dbc79a..00000000
--- a/src/ca/wixhttpca.vcxproj
+++ /dev/null
@@ -1,58 +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>{90743805-C043-47C7-B5FF-8F5EE5C8A2DE}</ProjectGuid>
29 <ConfigurationType>DynamicLibrary</ConfigurationType>
30 <CharacterSet>Unicode</CharacterSet>
31 <TargetName>wixhttpca</TargetName>
32 <ProjectModuleDefinitionFile>wixhttpca.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</ProjectAdditionalIncludeDirectories>
39 <ProjectAdditionalLinkLibraries>crypt32.lib;httpapi.lib;msi.lib;dutil.lib;wcautil.lib</ProjectAdditionalLinkLibraries>
40 </PropertyGroup>
41
42 <ItemGroup>
43 <ClCompile Include="dllmain.cpp" />
44 <ClCompile Include="wixhttpca.cpp" />
45 </ItemGroup>
46 <ItemGroup>
47 <ClInclude Include="cost.h" />
48 <ClInclude Include="precomp.h" />
49 </ItemGroup>
50 <ItemGroup>
51 <None Include="wixhttpca.def" />
52 </ItemGroup>
53 <ItemGroup>
54 <ResourceCompile Include="wixhttpca.rc" />
55 </ItemGroup>
56
57 <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), wix.proj))\tools\WixBuild.targets" />
58</Project>
diff --git a/src/test/WixToolsetTest.Http/HttpExtensionFixture.cs b/src/test/WixToolsetTest.Http/HttpExtensionFixture.cs
new file mode 100644
index 00000000..5658b657
--- /dev/null
+++ b/src/test/WixToolsetTest.Http/HttpExtensionFixture.cs
@@ -0,0 +1,33 @@
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.Http
4{
5 using System.Linq;
6 using WixBuildTools.TestSupport;
7 using WixToolset.Core.TestPackage;
8 using WixToolset.Http;
9 using Xunit;
10
11 public class HttpExtensionFixture
12 {
13 [Fact]
14 public void CanBuildUsingMessageQueue()
15 {
16 var folder = TestData.Get(@"TestData\UsingUrlReservation");
17 var build = new Builder(folder, typeof(HttpExtensionFactory), new[] { folder });
18
19 var results = build.BuildAndQuery(Build, "WixHttpUrlAce", "WixHttpUrlReservation");
20 Assert.Equal(new[]
21 {
22 "WixHttpUrlAce:ace3u9zYtPm8dLIoYgB0bARb0dbB9w\turlt8sDcF469vDrZNldk0moxI25IGM\tNT SERVICE\\TestService\t268435456",
23 "WixHttpUrlReservation:urlt8sDcF469vDrZNldk0moxI25IGM\t0\t\thttp://+:80/vroot/\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo",
24 }, results.OrderBy(s => s).ToArray());
25 }
26
27 private static void Build(string[] args)
28 {
29 var result = WixRunner.Execute(args)
30 .AssertSuccess();
31 }
32 }
33}
diff --git a/src/test/WixToolsetTest.Http/TestData/UsingUrlReservation/Package.en-us.wxl b/src/test/WixToolsetTest.Http/TestData/UsingUrlReservation/Package.en-us.wxl
new file mode 100644
index 00000000..38c12ac1
--- /dev/null
+++ b/src/test/WixToolsetTest.Http/TestData/UsingUrlReservation/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.Http/TestData/UsingUrlReservation/Package.wxs b/src/test/WixToolsetTest.Http/TestData/UsingUrlReservation/Package.wxs
new file mode 100644
index 00000000..68ff98fd
--- /dev/null
+++ b/src/test/WixToolsetTest.Http/TestData/UsingUrlReservation/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.Http/TestData/UsingUrlReservation/PackageComponents.wxs b/src/test/WixToolsetTest.Http/TestData/UsingUrlReservation/PackageComponents.wxs
new file mode 100644
index 00000000..780d598b
--- /dev/null
+++ b/src/test/WixToolsetTest.Http/TestData/UsingUrlReservation/PackageComponents.wxs
@@ -0,0 +1,16 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
3 xmlns:http="http://wixtoolset.org/schemas/v4/wxs/http">
4 <Fragment>
5 <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
6 <Component>
7 <File Source="example.txt" />
8 <ServiceInstall Name="TestService" Type="ownProcess" Start="auto" ErrorControl="ignore">
9 <http:UrlReservation Url="http://+:80/vroot/">
10 <http:UrlAce Rights="all" />
11 </http:UrlReservation>
12 </ServiceInstall>
13 </Component>
14 </ComponentGroup>
15 </Fragment>
16</Wix>
diff --git a/src/test/WixToolsetTest.Http/TestData/UsingUrlReservation/example.txt b/src/test/WixToolsetTest.Http/TestData/UsingUrlReservation/example.txt
new file mode 100644
index 00000000..1b4ffe8a
--- /dev/null
+++ b/src/test/WixToolsetTest.Http/TestData/UsingUrlReservation/example.txt
@@ -0,0 +1 @@
This is example.txt. \ No newline at end of file
diff --git a/src/test/WixToolsetTest.Http/WixToolsetTest.Http.csproj b/src/test/WixToolsetTest.Http/WixToolsetTest.Http.csproj
new file mode 100644
index 00000000..9298ffbf
--- /dev/null
+++ b/src/test/WixToolsetTest.Http/WixToolsetTest.Http.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\UsingUrlReservation\example.txt" CopyToOutputDirectory="PreserveNewest" />
16 <Content Include="TestData\UsingUrlReservation\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" />
17 <Content Include="TestData\UsingUrlReservation\Package.wxs" CopyToOutputDirectory="PreserveNewest" />
18 <Content Include="TestData\UsingUrlReservation\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" />
19 </ItemGroup>
20
21 <ItemGroup>
22 <ProjectReference Include="..\..\wixext\WixToolset.Http.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/HttpCompiler.cs b/src/wixext/HttpCompiler.cs
index c694ccde..094f5594 100644
--- a/src/wixext/HttpCompiler.cs
+++ b/src/wixext/HttpCompiler.cs
@@ -1,26 +1,20 @@
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.Http
4{ 4{
5 using System; 5 using System;
6 using System.Collections.Generic; 6 using System.Collections.Generic;
7 using System.Globalization;
8 using System.Xml.Linq; 7 using System.Xml.Linq;
9 using WixToolset.Data; 8 using WixToolset.Data;
10 using WixToolset.Extensibility; 9 using WixToolset.Extensibility;
10 using WixToolset.Http.Tuples;
11 11
12 /// <summary> 12 /// <summary>
13 /// The compiler for the WiX Toolset Http Extension. 13 /// The compiler for the WiX Toolset Http Extension.
14 /// </summary> 14 /// </summary>
15 public sealed class HttpCompiler : CompilerExtension 15 public sealed class HttpCompiler : BaseCompilerExtension
16 { 16 {
17 /// <summary> 17 public override XNamespace Namespace => "http://wixtoolset.org/schemas/v4/wxs/http";
18 /// Instantiate a new HttpCompiler.
19 /// </summary>
20 public HttpCompiler()
21 {
22 this.Namespace = "http://wixtoolset.org/schemas/v4/wxs/http";
23 }
24 18
25 /// <summary> 19 /// <summary>
26 /// Processes an element for the Compiler. 20 /// Processes an element for the Compiler.
@@ -29,7 +23,7 @@ namespace WixToolset.Extensions
29 /// <param name="parentElement">Parent element of element to process.</param> 23 /// <param name="parentElement">Parent element of element to process.</param>
30 /// <param name="element">Element to process.</param> 24 /// <param name="element">Element to process.</param>
31 /// <param name="contextValues">Extra information about the context in which this element is being parsed.</param> 25 /// <param name="contextValues">Extra information about the context in which this element is being parsed.</param>
32 public override void ParseElement(XElement parentElement, XElement element, IDictionary<string, string> context) 26 public override void ParseElement(Intermediate intermediate, IntermediateSection section, XElement parentElement, XElement element, IDictionary<string, string> context)
33 { 27 {
34 switch (parentElement.Name.LocalName) 28 switch (parentElement.Name.LocalName)
35 { 29 {
@@ -41,10 +35,10 @@ namespace WixToolset.Extensions
41 switch (element.Name.LocalName) 35 switch (element.Name.LocalName)
42 { 36 {
43 case "UrlReservation": 37 case "UrlReservation":
44 this.ParseUrlReservationElement(element, serviceComponentId, serviceUser); 38 this.ParseUrlReservationElement(intermediate, section, element, serviceComponentId, serviceUser);
45 break; 39 break;
46 default: 40 default:
47 this.Core.UnexpectedElement(parentElement, element); 41 this.ParseHelper.UnexpectedElement(parentElement, element);
48 break; 42 break;
49 } 43 }
50 break; 44 break;
@@ -54,15 +48,15 @@ namespace WixToolset.Extensions
54 switch (element.Name.LocalName) 48 switch (element.Name.LocalName)
55 { 49 {
56 case "UrlReservation": 50 case "UrlReservation":
57 this.ParseUrlReservationElement(element, componentId, null); 51 this.ParseUrlReservationElement(intermediate, section, element, componentId, null);
58 break; 52 break;
59 default: 53 default:
60 this.Core.UnexpectedElement(parentElement, element); 54 this.ParseHelper.UnexpectedElement(parentElement, element);
61 break; 55 break;
62 } 56 }
63 break; 57 break;
64 default: 58 default:
65 this.Core.UnexpectedElement(parentElement, element); 59 this.ParseHelper.UnexpectedElement(parentElement, element);
66 break; 60 break;
67 } 61 }
68 } 62 }
@@ -73,9 +67,9 @@ namespace WixToolset.Extensions
73 /// <param name="node">The element to parse.</param> 67 /// <param name="node">The element to parse.</param>
74 /// <param name="componentId">Identifier of the component that owns this URL reservation.</param> 68 /// <param name="componentId">Identifier of the component that owns this URL reservation.</param>
75 /// <param name="securityPrincipal">The security principal of the parent element (null if nested under Component).</param> 69 /// <param name="securityPrincipal">The security principal of the parent element (null if nested under Component).</param>
76 private void ParseUrlReservationElement(XElement node, string componentId, string securityPrincipal) 70 private void ParseUrlReservationElement(Intermediate intermediate, IntermediateSection section, XElement node, string componentId, string securityPrincipal)
77 { 71 {
78 SourceLineNumber sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); 72 SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node);
79 Identifier id = null; 73 Identifier id = null;
80 int handleExisting = HttpConstants.heReplace; 74 int handleExisting = HttpConstants.heReplace;
81 string handleExistingValue = null; 75 string handleExistingValue = null;
@@ -90,10 +84,10 @@ namespace WixToolset.Extensions
90 switch (attrib.Name.LocalName) 84 switch (attrib.Name.LocalName)
91 { 85 {
92 case "Id": 86 case "Id":
93 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); 87 id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib);
94 break; 88 break;
95 case "HandleExisting": 89 case "HandleExisting":
96 handleExistingValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 90 handleExistingValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
97 switch (handleExistingValue) 91 switch (handleExistingValue)
98 { 92 {
99 case "replace": 93 case "replace":
@@ -106,31 +100,31 @@ namespace WixToolset.Extensions
106 handleExisting = HttpConstants.heFail; 100 handleExisting = HttpConstants.heFail;
107 break; 101 break;
108 default: 102 default:
109 this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "HandleExisting", handleExistingValue, "replace", "ignore", "fail")); 103 this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "HandleExisting", handleExistingValue, "replace", "ignore", "fail"));
110 break; 104 break;
111 } 105 }
112 break; 106 break;
113 case "Sddl": 107 case "Sddl":
114 sddl = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 108 sddl = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
115 break; 109 break;
116 case "Url": 110 case "Url":
117 url = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 111 url = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
118 break; 112 break;
119 default: 113 default:
120 this.Core.UnexpectedAttribute(node, attrib); 114 this.ParseHelper.UnexpectedAttribute(node, attrib);
121 break; 115 break;
122 } 116 }
123 } 117 }
124 else 118 else
125 { 119 {
126 this.Core.ParseExtensionAttribute(node, attrib); 120 this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, node, attrib);
127 } 121 }
128 } 122 }
129 123
130 // Need the element ID for child element processing, so generate now if not authored. 124 // Need the element ID for child element processing, so generate now if not authored.
131 if (null == id) 125 if (null == id)
132 { 126 {
133 id = this.Core.CreateIdentifier("url", componentId, securityPrincipal, url); 127 id = this.ParseHelper.CreateIdentifier("url", componentId, securityPrincipal, url);
134 } 128 }
135 129
136 // Parse UrlAce children. 130 // Parse UrlAce children.
@@ -143,57 +137,56 @@ namespace WixToolset.Extensions
143 case "UrlAce": 137 case "UrlAce":
144 if (null != sddl) 138 if (null != sddl)
145 { 139 {
146 this.Core.OnMessage(WixErrors.IllegalParentAttributeWhenNested(sourceLineNumbers, "UrlReservation", "Sddl", "UrlAce")); 140 this.Messaging.Write(ErrorMessages.IllegalParentAttributeWhenNested(sourceLineNumbers, "UrlReservation", "Sddl", "UrlAce"));
147 } 141 }
148 else 142 else
149 { 143 {
150 foundACE = true; 144 foundACE = true;
151 this.ParseUrlAceElement(child, id.Id, securityPrincipal); 145 this.ParseUrlAceElement(intermediate, section, child, id.Id, securityPrincipal);
152 } 146 }
153 break; 147 break;
154 default: 148 default:
155 this.Core.UnexpectedElement(node, child); 149 this.ParseHelper.UnexpectedElement(node, child);
156 break; 150 break;
157 } 151 }
158 } 152 }
159 else 153 else
160 { 154 {
161 this.Core.ParseExtensionElement(node, child); 155 this.ParseHelper.ParseExtensionElement(this.Context.Extensions, intermediate, section, node, child);
162 } 156 }
163 } 157 }
164 158
165 // Url is required. 159 // Url is required.
166 if (null == url) 160 if (null == url)
167 { 161 {
168 this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Url")); 162 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Url"));
169 } 163 }
170 164
171 // Security is required. 165 // Security is required.
172 if (null == sddl && !foundACE) 166 if (null == sddl && !foundACE)
173 { 167 {
174 this.Core.OnMessage(HttpErrors.NoSecuritySpecified(sourceLineNumbers)); 168 this.Messaging.Write(HttpErrors.NoSecuritySpecified(sourceLineNumbers));
175 } 169 }
176 170
177 if (!this.Core.EncounteredError) 171 if (!this.Messaging.EncounteredError)
178 { 172 {
179 Row row = this.Core.CreateRow(sourceLineNumbers, "WixHttpUrlReservation"); 173 var row = (WixHttpUrlReservationTuple)this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixHttpUrlReservation", id);
180 row[0] = id.Id; 174 row.HandleExisting = handleExisting;
181 row[1] = handleExisting; 175 row.Sddl = sddl;
182 row[2] = sddl; 176 row.Url = url;
183 row[3] = url; 177 row.Component_ = componentId;
184 row[4] = componentId;
185 178
186 if (this.Core.CurrentPlatform == Platform.ARM) 179 if (this.Context.Platform == Platform.ARM)
187 { 180 {
188 // Ensure ARM version of the CA is referenced. 181 // Ensure ARM version of the CA is referenced.
189 this.Core.CreateSimpleReference(sourceLineNumbers, "CustomAction", "WixSchedHttpUrlReservationsInstall_ARM"); 182 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixSchedHttpUrlReservationsInstall_ARM");
190 this.Core.CreateSimpleReference(sourceLineNumbers, "CustomAction", "WixSchedHttpUrlReservationsUninstall_ARM"); 183 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixSchedHttpUrlReservationsUninstall_ARM");
191 } 184 }
192 else 185 else
193 { 186 {
194 // All other supported platforms use x86. 187 // All other supported platforms use x86.
195 this.Core.CreateSimpleReference(sourceLineNumbers, "CustomAction", "WixSchedHttpUrlReservationsInstall"); 188 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixSchedHttpUrlReservationsInstall");
196 this.Core.CreateSimpleReference(sourceLineNumbers, "CustomAction", "WixSchedHttpUrlReservationsUninstall"); 189 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixSchedHttpUrlReservationsUninstall");
197 } 190 }
198 } 191 }
199 } 192 }
@@ -204,9 +197,9 @@ namespace WixToolset.Extensions
204 /// <param name="node">The element to parse.</param> 197 /// <param name="node">The element to parse.</param>
205 /// <param name="urlReservationId">The URL reservation ID.</param> 198 /// <param name="urlReservationId">The URL reservation ID.</param>
206 /// <param name="defaultSecurityPrincipal">The default security principal.</param> 199 /// <param name="defaultSecurityPrincipal">The default security principal.</param>
207 private void ParseUrlAceElement(XElement node, string urlReservationId, string defaultSecurityPrincipal) 200 private void ParseUrlAceElement(Intermediate intermediate, IntermediateSection section, XElement node, string urlReservationId, string defaultSecurityPrincipal)
208 { 201 {
209 SourceLineNumber sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); 202 SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node);
210 Identifier id = null; 203 Identifier id = null;
211 string securityPrincipal = defaultSecurityPrincipal; 204 string securityPrincipal = defaultSecurityPrincipal;
212 int rights = HttpConstants.GENERIC_ALL; 205 int rights = HttpConstants.GENERIC_ALL;
@@ -219,13 +212,13 @@ namespace WixToolset.Extensions
219 switch (attrib.Name.LocalName) 212 switch (attrib.Name.LocalName)
220 { 213 {
221 case "Id": 214 case "Id":
222 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); 215 id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib);
223 break; 216 break;
224 case "SecurityPrincipal": 217 case "SecurityPrincipal":
225 securityPrincipal = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 218 securityPrincipal = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
226 break; 219 break;
227 case "Rights": 220 case "Rights":
228 rightsValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 221 rightsValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
229 switch (rightsValue) 222 switch (rightsValue)
230 { 223 {
231 case "all": 224 case "all":
@@ -238,42 +231,41 @@ namespace WixToolset.Extensions
238 rights = HttpConstants.GENERIC_EXECUTE; 231 rights = HttpConstants.GENERIC_EXECUTE;
239 break; 232 break;
240 default: 233 default:
241 this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Rights", rightsValue, "all", "delegate", "register")); 234 this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Rights", rightsValue, "all", "delegate", "register"));
242 break; 235 break;
243 } 236 }
244 break; 237 break;
245 default: 238 default:
246 this.Core.UnexpectedAttribute(node, attrib); 239 this.ParseHelper.UnexpectedAttribute(node, attrib);
247 break; 240 break;
248 } 241 }
249 } 242 }
250 else 243 else
251 { 244 {
252 this.Core.ParseExtensionAttribute(node, attrib); 245 this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, node, attrib);
253 } 246 }
254 } 247 }
255 248
256 // Generate Id now if not authored. 249 // Generate Id now if not authored.
257 if (null == id) 250 if (null == id)
258 { 251 {
259 id = this.Core.CreateIdentifier("ace", urlReservationId, securityPrincipal, rightsValue); 252 id = this.ParseHelper.CreateIdentifier("ace", urlReservationId, securityPrincipal, rightsValue);
260 } 253 }
261 254
262 this.Core.ParseForExtensionElements(node); 255 this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, node);
263 256
264 // SecurityPrincipal is required. 257 // SecurityPrincipal is required.
265 if (null == securityPrincipal) 258 if (null == securityPrincipal)
266 { 259 {
267 this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "SecurityPrincipal")); 260 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "SecurityPrincipal"));
268 } 261 }
269 262
270 if (!this.Core.EncounteredError) 263 if (!this.Messaging.EncounteredError)
271 { 264 {
272 Row row = this.Core.CreateRow(sourceLineNumbers, "WixHttpUrlAce"); 265 var row = (WixHttpUrlAceTuple)this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixHttpUrlAce", id);
273 row[0] = id.Id; 266 row.WixHttpUrlReservation_ = urlReservationId;
274 row[1] = urlReservationId; 267 row.SecurityPrincipal = securityPrincipal;
275 row[2] = securityPrincipal; 268 row.Rights = rights;
276 row[3] = rights;
277 } 269 }
278 } 270 }
279 } 271 }
diff --git a/src/wixext/HttpConstants.cs b/src/wixext/HttpConstants.cs
index 7760d03f..1c96f278 100644
--- a/src/wixext/HttpConstants.cs
+++ b/src/wixext/HttpConstants.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.Http
4{ 4{
5 using System; 5 using System;
6 6
diff --git a/src/wixext/HttpDecompiler.cs b/src/wixext/HttpDecompiler.cs
index 043ee1e1..8991ec2f 100644
--- a/src/wixext/HttpDecompiler.cs
+++ b/src/wixext/HttpDecompiler.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.Http
4{ 4{
5#if TODO_CONSIDER_DECOMPILER
5 using System; 6 using System;
6 using System.Collections; 7 using System.Collections;
7 using System.Diagnostics; 8 using System.Diagnostics;
@@ -132,4 +133,5 @@ namespace WixToolset.Extensions
132 } 133 }
133 } 134 }
134 } 135 }
136#endif
135} 137}
diff --git a/src/wixext/HttpErrors.cs b/src/wixext/HttpErrors.cs
new file mode 100644
index 00000000..e87adf54
--- /dev/null
+++ b/src/wixext/HttpErrors.cs
@@ -0,0 +1,31 @@
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.Http
4{
5 using System;
6 using System.Resources;
7 using WixToolset.Data;
8
9 public static class HttpErrors
10 {
11 public static Message NoSecuritySpecified(SourceLineNumber sourceLineNumbers)
12 {
13 return Message(sourceLineNumbers, Ids.NoSecuritySpecified, "The UrlReservation element doesn't identify the security for the reservation. You must either specify the Sddl attribute, or provide child UrlAce elements.");
14 }
15
16 private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args)
17 {
18 return new Message(sourceLineNumber, MessageLevel.Error, (int)id, format, args);
19 }
20
21 private static Message Message(SourceLineNumber sourceLineNumber, Ids id, ResourceManager resourceManager, string resourceName, params object[] args)
22 {
23 return new Message(sourceLineNumber, MessageLevel.Error, (int)id, resourceManager, resourceName, args);
24 }
25
26 public enum Ids
27 {
28 NoSecuritySpecified = 6701,
29 }
30 }
31}
diff --git a/src/wixext/HttpExtensionData.cs b/src/wixext/HttpExtensionData.cs
index db79a6c1..2ae4a911 100644
--- a/src/wixext/HttpExtensionData.cs
+++ b/src/wixext/HttpExtensionData.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.Http
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 Http Extension. 9 /// The WiX Toolset Http Extension.
12 /// </summary> 10 /// </summary>
13 public sealed class HttpExtensionData : ExtensionData 11 public sealed class HttpExtensionData : 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 HttpExtensionData.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 HttpExtensionData.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 = HttpTupleDefinitions.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.http.wixlib", tableDefinitions); 27 return Intermediate.Load(typeof(HttpExtensionData).Assembly, "WixToolset.Http.http.wixlib", tupleDefinitions);
62 } 28 }
63 } 29 }
64} 30}
diff --git a/src/wixext/HttpExtensionFactory.cs b/src/wixext/HttpExtensionFactory.cs
new file mode 100644
index 00000000..fa23dac6
--- /dev/null
+++ b/src/wixext/HttpExtensionFactory.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.Http
4{
5 using System;
6 using System.Collections.Generic;
7 using WixToolset.Extensibility;
8
9 public class HttpExtensionFactory : BaseExtensionFactory
10 {
11 protected override IEnumerable<Type> ExtensionTypes => new[]
12 {
13 typeof(HttpCompiler),
14 typeof(HttpExtensionData),
15 typeof(HttpWindowsInstallerBackendBinderExtension),
16 };
17 }
18}
diff --git a/src/wixext/HttpWindowsInstallerBackendBinderExtension.cs b/src/wixext/HttpWindowsInstallerBackendBinderExtension.cs
new file mode 100644
index 00000000..598cb275
--- /dev/null
+++ b/src/wixext/HttpWindowsInstallerBackendBinderExtension.cs
@@ -0,0 +1,26 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3namespace WixToolset.Http
4{
5 using System.Linq;
6 using System.Xml;
7 using WixToolset.Data.WindowsInstaller;
8 using WixToolset.Extensibility;
9
10 public class HttpWindowsInstallerBackendBinderExtension : BaseWindowsInstallerBackendBinderExtension
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(HttpWindowsInstallerBackendBinderExtension).Assembly.GetManifestResourceStream("WixToolset.Http.tables.xml"))
19 using (var reader = XmlReader.Create(resourceStream))
20 {
21 var tables = TableDefinitionCollection.Load(reader);
22 return tables.ToArray();
23 }
24 }
25 }
26}
diff --git a/src/wixext/Tuples/HttpTupleDefinitions.cs b/src/wixext/Tuples/HttpTupleDefinitions.cs
new file mode 100644
index 00000000..11305d2a
--- /dev/null
+++ b/src/wixext/Tuples/HttpTupleDefinitions.cs
@@ -0,0 +1,43 @@
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.Http
4{
5 using System;
6 using WixToolset.Data;
7
8 public enum HttpTupleDefinitionType
9 {
10 WixHttpUrlAce,
11 WixHttpUrlReservation,
12 }
13
14 public static partial class HttpTupleDefinitions
15 {
16 public static readonly Version Version = new Version("4.0.0");
17
18 public static IntermediateTupleDefinition ByName(string name)
19 {
20 if (!Enum.TryParse(name, out HttpTupleDefinitionType type))
21 {
22 return null;
23 }
24
25 return ByType(type);
26 }
27
28 public static IntermediateTupleDefinition ByType(HttpTupleDefinitionType type)
29 {
30 switch (type)
31 {
32 case HttpTupleDefinitionType.WixHttpUrlAce:
33 return HttpTupleDefinitions.WixHttpUrlAce;
34
35 case HttpTupleDefinitionType.WixHttpUrlReservation:
36 return HttpTupleDefinitions.WixHttpUrlReservation;
37
38 default:
39 throw new ArgumentOutOfRangeException(nameof(type));
40 }
41 }
42 }
43}
diff --git a/src/wixext/Tuples/WixHttpUrlAceTuple.cs b/src/wixext/Tuples/WixHttpUrlAceTuple.cs
new file mode 100644
index 00000000..3e0006a0
--- /dev/null
+++ b/src/wixext/Tuples/WixHttpUrlAceTuple.cs
@@ -0,0 +1,71 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3namespace WixToolset.Http
4{
5 using WixToolset.Data;
6 using WixToolset.Http.Tuples;
7
8 public static partial class HttpTupleDefinitions
9 {
10 public static readonly IntermediateTupleDefinition WixHttpUrlAce = new IntermediateTupleDefinition(
11 HttpTupleDefinitionType.WixHttpUrlAce.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(WixHttpUrlAceTupleFields.WixHttpUrlAce), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(WixHttpUrlAceTupleFields.WixHttpUrlReservation_), IntermediateFieldType.String),
16 new IntermediateFieldDefinition(nameof(WixHttpUrlAceTupleFields.SecurityPrincipal), IntermediateFieldType.String),
17 new IntermediateFieldDefinition(nameof(WixHttpUrlAceTupleFields.Rights), IntermediateFieldType.Number),
18 },
19 typeof(WixHttpUrlAceTuple));
20 }
21}
22
23namespace WixToolset.Http.Tuples
24{
25 using WixToolset.Data;
26
27 public enum WixHttpUrlAceTupleFields
28 {
29 WixHttpUrlAce,
30 WixHttpUrlReservation_,
31 SecurityPrincipal,
32 Rights,
33 }
34
35 public class WixHttpUrlAceTuple : IntermediateTuple
36 {
37 public WixHttpUrlAceTuple() : base(HttpTupleDefinitions.WixHttpUrlAce, null, null)
38 {
39 }
40
41 public WixHttpUrlAceTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(HttpTupleDefinitions.WixHttpUrlAce, sourceLineNumber, id)
42 {
43 }
44
45 public IntermediateField this[WixHttpUrlAceTupleFields index] => this.Fields[(int)index];
46
47 public string WixHttpUrlAce
48 {
49 get => this.Fields[(int)WixHttpUrlAceTupleFields.WixHttpUrlAce].AsString();
50 set => this.Set((int)WixHttpUrlAceTupleFields.WixHttpUrlAce, value);
51 }
52
53 public string WixHttpUrlReservation_
54 {
55 get => this.Fields[(int)WixHttpUrlAceTupleFields.WixHttpUrlReservation_].AsString();
56 set => this.Set((int)WixHttpUrlAceTupleFields.WixHttpUrlReservation_, value);
57 }
58
59 public string SecurityPrincipal
60 {
61 get => this.Fields[(int)WixHttpUrlAceTupleFields.SecurityPrincipal].AsString();
62 set => this.Set((int)WixHttpUrlAceTupleFields.SecurityPrincipal, value);
63 }
64
65 public int Rights
66 {
67 get => this.Fields[(int)WixHttpUrlAceTupleFields.Rights].AsNumber();
68 set => this.Set((int)WixHttpUrlAceTupleFields.Rights, value);
69 }
70 }
71} \ No newline at end of file
diff --git a/src/wixext/Tuples/WixHttpUrlReservationTuple.cs b/src/wixext/Tuples/WixHttpUrlReservationTuple.cs
new file mode 100644
index 00000000..7a251f3d
--- /dev/null
+++ b/src/wixext/Tuples/WixHttpUrlReservationTuple.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.Http
4{
5 using WixToolset.Data;
6 using WixToolset.Http.Tuples;
7
8 public static partial class HttpTupleDefinitions
9 {
10 public static readonly IntermediateTupleDefinition WixHttpUrlReservation = new IntermediateTupleDefinition(
11 HttpTupleDefinitionType.WixHttpUrlReservation.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(WixHttpUrlReservationTupleFields.WixHttpUrlReservation), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(WixHttpUrlReservationTupleFields.HandleExisting), IntermediateFieldType.Number),
16 new IntermediateFieldDefinition(nameof(WixHttpUrlReservationTupleFields.Sddl), IntermediateFieldType.String),
17 new IntermediateFieldDefinition(nameof(WixHttpUrlReservationTupleFields.Url), IntermediateFieldType.String),
18 new IntermediateFieldDefinition(nameof(WixHttpUrlReservationTupleFields.Component_), IntermediateFieldType.String),
19 },
20 typeof(WixHttpUrlReservationTuple));
21 }
22}
23
24namespace WixToolset.Http.Tuples
25{
26 using WixToolset.Data;
27
28 public enum WixHttpUrlReservationTupleFields
29 {
30 WixHttpUrlReservation,
31 HandleExisting,
32 Sddl,
33 Url,
34 Component_,
35 }
36
37 public class WixHttpUrlReservationTuple : IntermediateTuple
38 {
39 public WixHttpUrlReservationTuple() : base(HttpTupleDefinitions.WixHttpUrlReservation, null, null)
40 {
41 }
42
43 public WixHttpUrlReservationTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(HttpTupleDefinitions.WixHttpUrlReservation, sourceLineNumber, id)
44 {
45 }
46
47 public IntermediateField this[WixHttpUrlReservationTupleFields index] => this.Fields[(int)index];
48
49 public string WixHttpUrlReservation
50 {
51 get => this.Fields[(int)WixHttpUrlReservationTupleFields.WixHttpUrlReservation].AsString();
52 set => this.Set((int)WixHttpUrlReservationTupleFields.WixHttpUrlReservation, value);
53 }
54
55 public int HandleExisting
56 {
57 get => this.Fields[(int)WixHttpUrlReservationTupleFields.HandleExisting].AsNumber();
58 set => this.Set((int)WixHttpUrlReservationTupleFields.HandleExisting, value);
59 }
60
61 public string Sddl
62 {
63 get => this.Fields[(int)WixHttpUrlReservationTupleFields.Sddl].AsString();
64 set => this.Set((int)WixHttpUrlReservationTupleFields.Sddl, value);
65 }
66
67 public string Url
68 {
69 get => this.Fields[(int)WixHttpUrlReservationTupleFields.Url].AsString();
70 set => this.Set((int)WixHttpUrlReservationTupleFields.Url, value);
71 }
72
73 public string Component_
74 {
75 get => this.Fields[(int)WixHttpUrlReservationTupleFields.Component_].AsString();
76 set => this.Set((int)WixHttpUrlReservationTupleFields.Component_, value);
77 }
78 }
79} \ No newline at end of file
diff --git a/src/wixext/WixHttpExtension.csproj b/src/wixext/WixHttpExtension.csproj
deleted file mode 100644
index 74af503f..00000000
--- a/src/wixext/WixHttpExtension.csproj
+++ /dev/null
@@ -1,48 +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>{AAFC3C7F-D818-4B1D-AF3F-A331EA917F3F}</ProjectGuid>
8 <AssemblyName>WixHttpExtension</AssemblyName>
9 <OutputType>Library</OutputType>
10 <RootNamespace>WixToolset.Extensions</RootNamespace>
11 </PropertyGroup>
12 <ItemGroup>
13 <Compile Include="AssemblyInfo.cs" />
14 <Compile Include="HttpCompiler.cs" />
15 <Compile Include="HttpConstants.cs" />
16 <Compile Include="HttpDecompiler.cs" />
17 <Compile Include="HttpExtensionData.cs" />
18 <MsgGenSource Include="Data\messages.xml">
19 <ResourcesLogicalName>$(RootNamespace).Data.Messages.resources</ResourcesLogicalName>
20 </MsgGenSource>
21 <EmbeddedFlattenedResource Include="Data\tables.xml">
22 <LogicalName>$(RootNamespace).Data.tables.xml</LogicalName>
23 </EmbeddedFlattenedResource>
24 <EmbeddedFlattenedResource Include="Xsd\http.xsd">
25 <LogicalName>$(RootNamespace).Xsd.http.xsd</LogicalName>
26 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
27 </EmbeddedFlattenedResource>
28 <XsdGenSource Include="Xsd\http.xsd">
29 <CommonNamespace>WixToolset.Data.Serialize</CommonNamespace>
30 <Namespace>WixToolset.Extensions.Serialize.Http</Namespace>
31 </XsdGenSource>
32 <EmbeddedResource Include="$(OutputPath)\http.wixlib">
33 <Link>Data\http.wixlib</Link>
34 </EmbeddedResource>
35 </ItemGroup>
36 <ItemGroup>
37 <Reference Include="System" />
38 <Reference Include="System.Xml" />
39 <Reference Include="System.Xml.Linq" />
40 <ProjectReference Include="..\..\..\libs\WixToolset.Data\WixToolset.Data.csproj" />
41 <ProjectReference Include="..\..\..\libs\WixToolset.Extensibility\WixToolset.Extensibility.csproj" />
42 <ProjectReference Include="..\..\..\tools\wix\Wix.csproj" />
43 <ProjectReference Include="..\wixlib\HttpExtension.wixproj">
44 <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
45 </ProjectReference>
46 </ItemGroup>
47 <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), wix.proj))\tools\WixBuild.targets" />
48</Project>
diff --git a/src/wixext/WixToolset.Http.wixext.csproj b/src/wixext/WixToolset.Http.wixext.csproj
new file mode 100644
index 00000000..c681e308
--- /dev/null
+++ b/src/wixext/WixToolset.Http.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.Http</RootNamespace>
8 <Description>WiX Toolset Http Extension</Description>
9 <Title>WiX Toolset Http Extension</Title>
10 <IsTool>true</IsTool>
11 <ContentTargetFolders>build</ContentTargetFolders>
12 </PropertyGroup>
13
14 <ItemGroup>
15 <Content Include="$(MSBuildThisFileName).targets" />
16 <Content Include="http.xsd" PackagePath="tools" />
17 <EmbeddedResource Include="tables.xml" />
18 <EmbeddedResource Include="$(OutputPath)..\http.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\http.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.Http.wixext.targets b/src/wixext/WixToolset.Http.wixext.targets
new file mode 100644
index 00000000..254b0010
--- /dev/null
+++ b/src/wixext/WixToolset.Http.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 <WixToolsetHttpWixextPath Condition=" '$(WixToolsetHttpWixextPath)' == '' ">$(MSBuildThisFileDirectory)..\tools\WixToolset.Http.wixext.dll</WixToolsetHttpWixextPath>
7 </PropertyGroup>
8 <ItemGroup>
9 <WixExtension Include="$(WixToolsetHttpWixextPath)" />
10 </ItemGroup>
11</Project>
diff --git a/src/wixext/messages.xml b/src/wixext/messages.xml
deleted file mode 100644
index 6dcdc366..00000000
--- a/src/wixext/messages.xml
+++ /dev/null
@@ -1,13 +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="HttpErrors" ContainerName="HttpErrorEventArgs" BaseContainerName="MessageEventArgs" Level="Error">
7 <Message Id="NoSecuritySpecified" Number="6701">
8 <Instance>
9 The UrlReservation element doesn't identify the security for the reservation. You must either specify the Sddl attribute, or provide child UrlAce elements.
10 </Instance>
11 </Message>
12 </Class>
13</Messages>
diff --git a/src/wixlib/HttpExtension.wixproj b/src/wixlib/HttpExtension.wixproj
deleted file mode 100644
index 738579db..00000000
--- a/src/wixlib/HttpExtension.wixproj
+++ /dev/null
@@ -1,26 +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>{055C1517-4CED-4199-BCDE-A383E5C4EF78}</ProjectGuid>
8 <OutputName>http</OutputName>
9 <OutputType>Library</OutputType>
10 <BindFiles>true</BindFiles>
11 <Pedantic>true</Pedantic>
12 <Cultures>en-us</Cultures>
13 </PropertyGroup>
14
15 <ItemGroup>
16 <Compile Include="HttpExtension.wxs" />
17 <Compile Include="HttpExtension_x86.wxs" />
18 <EmbeddedResource Include="en-us.wxl" />
19 </ItemGroup>
20
21 <ItemGroup>
22 <ProjectReference Include="..\ca\wixhttpca.vcxproj" />
23 </ItemGroup>
24
25 <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), wix.proj))\tools\WixBuild.targets" />
26</Project>
diff --git a/src/wixlib/HttpExtension_Platform.wxi b/src/wixlib/HttpExtension_Platform.wxi
index 11c3aa2b..223b8e06 100644
--- a/src/wixlib/HttpExtension_Platform.wxi
+++ b/src/wixlib/HttpExtension_Platform.wxi
@@ -15,12 +15,12 @@
15 <ProgressText Action="WixExecHttpUrlReservationsUninstall$(var.DeferredSuffix)">!(loc.WixExecHttpUrlReservationsUninstall)</ProgressText> 15 <ProgressText Action="WixExecHttpUrlReservationsUninstall$(var.DeferredSuffix)">!(loc.WixExecHttpUrlReservationsUninstall)</ProgressText>
16 </UI> 16 </UI>
17 17
18 <CustomAction Id="WixSchedHttpUrlReservationsInstall$(var.Suffix)" BinaryKey="WixHttpCA$(var.Suffix)" DllEntry="SchedHttpUrlReservationsInstall" Execute="immediate" Return="check" SuppressModularization="yes" /> 18 <CustomAction Id="WixSchedHttpUrlReservationsInstall$(var.Suffix)" BinaryKey="HttpCA$(var.Suffix)" DllEntry="SchedHttpUrlReservationsInstall" Execute="immediate" Return="check" SuppressModularization="yes" />
19 <CustomAction Id="WixSchedHttpUrlReservationsUninstall$(var.Suffix)" BinaryKey="WixHttpCA$(var.Suffix)" DllEntry="SchedHttpUrlReservationsUninstall" Execute="immediate" Return="check" SuppressModularization="yes" /> 19 <CustomAction Id="WixSchedHttpUrlReservationsUninstall$(var.Suffix)" BinaryKey="HttpCA$(var.Suffix)" DllEntry="SchedHttpUrlReservationsUninstall" Execute="immediate" Return="check" SuppressModularization="yes" />
20 <CustomAction Id="WixRollbackHttpUrlReservationsInstall$(var.DeferredSuffix)" BinaryKey="WixHttpCA$(var.Suffix)" DllEntry="ExecHttpUrlReservations" Execute="rollback" Impersonate="no" Return="check" SuppressModularization="yes" /> 20 <CustomAction Id="WixRollbackHttpUrlReservationsInstall$(var.DeferredSuffix)" BinaryKey="HttpCA$(var.Suffix)" DllEntry="ExecHttpUrlReservations" Execute="rollback" Impersonate="no" Return="check" SuppressModularization="yes" />
21 <CustomAction Id="WixExecHttpUrlReservationsInstall$(var.DeferredSuffix)" BinaryKey="WixHttpCA$(var.Suffix)" DllEntry="ExecHttpUrlReservations" Execute="deferred" Impersonate="no" Return="check" SuppressModularization="yes" /> 21 <CustomAction Id="WixExecHttpUrlReservationsInstall$(var.DeferredSuffix)" BinaryKey="HttpCA$(var.Suffix)" DllEntry="ExecHttpUrlReservations" Execute="deferred" Impersonate="no" Return="check" SuppressModularization="yes" />
22 <CustomAction Id="WixRollbackHttpUrlReservationsUninstall$(var.DeferredSuffix)" BinaryKey="WixHttpCA$(var.Suffix)" DllEntry="ExecHttpUrlReservations" Execute="rollback" Impersonate="no" Return="check" SuppressModularization="yes" /> 22 <CustomAction Id="WixRollbackHttpUrlReservationsUninstall$(var.DeferredSuffix)" BinaryKey="HttpCA$(var.Suffix)" DllEntry="ExecHttpUrlReservations" Execute="rollback" Impersonate="no" Return="check" SuppressModularization="yes" />
23 <CustomAction Id="WixExecHttpUrlReservationsUninstall$(var.DeferredSuffix)" BinaryKey="WixHttpCA$(var.Suffix)" DllEntry="ExecHttpUrlReservations" Execute="deferred" Impersonate="no" Return="check" SuppressModularization="yes" /> 23 <CustomAction Id="WixExecHttpUrlReservationsUninstall$(var.DeferredSuffix)" BinaryKey="HttpCA$(var.Suffix)" DllEntry="ExecHttpUrlReservations" Execute="deferred" Impersonate="no" Return="check" SuppressModularization="yes" />
24 24
25 <!-- 25 <!--
26 We need the HTTP server on Windows XP SP2 or later. 26 We need the HTTP server on Windows XP SP2 or later.
@@ -35,6 +35,6 @@
35 </InstallExecuteSequence> 35 </InstallExecuteSequence>
36 </Fragment> 36 </Fragment>
37 <Fragment> 37 <Fragment>
38 <Binary Id="WixHttpCA$(var.Suffix)" SourceFile="!(bindpath.$(var.platform))wixhttpca.dll" /> 38 <Binary Id="HttpCA$(var.Suffix)" SourceFile="!(bindpath.$(var.platform))httpca.dll" />
39 </Fragment> 39 </Fragment>
40</Include> 40</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/http.wixproj b/src/wixlib/http.wixproj
new file mode 100644
index 00000000..ebd12321
--- /dev/null
+++ b/src/wixlib/http.wixproj
@@ -0,0 +1,42 @@
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>{055C1517-4CED-4199-BCDE-A383E5C4EF78}</ProjectGuid>
8 <OutputName>http</OutputName>
9 <OutputType>Library</OutputType>
10 <BindFiles>true</BindFiles>
11 <Pedantic>true</Pedantic>
12 <Cultures>en-us</Cultures>
13 </PropertyGroup>
14
15 <ItemGroup>
16 <Compile Include="HttpExtension.wxs" />
17 <Compile Include="HttpExtension_x86.wxs" />
18 <EmbeddedResource Include="en-us.wxl" />
19 </ItemGroup>
20 <ItemGroup>
21 <None Include="packages.config" />
22 </ItemGroup>
23 <ItemGroup>
24 <ProjectReference Include="..\ca\httpca.vcxproj">
25 <Name>httpca</Name>
26 <Project>{90743805-C043-47C7-B5FF-8F5EE5C8A2DE}</Project>
27 </ProjectReference>
28 </ItemGroup>
29 <Import Project="$(WixTargetsPath)" Condition=" '$(WixTargetsPath)' != '' AND Exists('$(WixTargetsPath)') " />
30 <Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\wix.targets" Condition=" '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\wix.targets') " />
31 <Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixTargetsImported)' != 'true' ">
32 <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/." />
33 </Target>
34 <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
35 <PropertyGroup>
36 <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>
37 </PropertyGroup>
38 <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'))" />
39 <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'))" />
40 </Target>
41 <Import Project="..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets" Condition="Exists('..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets')" />
42</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