Skip to content

Commit fa10948

Browse files
committed
Revert "Fix wmic (#642)"
This reverts commit 0ee90ab.
1 parent 1c844ee commit fa10948

3 files changed

Lines changed: 8 additions & 154 deletions

File tree

source/funkin/backend/system/framerate/SystemInfo.hx

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -54,25 +54,6 @@ class SystemInfo extends FramerateCategory {
5454
if (osName != "")
5555
osInfo = '${osName} ${osVersion}'.trim();
5656
}
57-
#elseif windows
58-
var windowsCurrentVersionPath = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion";
59-
var buildNumber = Std.parseInt(RegistryUtil.get(HKEY_LOCAL_MACHINE, windowsCurrentVersionPath, "CurrentBuildNumber"));
60-
var edition = RegistryUtil.get(HKEY_LOCAL_MACHINE, windowsCurrentVersionPath, "ProductName");
61-
62-
var lcuKey = "WinREVersion"; // Last Cumulative Update Key On Older Windows Versions
63-
if (buildNumber >= 22000) { // Windows 11 Initial Release Build Number
64-
edition = edition.replace("Windows 10", "Windows 11");
65-
lcuKey = "LCUVer"; // Last Cumulative Update Key On Windows 11
66-
}
67-
68-
var lcuVersion = RegistryUtil.get(HKEY_LOCAL_MACHINE, windowsCurrentVersionPath, lcuKey);
69-
70-
osInfo = edition;
71-
72-
if (lcuVersion != null && lcuVersion != "")
73-
osInfo += ' ${lcuVersion}';
74-
else if (lime.system.System.platformVersion != null && lime.system.System.platformVersion != "")
75-
osInfo += ' ${lime.system.System.platformVersion}';
7657
#else
7758
if (lime.system.System.platformLabel != null && lime.system.System.platformLabel != "" && lime.system.System.platformVersion != null && lime.system.System.platformVersion != "")
7859
osInfo = '${lime.system.System.platformLabel.replace(lime.system.System.platformVersion, "").trim()} ${lime.system.System.platformVersion}';
@@ -82,7 +63,10 @@ class SystemInfo extends FramerateCategory {
8263

8364
try {
8465
#if windows
85-
cpuName = RegistryUtil.get(HKEY_LOCAL_MACHINE, "HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0", "ProcessorNameString");
66+
var process = new HiddenProcess("wmic", ["cpu", "get", "name"]);
67+
if (process.exitCode() != 0) throw 'Could not fetch CPU information';
68+
69+
cpuName = process.stdout.readAll().toString().trim().split("\n")[1].trim();
8670
#elseif mac
8771
var process = new HiddenProcess("sysctl -a | grep brand_string"); // Somehow this isn't able to use the args but it still works
8872
if (process.exitCode() != 0) throw 'Could not fetch CPU information';

source/funkin/backend/utils/MemoryUtil.hx

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ final class MemoryUtil {
127127
public static function getMemType():String {
128128
#if windows
129129
var memoryMap:Map<Int, String> = [
130-
0 => null,
130+
0 => "Unknown",
131131
1 => "Other",
132132
2 => "DRAM",
133133
3 => "Synchronous DRAM",
@@ -152,23 +152,13 @@ final class MemoryUtil {
152152
22 => "DDR2 FB-DIMM",
153153
24 => "DDR3",
154154
25 => "FBD2",
155-
26 => "DDR4",
156-
27 => "LPDDR",
157-
28 => "LPDDR2",
158-
29 => "LPDDR3",
159-
30 => "LPDDR4",
160-
31 => "Logical Non-volatile device",
161-
32 => "HBM",
162-
33 => "HBM2",
163-
34 => "DDR5",
164-
35 => "LPDDR5",
165-
36 => "HBM3",
155+
26 => "DDR4"
166156
];
167157
var memoryOutput:Int = -1;
168158

169-
var process = new HiddenProcess("powershell", ["-Command", "Get-CimInstance Win32_PhysicalMemory | Select-Object -ExpandProperty SMBIOSMemoryType" ]);
159+
var process = new HiddenProcess("wmic", ["memorychip", "get", "SMBIOSMemoryType"]);
170160
if (process.exitCode() == 0) memoryOutput = Std.int(Std.parseFloat(process.stdout.readAll().toString().trim().split("\n")[1]));
171-
if (memoryOutput != -1) return memoryMap[memoryOutput] == null ? 'Unknown ($memoryOutput)' : memoryMap[memoryOutput];
161+
if (memoryOutput != -1) return memoryMap[memoryOutput];
172162
#elseif mac
173163
var process = new HiddenProcess("system_profiler", ["SPMemoryDataType"]);
174164
var reg = ~/Type: (.+)/;

source/funkin/backend/utils/RegistryUtil.hx

Lines changed: 0 additions & 120 deletions
This file was deleted.

0 commit comments

Comments
 (0)