aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBob Arnson <bob@firegiant.com>2020-07-04 18:59:34 -0400
committerBob Arnson <bob@firegiant.com>2020-07-04 19:01:59 -0400
commit6d17a027ff6155ed50f78858cad17d1baef9856d (patch)
tree446d5f4730ef61703f19aa3bd4ee20e6e767c795 /src
parent4e1ad5e7a257b351d40a8d68aa6e1a961766556b (diff)
downloadwix-6d17a027ff6155ed50f78858cad17d1baef9856d.tar.gz
wix-6d17a027ff6155ed50f78858cad17d1baef9856d.tar.bz2
wix-6d17a027ff6155ed50f78858cad17d1baef9856d.zip
Add per-platform custom action support.
Diffstat (limited to 'src')
-rw-r--r--src/ca/dependencyca.vcxproj39
-rw-r--r--src/ca/dependencyca.vcxproj.filters1
-rw-r--r--src/wixext/DependencyCompiler.cs23
-rw-r--r--src/wixlib/DependencyExtension_Platform.wxi13
-rw-r--r--src/wixlib/DependencyExtension_arm.wxs8
-rw-r--r--src/wixlib/DependencyExtension_arm64.wxs8
-rw-r--r--src/wixlib/DependencyExtension_x64.wxs8
-rw-r--r--src/wixlib/caDecor.wxi40
-rw-r--r--src/wixlib/caSuffix.wxi28
-rw-r--r--src/wixlib/dependency.wixproj7
10 files changed, 107 insertions, 68 deletions
diff --git a/src/ca/dependencyca.vcxproj b/src/ca/dependencyca.vcxproj
index d8441f14..c1dfc0c0 100644
--- a/src/ca/dependencyca.vcxproj
+++ b/src/ca/dependencyca.vcxproj
@@ -1,10 +1,8 @@
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
8 <ItemGroup Label="ProjectConfigurations"> 6 <ItemGroup Label="ProjectConfigurations">
9 <ProjectConfiguration Include="Debug|Win32"> 7 <ProjectConfiguration Include="Debug|Win32">
10 <Configuration>Debug</Configuration> 8 <Configuration>Debug</Configuration>
@@ -14,43 +12,60 @@
14 <Configuration>Release</Configuration> 12 <Configuration>Release</Configuration>
15 <Platform>Win32</Platform> 13 <Platform>Win32</Platform>
16 </ProjectConfiguration> 14 </ProjectConfiguration>
15 <ProjectConfiguration Include="Debug|x64">
16 <Configuration>Debug</Configuration>
17 <Platform>x64</Platform>
18 </ProjectConfiguration>
19 <ProjectConfiguration Include="Release|x64">
20 <Configuration>Release</Configuration>
21 <Platform>x64</Platform>
22 </ProjectConfiguration>
23 <ProjectConfiguration Include="Debug|ARM">
24 <Configuration>Debug</Configuration>
25 <Platform>ARM</Platform>
26 </ProjectConfiguration>
27 <ProjectConfiguration Include="Release|ARM">
28 <Configuration>Release</Configuration>
29 <Platform>ARM</Platform>
30 </ProjectConfiguration>
31 <ProjectConfiguration Include="Debug|ARM64">
32 <Configuration>Debug</Configuration>
33 <Platform>ARM64</Platform>
34 </ProjectConfiguration>
35 <ProjectConfiguration Include="Release|ARM64">
36 <Configuration>Release</Configuration>
37 <Platform>ARM64</Platform>
38 </ProjectConfiguration>
17 </ItemGroup> 39 </ItemGroup>
18
19 <PropertyGroup Label="Globals"> 40 <PropertyGroup Label="Globals">
20 <ProjectGuid>{B86AF46C-0F90-49CC-923F-A800B088D015}</ProjectGuid> 41 <ProjectGuid>{B86AF46C-0F90-49CC-923F-A800B088D015}</ProjectGuid>
21 <ConfigurationType>DynamicLibrary</ConfigurationType> 42 <ConfigurationType>DynamicLibrary</ConfigurationType>
22 <PlatformToolset>v141</PlatformToolset> 43 <PlatformToolset>v142</PlatformToolset>
23 <CharacterSet>Unicode</CharacterSet> 44 <CharacterSet>Unicode</CharacterSet>
24 <TargetName>dependencyca</TargetName> 45 <TargetName>dependencyca</TargetName>
25 <ProjectModuleDefinitionFile>wixdepca.def</ProjectModuleDefinitionFile> 46 <ProjectModuleDefinitionFile>wixdepca.def</ProjectModuleDefinitionFile>
26 <Description>WiX Toolset Dependency CustomAction</Description> 47 <Description>WiX Toolset Dependency CustomAction</Description>
48 <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
27 </PropertyGroup> 49 </PropertyGroup>
28
29 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> 50 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
30 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> 51 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
31
32 <PropertyGroup> 52 <PropertyGroup>
33 <ProjectAdditionalLinkLibraries>msi.lib</ProjectAdditionalLinkLibraries> 53 <ProjectAdditionalLinkLibraries>msi.lib</ProjectAdditionalLinkLibraries>
34 </PropertyGroup> 54 </PropertyGroup>
35
36 <ItemGroup> 55 <ItemGroup>
37 <ClCompile Include="dllmain.cpp"> 56 <ClCompile Include="dllmain.cpp">
38 <PrecompiledHeader>Create</PrecompiledHeader> 57 <PrecompiledHeader>Create</PrecompiledHeader>
39 </ClCompile> 58 </ClCompile>
40 <ClCompile Include="wixdepca.cpp" /> 59 <ClCompile Include="wixdepca.cpp" />
41 </ItemGroup> 60 </ItemGroup>
42
43 <ItemGroup> 61 <ItemGroup>
44 <ClInclude Include="precomp.h" /> 62 <ClInclude Include="precomp.h" />
45 </ItemGroup> 63 </ItemGroup>
46
47 <ItemGroup> 64 <ItemGroup>
48 <None Include="packages.config" /> 65 <None Include="packages.config" />
49 <None Include="wixdepca.def" /> 66 <None Include="wixdepca.def" />
50 </ItemGroup> 67 </ItemGroup>
51
52 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> 68 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
53
54 <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> 69 <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
55 <PropertyGroup> 70 <PropertyGroup>
56 <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> 71 <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,4 +73,4 @@
58 <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'))" /> 73 <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'))" />
59 <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'))" /> 74 <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'))" />
60 </Target> 75 </Target>
61</Project> 76</Project> \ No newline at end of file
diff --git a/src/ca/dependencyca.vcxproj.filters b/src/ca/dependencyca.vcxproj.filters
index d4931f32..bfe457e2 100644
--- a/src/ca/dependencyca.vcxproj.filters
+++ b/src/ca/dependencyca.vcxproj.filters
@@ -31,5 +31,6 @@
31 <None Include="wixdepca.def"> 31 <None Include="wixdepca.def">
32 <Filter>Source Files</Filter> 32 <Filter>Source Files</Filter>
33 </None> 33 </None>
34 <None Include="packages.config" />
34 </ItemGroup> 35 </ItemGroup>
35</Project> \ No newline at end of file 36</Project> \ No newline at end of file
diff --git a/src/wixext/DependencyCompiler.cs b/src/wixext/DependencyCompiler.cs
index 018a507a..36a24c67 100644
--- a/src/wixext/DependencyCompiler.cs
+++ b/src/wixext/DependencyCompiler.cs
@@ -362,17 +362,7 @@ namespace WixToolset.Dependency
362 362
363 if (PackageType.None == packageType) 363 if (PackageType.None == packageType)
364 { 364 {
365 // Reference the Check custom action to check for dependencies on the current provider. 365 this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "DependencyCheck", this.Context.Platform, CustomActionPlatforms.X86 | CustomActionPlatforms.X64 | CustomActionPlatforms.ARM | CustomActionPlatforms.ARM64);
366 if (Platform.ARM == this.Context.Platform)
367 {
368 // Ensure the ARM version of the CA is referenced.
369 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixDependencyCheck_ARM");
370 }
371 else
372 {
373 // All other supported platforms use x86.
374 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixDependencyCheck");
375 }
376 366
377 // Generate registry rows for the provider using binder properties. 367 // Generate registry rows for the provider using binder properties.
378 var keyProvides = String.Concat(DependencyCommon.RegistryRoot, key); 368 var keyProvides = String.Concat(DependencyCommon.RegistryRoot, key);
@@ -578,16 +568,7 @@ namespace WixToolset.Dependency
578 568
579 private void AddReferenceToWixDependencyRequire(IntermediateSection section, SourceLineNumber sourceLineNumbers) 569 private void AddReferenceToWixDependencyRequire(IntermediateSection section, SourceLineNumber sourceLineNumbers)
580 { 570 {
581 if (Platform.ARM == this.Context.Platform) 571 this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "DependencyRequire", this.Context.Platform, CustomActionPlatforms.X86 | CustomActionPlatforms.X64 | CustomActionPlatforms.ARM | CustomActionPlatforms.ARM64);
582 {
583 // Ensure the ARM version of the CA is referenced.
584 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixDependencyRequire_ARM");
585 }
586 else
587 {
588 // All other supported platforms use x86.
589 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixDependencyRequire");
590 }
591 } 572 }
592 } 573 }
593} 574}
diff --git a/src/wixlib/DependencyExtension_Platform.wxi b/src/wixlib/DependencyExtension_Platform.wxi
index 7cd7ad96..299a93eb 100644
--- a/src/wixlib/DependencyExtension_Platform.wxi
+++ b/src/wixlib/DependencyExtension_Platform.wxi
@@ -3,23 +3,26 @@
3 3
4 4
5<Include xmlns="http://wixtoolset.org/schemas/v4/wxs"> 5<Include xmlns="http://wixtoolset.org/schemas/v4/wxs">
6 <?include caSuffix.wxi ?> 6 <?include caDecor.wxi ?>
7
7 <Fragment> 8 <Fragment>
8 <CustomAction Id="WixDependencyRequire$(var.Suffix)" BinaryKey="DependencyCA$(var.Suffix)" DllEntry="WixDependencyRequire" Execute="immediate" Return="check" SuppressModularization="yes"/> 9 <CustomAction Id="$(var.Prefix)DependencyRequire$(var.Suffix)" BinaryKey="DependencyCA$(var.Suffix)" DllEntry="WixDependencyRequire" Execute="immediate" Return="check" SuppressModularization="yes"/>
9 <InstallExecuteSequence> 10 <InstallExecuteSequence>
10 <Custom Action="WixDependencyRequire$(var.Suffix)" Before="WixDependencyCheck$(var.Suffix)" Overridable="yes"><![CDATA[NOT DISABLEDEPENDENCYCHECK]]></Custom> 11 <Custom Action="$(var.Prefix)DependencyRequire$(var.Suffix)" Before="WixDependencyCheck$(var.Suffix)" Overridable="yes"><![CDATA[NOT DISABLEDEPENDENCYCHECK]]></Custom>
11 </InstallExecuteSequence> 12 </InstallExecuteSequence>
12 <UIRef Id="WixDependencyErrors"/> 13 <UIRef Id="WixDependencyErrors"/>
13 <PropertyRef Id="DISABLEDEPENDENCYCHECK"/> 14 <PropertyRef Id="DISABLEDEPENDENCYCHECK"/>
14 </Fragment> 15 </Fragment>
16
15 <Fragment> 17 <Fragment>
16 <CustomAction Id="WixDependencyCheck$(var.Suffix)" BinaryKey="DependencyCA$(var.Suffix)" DllEntry="WixDependencyCheck" Execute="immediate" Return="check" SuppressModularization="yes"/> 18 <CustomAction Id="$(var.Prefix)DependencyCheck$(var.Suffix)" BinaryKey="DependencyCA$(var.Suffix)" DllEntry="WixDependencyCheck" Execute="immediate" Return="check" SuppressModularization="yes"/>
17 <InstallExecuteSequence> 19 <InstallExecuteSequence>
18 <Custom Action="WixDependencyCheck$(var.Suffix)" Before="InstallInitialize" Overridable="yes"><![CDATA[(REMOVE OR MsiPatchRemovalList) AND NOT (UPGRADINGPRODUCTCODE OR IGNOREDEPENDENCIES="ALL")]]></Custom> 20 <Custom Action="$(var.Prefix)DependencyCheck$(var.Suffix)" Before="InstallInitialize" Overridable="yes"><![CDATA[(REMOVE OR MsiPatchRemovalList) AND NOT (UPGRADINGPRODUCTCODE OR IGNOREDEPENDENCIES="ALL")]]></Custom>
19 </InstallExecuteSequence> 21 </InstallExecuteSequence>
20 <UIRef Id="WixDependencyErrors"/> 22 <UIRef Id="WixDependencyErrors"/>
21 <PropertyRef Id="IGNOREDEPENDENCIES"/> 23 <PropertyRef Id="IGNOREDEPENDENCIES"/>
22 </Fragment> 24 </Fragment>
25
23 <Fragment> 26 <Fragment>
24 <Binary Id="DependencyCA$(var.Suffix)" SourceFile="!(bindpath.$(var.platform))dependencyca.dll"/> 27 <Binary Id="DependencyCA$(var.Suffix)" SourceFile="!(bindpath.$(var.platform))dependencyca.dll"/>
25 </Fragment> 28 </Fragment>
diff --git a/src/wixlib/DependencyExtension_arm.wxs b/src/wixlib/DependencyExtension_arm.wxs
new file mode 100644
index 00000000..d4ba33a3
--- /dev/null
+++ b/src/wixlib/DependencyExtension_arm.wxs
@@ -0,0 +1,8 @@
1<?xml version="1.0"?>
2<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3
4
5<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
6 <?define platform=arm ?>
7 <?include DependencyExtension_Platform.wxi ?>
8</Wix>
diff --git a/src/wixlib/DependencyExtension_arm64.wxs b/src/wixlib/DependencyExtension_arm64.wxs
new file mode 100644
index 00000000..36e023e7
--- /dev/null
+++ b/src/wixlib/DependencyExtension_arm64.wxs
@@ -0,0 +1,8 @@
1<?xml version="1.0"?>
2<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3
4
5<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
6 <?define platform=arm64 ?>
7 <?include DependencyExtension_Platform.wxi ?>
8</Wix>
diff --git a/src/wixlib/DependencyExtension_x64.wxs b/src/wixlib/DependencyExtension_x64.wxs
new file mode 100644
index 00000000..8298bce6
--- /dev/null
+++ b/src/wixlib/DependencyExtension_x64.wxs
@@ -0,0 +1,8 @@
1<?xml version="1.0"?>
2<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3
4
5<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
6 <?define platform=x64 ?>
7 <?include DependencyExtension_Platform.wxi ?>
8</Wix>
diff --git a/src/wixlib/caDecor.wxi b/src/wixlib/caDecor.wxi
new file mode 100644
index 00000000..1d00df8f
--- /dev/null
+++ b/src/wixlib/caDecor.wxi
@@ -0,0 +1,40 @@
1<?xml version="1.0" encoding="utf-8"?>
2<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3
4
5<Include xmlns="http://schemas.microsoft.com/wix/2006/wi">
6 <?ifdef Prefix ?>
7 <?undef Prefix ?>
8 <?endif ?>
9
10 <?define Prefix="Wix4" ?>
11
12 <?ifndef platform ?>
13 <?define platform="x86" ?>
14 <?endif ?>
15
16 <?if $(var.platform)="" ?>
17 <?undef platform ?>
18 <?define platform="x86" ?>
19 <?endif ?>
20
21 <?ifdef Suffix ?>
22 <?undef Suffix ?>
23 <?endif ?>
24
25 <?if $(var.platform)~="x86" ?>
26 <?define Suffix="_X86" ?>
27 <?endif ?>
28
29 <?if $(var.platform)~="x64" ?>
30 <?define Suffix="_X64" ?>
31 <?endif ?>
32
33 <?if $(var.platform)~="arm" ?>
34 <?define Suffix="_A32" ?>
35 <?endif ?>
36
37 <?if $(var.platform)~="arm64" ?>
38 <?define Suffix="_A64" ?>
39 <?endif ?>
40</Include>
diff --git a/src/wixlib/caSuffix.wxi b/src/wixlib/caSuffix.wxi
deleted file mode 100644
index a56a2393..00000000
--- a/src/wixlib/caSuffix.wxi
+++ /dev/null
@@ -1,28 +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<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/dependency.wixproj b/src/wixlib/dependency.wixproj
index 25e13317..f7ba0f79 100644
--- a/src/wixlib/dependency.wixproj
+++ b/src/wixlib/dependency.wixproj
@@ -4,12 +4,15 @@
4 <PropertyGroup> 4 <PropertyGroup>
5 <OutputType>Library</OutputType> 5 <OutputType>Library</OutputType>
6 <BindFiles>true</BindFiles> 6 <BindFiles>true</BindFiles>
7 <!-- <SuppressSpecificWarnings>1086</SuppressSpecificWarnings> --> 7 <SuppressSpecificWarnings>1086</SuppressSpecificWarnings>
8 <Cultures>en-us</Cultures> 8 <Cultures>en-us</Cultures>
9 </PropertyGroup> 9 </PropertyGroup>
10 10
11 <ItemGroup> 11 <ItemGroup>
12 <ProjectReference Include="..\ca\dependencyca.vcxproj" /> 12 <ProjectReference Include="..\ca\dependencyca.vcxproj" Properties="Platform=ARM" />
13 <ProjectReference Include="..\ca\dependencyca.vcxproj" Properties="Platform=ARM64" />
14 <ProjectReference Include="..\ca\dependencyca.vcxproj" Properties="Platform=x86" />
15 <ProjectReference Include="..\ca\dependencyca.vcxproj" Properties="Platform=x64" />
13 </ItemGroup> 16 </ItemGroup>
14 17
15 <ItemGroup> 18 <ItemGroup>