Răsfoiți Sursa

CPU detection under Windows 7 hotfix (v11.5)

deadmoon 3 ani în urmă
părinte
comite
5ac3164419
7 a modificat fișierele cu 58 adăugiri și 26 ștergeri
  1. 3 0
      CHANGELOG.md
  2. 27 12
      CONFS.md
  3. 0 1
      Optimizer/Forms/MainForm.cs
  4. 19 4
      Optimizer/IndiciumHelper.cs
  5. 3 3
      Optimizer/Program.cs
  6. 5 5
      README.md
  7. 1 1
      version.txt

+ 3 - 0
CHANGELOG.md

@@ -2,6 +2,9 @@
 
 
 All notable changes to this project will be documented in this file.
 All notable changes to this project will be documented in this file.
 
 
+## [11.5] - 2022-01-31
+- Hotfix: Crashing when detecting CPU on Windows 7 (#90)
+
 ## [11.4] - 2022-01-30
 ## [11.4] - 2022-01-30
 - New: Hardware specifications inspection tool
 - New: Hardware specifications inspection tool
 - New: Network speed monitoring in Quick Access Menu (if enabled)
 - New: Network speed monitoring in Quick Access Menu (if enabled)

+ 27 - 12
CONFS.md

@@ -1,3 +1,29 @@
+## Run Optimizer on Windows Server 2008-2012-2016-2019-2022 ##
+#### Some options might not work properly ####
+optimizer.exe /unsafe
+
+## How to disable Windows Defender in Windows 10 1903 and later ##
+#### https://docs.microsoft.com/en-us/windows-hardware/customize/desktop/unattend/security-malware-windows-defender-disableantispyware "DisableAntiSpyware" is discontinued and will be ignored on client devices, as of version 1903. ####
+
+- Restart in SAFE MODE
+- Execute: optimizer.exe /disabledefender
+
+## You may disable specific tools for troubleshooting purposes ##
+#### Available list: ####
+
+* Hardware inspection utility (indicium)
+* Common Apps downloader tool (apps)
+* HOSTS Editor tool (hosts)
+* UWP Apps Uninstaller (uwp)
+
+#### Examples ####
+
+- optimizer.exe /disable=indicium,uwp
+- optimizer.exe /disable=indicium,uwp,hosts
+
+## Reset Optimizer configuration might fix it when can't open ##
+optimizer.exe /reset
+
 ## You can execute Optimizer silently, applying tweaks according to a configuration file. ##
 ## You can execute Optimizer silently, applying tweaks according to a configuration file. ##
 
 
 Download the configuration file based on your Windows version and edit it accordingly.
 Download the configuration file based on your Windows version and edit it accordingly.
@@ -6,7 +32,7 @@ Download the configuration file based on your Windows version and edit it accord
 * false: resets the specific option
 * false: resets the specific option
 * null: ignores the specific option
 * null: ignores the specific option
 
 
-Then, execute it like this: optimizer.exe /w10.conf
+Then, execute it like this: optimizer.exe /win10.conf
 
 
 ### For Windows 7: ###
 ### For Windows 7: ###
 https://github.com/hellzerg/optimizer/blob/master/confs/win7.conf
 https://github.com/hellzerg/optimizer/blob/master/confs/win7.conf
@@ -20,15 +46,4 @@ https://github.com/hellzerg/optimizer/blob/master/confs/win10.conf
 ### For Windows 11: ###
 ### For Windows 11: ###
 https://github.com/hellzerg/optimizer/blob/master/confs/win11.conf
 https://github.com/hellzerg/optimizer/blob/master/confs/win11.conf
 
 
-## Run Optimizer on Windows Server 2008-2012-2016-2019-2022 ##
-#### Some options might not work properly ####
-optimizer.exe /unsafe
-
-## How to disable Windows Defender in Windows 10 1903 and later ##
-#### https://docs.microsoft.com/en-us/windows-hardware/customize/desktop/unattend/security-malware-windows-defender-disableantispyware "DisableAntiSpyware" is discontinued and will be ignored on client devices, as of version 1903. ####
 
 
-- Restart in SAFE MODE
-- Execute: optimizer.exe /disabledefender
-
-## Reset Optimizer configuration might fix it when can't open ##
-optimizer.exe /reset

+ 0 - 1
Optimizer/Forms/MainForm.cs

@@ -1164,7 +1164,6 @@ namespace Optimizer
 
 
                     node.Nodes.Add("Cores: " + cpu.Cores);
                     node.Nodes.Add("Cores: " + cpu.Cores);
                     node.Nodes.Add("Threads: " + cpu.LogicalCpus);
                     node.Nodes.Add("Threads: " + cpu.LogicalCpus);
-                    //node.Nodes.Add("Logical CPUs: " + cpu.LogicalCpus);
                     node.Nodes.Add("Virtualization: " + cpu.Virtualization);
                     node.Nodes.Add("Virtualization: " + cpu.Virtualization);
                     node.Nodes.Add("Data Execution Prevention: " + cpu.DataExecutionPrevention);
                     node.Nodes.Add("Data Execution Prevention: " + cpu.DataExecutionPrevention);
                     node.Nodes.Add("L2 Cache: " + cpu.L2CacheSize);
                     node.Nodes.Add("L2 Cache: " + cpu.L2CacheSize);

+ 19 - 4
Optimizer/IndiciumHelper.cs

@@ -33,10 +33,22 @@ namespace Optimizer
                     cpu.L2CacheSize = ByteSize.FromKiloBytes(Convert.ToDouble(mo.Properties["L2CacheSize"].Value));
                     cpu.L2CacheSize = ByteSize.FromKiloBytes(Convert.ToDouble(mo.Properties["L2CacheSize"].Value));
                     cpu.L3CacheSize = ByteSize.FromKiloBytes(Convert.ToDouble(mo.Properties["L3CacheSize"].Value));
                     cpu.L3CacheSize = ByteSize.FromKiloBytes(Convert.ToDouble(mo.Properties["L3CacheSize"].Value));
                     cpu.Cores = Convert.ToUInt32(mo.Properties["NumberOfCores"].Value);
                     cpu.Cores = Convert.ToUInt32(mo.Properties["NumberOfCores"].Value);
-                    cpu.Threads = Convert.ToUInt32(mo.Properties["ThreadCount"].Value);
+
+                    // ThreadCount is for Windows 10+
+                    //cpu.Threads = Convert.ToUInt32(mo.Properties["ThreadCount"].Value);
+
                     cpu.LogicalCpus = Convert.ToUInt32(mo.Properties["NumberOfLogicalProcessors"].Value);
                     cpu.LogicalCpus = Convert.ToUInt32(mo.Properties["NumberOfLogicalProcessors"].Value);
-                    bool temp = Convert.ToBoolean(mo.Properties["VirtualizationFirmwareEnabled"].Value);
-                    cpu.Virtualization = (temp) ? "Yes" : "No";
+
+                    if (Utilities.CurrentWindowsVersion != WindowsVersion.Windows7)
+                    {
+                        bool temp = Convert.ToBoolean(mo.Properties["VirtualizationFirmwareEnabled"].Value);
+                        cpu.Virtualization = (temp) ? "Yes" : "No";
+                    }
+                    else
+                    {
+                        cpu.Virtualization = "-";
+                    }
+                    
                     cpu.Stepping = Convert.ToString(mo.Properties["Description"].Value);
                     cpu.Stepping = Convert.ToString(mo.Properties["Description"].Value);
                     cpu.Revision = Convert.ToString(mo.Properties["Revision"].Value);
                     cpu.Revision = Convert.ToString(mo.Properties["Revision"].Value);
 
 
@@ -49,7 +61,10 @@ namespace Optimizer
                             cpu.DataExecutionPrevention = (temp2) ? "Yes" : "No";
                             cpu.DataExecutionPrevention = (temp2) ? "Yes" : "No";
                         }
                         }
                     }
                     }
-                    catch { }
+                    catch 
+                    {
+                        cpu.DataExecutionPrevention = "-";
+                    }
 
 
                     if (string.IsNullOrEmpty(cpu.Name)) cpu.Name = GetCPUNameAlternative();
                     if (string.IsNullOrEmpty(cpu.Name)) cpu.Name = GetCPUNameAlternative();
 
 

+ 3 - 3
Optimizer/Program.cs

@@ -12,10 +12,10 @@ namespace Optimizer
         /* VERSION PROPERTIES */
         /* VERSION PROPERTIES */
         /* DO NOT LEAVE THEM EMPTY */
         /* DO NOT LEAVE THEM EMPTY */
 
 
-        internal readonly static float Major = 0;
-        internal readonly static float Minor = 0;
+        internal readonly static float Major = 11;
+        internal readonly static float Minor = 5;
 
 
-        internal readonly static bool EXPERIMENTAL_BUILD = true;
+        internal readonly static bool EXPERIMENTAL_BUILD = false;
 
 
         internal static string GetCurrentVersionTostring()
         internal static string GetCurrentVersionTostring()
         {
         {

+ 5 - 5
README.md

@@ -10,7 +10,7 @@ Optimizer is recommended after a fresh, clean installation of Windows to achieve
 
 
 Depending on your version of Windows, Optimizer will also allow you to perform some specific tweaks.
 Depending on your version of Windows, Optimizer will also allow you to perform some specific tweaks.
 <p align="center">
 <p align="center">
-	<a href="https://github.com/hellzerg/optimizer/releases/download/11.4/Optimizer-11.4.exe" target="_blank">
+	<a href="https://github.com/hellzerg/optimizer/releases/download/11.5/Optimizer-11.5.exe" target="_blank">
 		<img src="download-button.png">
 		<img src="download-button.png">
 		<br>
 		<br>
 		<img src="flags.png">
 		<img src="flags.png">
@@ -49,7 +49,7 @@ https://github.com/hellzerg/optimizer/blob/master/IMAGES.md
 #### (https://docs.microsoft.com/en-us/windows-hardware/customize/desktop/unattend/security-malware-windows-defender-disableantispyware) ####
 #### (https://docs.microsoft.com/en-us/windows-hardware/customize/desktop/unattend/security-malware-windows-defender-disableantispyware) ####
 Restart in SAFE-MODE and run Optimizer with "/disabledefender" switch
 Restart in SAFE-MODE and run Optimizer with "/disabledefender" switch
 
 
-## Silent configuration files: ##
+## Command-line options and silent configuration files: ##
 https://github.com/hellzerg/optimizer/blob/master/CONFS.md
 https://github.com/hellzerg/optimizer/blob/master/CONFS.md
 
 
 ## Changelog: ##
 ## Changelog: ##
@@ -84,6 +84,6 @@ https://github.com/hellzerg/optimizer/blob/master/FEED.md
 
 
 ## Details: ##
 ## Details: ##
 
 
-* Latest version: 11.4
-* Released: January 30, 2022
-* SHA256: 7A04483407F7493B6B18CFB56BFD42F1BE63CBAF3A4BD89CD25334E60DE318A7
+* Latest version: 11.5
+* Released: January 31, 2022
+* SHA256: 116D9B0AD6103F1F7CF70D01E21E7DEE17411DD63EDEA0D682232A62D6BE7CC7

+ 1 - 1
version.txt

@@ -1 +1 @@
-11.4
+11.5