@joebigelow / wix / commits / 8ce57f2f

Add CreateIdentifierValueFromPlatform.

Sean Hall committed Jul 10, 2020 at 21:36 UTC 8ce57f2f167db67687470f2e9744cd4930c6dd95
1 file changed +35
src/WixToolset.Core/ExtensibilityServices/ParseHelper.cs
+35
@@ -147,6 +147,41 @@ namespace WixToolset.Core.ExtensibilityServices
147 return new Identifier(AccessModifier.Private, id);
148 }
149
150 + public string CreateIdentifierValueFromPlatform(string name, Platform currentPlatform, BurnPlatforms supportedPlatforms)
151 + {
152 + string suffix = null;
153 +
154 + switch (currentPlatform)
155 + {
156 + case Platform.X86:
157 + if ((supportedPlatforms & BurnPlatforms.X64) == BurnPlatforms.X64)
158 + {
159 + suffix = "_X86";
160 + }
161 + break;
162 + case Platform.X64:
163 + if ((supportedPlatforms & BurnPlatforms.X64) == BurnPlatforms.X64)
164 + {
165 + suffix = "_X64";
166 + }
167 + break;
168 + case Platform.ARM:
169 + if ((supportedPlatforms & BurnPlatforms.ARM) == BurnPlatforms.ARM)
170 + {
171 + suffix = "_A32";
172 + }
173 + break;
174 + case Platform.ARM64:
175 + if ((supportedPlatforms & BurnPlatforms.ARM64) == BurnPlatforms.ARM64)
176 + {
177 + suffix = "_A64";
178 + }
179 + break;
180 + }
181 +
182 + return suffix == null ? null : name + suffix;
183 + }
184 +
185 [Obsolete]
186 public Identifier CreateRegistryRow(IntermediateSection section, SourceLineNumber sourceLineNumbers, RegistryRootType root, string key, string name, string value, string componentId, bool escapeLeadingHash)
187 {