Browse Source

Updated to v10.2

deadmoon 3 years ago
parent
commit
96b156db6e

+ 5 - 0
CHANGELOG.md

@@ -2,6 +2,11 @@
 
 
 All notable changes to this project will be documented in this file.
 All notable changes to this project will be documented in this file.
 
 
+## [10.2] - 2021-10-07
+- New: Optimizer now runs in single-instance mode
+- Improved: Preview and select files before cleaning
+- Improved: French translation
+
 ## [10.1] - 2021-10-06
 ## [10.1] - 2021-10-06
 - New: Fully compatible with Windows 11 (with silent configuration support)
 - New: Fully compatible with Windows 11 (with silent configuration support)
 - New: Align taskbar to te left
 - New: Align taskbar to te left

+ 35 - 39
Optimizer/CleanHelper.cs

@@ -1,4 +1,5 @@
 using System;
 using System;
+using System.Collections.Generic;
 using System.IO;
 using System.IO;
 using System.Linq;
 using System.Linq;
 using System.Runtime.InteropServices;
 using System.Runtime.InteropServices;
@@ -15,31 +16,32 @@ namespace Optimizer
         internal static readonly string ProfileAppDataRoaming = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
         internal static readonly string ProfileAppDataRoaming = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
         internal static readonly string ProgramData = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);
         internal static readonly string ProgramData = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);
         internal static readonly string ProfileAppDataLocal = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
         internal static readonly string ProfileAppDataLocal = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
-        internal static readonly string ProfileAppDataLocalLow = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "Low";
-        internal static readonly string OSDrive = System32Folder.Substring(0, 3);
+        //internal static readonly string ProfileAppDataLocalLow = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "Low";
+        //internal static readonly string OSDrive = System32Folder.Substring(0, 3);
         internal static readonly string OSDriveWindows = Environment.GetEnvironmentVariable("WINDIR", EnvironmentVariableTarget.Machine);
         internal static readonly string OSDriveWindows = Environment.GetEnvironmentVariable("WINDIR", EnvironmentVariableTarget.Machine);
 
 
-        internal static void EmptyFolder(string path)
+        internal static List<string> PreviewCleanList = new List<string>();
+
+        internal static void PreviewFolder(string path)
         {
         {
             try
             try
             {
             {
                 DirectoryInfo di = new DirectoryInfo(path);
                 DirectoryInfo di = new DirectoryInfo(path);
 
 
-                foreach (FileInfo file in di.GetFiles())
+                foreach (FileInfo file in di.GetFiles("*", SearchOption.AllDirectories))
                 {
                 {
                     try
                     try
                     {
                     {
-                        file.IsReadOnly = false;
-                        file.Delete();
+                        PreviewCleanList.Add(file.FullName);
                     }
                     }
                     catch { }
                     catch { }
                 }
                 }
 
 
-                foreach (DirectoryInfo dir in di.GetDirectories())
+                foreach (DirectoryInfo dir in di.GetDirectories("*", SearchOption.AllDirectories))
                 {
                 {
                     try
                     try
                     {
                     {
-                        dir.Delete(true);
+                        PreviewCleanList.Add(dir.FullName);
                     }
                     }
                     catch { }
                     catch { }
                 }
                 }
@@ -47,50 +49,44 @@ namespace Optimizer
             catch { }
             catch { }
         }
         }
 
 
-        internal static void EmptyRecycleBin()
+        internal static void Clean()
         {
         {
-            SHEmptyRecycleBin(IntPtr.Zero, null, RecycleFlag.SHERB_NOSOUND | RecycleFlag.SHERB_NOCONFIRMATION);
-        }
-
-        internal static void CleanTemporaries()
-        {
-            EmptyFolder(TempFolder);
+            foreach (string x in PreviewCleanList)
+            {
+                try
+                {
+                    if (Directory.Exists(x)) Directory.Delete(x);
+                    if (File.Exists(x)) File.Delete(x);
+                }
+                catch { }
+            }
         }
         }
 
 
-        internal static void CleanMiniDumps()
+        internal static void EmptyRecycleBin()
         {
         {
-            EmptyFolder(OSDriveWindows + "\\Minidump");
+            SHEmptyRecycleBin(IntPtr.Zero, null, RecycleFlag.SHERB_NOSOUND | RecycleFlag.SHERB_NOCONFIRMATION);
         }
         }
 
 
-        internal static void CleanErrorReports()
+        internal static void PreviewTemp()
         {
         {
-            EmptyFolder(ProfileAppDataLocal + "\\Microsoft\\Windows\\WER\\ReportArchive");
-            EmptyFolder(ProfileAppDataLocal + "\\Microsoft\\Windows\\WER\\ReportQueue");
-            EmptyFolder(ProfileAppDataLocal + "\\Microsoft\\Windows\\WER\\Temp");
-            EmptyFolder(ProfileAppDataLocal + "\\Microsoft\\Windows\\WER\\ERC");
-            EmptyFolder(ProgramData + "\\Microsoft\\Windows\\WER\\ReportArchive");
-            EmptyFolder(ProgramData + "\\Microsoft\\Windows\\WER\\ReportQueue");
-            EmptyFolder(ProgramData + "\\Microsoft\\Windows\\WER\\Temp");
-            EmptyFolder(ProgramData + "\\Microsoft\\Windows\\WER\\ERC");
+            PreviewFolder(TempFolder);
         }
         }
 
 
-        internal static void CleanMediaPlayersCache()
+        internal static void PreviewMinidumps()
         {
         {
-            EmptyFolder(ProfileAppDataLocal + "\\Microsoft\\Media Player");
-            EmptyFolder(ProfileAppDataLocalLow + "\\Apple Computer\\QuickTime\\downloads");
-            EmptyFolder(ProfileAppDataRoaming + "\\Macromedia");
-
-            try
-            {
-                File.Delete(ProfileAppDataLocalLow + "\\Apple Computer\\QuickTime\\QTPlayerSession.xml");
-            }
-            catch { }
+            PreviewFolder(OSDriveWindows + "\\Minidump");
         }
         }
 
 
-        internal static void CleanLogs()
+        internal static void PreviewErrorReports()
         {
         {
-            EmptyFolder(System32Folder + "\\LogFiles");
-            EmptyFolder(OSDrive + "\\inetpub\\logs\\LogFiles");
+            PreviewFolder(ProfileAppDataLocal + "\\Microsoft\\Windows\\WER\\ReportArchive");
+            PreviewFolder(ProfileAppDataLocal + "\\Microsoft\\Windows\\WER\\ReportQueue");
+            PreviewFolder(ProfileAppDataLocal + "\\Microsoft\\Windows\\WER\\Temp");
+            PreviewFolder(ProfileAppDataLocal + "\\Microsoft\\Windows\\WER\\ERC");
+            PreviewFolder(ProgramData + "\\Microsoft\\Windows\\WER\\ReportArchive");
+            PreviewFolder(ProgramData + "\\Microsoft\\Windows\\WER\\ReportQueue");
+            PreviewFolder(ProgramData + "\\Microsoft\\Windows\\WER\\Temp");
+            PreviewFolder(ProgramData + "\\Microsoft\\Windows\\WER\\ERC");
         }
         }
 
 
         // only for TEMP folder
         // only for TEMP folder

+ 166 - 0
Optimizer/CleanPreviewForm.Designer.cs

@@ -0,0 +1,166 @@
+
+namespace Optimizer
+{
+    partial class CleanPreviewForm
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.panel2 = new System.Windows.Forms.Panel();
+            this.cancelBackup = new System.Windows.Forms.Button();
+            this.cleanDriveB = new System.Windows.Forms.Button();
+            this.panel1 = new System.Windows.Forms.Panel();
+            this.listPreview = new Optimizer.ColoredCheckList();
+            this.checkSelectAll = new System.Windows.Forms.LinkLabel();
+            this.panel2.SuspendLayout();
+            this.panel1.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // panel2
+            // 
+            this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.panel2.Controls.Add(this.checkSelectAll);
+            this.panel2.Controls.Add(this.cancelBackup);
+            this.panel2.Controls.Add(this.cleanDriveB);
+            this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom;
+            this.panel2.Location = new System.Drawing.Point(0, 526);
+            this.panel2.Name = "panel2";
+            this.panel2.Size = new System.Drawing.Size(834, 38);
+            this.panel2.TabIndex = 1;
+            // 
+            // cancelBackup
+            // 
+            this.cancelBackup.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+            this.cancelBackup.BackColor = System.Drawing.Color.DodgerBlue;
+            this.cancelBackup.FlatAppearance.BorderColor = System.Drawing.Color.DodgerBlue;
+            this.cancelBackup.FlatAppearance.MouseDownBackColor = System.Drawing.Color.RoyalBlue;
+            this.cancelBackup.FlatAppearance.MouseOverBackColor = System.Drawing.Color.RoyalBlue;
+            this.cancelBackup.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.cancelBackup.ForeColor = System.Drawing.Color.White;
+            this.cancelBackup.Location = new System.Drawing.Point(532, 3);
+            this.cancelBackup.Margin = new System.Windows.Forms.Padding(2);
+            this.cancelBackup.Name = "cancelBackup";
+            this.cancelBackup.Size = new System.Drawing.Size(147, 31);
+            this.cancelBackup.TabIndex = 36;
+            this.cancelBackup.Tag = "themeable";
+            this.cancelBackup.Text = "Cancel";
+            this.cancelBackup.UseVisualStyleBackColor = false;
+            this.cancelBackup.Click += new System.EventHandler(this.cancelBackup_Click);
+            // 
+            // cleanDriveB
+            // 
+            this.cleanDriveB.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+            this.cleanDriveB.BackColor = System.Drawing.Color.DodgerBlue;
+            this.cleanDriveB.FlatAppearance.BorderColor = System.Drawing.Color.DodgerBlue;
+            this.cleanDriveB.FlatAppearance.MouseDownBackColor = System.Drawing.Color.RoyalBlue;
+            this.cleanDriveB.FlatAppearance.MouseOverBackColor = System.Drawing.Color.RoyalBlue;
+            this.cleanDriveB.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.cleanDriveB.ForeColor = System.Drawing.Color.White;
+            this.cleanDriveB.Location = new System.Drawing.Point(683, 3);
+            this.cleanDriveB.Margin = new System.Windows.Forms.Padding(2);
+            this.cleanDriveB.Name = "cleanDriveB";
+            this.cleanDriveB.Size = new System.Drawing.Size(147, 31);
+            this.cleanDriveB.TabIndex = 35;
+            this.cleanDriveB.Tag = "themeable";
+            this.cleanDriveB.Text = "Clean";
+            this.cleanDriveB.UseVisualStyleBackColor = false;
+            this.cleanDriveB.Click += new System.EventHandler(this.cleanDriveB_Click);
+            // 
+            // panel1
+            // 
+            this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.panel1.Controls.Add(this.listPreview);
+            this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.panel1.Location = new System.Drawing.Point(0, 0);
+            this.panel1.Name = "panel1";
+            this.panel1.Size = new System.Drawing.Size(834, 526);
+            this.panel1.TabIndex = 2;
+            // 
+            // listPreview
+            // 
+            this.listPreview.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
+            this.listPreview.BorderStyle = System.Windows.Forms.BorderStyle.None;
+            this.listPreview.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.listPreview.Font = new System.Drawing.Font("Segoe UI Semibold", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.listPreview.ForeColor = System.Drawing.Color.Silver;
+            this.listPreview.FormattingEnabled = true;
+            this.listPreview.Location = new System.Drawing.Point(0, 0);
+            this.listPreview.Name = "listPreview";
+            this.listPreview.Size = new System.Drawing.Size(832, 524);
+            this.listPreview.TabIndex = 0;
+            // 
+            // checkSelectAll
+            // 
+            this.checkSelectAll.AutoSize = true;
+            this.checkSelectAll.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.checkSelectAll.ForeColor = System.Drawing.Color.DodgerBlue;
+            this.checkSelectAll.LinkColor = System.Drawing.Color.DodgerBlue;
+            this.checkSelectAll.Location = new System.Drawing.Point(2, 7);
+            this.checkSelectAll.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.checkSelectAll.Name = "checkSelectAll";
+            this.checkSelectAll.Size = new System.Drawing.Size(75, 21);
+            this.checkSelectAll.TabIndex = 87;
+            this.checkSelectAll.TabStop = true;
+            this.checkSelectAll.Tag = "themeable";
+            this.checkSelectAll.Text = "Select all";
+            this.checkSelectAll.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.checkSelectAll_LinkClicked);
+            // 
+            // CleanPreviewForm
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
+            this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
+            this.ClientSize = new System.Drawing.Size(834, 564);
+            this.Controls.Add(this.panel1);
+            this.Controls.Add(this.panel2);
+            this.DoubleBuffered = true;
+            this.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.ForeColor = System.Drawing.Color.White;
+            this.MinimizeBox = false;
+            this.Name = "CleanPreviewForm";
+            this.ShowIcon = false;
+            this.ShowInTaskbar = false;
+            this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+            this.Text = "Clean Preview";
+            this.Load += new System.EventHandler(this.CleanPreviewForm_Load);
+            this.panel2.ResumeLayout(false);
+            this.panel2.PerformLayout();
+            this.panel1.ResumeLayout(false);
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Panel panel2;
+        private System.Windows.Forms.Panel panel1;
+        private System.Windows.Forms.Button cancelBackup;
+        private System.Windows.Forms.Button cleanDriveB;
+        private ColoredCheckList listPreview;
+        private System.Windows.Forms.LinkLabel checkSelectAll;
+    }
+}

+ 82 - 0
Optimizer/CleanPreviewForm.cs

@@ -0,0 +1,82 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Windows.Forms;
+
+namespace Optimizer
+{
+    public partial class CleanPreviewForm : Form
+    {
+        bool selectAll = true;
+
+        public CleanPreviewForm(List<string> preview)
+        {
+            InitializeComponent();
+
+            CheckForIllegalCrossThreadCalls = false;
+            Options.ApplyTheme(this);
+
+            if (Options.CurrentOptions.LanguageCode != LanguageCode.EN) Translate();
+
+            preview.Sort();
+            listPreview.Items.AddRange(preview.ToArray());
+
+            for (int i = 0; i < listPreview.Items.Count; i++)
+            {
+                listPreview.SetItemChecked(i, true);
+            }
+        }
+
+        private void CleanPreviewForm_Load(object sender, EventArgs e)
+        {
+
+        }
+
+        private void cancelBackup_Click(object sender, EventArgs e)
+        {
+            this.Close();
+        }
+
+        private void cleanDriveB_Click(object sender, EventArgs e)
+        {
+            cleanDriveB.Enabled = false;
+
+            CleanHelper.PreviewCleanList.Clear();
+            for (int i = 0; i < listPreview.CheckedItems.Count; i++)
+            {
+                CleanHelper.PreviewCleanList.Add(listPreview.CheckedItems[i].ToString());
+            }
+
+            CleanHelper.Clean();
+            this.Close();
+        }
+
+        private void Translate()
+        {
+            this.Text = Options.TranslationList["CleanPreviewForm"];
+
+            Dictionary<string, string> translationList = Options.TranslationList.ToObject<Dictionary<string, string>>();
+
+            Control element;
+
+            foreach (var x in translationList)
+            {
+                if (x.Key == null || x.Key == string.Empty) continue;
+                element = this.Controls.Find(x.Key, true).FirstOrDefault();
+
+                if (element == null) continue;
+
+                element.Text = x.Value;
+            }
+        }
+
+        private void checkSelectAll_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
+        {
+            selectAll = !selectAll;
+            for (int i = 0; i < listPreview.Items.Count; i++)
+            {
+                listPreview.SetItemChecked(i, selectAll);
+            }
+        }
+    }
+}

+ 120 - 0
Optimizer/CleanPreviewForm.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 5 - 0
Optimizer/ColoredControls/ColoredCheckBox.cs

@@ -6,6 +6,11 @@ namespace Optimizer
 {
 {
     public class ColoredCheckBox : CheckBox
     public class ColoredCheckBox : CheckBox
     {
     {
+        public ColoredCheckBox()
+        {
+            DoubleBuffered = true;
+        }
+
         protected override void OnCheckedChanged(EventArgs e)
         protected override void OnCheckedChanged(EventArgs e)
         {
         {
             base.OnCheckedChanged(e);
             base.OnCheckedChanged(e);

+ 64 - 0
Optimizer/ColoredControls/ColoredCheckList.cs

@@ -0,0 +1,64 @@
+using System.Drawing;
+using System.Windows.Forms;
+
+namespace Optimizer
+{
+    public class ColoredCheckList : CheckedListBox
+    {
+        public ColoredCheckList()
+        {
+            DoubleBuffered = true;
+        }
+
+        protected override void OnDrawItem(DrawItemEventArgs e)
+        {
+            Color foreColor = Color.Silver;
+            Color accentColor = Color.MediumOrchid;
+
+            switch (Options.CurrentOptions.Color)
+            {
+                case Theme.Caramel:
+                    accentColor = Color.DarkOrange;
+                    break;
+                case Theme.Lime:
+                    accentColor = Color.LimeGreen;
+                    break;
+                case Theme.Magma:
+                    accentColor = Color.Tomato;
+                    break;
+                case Theme.Minimal:
+                    accentColor = Color.Gray;
+                    break;
+                case Theme.Ocean:
+                    accentColor = Color.DodgerBlue;
+                    break;
+                case Theme.Zerg:
+                    accentColor = Color.MediumOrchid;
+                    break;
+            }
+
+            if (this.Items.Count > 0)
+            {
+                if (e.Index >= 0)
+                {
+                    foreColor = GetItemChecked(e.Index) ? accentColor : foreColor;
+                }
+                else
+                {
+                    foreColor = e.ForeColor;
+                }
+            }
+
+            var tweakedEventArgs = new DrawItemEventArgs(
+                e.Graphics,
+                e.Font,
+                e.Bounds,
+                e.Index,
+                e.State,
+                foreColor,
+                e.BackColor);
+
+            base.OnDrawItem(tweakedEventArgs);
+        }
+    }
+}

+ 1 - 0
Optimizer/ColoredControls/ColoredProgress.cs

@@ -8,6 +8,7 @@ namespace Optimizer
     {
     {
         public ColoredProgress()
         public ColoredProgress()
         {
         {
+            DoubleBuffered = true;
             this.SetStyle(ControlStyles.UserPaint, true);
             this.SetStyle(ControlStyles.UserPaint, true);
         }
         }
 
 

+ 5 - 0
Optimizer/ColoredControls/ColoredRadioButton.cs

@@ -6,6 +6,11 @@ namespace Optimizer
 {
 {
     public class ColoredRadioButton : RadioButton
     public class ColoredRadioButton : RadioButton
     {
     {
+        public ColoredRadioButton()
+        {
+            DoubleBuffered = true;
+        }
+
         protected override void OnCheckedChanged(EventArgs e)
         protected override void OnCheckedChanged(EventArgs e)
         {
         {
             base.OnCheckedChanged(e);
             base.OnCheckedChanged(e);

+ 1 - 1
Optimizer/ErrorLogger.cs

@@ -11,7 +11,7 @@ namespace Optimizer
         {
         {
             try
             try
             {
             {
-                if (!File.Exists(ErrorLogFile) || ( File.Exists(ErrorLogFile) && File.ReadAllText(ErrorLogFile).Trim() == string.Empty ))
+                if (!File.Exists(ErrorLogFile) || (File.Exists(ErrorLogFile) && File.ReadAllText(ErrorLogFile).Trim() == string.Empty))
                 {
                 {
                     string bitness = Environment.Is64BitOperatingSystem ? "64-bit" : "32-bit";
                     string bitness = Environment.Is64BitOperatingSystem ? "64-bit" : "32-bit";
 
 

File diff suppressed because it is too large
+ 3858 - 3697
Optimizer/MainForm.Designer.cs


+ 29 - 27
Optimizer/MainForm.cs

@@ -12,7 +12,6 @@ using System.Net;
 using System.Net.NetworkInformation;
 using System.Net.NetworkInformation;
 using System.Reflection;
 using System.Reflection;
 using System.Text;
 using System.Text;
-using System.Threading;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
 using System.Windows.Forms;
 using System.Windows.Forms;
 
 
@@ -141,6 +140,15 @@ namespace Optimizer
                             File.Move(tempFile, appFile);
                             File.Move(tempFile, appFile);
 
 
                             _trayMenu = false;
                             _trayMenu = false;
+
+                            // BYPASS SINGLE-INSTANCE MECHANISM
+                            if (Program.MUTEX != null)
+                            {
+                                Program.MUTEX.ReleaseMutex();
+                                Program.MUTEX.Dispose();
+                                Program.MUTEX = null;
+                            }
+
                             Application.Restart();
                             Application.Restart();
                         }
                         }
                         catch (Exception ex)
                         catch (Exception ex)
@@ -850,23 +858,15 @@ namespace Optimizer
             {
             {
                 if (checkTemp.Checked)
                 if (checkTemp.Checked)
                 {
                 {
-                    CleanHelper.CleanTemporaries();
+                    CleanHelper.PreviewTemp();
                 }
                 }
                 if (checkMiniDumps.Checked)
                 if (checkMiniDumps.Checked)
                 {
                 {
-                    CleanHelper.CleanMiniDumps();
-                }
-                if (checkMediaCache.Checked)
-                {
-                    CleanHelper.CleanMediaPlayersCache();
-                }
-                if (checkLogs.Checked)
-                {
-                    CleanHelper.CleanLogs();
+                    CleanHelper.PreviewMinidumps();
                 }
                 }
                 if (checkErrorReports.Checked)
                 if (checkErrorReports.Checked)
                 {
                 {
-                    CleanHelper.CleanErrorReports();
+                    CleanHelper.PreviewErrorReports();
                 }
                 }
                 if (checkBin.Checked)
                 if (checkBin.Checked)
                 {
                 {
@@ -879,7 +879,7 @@ namespace Optimizer
             }
             }
             finally
             finally
             {
             {
-                Cleaning(false);
+                if (CleanHelper.PreviewCleanList.Count > 0) new CleanPreviewForm(CleanHelper.PreviewCleanList).ShowDialog();
                 GetFootprint();
                 GetFootprint();
             }
             }
         }
         }
@@ -1004,7 +1004,7 @@ namespace Optimizer
 
 
         private void Main_Load(object sender, EventArgs e)
         private void Main_Load(object sender, EventArgs e)
         {
         {
-            
+
         }
         }
 
 
         private void GetDesktopItems()
         private void GetDesktopItems()
@@ -1190,28 +1190,18 @@ namespace Optimizer
         {
         {
             checkTemp.Checked = checkSelectAll.Checked;
             checkTemp.Checked = checkSelectAll.Checked;
             checkMiniDumps.Checked = checkSelectAll.Checked;
             checkMiniDumps.Checked = checkSelectAll.Checked;
-            checkMediaCache.Checked = checkSelectAll.Checked;
-            checkLogs.Checked = checkSelectAll.Checked;
-            checkBin.Checked = checkSelectAll.Checked;
             checkErrorReports.Checked = checkSelectAll.Checked;
             checkErrorReports.Checked = checkSelectAll.Checked;
         }
         }
 
 
         private void button20_Click(object sender, EventArgs e)
         private void button20_Click(object sender, EventArgs e)
         {
         {
-            Cleaning(true);
-            Task t = new Task(() => CleanPC());
-            t.Start();
-        }
-
-        private void Cleaning(bool enabled)
-        {
-            cleanDriveB.Enabled = !enabled;
-            cleanDriveB.Text = (enabled) ? "..." : Options.TranslationList["cleanDriveB"];
+            CleanHelper.PreviewCleanList.Clear();
+            CleanPC();
         }
         }
 
 
         private void button32_Click(object sender, EventArgs e)
         private void button32_Click(object sender, EventArgs e)
         {
         {
-            if (listStartupItems.CheckedItems.Count <= 0) return; 
+            if (listStartupItems.CheckedItems.Count <= 0) return;
 
 
             string report = string.Empty;
             string report = string.Empty;
 
 
@@ -3123,5 +3113,17 @@ namespace Optimizer
         {
         {
             radioFrench.PerformClick();
             radioFrench.PerformClick();
         }
         }
+
+        private void listStartupItems_ItemChecked(object sender, ItemCheckedEventArgs e)
+        {
+            if (e.Item.Checked)
+            {
+                e.Item.ForeColor = Options.ForegroundColor;
+            }
+            else
+            {
+                e.Item.ForeColor = Color.White;
+            }
+        }
     }
     }
 }
 }

+ 12 - 0
Optimizer/Optimizer.csproj

@@ -97,6 +97,9 @@
     <Compile Include="AppCard.Designer.cs">
     <Compile Include="AppCard.Designer.cs">
       <DependentUpon>AppCard.cs</DependentUpon>
       <DependentUpon>AppCard.cs</DependentUpon>
     </Compile>
     </Compile>
+    <Compile Include="ColoredControls\ColoredCheckList.cs">
+      <SubType>Component</SubType>
+    </Compile>
     <Compile Include="ColoredControls\ColoredProgress.cs">
     <Compile Include="ColoredControls\ColoredProgress.cs">
       <SubType>Component</SubType>
       <SubType>Component</SubType>
     </Compile>
     </Compile>
@@ -121,6 +124,12 @@
     <Compile Include="FirstRunForm.Designer.cs">
     <Compile Include="FirstRunForm.Designer.cs">
       <DependentUpon>FirstRunForm.cs</DependentUpon>
       <DependentUpon>FirstRunForm.cs</DependentUpon>
     </Compile>
     </Compile>
+    <Compile Include="CleanPreviewForm.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="CleanPreviewForm.Designer.cs">
+      <DependentUpon>CleanPreviewForm.cs</DependentUpon>
+    </Compile>
     <Compile Include="Hardware.cs" />
     <Compile Include="Hardware.cs" />
     <Compile Include="HostsEditorForm.cs">
     <Compile Include="HostsEditorForm.cs">
       <SubType>Form</SubType>
       <SubType>Form</SubType>
@@ -190,6 +199,9 @@
     <EmbeddedResource Include="FirstRunForm.resx">
     <EmbeddedResource Include="FirstRunForm.resx">
       <DependentUpon>FirstRunForm.cs</DependentUpon>
       <DependentUpon>FirstRunForm.cs</DependentUpon>
     </EmbeddedResource>
     </EmbeddedResource>
+    <EmbeddedResource Include="CleanPreviewForm.resx">
+      <DependentUpon>CleanPreviewForm.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="HostsEditorForm.resx">
     <EmbeddedResource Include="HostsEditorForm.resx">
       <DependentUpon>HostsEditorForm.cs</DependentUpon>
       <DependentUpon>HostsEditorForm.cs</DependentUpon>
     </EmbeddedResource>
     </EmbeddedResource>

+ 137 - 132
Optimizer/Program.cs

@@ -1,7 +1,5 @@
 using System;
 using System;
-using System.Diagnostics;
 using System.IO;
 using System.IO;
-using System.Linq;
 using System.Reflection;
 using System.Reflection;
 using System.Threading;
 using System.Threading;
 using System.Windows.Forms;
 using System.Windows.Forms;
@@ -16,7 +14,7 @@ namespace Optimizer
         // Enter current version here
         // Enter current version here
 
 
         internal readonly static float Major = 10;
         internal readonly static float Major = 10;
-        internal readonly static float Minor = 1;
+        internal readonly static float Minor = 2;
 
 
         internal readonly static bool EXPERIMENTAL_BUILD = false;
         internal readonly static bool EXPERIMENTAL_BUILD = false;
 
 
@@ -50,6 +48,10 @@ namespace Optimizer
         static string _argInvalidMsg = "Invalid argument! Example: Optimizer.exe /silent.conf";
         static string _argInvalidMsg = "Invalid argument! Example: Optimizer.exe /silent.conf";
         static string _alreadyRunningMsg = "Optimizer is already running in the background!";
         static string _alreadyRunningMsg = "Optimizer is already running in the background!";
 
 
+        const string MUTEX_GUID = @"{DEADMOON-0EFC7B8A-D1FC-467F-B4B1-0117C643FE19-OPTIMIZER}";
+        internal static Mutex MUTEX;
+        static bool _notRunning;
+
         [STAThread]
         [STAThread]
         static void Main(string[] switches)
         static void Main(string[] switches)
         {
         {
@@ -68,168 +70,171 @@ namespace Optimizer
             //    Environment.Exit(0);
             //    Environment.Exit(0);
             //}
             //}
 
 
-            if (!Utilities.IsAdmin())
-            {
-                HelperForm f = new HelperForm(null, MessageType.Error, _adminMissingMessage);
-                f.ShowDialog();
-
-                Application.Exit();
-            }
-            else
+            // single-instance mechanism
+            using (MUTEX = new Mutex(true, MUTEX_GUID, out _notRunning))
             {
             {
-                if (Utilities.IsCompatible())
+                if (!_notRunning)
                 {
                 {
-                    // single-instance mechanism
-                    //int processCount = Process.GetProcesses().Count(p => p.ProcessName.ToLowerInvariant().Contains("optimizer"));
-
-                    //if (processCount > 1)
-                    //{
-                    //    MessageBox.Show(_alreadyRunningMsg, "Optimizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
-                    //    Environment.Exit(0);
-                    //}
-
-                    Required.Deploy();
-
-                    // for backward compatibility (legacy)
-                    Options.LegacyCheck();
-
-                    // load settings, if there is no settings, load defaults
-                    try
+                    MessageBox.Show(_alreadyRunningMsg, "Optimizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
+                    Environment.Exit(0);
+                }
+                else
+                {
+                    if (!Utilities.IsAdmin())
                     {
                     {
-                        // show FirstRunForm if app is running first time
-                        if (!File.Exists(Options.SettingsFile))
-                        {
-                            Options.LoadSettings();
-                            FirstRunForm frf = new FirstRunForm();
-                            frf.ShowDialog();
-                        }
-                        else
-                        {
-                            Options.LoadSettings();
-                        }
+                        HelperForm f = new HelperForm(null, MessageType.Error, _adminMissingMessage);
+                        f.ShowDialog();
 
 
-                        // ideal place to replace internal messages from translation list
-                        _adminMissingMessage = Options.TranslationList["adminMissingMsg"];
-                        _unsupportedMessage = Options.TranslationList["unsupportedMsg"];
-                        _confInvalidFormatMsg = Options.TranslationList["confInvalidFormatMsg"];
-                        _confInvalidVersionMsg = Options.TranslationList["confInvalidVersionMsg"];
-                        _confNotFoundMsg = Options.TranslationList["confNotFoundMsg"];
-                        _argInvalidMsg = Options.TranslationList["argInvalidMsg"];
-                        _alreadyRunningMsg = Options.TranslationList["alreadyRunningMsg"];
-                    }
-                    catch (Exception ex)
-                    {
-                        ErrorLogger.LogError("Program.Main", ex.Message, ex.StackTrace);
+                        Application.Exit();
                     }
                     }
-
-                    // checking for silent config argument
-                    if (switches.Length == 1)
+                    else
                     {
                     {
-                        string arg = switches[0].Trim();
-
-                        // UNSAFE mode switch (allows running on Windows Server 2008+)
-                        if (arg == "/unsafe")
+                        if (Utilities.IsCompatible())
                         {
                         {
-                            UNSAFE_MODE = true;
-                            Application.Run(new MainForm());
-                            return;
-                        }
+                            Required.Deploy();
 
 
-                        // resets configuration
-                        if (arg == "/reset")
-                        {
-                            Utilities.ResetConfiguration(true);
-                            return;
-                        }
+                            // for backward compatibility (legacy)
+                            Options.LegacyCheck();
 
 
-                        // disables Defender in SAFE MODE (for Windows 10 1903+)
-                        if (arg == "/disabledefender")
-                        {
-                            File.WriteAllText("DisableDefenderSafeMode.bat", Properties.Resources.DisableDefenderSafeMode1903Plus);
-                            Utilities.RunBatchFile("DisableDefenderSafeMode.bat");
-                            System.Threading.Thread.Sleep(1000);
-                            Utilities.RunBatchFile("DisableDefenderSafeMode.bat");
-                            System.Threading.Thread.Sleep(1000);
-                            File.Delete("DisableDefenderSafeMode.bat");
-
-                            return;
-                        }
+                            // load settings, if there is no settings, load defaults
+                            try
+                            {
+                                // show FirstRunForm if app is running first time
+                                if (!File.Exists(Options.SettingsFile))
+                                {
+                                    Options.LoadSettings();
+                                    FirstRunForm frf = new FirstRunForm();
+                                    frf.ShowDialog();
+                                }
+                                else
+                                {
+                                    Options.LoadSettings();
+                                }
 
 
-                        if (arg.StartsWith("/"))
-                        {
-                            if (File.Exists(arg.Remove(0, 1)))
+                                // ideal place to replace internal messages from translation list
+                                _adminMissingMessage = Options.TranslationList["adminMissingMsg"];
+                                _unsupportedMessage = Options.TranslationList["unsupportedMsg"];
+                                _confInvalidFormatMsg = Options.TranslationList["confInvalidFormatMsg"];
+                                _confInvalidVersionMsg = Options.TranslationList["confInvalidVersionMsg"];
+                                _confNotFoundMsg = Options.TranslationList["confNotFoundMsg"];
+                                _argInvalidMsg = Options.TranslationList["argInvalidMsg"];
+                                _alreadyRunningMsg = Options.TranslationList["alreadyRunningMsg"];
+                            }
+                            catch (Exception ex)
                             {
                             {
-                                SilentOps.GetSilentConfig(arg.Remove(0, 1));
+                                ErrorLogger.LogError("Program.Main", ex.Message, ex.StackTrace);
+                            }
+
+                            // checking for silent config argument
+                            if (switches.Length == 1)
+                            {
+                                string arg = switches[0].Trim();
 
 
-                                if (SilentOps.CurrentSilentConfig != null)
+                                // UNSAFE mode switch (allows running on Windows Server 2008+)
+                                if (arg == "/unsafe")
                                 {
                                 {
-                                    if (SilentOps.CurrentSilentConfig.WindowsVersion == 7 && Utilities.CurrentWindowsVersion == WindowsVersion.Windows7)
-                                    {
-                                        SilentOps.ProcessSilentConfigGeneral();
-                                        SilentOps.SilentUpdateOptionsGeneral();
-                                        Options.SaveSettings();
-                                    }
-                                    else if (SilentOps.CurrentSilentConfig.WindowsVersion == 8 && Utilities.CurrentWindowsVersion == WindowsVersion.Windows8)
-                                    {
-                                        SilentOps.ProcessSilentConfigGeneral();
-                                        SilentOps.ProcessSilentConfigWindows8();
-                                        SilentOps.SilentUpdateOptionsGeneral();
-                                        SilentOps.SilentUpdateOptions8();
-                                        Options.SaveSettings();
-                                    }
-                                    else if (SilentOps.CurrentSilentConfig.WindowsVersion == 10 && Utilities.CurrentWindowsVersion == WindowsVersion.Windows10)
-                                    {
-                                        SilentOps.ProcessSilentConfigGeneral();
-                                        SilentOps.ProcessSilentConfigWindows10();
-                                        SilentOps.SilentUpdateOptionsGeneral();
-                                        SilentOps.SilentUpdateOptions10();
-                                        Options.SaveSettings();
-                                    }
-                                    else if (SilentOps.CurrentSilentConfig.WindowsVersion == 11 && Utilities.CurrentWindowsVersion == WindowsVersion.Windows11)
+                                    UNSAFE_MODE = true;
+                                    Application.Run(new MainForm());
+                                    return;
+                                }
+
+                                // resets configuration
+                                if (arg == "/reset")
+                                {
+                                    Utilities.ResetConfiguration(true);
+                                    return;
+                                }
+
+                                // disables Defender in SAFE MODE (for Windows 10 1903+)
+                                if (arg == "/disabledefender")
+                                {
+                                    File.WriteAllText("DisableDefenderSafeMode.bat", Properties.Resources.DisableDefenderSafeMode1903Plus);
+                                    Utilities.RunBatchFile("DisableDefenderSafeMode.bat");
+                                    System.Threading.Thread.Sleep(1000);
+                                    Utilities.RunBatchFile("DisableDefenderSafeMode.bat");
+                                    System.Threading.Thread.Sleep(1000);
+                                    File.Delete("DisableDefenderSafeMode.bat");
+
+                                    return;
+                                }
+
+                                if (arg.StartsWith("/"))
+                                {
+                                    if (File.Exists(arg.Remove(0, 1)))
                                     {
                                     {
-                                        SilentOps.ProcessSilentConfigGeneral();
-                                        SilentOps.ProcessSilentConfigWindows10();
-                                        SilentOps.ProcessSilentConfigWindows11();
-                                        SilentOps.SilentUpdateOptionsGeneral();
-                                        SilentOps.SilentUpdateOptions10();
-                                        SilentOps.SilentUpdateOptions11();
-                                        Options.SaveSettings();
+                                        SilentOps.GetSilentConfig(arg.Remove(0, 1));
+
+                                        if (SilentOps.CurrentSilentConfig != null)
+                                        {
+                                            if (SilentOps.CurrentSilentConfig.WindowsVersion == 7 && Utilities.CurrentWindowsVersion == WindowsVersion.Windows7)
+                                            {
+                                                SilentOps.ProcessSilentConfigGeneral();
+                                                SilentOps.SilentUpdateOptionsGeneral();
+                                                Options.SaveSettings();
+                                            }
+                                            else if (SilentOps.CurrentSilentConfig.WindowsVersion == 8 && Utilities.CurrentWindowsVersion == WindowsVersion.Windows8)
+                                            {
+                                                SilentOps.ProcessSilentConfigGeneral();
+                                                SilentOps.ProcessSilentConfigWindows8();
+                                                SilentOps.SilentUpdateOptionsGeneral();
+                                                SilentOps.SilentUpdateOptions8();
+                                                Options.SaveSettings();
+                                            }
+                                            else if (SilentOps.CurrentSilentConfig.WindowsVersion == 10 && Utilities.CurrentWindowsVersion == WindowsVersion.Windows10)
+                                            {
+                                                SilentOps.ProcessSilentConfigGeneral();
+                                                SilentOps.ProcessSilentConfigWindows10();
+                                                SilentOps.SilentUpdateOptionsGeneral();
+                                                SilentOps.SilentUpdateOptions10();
+                                                Options.SaveSettings();
+                                            }
+                                            else if (SilentOps.CurrentSilentConfig.WindowsVersion == 11 && Utilities.CurrentWindowsVersion == WindowsVersion.Windows11)
+                                            {
+                                                SilentOps.ProcessSilentConfigGeneral();
+                                                SilentOps.ProcessSilentConfigWindows10();
+                                                SilentOps.ProcessSilentConfigWindows11();
+                                                SilentOps.SilentUpdateOptionsGeneral();
+                                                SilentOps.SilentUpdateOptions10();
+                                                SilentOps.SilentUpdateOptions11();
+                                                Options.SaveSettings();
+                                            }
+                                            else
+                                            {
+                                                MessageBox.Show(_confInvalidVersionMsg, "Optimizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
+                                                Environment.Exit(0);
+                                            }
+                                        }
+                                        else
+                                        {
+                                            MessageBox.Show(_confInvalidFormatMsg, "Optimizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
+                                            Environment.Exit(0);
+                                        }
                                     }
                                     }
                                     else
                                     else
                                     {
                                     {
-                                        MessageBox.Show(_confInvalidVersionMsg, "Optimizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
+                                        MessageBox.Show(_confNotFoundMsg, "Optimizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                         Environment.Exit(0);
                                         Environment.Exit(0);
                                     }
                                     }
                                 }
                                 }
                                 else
                                 else
                                 {
                                 {
-                                    MessageBox.Show(_confInvalidFormatMsg, "Optimizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
+                                    MessageBox.Show(_argInvalidMsg, "Optimizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                     Environment.Exit(0);
                                     Environment.Exit(0);
                                 }
                                 }
                             }
                             }
                             else
                             else
                             {
                             {
-                                MessageBox.Show(_confNotFoundMsg, "Optimizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
-                                Environment.Exit(0);
+                                Application.Run(new MainForm());
                             }
                             }
                         }
                         }
                         else
                         else
                         {
                         {
-                            MessageBox.Show(_argInvalidMsg, "Optimizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
-                            Environment.Exit(0);
+                            HelperForm f = new HelperForm(null, MessageType.Error, _unsupportedMessage);
+                            f.ShowDialog();
+
+                            Application.Exit();
                         }
                         }
                     }
                     }
-                    else
-                    {
-                        Application.Run(new MainForm());
-                    }
-                }
-                else
-                {
-                    HelperForm f = new HelperForm(null, MessageType.Error, _unsupportedMessage);
-                    f.ShowDialog();
-
-                    Application.Exit();
                 }
                 }
             }
             }
         }
         }

+ 0 - 5
Optimizer/Required.cs

@@ -111,10 +111,5 @@ namespace Optimizer
                 }
                 }
             }
             }
         }
         }
-
-        internal static void Clean()
-        {
-            CleanHelper.EmptyFolder(CoreFolder);
-        }
     }
     }
 }
 }

+ 1 - 0
Optimizer/Resources/DE.json

@@ -74,6 +74,7 @@
 	"removeStartupItemB": "Entfernen",
 	"removeStartupItemB": "Entfernen",
 	"locateFileB": "Datei suchen",
 	"locateFileB": "Datei suchen",
 	"findInRegB": "In der Registry suchen",
 	"findInRegB": "In der Registry suchen",
+	"CleanPreviewForm": "Vorschau Bereinigen",
 	"refreshStartupB": "Aktualisieren",
 	"refreshStartupB": "Aktualisieren",
 	"restoreStartupB": "Wiederherstellen",
 	"restoreStartupB": "Wiederherstellen",
 	"backupStartupB": "Backup",
 	"backupStartupB": "Backup",

+ 1 - 0
Optimizer/Resources/EL.json

@@ -80,6 +80,7 @@
 	"lblBackupTitle": "Τίτλος Αντιγράφου Ασφαλείας:",
 	"lblBackupTitle": "Τίτλος Αντιγράφου Ασφαλείας:",
 	"doBackup": "Εντάξει",
 	"doBackup": "Εντάξει",
 	"cancelBackup": "Ακύρωση",
 	"cancelBackup": "Ακύρωση",
+	"CleanPreviewForm": "Προεπισκόπηση Εκκαθάρισης",
 	"startupItemName": "Όνομα",
 	"startupItemName": "Όνομα",
 	"startupItemLocation": "Τοποθεσία",
 	"startupItemLocation": "Τοποθεσία",
 	"startupItemType": "Τύπος",
 	"startupItemType": "Τύπος",

+ 1 - 0
Optimizer/Resources/EN.json

@@ -31,6 +31,7 @@
 	"pingerTab": "Pinger",
 	"pingerTab": "Pinger",
 	"registryFixerTab": "Registry",
 	"registryFixerTab": "Registry",
 	"integratorTab": "Integrator",
 	"integratorTab": "Integrator",
+	"CleanPreviewForm": "Clean Preview",
 	"optionsTab": "Options",
 	"optionsTab": "Options",
 	"oldMixerSw": "Enable Classic Volume Mixer",
 	"oldMixerSw": "Enable Classic Volume Mixer",
 	"colorBarSw": "Enable Taskbar Color",
 	"colorBarSw": "Enable Taskbar Color",

+ 1 - 0
Optimizer/Resources/ES.json

@@ -8,6 +8,7 @@
 	"txtBitness": "Estas trabajando con {BITS}",
 	"txtBitness": "Estas trabajando con {BITS}",
 	"linkUpdate": "Actualización disponible",
 	"linkUpdate": "Actualización disponible",
 	"lblLab": "Lamzamiento experimental\n(eliminar después de la prueba)",
 	"lblLab": "Lamzamiento experimental\n(eliminar después de la prueba)",
+	"CleanPreviewForm": "Vista Previa Limpia",
 	"performanceSw": "Habilitar ajustes de rendimiento",
 	"performanceSw": "Habilitar ajustes de rendimiento",
 	"networkSw": "Deshabilitar la limitación de la red",
 	"networkSw": "Deshabilitar la limitación de la red",
 	"defenderSw": "Deshabilitar Windows Defender",
 	"defenderSw": "Deshabilitar Windows Defender",

+ 1 - 0
Optimizer/Resources/FR.json

@@ -7,6 +7,7 @@
 	"txtVersion": "Version: {VN}",
 	"txtVersion": "Version: {VN}",
 	"txtBitness": "Vous travaillez avec {BITS}",
 	"txtBitness": "Vous travaillez avec {BITS}",
 	"linkUpdate": "Mise a jour disponible",
 	"linkUpdate": "Mise a jour disponible",
+	"CleanPreviewForm": "Nettoyer L'aperçu",
 	"lblLab": "build Experimental\n(supprimer apres avoir teste)",
 	"lblLab": "build Experimental\n(supprimer apres avoir teste)",
 	"performanceSw": "Activer les Tweaks de Performance",
 	"performanceSw": "Activer les Tweaks de Performance",
 	"networkSw": "Desactiver la limitation du reseau",
 	"networkSw": "Desactiver la limitation du reseau",

+ 1 - 0
Optimizer/Resources/PT.json

@@ -4,6 +4,7 @@
 	"restartButton8": "Aplicar e reiniciar",
 	"restartButton8": "Aplicar e reiniciar",
 	"restartButton10": "Aplicar e reiniciar",
 	"restartButton10": "Aplicar e reiniciar",
 	"restartAndApply": "Reiniciar para aplicar as alterações?",
 	"restartAndApply": "Reiniciar para aplicar as alterações?",
+	"CleanPreviewForm": "Antevisão Limpa",
 	"txtVersion": "Versão: {VN}",
 	"txtVersion": "Versão: {VN}",
 	"txtBitness": "A arquitetura do seu computador é de {BITS}.",
 	"txtBitness": "A arquitetura do seu computador é de {BITS}.",
 	"linkUpdate": "Nova atualização disponível",
 	"linkUpdate": "Nova atualização disponível",

+ 1 - 0
Optimizer/Resources/RU.json

@@ -6,6 +6,7 @@
 	"restartAndApply": "перезагрузить, чтобы изменения вступили в силу?",
 	"restartAndApply": "перезагрузить, чтобы изменения вступили в силу?",
 	"txtVersion": "Версия: {VN}",
 	"txtVersion": "Версия: {VN}",
 	"txtBitness": "Вы работаете с {BITS}",
 	"txtBitness": "Вы работаете с {BITS}",
+	"CleanPreviewForm": "Чистый предварительный просмотр",
 	"linkUpdate": "обновление доступно",
 	"linkUpdate": "обновление доступно",
 	"lblLab": "экспериментальная сборка\n(удалить после тестирования)",
 	"lblLab": "экспериментальная сборка\n(удалить после тестирования)",
 	"performanceSw": "Вкл Настройки производительности",
 	"performanceSw": "Вкл Настройки производительности",

+ 1 - 0
Optimizer/Resources/TR.json

@@ -6,6 +6,7 @@
 	"restartAndApply": "Değişiklikleri uygulamak için yeniden başlatılsın mı?",
 	"restartAndApply": "Değişiklikleri uygulamak için yeniden başlatılsın mı?",
 	"txtVersion": "Versiyon: {VN}",
 	"txtVersion": "Versiyon: {VN}",
 	"txtBitness": "{BITS} ile çalışıyor.",
 	"txtBitness": "{BITS} ile çalışıyor.",
+	"CleanPreviewForm": "Temiz Önizleme",
 	"linkUpdate": "Güncelleme Mevcut",
 	"linkUpdate": "Güncelleme Mevcut",
 	"lblLab": "Deneysel Yapı\n(Testten sonra silin)",
 	"lblLab": "Deneysel Yapı\n(Testten sonra silin)",
 	"performanceSw": "Performans Ayarlarını Etkinleştir",
 	"performanceSw": "Performans Ayarlarını Etkinleştir",

+ 1 - 1
Optimizer/SilentOps.cs

@@ -680,7 +680,7 @@ namespace Optimizer
             }
             }
         }
         }
 
 
-        internal static void SilentUpdateOptions11() 
+        internal static void SilentUpdateOptions11()
         {
         {
             if (CurrentSilentConfig.TaskbarToLeft.HasValue)
             if (CurrentSilentConfig.TaskbarToLeft.HasValue)
             {
             {

+ 5 - 5
Optimizer/StartupPreviewForm.Designer.cs

@@ -39,7 +39,7 @@
             this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
             this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
             this.panel1.Location = new System.Drawing.Point(0, 0);
             this.panel1.Location = new System.Drawing.Point(0, 0);
             this.panel1.Name = "panel1";
             this.panel1.Name = "panel1";
-            this.panel1.Size = new System.Drawing.Size(686, 214);
+            this.panel1.Size = new System.Drawing.Size(757, 432);
             this.panel1.TabIndex = 0;
             this.panel1.TabIndex = 0;
             // 
             // 
             // listPreview
             // listPreview
@@ -47,15 +47,15 @@
             this.listPreview.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
             this.listPreview.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
             this.listPreview.BorderStyle = System.Windows.Forms.BorderStyle.None;
             this.listPreview.BorderStyle = System.Windows.Forms.BorderStyle.None;
             this.listPreview.Dock = System.Windows.Forms.DockStyle.Fill;
             this.listPreview.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.listPreview.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.listPreview.Font = new System.Drawing.Font("Segoe UI Semibold", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
             this.listPreview.ForeColor = System.Drawing.Color.White;
             this.listPreview.ForeColor = System.Drawing.Color.White;
             this.listPreview.FormattingEnabled = true;
             this.listPreview.FormattingEnabled = true;
             this.listPreview.HorizontalScrollbar = true;
             this.listPreview.HorizontalScrollbar = true;
-            this.listPreview.ItemHeight = 21;
+            this.listPreview.ItemHeight = 17;
             this.listPreview.Location = new System.Drawing.Point(0, 0);
             this.listPreview.Location = new System.Drawing.Point(0, 0);
             this.listPreview.Name = "listPreview";
             this.listPreview.Name = "listPreview";
             this.listPreview.SelectionMode = System.Windows.Forms.SelectionMode.None;
             this.listPreview.SelectionMode = System.Windows.Forms.SelectionMode.None;
-            this.listPreview.Size = new System.Drawing.Size(686, 214);
+            this.listPreview.Size = new System.Drawing.Size(757, 432);
             this.listPreview.TabIndex = 0;
             this.listPreview.TabIndex = 0;
             // 
             // 
             // StartupPreviewForm
             // StartupPreviewForm
@@ -63,7 +63,7 @@
             this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
             this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
             this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
             this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
-            this.ClientSize = new System.Drawing.Size(686, 214);
+            this.ClientSize = new System.Drawing.Size(757, 432);
             this.Controls.Add(this.panel1);
             this.Controls.Add(this.panel1);
             this.DoubleBuffered = true;
             this.DoubleBuffered = true;
             this.Font = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
             this.Font = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));

+ 2 - 0
Optimizer/ToggleSwitch/ToggleSwitch.cs

@@ -68,6 +68,8 @@ namespace Optimizer
 
 
         public ToggleSwitch()
         public ToggleSwitch()
         {
         {
+            DoubleBuffered = true;
+
             SetStyle(ControlStyles.ResizeRedraw |
             SetStyle(ControlStyles.ResizeRedraw |
                         ControlStyles.SupportsTransparentBackColor |
                         ControlStyles.SupportsTransparentBackColor |
                         ControlStyles.AllPaintingInWmPaint |
                         ControlStyles.AllPaintingInWmPaint |

+ 13 - 1
Optimizer/Utilities.cs

@@ -635,7 +635,19 @@ namespace Optimizer
             }
             }
             finally
             finally
             {
             {
-                if (withoutRestart == false) Application.Restart();
+                if (withoutRestart == false)
+                {
+                    // BYPASS SINGLE-INSTANCE MECHANISM
+                    if (Program.MUTEX != null)
+                    {
+                        Program.MUTEX.ReleaseMutex();
+                        Program.MUTEX.Dispose();
+                        Program.MUTEX = null;
+                    }
+
+                    Application.Restart();
+                }
+                
             }
             }
         }
         }
 
 

+ 4 - 4
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/10.1/Optimizer-10.1.exe" target="_blank">
+	<a href="https://github.com/hellzerg/optimizer/releases/download/10.2/Optimizer-10.2.exe" target="_blank">
 		<img src="download-button.png">
 		<img src="download-button.png">
 		<br>
 		<br>
 		<img src="flags.png">
 		<img src="flags.png">
@@ -80,6 +80,6 @@ https://github.com/hellzerg/optimizer/blob/master/FEED.md
 
 
 ## Details: ##
 ## Details: ##
 
 
-* Latest version: 10.1
-* Released: October 6, 2021
-* SHA256: B6FACDF03CE213D41301A7CA492CAD717F016A113C1DAF350300C10EA1E6FA94
+* Latest version: 10.2
+* Released: October 7, 2021
+* SHA256: 557527FA67AB217C28233414E5CBCFFC1C834A5ADDEFE23FBC49B398489C6F5B

+ 1 - 1
version.txt

@@ -1 +1 @@
-10.1
+10.2

Some files were not shown because too many files changed in this diff