From 6d17a027ff6155ed50f78858cad17d1baef9856d Mon Sep 17 00:00:00 2001
From: Bob Arnson <bob@firegiant.com>
Date: Sat, 4 Jul 2020 18:59:34 -0400
Subject: Add per-platform custom action support.

---
 src/wixext/DependencyCompiler.cs | 23 ++---------------------
 1 file changed, 2 insertions(+), 21 deletions(-)

(limited to 'src/wixext')

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
 
                 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 @@ namespace WixToolset.Dependency
 
         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);
         }
     }
 }
-- 
cgit v1.2.3-55-g6feb