Skip to content

Commit

Permalink
update to v15.3
Browse files Browse the repository at this point in the history
  • Loading branch information
hellzerg committed May 18, 2023
1 parent 1fd9bdc commit fcebecb
Show file tree
Hide file tree
Showing 20 changed files with 784 additions and 574 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## [15.3] - 2023-05-18
- New: Automation engine by using reusable templates (https://github.com/hellzerg/optimizer/blob/master/TEMPLATING.md)
- Hotfix: Various localization updates
- Hotfix: Rare bug in Cleaner, when choosing Mozilla Firefox
- Hotfix: Improvements on UI scaling

## [15.2] - 2023-05-11
- New: Disable or Reset svchost process splitting mechanism
- Hotfix: Rare crash when loading UWP apps
Expand Down
27 changes: 1 addition & 26 deletions CONFS.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
### Reduces the amount of svchost processes running, improving RAM usage ###
### To disable it, you need to provide your amount of RAM using this command (example for 8GB RAM): ###


```optimizer.exe /svchostsplit=8```

#### Reset the mechanism to its default configuration using: ####
Expand All @@ -63,28 +62,4 @@
## How to disable/enable HPET (High Precision Event Timer) in order to gain a boost when gaming [use at your own risk!] ##

- ```optimizer.exe /disablehpet```
- ```optimizer.exe /enablehpet```

## 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.

* ```true```: applies the specific option
* ```false```: resets the specific option
* ```null```: ignores the specific option

Then, execute it like this: ```optimizer.exe /config=win10.conf```

### For Windows 7: ###
https://github.com/hellzerg/optimizer/blob/master/confs/win7.conf

### For Windows 8/8.1: ###
https://github.com/hellzerg/optimizer/blob/master/confs/win8.conf

### For Windows 10: ###
https://github.com/hellzerg/optimizer/blob/master/confs/win10.conf

### For Windows 11: ###
https://github.com/hellzerg/optimizer/blob/master/confs/win11.conf


- ```optimizer.exe /enablehpet```
48 changes: 27 additions & 21 deletions Optimizer/CleanHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,38 +262,44 @@ internal static void PreviewInternetExplorerCache()

internal static void PreviewFireFoxClean(bool cache, bool cookies, bool searchHistory)
{
foreach (string x in Directory.EnumerateDirectories(firefoxRoaming))
if (Directory.Exists(firefoxRoaming))
{
if (x.ToLowerInvariant().Contains("release"))
foreach (string x in Directory.EnumerateDirectories(firefoxRoaming))
{
if (cookies)
{
PreviewFolder(Path.Combine(x, "cookies.sqlite"));
PreviewSizeToBeFreed += CalculateSize(Path.Combine(x, "cookies.sqlite"));
}

if (searchHistory)
{
PreviewFolder(Path.Combine(x, "places.sqlite"));
PreviewSizeToBeFreed += CalculateSize(Path.Combine(x, "places.sqlite"));
}

if (cache)
if (x.ToLowerInvariant().Contains("release"))
{
PreviewFolder(Path.Combine(x, "shader-cache"));
PreviewSizeToBeFreed += CalculateSize(Path.Combine(x, "shader-cache"));
if (cookies)
{
PreviewFolder(Path.Combine(x, "cookies.sqlite"));
PreviewSizeToBeFreed += CalculateSize(Path.Combine(x, "cookies.sqlite"));
}

if (searchHistory)
{
PreviewFolder(Path.Combine(x, "places.sqlite"));
PreviewSizeToBeFreed += CalculateSize(Path.Combine(x, "places.sqlite"));
}

if (cache)
{
PreviewFolder(Path.Combine(x, "shader-cache"));
PreviewSizeToBeFreed += CalculateSize(Path.Combine(x, "shader-cache"));
}
}
}
}

if (cache)
{
foreach (string x in Directory.EnumerateDirectories(firefoxLocal))
if (Directory.Exists(firefoxLocal))
{
if (x.ToLowerInvariant().Contains("release"))
foreach (string x in Directory.EnumerateDirectories(firefoxLocal))
{
PreviewFolder(Path.Combine(x, "cache2"));
PreviewSizeToBeFreed += CalculateSize(Path.Combine(x, "cache2"));
if (x.ToLowerInvariant().Contains("release"))
{
PreviewFolder(Path.Combine(x, "cache2"));
PreviewSizeToBeFreed += CalculateSize(Path.Combine(x, "cache2"));
}
}
}
}
Expand Down
46 changes: 46 additions & 0 deletions Optimizer/ErrorLogger.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,60 @@
using System;
using System.IO;
using System.Text;

namespace Optimizer
{
internal static class ErrorLogger
{
internal static string ErrorLogFile = Path.Combine(CoreHelper.CoreFolder, "Optimizer.log");

static StringBuilder _silentReportLog;

private static void LogErrorSilent(string functionName, string errorMessage, string errorStackTrace)
{
_silentReportLog.AppendLine(string.Format("[ERROR] [{0}] in function [{1}]", DateTime.Now.ToString(), functionName));
_silentReportLog.AppendLine();
_silentReportLog.AppendLine(errorMessage);
_silentReportLog.AppendLine();
_silentReportLog.AppendLine(errorStackTrace);
_silentReportLog.AppendLine();
_silentReportLog.AppendLine();
}

internal static void LogInfoSilent(string message)
{
_silentReportLog.AppendLine($"[OK] {message}");
_silentReportLog.AppendLine();
}

internal static void InitSilentReport()
{
_silentReportLog = new StringBuilder();

_silentReportLog.AppendLine(Utilities.GetWindowsDetails());
_silentReportLog.AppendLine(string.Format("Optimizer {0} - .NET Framework {1} - Experimental build: {2}", Program.GetCurrentVersionTostring(), Utilities.GetNETFramework(), Program.EXPERIMENTAL_BUILD));

_silentReportLog.AppendLine();
_silentReportLog.AppendLine();
}

internal static void GenerateSilentReport()
{
try
{
File.WriteAllText("optimizer-silent-report.log", _silentReportLog.ToString());
}
catch { }
}

internal static void LogError(string functionName, string errorMessage, string errorStackTrace)
{
if (Program.SILENT_MODE)
{
LogErrorSilent(functionName, errorMessage, errorStackTrace);
return;
}

try
{
if (!File.Exists(ErrorLogFile) || (File.Exists(ErrorLogFile) && File.ReadAllText(ErrorLogFile).Trim() == string.Empty))
Expand Down
Loading

0 comments on commit fcebecb

Please sign in to comment.