From 6d17a027ff6155ed50f78858cad17d1baef9856d Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Sat, 4 Jul 2020 18:59:34 -0400 Subject: [PATCH] Add per-platform custom action support. --- Dependency.wixext.sln | 4 +-- src/ca/dependencyca.vcxproj | 39 +++++++++++++------- src/ca/dependencyca.vcxproj.filters | 1 + src/wixext/DependencyCompiler.cs | 23 ++---------- src/wixlib/DependencyExtension_Platform.wxi | 13 ++++--- src/wixlib/DependencyExtension_arm.wxs | 8 +++++ src/wixlib/DependencyExtension_arm64.wxs | 8 +++++ src/wixlib/DependencyExtension_x64.wxs | 8 +++++ src/wixlib/caDecor.wxi | 40 +++++++++++++++++++++ src/wixlib/caSuffix.wxi | 28 --------------- src/wixlib/dependency.wixproj | 7 ++-- 11 files changed, 109 insertions(+), 70 deletions(-) create mode 100644 src/wixlib/DependencyExtension_arm.wxs create mode 100644 src/wixlib/DependencyExtension_arm64.wxs create mode 100644 src/wixlib/DependencyExtension_x64.wxs create mode 100644 src/wixlib/caDecor.wxi delete mode 100644 src/wixlib/caSuffix.wxi diff --git a/Dependency.wixext.sln b/Dependency.wixext.sln index c69a467..e771ddf 100644 --- a/Dependency.wixext.sln +++ b/Dependency.wixext.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.28010.2016 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30204.135 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dependencyca", "src\ca\dependencyca.vcxproj", "{B86AF46C-0F90-49CC-923F-A800B088D015}" EndProject diff --git a/src/ca/dependencyca.vcxproj b/src/ca/dependencyca.vcxproj index d8441f1..c1dfc0c 100644 --- a/src/ca/dependencyca.vcxproj +++ b/src/ca/dependencyca.vcxproj @@ -1,10 +1,8 @@ - - Debug @@ -14,43 +12,60 @@ Release Win32 + + Debug + x64 + + + Release + x64 + + + Debug + ARM + + + Release + ARM + + + Debug + ARM64 + + + Release + ARM64 + - {B86AF46C-0F90-49CC-923F-A800B088D015} DynamicLibrary - v141 + v142 Unicode dependencyca wixdepca.def WiX Toolset Dependency CustomAction + 10.0 - - msi.lib - Create - - - - 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}. @@ -58,4 +73,4 @@ - + \ No newline at end of file diff --git a/src/ca/dependencyca.vcxproj.filters b/src/ca/dependencyca.vcxproj.filters index d4931f3..bfe457e 100644 --- a/src/ca/dependencyca.vcxproj.filters +++ b/src/ca/dependencyca.vcxproj.filters @@ -31,5 +31,6 @@ Source Files + \ No newline at end of file diff --git a/src/wixext/DependencyCompiler.cs b/src/wixext/DependencyCompiler.cs index 018a507..36a24c6 100644 --- a/src/wixext/DependencyCompiler.cs +++ b/src/wixext/DependencyCompiler.cs @@ -362,17 +362,7 @@ private IComponentKeyPath ParseProvidesElement(Intermediate intermediate, Interm if (PackageType.None == packageType) { - // Reference the Check custom action to check for dependencies on the current provider. - if (Platform.ARM == this.Context.Platform) - { - // Ensure the ARM version of the CA is referenced. - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixDependencyCheck_ARM"); - } - else - { - // All other supported platforms use x86. - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixDependencyCheck"); - } + this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "DependencyCheck", this.Context.Platform, CustomActionPlatforms.X86 | CustomActionPlatforms.X64 | CustomActionPlatforms.ARM | CustomActionPlatforms.ARM64); // Generate registry rows for the provider using binder properties. var keyProvides = String.Concat(DependencyCommon.RegistryRoot, key); @@ -578,16 +568,7 @@ private void ParseRequiresRefElement(Intermediate intermediate, IntermediateSect private void AddReferenceToWixDependencyRequire(IntermediateSection section, SourceLineNumber sourceLineNumbers) { - if (Platform.ARM == this.Context.Platform) - { - // Ensure the ARM version of the CA is referenced. - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixDependencyRequire_ARM"); - } - else - { - // All other supported platforms use x86. - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixDependencyRequire"); - } + this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "DependencyRequire", this.Context.Platform, CustomActionPlatforms.X86 | CustomActionPlatforms.X64 | CustomActionPlatforms.ARM | CustomActionPlatforms.ARM64); } } } diff --git a/src/wixlib/DependencyExtension_Platform.wxi b/src/wixlib/DependencyExtension_Platform.wxi index 7cd7ad9..299a93e 100644 --- a/src/wixlib/DependencyExtension_Platform.wxi +++ b/src/wixlib/DependencyExtension_Platform.wxi @@ -3,23 +3,26 @@ - + + - + - + + - + - + + diff --git a/src/wixlib/DependencyExtension_arm.wxs b/src/wixlib/DependencyExtension_arm.wxs new file mode 100644 index 0000000..d4ba33a --- /dev/null +++ b/src/wixlib/DependencyExtension_arm.wxs @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/wixlib/DependencyExtension_arm64.wxs b/src/wixlib/DependencyExtension_arm64.wxs new file mode 100644 index 0000000..36e023e --- /dev/null +++ b/src/wixlib/DependencyExtension_arm64.wxs @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/wixlib/DependencyExtension_x64.wxs b/src/wixlib/DependencyExtension_x64.wxs new file mode 100644 index 0000000..8298bce --- /dev/null +++ b/src/wixlib/DependencyExtension_x64.wxs @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/wixlib/caDecor.wxi b/src/wixlib/caDecor.wxi new file mode 100644 index 0000000..1d00df8 --- /dev/null +++ b/src/wixlib/caDecor.wxi @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/wixlib/caSuffix.wxi b/src/wixlib/caSuffix.wxi deleted file mode 100644 index a56a239..0000000 --- a/src/wixlib/caSuffix.wxi +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/wixlib/dependency.wixproj b/src/wixlib/dependency.wixproj index 25e1331..f7ba0f7 100644 --- a/src/wixlib/dependency.wixproj +++ b/src/wixlib/dependency.wixproj @@ -4,12 +4,15 @@ Library true - + 1086 en-us - + + + +