Updating arch support for arm (dotnet/core-setup#4085)
authorPeter Marcu <Peter.Marcu@Microsoft.com>
Mon, 30 Apr 2018 16:35:47 +0000 (09:35 -0700)
committerGitHub <noreply@github.com>
Mon, 30 Apr 2018 16:35:47 +0000 (09:35 -0700)
* Updating arch support for arm

* Switching to process instead of OS arch

Commit migrated from https://github.com/dotnet/core-setup/commit/63dcd371cd0b0cd9c9714d2f65e076c515482384

src/installer/managed/Microsoft.DotNet.PlatformAbstractions/RuntimeEnvironment.cs

index 5cd6288..ffece18 100644 (file)
@@ -2,6 +2,7 @@
 // Licensed under the MIT license. See LICENSE file in the project root for full license information.
 
 using System;
+using System.Runtime.InteropServices;
 using Microsoft.DotNet.PlatformAbstractions.Native;
 
 namespace Microsoft.DotNet.PlatformAbstractions
@@ -23,7 +24,7 @@ namespace Microsoft.DotNet.PlatformAbstractions
 #if NET45
             return Environment.Is64BitProcess ? "x64" : "x86";
 #else
-            return IntPtr.Size == 8 ? "x64" : "x86";
+            return RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant();
 #endif
         }
 
@@ -36,11 +37,7 @@ namespace Microsoft.DotNet.PlatformAbstractions
 
         private static string GetRIDArch()
         {
-            if (!string.IsNullOrEmpty(RuntimeArchitecture))
-            {
-                return $"-{RuntimeArchitecture.ToLowerInvariant()}";
-            }
-            return string.Empty;
+            return $"-{RuntimeArchitecture}";
         }
 
         private static string GetRIDVersion()