From bbd2534f94ec7caf9bfeb0cd12a6be41eecaec3f Mon Sep 17 00:00:00 2001 From: pizzaboxer <41478239+pizzaboxer@users.noreply.github.com> Date: Sun, 12 Mar 2023 23:14:09 +0000 Subject: [PATCH] 32-bit support notice followup just realized the compatibility package makes the binary size balloon to 50mb lmao jesus --- Bloxstrap/App.xaml.cs | 26 ++++++++++++++++---------- Bloxstrap/Bloxstrap.csproj | 5 ++--- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/Bloxstrap/App.xaml.cs b/Bloxstrap/App.xaml.cs index c9340d1..eaa922c 100644 --- a/Bloxstrap/App.xaml.cs +++ b/Bloxstrap/App.xaml.cs @@ -1,7 +1,7 @@ using System; +using System.Diagnostics; using System.Globalization; using System.IO; -using System.Management; using System.Net.Http; using System.Net; using System.Reflection; @@ -83,19 +83,25 @@ namespace Bloxstrap Logger.WriteLine($"[App::OnStartup] Starting {ProjectName} v{Version}"); + // todo: remove this once 32-bit support is fully gone if (!Environment.Is64BitOperatingSystem) { string message = "In the near future, Roblox will no longer support 32-bit Windows devices. To keep playing Roblox, please use a device that is 64-bit compatible."; - // check if the processor actually supports 64-bit so we can tell - // the user that they are able to upgrade to 64-bit windows - foreach (ManagementObject result in new ManagementObjectSearcher("SELECT * FROM Win32_Processor").Get()) - { - // https://learn.microsoft.com/en-us/windows/win32/cimwin32prov/win32-processor - // architecture type 9 is x64 - if (result["Architecture"].ToString() == "9") - message += "\n\nYour computer is running a 32-bit version of Windows but is actually 64-bit compatible. Search online for how to upgrade to a 64-bit version of Windows."; - } + // check if the processor actually supports 64-bit with wmic + // chances are the user just has a 32-bit version of windows installed on 64-bit hardware + Process p = new(); + p.StartInfo.CreateNoWindow = true; + p.StartInfo.UseShellExecute = false; + p.StartInfo.RedirectStandardOutput = true; + p.StartInfo.FileName = "wmic.exe"; + p.StartInfo.Arguments = "cpu get Architecture"; + p.Start(); + + // https://learn.microsoft.com/en-us/windows/win32/cimwin32prov/win32-processor + // architecture type 9 is x64 + if (p.StandardOutput.ReadToEnd().Contains('9')) + message += "\n\nYour computer is running a 32-bit version of Windows but is actually 64-bit compatible. Search online for how to upgrade to a 64-bit version of Windows."; ShowMessageBox(message, MessageBoxImage.Warning); } diff --git a/Bloxstrap/Bloxstrap.csproj b/Bloxstrap/Bloxstrap.csproj index 9d374bf..eca361c 100644 --- a/Bloxstrap/Bloxstrap.csproj +++ b/Bloxstrap/Bloxstrap.csproj @@ -7,8 +7,8 @@ true True Bloxstrap.ico - 2.1.0 - 2.1.0.0 + 2.0.0 + 2.0.0.0 app.manifest @@ -26,7 +26,6 @@ -