From 8ce57f2f167db67687470f2e9744cd4930c6dd95 Mon Sep 17 00:00:00 2001
From: Sean Hall <r.sean.hall@gmail.com>
Date: Fri, 10 Jul 2020 21:36:00 +1000
Subject: Add CreateIdentifierValueFromPlatform.

---
 .../ExtensibilityServices/ParseHelper.cs           | 35 ++++++++++++++++++++++
 1 file changed, 35 insertions(+)

(limited to 'src')

diff --git a/src/WixToolset.Core/ExtensibilityServices/ParseHelper.cs b/src/WixToolset.Core/ExtensibilityServices/ParseHelper.cs
index 81a18e24..7115017c 100644
--- a/src/WixToolset.Core/ExtensibilityServices/ParseHelper.cs
+++ b/src/WixToolset.Core/ExtensibilityServices/ParseHelper.cs
@@ -147,6 +147,41 @@ namespace WixToolset.Core.ExtensibilityServices
             return new Identifier(AccessModifier.Private, id);
         }
 
+        public string CreateIdentifierValueFromPlatform(string name, Platform currentPlatform, BurnPlatforms supportedPlatforms)
+        {
+            string suffix = null;
+
+            switch (currentPlatform)
+            {
+                case Platform.X86:
+                    if ((supportedPlatforms & BurnPlatforms.X64) == BurnPlatforms.X64)
+                    {
+                        suffix = "_X86";
+                    }
+                    break;
+                case Platform.X64:
+                    if ((supportedPlatforms & BurnPlatforms.X64) == BurnPlatforms.X64)
+                    {
+                        suffix = "_X64";
+                    }
+                    break;
+                case Platform.ARM:
+                    if ((supportedPlatforms & BurnPlatforms.ARM) == BurnPlatforms.ARM)
+                    {
+                        suffix = "_A32";
+                    }
+                    break;
+                case Platform.ARM64:
+                    if ((supportedPlatforms & BurnPlatforms.ARM64) == BurnPlatforms.ARM64)
+                    {
+                        suffix = "_A64";
+                    }
+                    break;
+            }
+
+            return suffix == null ? null : name + suffix;
+        }
+
         [Obsolete]
         public Identifier CreateRegistryRow(IntermediateSection section, SourceLineNumber sourceLineNumbers, RegistryRootType root, string key, string name, string value, string componentId, bool escapeLeadingHash)
         {
-- 
cgit v1.2.3-55-g6feb