From d5bd8871a28719b01b8adc43fbbf63e1a7f608ae Mon Sep 17 00:00:00 2001 From: KeatonTheBot Date: Fri, 20 Feb 2026 15:16:32 -0600 Subject: [PATCH] Windows ARM (win-arm64) build now launches with full trimming --- Directory.Packages.props | 3 +- src/Ryujinx.Common/Ryujinx.Common.csproj | 1 - .../SystemInfo/WindowsSystemInfo.cs | 56 +++++++------------ src/Ryujinx/TrimmerRootDescriptor.xml | 4 -- 4 files changed, 21 insertions(+), 43 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 47cf1f84d..b65ac38f1 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -50,7 +50,6 @@ - - + \ No newline at end of file diff --git a/src/Ryujinx.Common/Ryujinx.Common.csproj b/src/Ryujinx.Common/Ryujinx.Common.csproj index 54f5e0c39..1cd0c9f41 100644 --- a/src/Ryujinx.Common/Ryujinx.Common.csproj +++ b/src/Ryujinx.Common/Ryujinx.Common.csproj @@ -10,7 +10,6 @@ - diff --git a/src/Ryujinx.UI.Common/SystemInfo/WindowsSystemInfo.cs b/src/Ryujinx.UI.Common/SystemInfo/WindowsSystemInfo.cs index 40130adba..3c469524a 100644 --- a/src/Ryujinx.UI.Common/SystemInfo/WindowsSystemInfo.cs +++ b/src/Ryujinx.UI.Common/SystemInfo/WindowsSystemInfo.cs @@ -1,6 +1,5 @@ using Ryujinx.Common.Logging; using System; -using System.Management; using System.Runtime.InteropServices; using System.Runtime.Versioning; @@ -11,7 +10,7 @@ namespace Ryujinx.UI.Common.SystemInfo { internal WindowsSystemInfo() { - CpuName = $"{GetCpuidCpuName() ?? GetCpuNameWMI()} ; {LogicalCoreCount} logical"; // WMI is very slow + CpuName = $"{GetCpuidCpuName() ?? GetCpuName()} ; {LogicalCoreCount} logical"; (RamTotal, RamAvailable) = GetMemoryStats(); } @@ -28,25 +27,33 @@ namespace Ryujinx.UI.Common.SystemInfo return (0, 0); } - private static string GetCpuNameWMI() + private static string GetCpuName() { - ManagementObjectCollection cpuObjs = GetWMIObjects("root\\CIMV2", "SELECT * FROM Win32_Processor"); + string cpuName = GetCpuNameFromRegistry(); - if (cpuObjs != null) + return !string.IsNullOrEmpty(cpuName) ? cpuName : Environment.GetEnvironmentVariable("PROCESSOR_IDENTIFIER")?.Trim(); + } + + private static string GetCpuNameFromRegistry() + { + try { - foreach (var cpuObj in cpuObjs) - { - return cpuObj["Name"].ToString()?.Trim(); - } - } + using var key = Microsoft.Win32.Registry.LocalMachine.OpenSubKey( + @"HARDWARE\DESCRIPTION\System\CentralProcessor\0"); - return Environment.GetEnvironmentVariable("PROCESSOR_IDENTIFIER")?.Trim(); + return key?.GetValue("ProcessorNameString")?.ToString()?.Trim(); + } + catch (Exception ex) + { + Logger.Error?.Print(LogClass.Application, $"Registry CPU name lookup failed: {ex.Message}"); + return null; + } } [StructLayout(LayoutKind.Sequential)] - private struct MemoryStatusEx + private struct MemoryStatusEx() { - public uint Length; + public uint Length = (uint)Marshal.SizeOf(); public uint MemoryLoad; public ulong TotalPhys; public ulong AvailPhys; @@ -55,33 +62,10 @@ namespace Ryujinx.UI.Common.SystemInfo public ulong TotalVirtual; public ulong AvailVirtual; public ulong AvailExtendedVirtual; - - public MemoryStatusEx() - { - Length = (uint)Marshal.SizeOf(); - } } [LibraryImport("kernel32.dll", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool GlobalMemoryStatusEx(ref MemoryStatusEx lpBuffer); - - private static ManagementObjectCollection GetWMIObjects(string scope, string query) - { - try - { - return new ManagementObjectSearcher(scope, query).Get(); - } - catch (PlatformNotSupportedException ex) - { - Logger.Error?.Print(LogClass.Application, $"WMI isn't available : {ex.Message}"); - } - catch (COMException ex) - { - Logger.Error?.Print(LogClass.Application, $"WMI isn't available : {ex.Message}"); - } - - return null; - } } } diff --git a/src/Ryujinx/TrimmerRootDescriptor.xml b/src/Ryujinx/TrimmerRootDescriptor.xml index cb1d8f8bd..55a0b96a1 100644 --- a/src/Ryujinx/TrimmerRootDescriptor.xml +++ b/src/Ryujinx/TrimmerRootDescriptor.xml @@ -6,8 +6,4 @@ - - - -