From 244fbf56d1b6c7aa0ab059f0f80ceaea178e78b1 Mon Sep 17 00:00:00 2001 From: MS-GITS <137760120+Greenie0701@users.noreply.github.com> Date: Wed, 17 Sep 2025 14:50:41 +0530 Subject: [PATCH 1/3] Add ARM64 support for .NET runtime detection --- mRemoteNG/App/Update/DotNetRuntimeCheck.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mRemoteNG/App/Update/DotNetRuntimeCheck.cs b/mRemoteNG/App/Update/DotNetRuntimeCheck.cs index 369ea42f..53ebaf61 100644 --- a/mRemoteNG/App/Update/DotNetRuntimeCheck.cs +++ b/mRemoteNG/App/Update/DotNetRuntimeCheck.cs @@ -28,7 +28,8 @@ namespace mRemoteNG.DotNet.Update string[] registryPaths = new[] { @"SOFTWARE\dotnet\Setup\InstalledVersions\x86", - @"SOFTWARE\dotnet\Setup\InstalledVersions\x64" + @"SOFTWARE\dotnet\Setup\InstalledVersions\x64", + @"SOFTWARE\dotnet\Setup\InstalledVersions\arm64" }; foreach (string path in registryPaths) @@ -86,10 +87,13 @@ namespace mRemoteNG.DotNet.Update if (dotnetEntry != null && dotnetEntry["latest-runtime"] != null) { string? latestRuntimeVersion = dotnetEntry["latest-runtime"]?.ToString(); + string arch = RuntimeInformation.OSArchitecture == Architecture.Arm64 ? "arm64" + : RuntimeInformation.OSArchitecture == Architecture.X86 ? "x86" + : "x64"; if (!string.IsNullOrEmpty(latestRuntimeVersion)) { // Construct the download URL using the latest version - string downloadUrl = $"https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-desktop-{latestRuntimeVersion}-windows-x64-installer"; + string downloadUrl = $"https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-desktop-{latestRuntimeVersion}-windows-{arch}-installer"; return (latestRuntimeVersion, downloadUrl); } } From 44f05a29680cbe81e5e4a8792fed3ae4687ddc40 Mon Sep 17 00:00:00 2001 From: MS-GITS <137760120+Greenie0701@users.noreply.github.com> Date: Wed, 17 Sep 2025 14:52:54 +0530 Subject: [PATCH 2/3] Add ARM64 support for .NET runtime detection --- mRemoteNG/App/Update/DotNetRuntimeCheck.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/mRemoteNG/App/Update/DotNetRuntimeCheck.cs b/mRemoteNG/App/Update/DotNetRuntimeCheck.cs index 53ebaf61..60f6ff76 100644 --- a/mRemoteNG/App/Update/DotNetRuntimeCheck.cs +++ b/mRemoteNG/App/Update/DotNetRuntimeCheck.cs @@ -8,6 +8,7 @@ using System.Net.Http; using System.Runtime.Versioning; using System.Threading.Tasks; using System.Windows.Forms; +using System.Runtime.InteropServices; namespace mRemoteNG.DotNet.Update { From 552cee1c24ee9caaf83e85f64b71d180a9584e69 Mon Sep 17 00:00:00 2001 From: Dimitrij Date: Wed, 17 Sep 2025 10:55:28 +0100 Subject: [PATCH 3/3] Update mRemoteNG/App/Update/DotNetRuntimeCheck.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- mRemoteNG/App/Update/DotNetRuntimeCheck.cs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/mRemoteNG/App/Update/DotNetRuntimeCheck.cs b/mRemoteNG/App/Update/DotNetRuntimeCheck.cs index 60f6ff76..ef7abd38 100644 --- a/mRemoteNG/App/Update/DotNetRuntimeCheck.cs +++ b/mRemoteNG/App/Update/DotNetRuntimeCheck.cs @@ -88,9 +88,21 @@ namespace mRemoteNG.DotNet.Update if (dotnetEntry != null && dotnetEntry["latest-runtime"] != null) { string? latestRuntimeVersion = dotnetEntry["latest-runtime"]?.ToString(); - string arch = RuntimeInformation.OSArchitecture == Architecture.Arm64 ? "arm64" - : RuntimeInformation.OSArchitecture == Architecture.X86 ? "x86" - : "x64"; + string arch; + switch (RuntimeInformation.OSArchitecture) + { + case Architecture.Arm64: + arch = "arm64"; + break; + case Architecture.X86: + arch = "x86"; + break; + case Architecture.X64: + arch = "x64"; + break; + default: + throw new NotSupportedException($"Unsupported architecture: {RuntimeInformation.OSArchitecture}"); + } if (!string.IsNullOrEmpty(latestRuntimeVersion)) { // Construct the download URL using the latest version