diff options
author | Bob Arnson <bob@firegiant.com> | 2020-07-04 19:02:15 -0400 |
---|---|---|
committer | Bob Arnson <bob@firegiant.com> | 2020-07-04 19:06:16 -0400 |
commit | ecb774445b177c739864cbd0f6ad441c7864e3be (patch) | |
tree | 410717cb3b17e154b2056772b68a2e89b87ab136 /src/ca | |
parent | cd0d556f06a220c3406d3a42a4e4628ee1cb7cd6 (diff) | |
download | wix-ecb774445b177c739864cbd0f6ad441c7864e3be.tar.gz wix-ecb774445b177c739864cbd0f6ad441c7864e3be.tar.bz2 wix-ecb774445b177c739864cbd0f6ad441c7864e3be.zip |
Add per-platform custom action support.
Diffstat (limited to 'src/ca')
-rw-r--r-- | src/ca/caDecor.h | 13 | ||||
-rw-r--r-- | src/ca/httpca.vcxproj | 50 | ||||
-rw-r--r-- | src/ca/httpca.vcxproj.filters | 4 | ||||
-rw-r--r-- | src/ca/precomp.h | 2 | ||||
-rw-r--r-- | src/ca/wixhttpca.cpp | 9 |
5 files changed, 58 insertions, 20 deletions
diff --git a/src/ca/caDecor.h b/src/ca/caDecor.h new file mode 100644 index 00000000..da274650 --- /dev/null +++ b/src/ca/caDecor.h | |||
@@ -0,0 +1,13 @@ | |||
1 | #pragma once | ||
2 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
3 | |||
4 | |||
5 | #if defined(_M_ARM64) | ||
6 | #define CUSTOM_ACTION_DECORATION(f) L"Wix4" f L"_A64" | ||
7 | #elif defined(_M_AMD64) | ||
8 | #define CUSTOM_ACTION_DECORATION(f) L"Wix4" f L"_X64" | ||
9 | #elif defined(_M_ARM) | ||
10 | #define CUSTOM_ACTION_DECORATION(f) L"Wix4" f L"_ARM" | ||
11 | #else | ||
12 | #define CUSTOM_ACTION_DECORATION(f) L"Wix4" f L"_X86" | ||
13 | #endif | ||
diff --git a/src/ca/httpca.vcxproj b/src/ca/httpca.vcxproj index aa88d62e..608224c2 100644 --- a/src/ca/httpca.vcxproj +++ b/src/ca/httpca.vcxproj | |||
@@ -1,10 +1,9 @@ | |||
1 | <?xml version="1.0" encoding="utf-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. --> | 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"> | 3 | <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
5 | <Import Project="..\..\packages\WixToolset.DUtil.4.0.30\build\WixToolset.DUtil.props" Condition="Exists('..\..\packages\WixToolset.DUtil.4.0.30\build\WixToolset.DUtil.props')" /> | 4 | <Import Project="..\..\packages\WixToolset.DUtil.4.0.30\build\WixToolset.DUtil.props" Condition="Exists('..\..\packages\WixToolset.DUtil.4.0.30\build\WixToolset.DUtil.props')" /> |
6 | <Import Project="..\..\packages\WixToolset.WcaUtil.4.0.16\build\WixToolset.WcaUtil.props" Condition="Exists('..\..\packages\WixToolset.WcaUtil.4.0.16\build\WixToolset.WcaUtil.props')" /> | 5 | <Import Project="..\..\packages\WixToolset.WcaUtil.4.0.16\build\WixToolset.WcaUtil.props" Condition="Exists('..\..\packages\WixToolset.WcaUtil.4.0.16\build\WixToolset.WcaUtil.props')" /> |
7 | 6 | ||
8 | <ItemGroup Label="ProjectConfigurations"> | 7 | <ItemGroup Label="ProjectConfigurations"> |
9 | <ProjectConfiguration Include="Debug|Win32"> | 8 | <ProjectConfiguration Include="Debug|Win32"> |
10 | <Configuration>Debug</Configuration> | 9 | <Configuration>Debug</Configuration> |
@@ -14,44 +13,63 @@ | |||
14 | <Configuration>Release</Configuration> | 13 | <Configuration>Release</Configuration> |
15 | <Platform>Win32</Platform> | 14 | <Platform>Win32</Platform> |
16 | </ProjectConfiguration> | 15 | </ProjectConfiguration> |
16 | <ProjectConfiguration Include="Debug|x64"> | ||
17 | <Configuration>Debug</Configuration> | ||
18 | <Platform>x64</Platform> | ||
19 | </ProjectConfiguration> | ||
20 | <ProjectConfiguration Include="Release|x64"> | ||
21 | <Configuration>Release</Configuration> | ||
22 | <Platform>x64</Platform> | ||
23 | </ProjectConfiguration> | ||
24 | <ProjectConfiguration Include="Debug|ARM"> | ||
25 | <Configuration>Debug</Configuration> | ||
26 | <Platform>ARM</Platform> | ||
27 | </ProjectConfiguration> | ||
28 | <ProjectConfiguration Include="Release|ARM"> | ||
29 | <Configuration>Release</Configuration> | ||
30 | <Platform>ARM</Platform> | ||
31 | </ProjectConfiguration> | ||
32 | <ProjectConfiguration Include="Debug|ARM64"> | ||
33 | <Configuration>Debug</Configuration> | ||
34 | <Platform>ARM64</Platform> | ||
35 | </ProjectConfiguration> | ||
36 | <ProjectConfiguration Include="Release|ARM64"> | ||
37 | <Configuration>Release</Configuration> | ||
38 | <Platform>ARM64</Platform> | ||
39 | </ProjectConfiguration> | ||
17 | </ItemGroup> | 40 | </ItemGroup> |
18 | 41 | ||
19 | <PropertyGroup Label="Globals"> | 42 | <PropertyGroup Label="Globals"> |
20 | <ProjectGuid>{90743805-C043-47C7-B5FF-8F5EE5C8A2DE}</ProjectGuid> | 43 | <ProjectGuid>{90743805-C043-47C7-B5FF-8F5EE5C8A2DE}</ProjectGuid> |
21 | <ConfigurationType>DynamicLibrary</ConfigurationType> | 44 | <ConfigurationType>DynamicLibrary</ConfigurationType> |
22 | <PlatformToolset>v141</PlatformToolset> | 45 | <PlatformToolset>v142</PlatformToolset> |
23 | <CharacterSet>Unicode</CharacterSet> | 46 | <CharacterSet>Unicode</CharacterSet> |
24 | <TargetName>httpca</TargetName> | 47 | <TargetName>httpca</TargetName> |
25 | <ProjectModuleDefinitionFile>wixhttpca.def</ProjectModuleDefinitionFile> | 48 | <ProjectModuleDefinitionFile>wixhttpca.def</ProjectModuleDefinitionFile> |
26 | <Description>WiX Toolset Http CustomAction</Description> | 49 | <Description>WiX Toolset Http CustomAction</Description> |
50 | <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> | ||
27 | </PropertyGroup> | 51 | </PropertyGroup> |
28 | 52 | ||
29 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> | 53 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> |
30 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> | 54 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> |
31 | 55 | ||
32 | <PropertyGroup> | 56 | <PropertyGroup> |
33 | <ProjectAdditionalLinkLibraries>crypt32.lib;httpapi.lib;msi.lib</ProjectAdditionalLinkLibraries> | 57 | <ProjectAdditionalLinkLibraries>crypt32.lib;httpapi.lib;msi.lib</ProjectAdditionalLinkLibraries> |
34 | </PropertyGroup> | 58 | </PropertyGroup> |
35 | 59 | ||
36 | <ItemGroup> | 60 | <ItemGroup> |
37 | <ClCompile Include="dllmain.cpp"> | 61 | <ClCompile Include="dllmain.cpp"> |
38 | <PrecompiledHeader>Create</PrecompiledHeader> | 62 | <PrecompiledHeader>Create</PrecompiledHeader> |
39 | </ClCompile> | 63 | </ClCompile> |
40 | <ClCompile Include="wixhttpca.cpp" /> | 64 | <ClCompile Include="wixhttpca.cpp" /> |
41 | </ItemGroup> | ||
42 | |||
43 | <ItemGroup> | ||
44 | <ClInclude Include="cost.h" /> | 65 | <ClInclude Include="cost.h" /> |
45 | <ClInclude Include="precomp.h" /> | 66 | <ClInclude Include="precomp.h" /> |
46 | </ItemGroup> | ||
47 | |||
48 | <ItemGroup> | ||
49 | <None Include="packages.config" /> | 67 | <None Include="packages.config" /> |
50 | <None Include="wixhttpca.def" /> | 68 | <None Include="wixhttpca.def" /> |
51 | </ItemGroup> | 69 | </ItemGroup> |
52 | 70 | ||
53 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | 71 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> |
54 | 72 | ||
55 | <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> | 73 | <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> |
56 | <PropertyGroup> | 74 | <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> | 75 | <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> |
@@ -59,4 +77,4 @@ | |||
59 | <Error Condition="!Exists('..\..\packages\WixToolset.DUtil.4.0.30\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.DUtil.4.0.30\build\WixToolset.DUtil.props'))" /> | 77 | <Error Condition="!Exists('..\..\packages\WixToolset.DUtil.4.0.30\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.DUtil.4.0.30\build\WixToolset.DUtil.props'))" /> |
60 | <Error Condition="!Exists('..\..\packages\WixToolset.WcaUtil.4.0.16\build\WixToolset.WcaUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.WcaUtil.4.0.16\build\WixToolset.WcaUtil.props'))" /> | 78 | <Error Condition="!Exists('..\..\packages\WixToolset.WcaUtil.4.0.16\build\WixToolset.WcaUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.WcaUtil.4.0.16\build\WixToolset.WcaUtil.props'))" /> |
61 | </Target> | 79 | </Target> |
62 | </Project> | 80 | </Project> \ No newline at end of file |
diff --git a/src/ca/httpca.vcxproj.filters b/src/ca/httpca.vcxproj.filters index d2ab3287..979b9ef3 100644 --- a/src/ca/httpca.vcxproj.filters +++ b/src/ca/httpca.vcxproj.filters | |||
@@ -26,10 +26,14 @@ | |||
26 | <ClInclude Include="precomp.h"> | 26 | <ClInclude Include="precomp.h"> |
27 | <Filter>Header Files</Filter> | 27 | <Filter>Header Files</Filter> |
28 | </ClInclude> | 28 | </ClInclude> |
29 | <ClInclude Include="cost.h"> | ||
30 | <Filter>Header Files</Filter> | ||
31 | </ClInclude> | ||
29 | </ItemGroup> | 32 | </ItemGroup> |
30 | <ItemGroup> | 33 | <ItemGroup> |
31 | <None Include="wixhttpca.def"> | 34 | <None Include="wixhttpca.def"> |
32 | <Filter>Source Files</Filter> | 35 | <Filter>Source Files</Filter> |
33 | </None> | 36 | </None> |
37 | <None Include="packages.config" /> | ||
34 | </ItemGroup> | 38 | </ItemGroup> |
35 | </Project> \ No newline at end of file | 39 | </Project> \ No newline at end of file |
diff --git a/src/ca/precomp.h b/src/ca/precomp.h index 85aeb70e..d5143dac 100644 --- a/src/ca/precomp.h +++ b/src/ca/precomp.h | |||
@@ -14,3 +14,5 @@ | |||
14 | #include "aclutil.h" | 14 | #include "aclutil.h" |
15 | 15 | ||
16 | #include "cost.h" | 16 | #include "cost.h" |
17 | |||
18 | #include "caDecor.h" | ||
diff --git a/src/ca/wixhttpca.cpp b/src/ca/wixhttpca.cpp index 58b46c0f..3c091192 100644 --- a/src/ca/wixhttpca.cpp +++ b/src/ca/wixhttpca.cpp | |||
@@ -193,16 +193,16 @@ static UINT SchedHttpUrlReservations( | |||
193 | 193 | ||
194 | if (WCA_TODO_INSTALL == todoSched) | 194 | if (WCA_TODO_INSTALL == todoSched) |
195 | { | 195 | { |
196 | hr = WcaDoDeferredAction(L"WixRollbackHttpUrlReservationsInstall", sczRollbackCustomActionData, cUrlReservations * COST_HTTP_URL_ACL); | 196 | hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"WixRollbackHttpUrlReservationsInstall"), sczRollbackCustomActionData, cUrlReservations * COST_HTTP_URL_ACL); |
197 | ExitOnFailure(hr, "Failed to schedule install URL reservations rollback."); | 197 | ExitOnFailure(hr, "Failed to schedule install URL reservations rollback."); |
198 | hr = WcaDoDeferredAction(L"WixExecHttpUrlReservationsInstall", sczCustomActionData, cUrlReservations * COST_HTTP_URL_ACL); | 198 | hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"WixExecHttpUrlReservationsInstall"), sczCustomActionData, cUrlReservations * COST_HTTP_URL_ACL); |
199 | ExitOnFailure(hr, "Failed to schedule install URL reservations execution."); | 199 | ExitOnFailure(hr, "Failed to schedule install URL reservations execution."); |
200 | } | 200 | } |
201 | else | 201 | else |
202 | { | 202 | { |
203 | hr = WcaDoDeferredAction(L"WixRollbackHttpUrlReservationsUninstall", sczRollbackCustomActionData, cUrlReservations * COST_HTTP_URL_ACL); | 203 | hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"WixRollbackHttpUrlReservationsUninstall"), sczRollbackCustomActionData, cUrlReservations * COST_HTTP_URL_ACL); |
204 | ExitOnFailure(hr, "Failed to schedule uninstall URL reservations rollback."); | 204 | ExitOnFailure(hr, "Failed to schedule uninstall URL reservations rollback."); |
205 | hr = WcaDoDeferredAction(L"WixExecHttpUrlReservationsUninstall", sczCustomActionData, cUrlReservations * COST_HTTP_URL_ACL); | 205 | hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"WixExecHttpUrlReservationsUninstall"), sczCustomActionData, cUrlReservations * COST_HTTP_URL_ACL); |
206 | ExitOnFailure(hr, "Failed to schedule uninstall URL reservations execution."); | 206 | ExitOnFailure(hr, "Failed to schedule uninstall URL reservations execution."); |
207 | } | 207 | } |
208 | } | 208 | } |
@@ -210,6 +210,7 @@ static UINT SchedHttpUrlReservations( | |||
210 | { | 210 | { |
211 | WcaLog(LOGMSG_STANDARD, "No URL reservations scheduled."); | 211 | WcaLog(LOGMSG_STANDARD, "No URL reservations scheduled."); |
212 | } | 212 | } |
213 | |||
213 | LExit: | 214 | LExit: |
214 | ReleaseStr(sczSDDL); | 215 | ReleaseStr(sczSDDL); |
215 | ReleaseStr(sczExistingSDDL); | 216 | ReleaseStr(sczExistingSDDL); |