Browse Source

upstream for new config templating engine

deadmoon 2 years ago
parent
commit
1fd9bdc1c6

+ 2 - 2
Optimizer/Controls/ColorPicker.cs

@@ -449,7 +449,7 @@ namespace Optimizer.Controls
 
 
             return result;
             return result;
         }
         }
-        
+
         protected virtual Color GetContrastColor(Color c)
         protected virtual Color GetContrastColor(Color c)
         {
         {
             double brightness = c.R * 0.299 + c.G * 0.587 + c.B * 0.114;
             double brightness = c.R * 0.299 + c.G * 0.587 + c.B * 0.114;
@@ -526,7 +526,7 @@ namespace Optimizer.Controls
             {
             {
                 this.HslColor = new HslColor(this.Color);
                 this.HslColor = new HslColor(this.Color);
             }
             }
-            
+
             this.SelectionGlyph = this.CreateSelectionGlyph();
             this.SelectionGlyph = this.CreateSelectionGlyph();
             this.Refresh();
             this.Refresh();
 
 

+ 1 - 1
Optimizer/Controls/MoonTabs.cs

@@ -86,7 +86,7 @@ namespace Optimizer
 
 
             Margin = new Padding(0);
             Margin = new Padding(0);
             Padding = new Point(0, 0);
             Padding = new Point(0, 0);
-            
+
             this.SizeMode = TabSizeMode.Fixed;
             this.SizeMode = TabSizeMode.Fixed;
         }
         }
 
 

+ 1 - 1
Optimizer/Required.cs → Optimizer/CoreHelper.cs

@@ -3,7 +3,7 @@ using System.Text;
 
 
 namespace Optimizer
 namespace Optimizer
 {
 {
-    internal static class Required
+    internal static class CoreHelper
     {
     {
         internal readonly static string CoreFolder = CleanHelper.ProgramData + "\\Optimizer\\";
         internal readonly static string CoreFolder = CleanHelper.ProgramData + "\\Optimizer\\";
         internal readonly static string ReadyMadeMenusFolder = CleanHelper.ProgramData + "\\Optimizer\\ReadyMadeMenus\\";
         internal readonly static string ReadyMadeMenusFolder = CleanHelper.ProgramData + "\\Optimizer\\ReadyMadeMenus\\";

+ 13 - 5
Optimizer/Enums.cs

@@ -8,11 +8,11 @@
 
 
     internal enum WindowsVersion
     internal enum WindowsVersion
     {
     {
-        Unsupported,
-        Windows7,
-        Windows8,
-        Windows10,
-        Windows11
+        Unsupported = 0,
+        Windows7 = 7,
+        Windows8 = 8,
+        Windows10 = 10,
+        Windows11 = 11
     }
     }
 
 
     public enum StartupItemLocation
     public enum StartupItemLocation
@@ -76,6 +76,14 @@
         Right
         Right
     }
     }
 
 
+    public enum RestartType
+    {
+        Normal,
+        SafeMode,
+        DisableDefender,
+        EnableDefender
+    }
+
     public enum LanguageCode
     public enum LanguageCode
     {
     {
         EN, // english
         EN, // english

+ 1 - 1
Optimizer/ErrorLogger.cs

@@ -5,7 +5,7 @@ namespace Optimizer
 {
 {
     internal static class ErrorLogger
     internal static class ErrorLogger
     {
     {
-        internal static string ErrorLogFile = Path.Combine(Required.CoreFolder, "Optimizer.log");
+        internal static string ErrorLogFile = Path.Combine(CoreHelper.CoreFolder, "Optimizer.log");
 
 
         internal static void LogError(string functionName, string errorMessage, string errorStackTrace)
         internal static void LogError(string functionName, string errorMessage, string errorStackTrace)
         {
         {

File diff suppressed because it is too large
+ 197 - 215
Optimizer/Forms/MainForm.Designer.cs


+ 54 - 53
Optimizer/Forms/MainForm.cs

@@ -984,6 +984,7 @@ namespace Optimizer
             // PINGER
             // PINGER
             if (!disablePinger)
             if (!disablePinger)
             {
             {
+                boxDNS.Items.AddRange(PingerHelper.DNSOptions);
                 LoadPingerDNSConfig();
                 LoadPingerDNSConfig();
                 DisplayCurrentDNS();
                 DisplayCurrentDNS();
 
 
@@ -1052,13 +1053,13 @@ namespace Optimizer
 
 
         private void LoadReadyMenusState()
         private void LoadReadyMenusState()
         {
         {
-            AddCMDB.ToggleChecked = Integrator.OpenWithCMDExists();
-            AddOwnerB.ToggleChecked = Integrator.TakeOwnershipExists();
-            DSB.ToggleChecked = Integrator.DesktopItemExists("DesktopShortcuts");
-            PMB.ToggleChecked = Integrator.DesktopItemExists("Power Menu");
-            SSB.ToggleChecked = Integrator.DesktopItemExists("SystemShortcuts");
-            STB.ToggleChecked = Integrator.DesktopItemExists("SystemTools");
-            WAB.ToggleChecked = Integrator.DesktopItemExists("WindowsApps");
+            AddCMDB.ToggleChecked = IntegratorHelper.OpenWithCMDExists();
+            AddOwnerB.ToggleChecked = IntegratorHelper.TakeOwnershipExists();
+            DSB.ToggleChecked = IntegratorHelper.DesktopItemExists("DesktopShortcuts");
+            PMB.ToggleChecked = IntegratorHelper.DesktopItemExists("Power Menu");
+            SSB.ToggleChecked = IntegratorHelper.DesktopItemExists("SystemShortcuts");
+            STB.ToggleChecked = IntegratorHelper.DesktopItemExists("SystemTools");
+            WAB.ToggleChecked = IntegratorHelper.DesktopItemExists("WindowsApps");
         }
         }
 
 
         private void LoadPingerDNSConfig()
         private void LoadPingerDNSConfig()
@@ -1092,32 +1093,32 @@ namespace Optimizer
 
 
             if (PingerHelper.CloudflareDNSv4.Any(x => _currentDNS.Select(y => y.ToString()).Contains(x)))
             if (PingerHelper.CloudflareDNSv4.Any(x => _currentDNS.Select(y => y.ToString()).Contains(x)))
             {
             {
-                boxDNS.Text = "Cloudflare DNS";
+                boxDNS.Text = "Cloudflare";
                 return;
                 return;
             }
             }
             else if (PingerHelper.OpenDNSv4.Any(x => _currentDNS.Select(y => y.ToString()).Contains(x)))
             else if (PingerHelper.OpenDNSv4.Any(x => _currentDNS.Select(y => y.ToString()).Contains(x)))
             {
             {
-                boxDNS.Text = "Open DNS";
+                boxDNS.Text = "OpenDNS";
                 return;
                 return;
             }
             }
             else if (PingerHelper.Quad9DNSv4.Any(x => _currentDNS.Select(y => y.ToString()).Contains(x)))
             else if (PingerHelper.Quad9DNSv4.Any(x => _currentDNS.Select(y => y.ToString()).Contains(x)))
             {
             {
-                boxDNS.Text = "Quad9 DNS";
+                boxDNS.Text = "Quad9";
                 return;
                 return;
             }
             }
             else if (PingerHelper.GoogleDNSv4.Any(x => _currentDNS.Select(y => y.ToString()).Contains(x)))
             else if (PingerHelper.GoogleDNSv4.Any(x => _currentDNS.Select(y => y.ToString()).Contains(x)))
             {
             {
-                boxDNS.Text = "Google DNS";
+                boxDNS.Text = "Google";
                 return;
                 return;
             }
             }
             else if (PingerHelper.AlternateDNSv4.Any(x => _currentDNS.Select(y => y.ToString()).Contains(x)))
             else if (PingerHelper.AlternateDNSv4.Any(x => _currentDNS.Select(y => y.ToString()).Contains(x)))
             {
             {
-                boxDNS.Text = "Alternate DNS";
+                boxDNS.Text = "AlternateDNS";
                 return;
                 return;
             }
             }
             else if (PingerHelper.AdguardDNSv4.Any(x => _currentDNS.Select(y => y.ToString()).Contains(x)))
             else if (PingerHelper.AdguardDNSv4.Any(x => _currentDNS.Select(y => y.ToString()).Contains(x)))
             {
             {
-                boxDNS.Text = "Adguard DNS";
+                boxDNS.Text = "Adguard";
                 return;
                 return;
             }
             }
             else if (PingerHelper.CleanBrowsingDNSv4.Any(x => _currentDNS.Select(y => y.ToString()).Contains(x)))
             else if (PingerHelper.CleanBrowsingDNSv4.Any(x => _currentDNS.Select(y => y.ToString()).Contains(x)))
@@ -2263,7 +2264,7 @@ namespace Optimizer
 
 
         private void GetDesktopItems()
         private void GetDesktopItems()
         {
         {
-            _desktopItems = Integrator.GetDesktopItems();
+            _desktopItems = IntegratorHelper.GetDesktopItems();
             listDesktopItems.Items.Clear();
             listDesktopItems.Items.Clear();
 
 
             for (int i = 0; i < _desktopItems.Count; i++)
             for (int i = 0; i < _desktopItems.Count; i++)
@@ -2412,7 +2413,7 @@ namespace Optimizer
 
 
         private void GetCustomCommands()
         private void GetCustomCommands()
         {
         {
-            _customCommands = Integrator.GetCustomCommands();
+            _customCommands = IntegratorHelper.GetCustomCommands();
             listCustomCommands.Items.Clear();
             listCustomCommands.Items.Clear();
 
 
             foreach (string s in _customCommands)
             foreach (string s in _customCommands)
@@ -2626,7 +2627,7 @@ namespace Optimizer
         {
         {
             if (!string.IsNullOrEmpty(txtRunFile.Text) && !string.IsNullOrEmpty(txtRunKeyword.Text))
             if (!string.IsNullOrEmpty(txtRunFile.Text) && !string.IsNullOrEmpty(txtRunKeyword.Text))
             {
             {
-                Integrator.CreateCustomCommand(txtRunFile.Text, txtRunKeyword.Text);
+                IntegratorHelper.CreateCustomCommand(txtRunFile.Text, txtRunKeyword.Text);
 
 
                 txtRunFile.Clear();
                 txtRunFile.Clear();
                 txtRunKeyword.Clear();
                 txtRunKeyword.Clear();
@@ -2650,7 +2651,7 @@ namespace Optimizer
         {
         {
             if (listDesktopItems.SelectedItems.Count == 1)
             if (listDesktopItems.SelectedItems.Count == 1)
             {
             {
-                Integrator.RemoveItem(listDesktopItems.SelectedItem.ToString());
+                IntegratorHelper.RemoveItem(listDesktopItems.SelectedItem.ToString());
                 GetDesktopItems();
                 GetDesktopItems();
             }
             }
         }
         }
@@ -2663,7 +2664,7 @@ namespace Optimizer
                 collection.Add(item);
                 collection.Add(item);
             }
             }
 
 
-            Integrator.RemoveAllItems(collection);
+            IntegratorHelper.RemoveAllItems(collection);
 
 
             GetDesktopItems();
             GetDesktopItems();
         }
         }
@@ -2840,7 +2841,7 @@ namespace Optimizer
 
 
             if (txtIcon.Text.Contains(".exe"))
             if (txtIcon.Text.Contains(".exe"))
             {
             {
-                string iconpath = Integrator.ExtractIconFromExecutable(txtItemName.Text, DefineProgramIconDialog.FileName);
+                string iconpath = IntegratorHelper.ExtractIconFromExecutable(txtItemName.Text, DefineProgramIconDialog.FileName);
                 txtIcon.Text = iconpath;
                 txtIcon.Text = iconpath;
             }
             }
         }
         }
@@ -2851,7 +2852,7 @@ namespace Optimizer
 
 
             if (txtIcon.Text.Contains(".exe"))
             if (txtIcon.Text.Contains(".exe"))
             {
             {
-                string iconpath = Integrator.ExtractIconFromExecutable(txtItemName.Text, DefineFolderIconDialog.FileName);
+                string iconpath = IntegratorHelper.ExtractIconFromExecutable(txtItemName.Text, DefineFolderIconDialog.FileName);
                 txtIcon.Text = iconpath;
                 txtIcon.Text = iconpath;
             }
             }
         }
         }
@@ -2862,7 +2863,7 @@ namespace Optimizer
 
 
             if (txtIcon.Text.Contains(".exe"))
             if (txtIcon.Text.Contains(".exe"))
             {
             {
-                string iconpath = Integrator.ExtractIconFromExecutable(txtItemName.Text, DefineURLIconDialog.FileName);
+                string iconpath = IntegratorHelper.ExtractIconFromExecutable(txtItemName.Text, DefineURLIconDialog.FileName);
                 txtIcon.Text = iconpath;
                 txtIcon.Text = iconpath;
             }
             }
         }
         }
@@ -2873,7 +2874,7 @@ namespace Optimizer
 
 
             if (txtIcon.Text.Contains(".exe"))
             if (txtIcon.Text.Contains(".exe"))
             {
             {
-                string iconpath = Integrator.ExtractIconFromExecutable(txtItemName.Text, DefineFileIconDialog.FileName);
+                string iconpath = IntegratorHelper.ExtractIconFromExecutable(txtItemName.Text, DefineFileIconDialog.FileName);
                 txtIcon.Text = iconpath;
                 txtIcon.Text = iconpath;
             }
             }
         }
         }
@@ -2884,7 +2885,7 @@ namespace Optimizer
 
 
             if (txtIcon.Text.Contains(".exe"))
             if (txtIcon.Text.Contains(".exe"))
             {
             {
-                string iconpath = Integrator.ExtractIconFromExecutable(txtItemName.Text, DefineCommandIconDialog.FileName);
+                string iconpath = IntegratorHelper.ExtractIconFromExecutable(txtItemName.Text, DefineCommandIconDialog.FileName);
                 txtIcon.Text = iconpath;
                 txtIcon.Text = iconpath;
             }
             }
         }
         }
@@ -2915,33 +2916,33 @@ namespace Optimizer
                         icon = txtIcon.Text;
                         icon = txtIcon.Text;
                     }
                     }
 
 
-                    Integrator.AddItem(txtItemName.Text, txtItem.Text, icon, _desktopItemPosition, checkShift.Checked, DesktopItemType.Program);
+                    IntegratorHelper.AddItem(txtItemName.Text, txtItem.Text, icon, _desktopItemPosition, checkShift.Checked, DesktopItemType.Program);
 
 
                     break;
                     break;
                 case DesktopItemType.Folder:
                 case DesktopItemType.Folder:
                     if (checkDefaultIcon.Checked)
                     if (checkDefaultIcon.Checked)
                     {
                     {
-                        icon = Integrator.FolderDefaultIcon;
+                        icon = IntegratorHelper.FolderDefaultIcon;
                     }
                     }
                     else
                     else
                     {
                     {
                         icon = txtIcon.Text;
                         icon = txtIcon.Text;
                     }
                     }
 
 
-                    Integrator.AddItem(txtItemName.Text, txtItem.Text, icon, _desktopItemPosition, checkShift.Checked, DesktopItemType.Folder);
+                    IntegratorHelper.AddItem(txtItemName.Text, txtItem.Text, icon, _desktopItemPosition, checkShift.Checked, DesktopItemType.Folder);
 
 
                     break;
                     break;
                 case DesktopItemType.Link:
                 case DesktopItemType.Link:
                     if (checkDefaultIcon.Checked)
                     if (checkDefaultIcon.Checked)
                     {
                     {
-                        icon = Integrator.DownloadFavicon(txtItem.Text, txtItemName.Text);
+                        icon = IntegratorHelper.DownloadFavicon(txtItem.Text, txtItemName.Text);
                     }
                     }
                     else
                     else
                     {
                     {
                         icon = txtIcon.Text;
                         icon = txtIcon.Text;
                     }
                     }
 
 
-                    Integrator.AddItem(txtItemName.Text, txtItem.Text, icon, _desktopItemPosition, checkShift.Checked, DesktopItemType.Link);
+                    IntegratorHelper.AddItem(txtItemName.Text, txtItem.Text, icon, _desktopItemPosition, checkShift.Checked, DesktopItemType.Link);
 
 
                     break;
                     break;
                 case DesktopItemType.File:
                 case DesktopItemType.File:
@@ -2950,7 +2951,7 @@ namespace Optimizer
                         icon = txtIcon.Text;
                         icon = txtIcon.Text;
                     }
                     }
 
 
-                    Integrator.AddItem(txtItemName.Text, txtItem.Text, icon, _desktopItemPosition, checkShift.Checked, DesktopItemType.File);
+                    IntegratorHelper.AddItem(txtItemName.Text, txtItem.Text, icon, _desktopItemPosition, checkShift.Checked, DesktopItemType.File);
 
 
                     break;
                     break;
                 case DesktopItemType.Command:
                 case DesktopItemType.Command:
@@ -2959,7 +2960,7 @@ namespace Optimizer
                         icon = txtIcon.Text;
                         icon = txtIcon.Text;
                     }
                     }
 
 
-                    Integrator.AddItem(txtItemName.Text, txtItem.Text, icon, _desktopItemPosition, checkShift.Checked, DesktopItemType.Command);
+                    IntegratorHelper.AddItem(txtItemName.Text, txtItem.Text, icon, _desktopItemPosition, checkShift.Checked, DesktopItemType.Command);
 
 
                     break;
                     break;
             }
             }
@@ -3058,7 +3059,7 @@ namespace Optimizer
         {
         {
             if (listCustomCommands.SelectedItems.Count == 1)
             if (listCustomCommands.SelectedItems.Count == 1)
             {
             {
-                Integrator.DeleteCustomCommand(listCustomCommands.SelectedItem.ToString());
+                IntegratorHelper.DeleteCustomCommand(listCustomCommands.SelectedItem.ToString());
                 GetCustomCommands();
                 GetCustomCommands();
             }
             }
         }
         }
@@ -3774,7 +3775,7 @@ namespace Optimizer
 
 
         private void btnOpenConf_Click(object sender, EventArgs e)
         private void btnOpenConf_Click(object sender, EventArgs e)
         {
         {
-            Process.Start(Required.CoreFolder);
+            Process.Start(CoreHelper.CoreFolder);
         }
         }
 
 
         private void btnPing_Click(object sender, EventArgs e)
         private void btnPing_Click(object sender, EventArgs e)
@@ -4040,7 +4041,7 @@ namespace Optimizer
 
 
                 try
                 try
                 {
                 {
-                    File.WriteAllText(Required.StartupItemsBackupFolder + Utilities.SanitizeFileFolderName(txtBackupTitle.Text + " - [" + DateTime.Now.ToShortDateString() + "-" + DateTime.Now.ToShortTimeString()) + "].json", JsonConvert.SerializeObject(_backupItems, Formatting.Indented));
+                    File.WriteAllText(CoreHelper.StartupItemsBackupFolder + Utilities.SanitizeFileFolderName(txtBackupTitle.Text + " - [" + DateTime.Now.ToShortDateString() + "-" + DateTime.Now.ToShortTimeString()) + "].json", JsonConvert.SerializeObject(_backupItems, Formatting.Indented));
                 }
                 }
                 catch (Exception ex)
                 catch (Exception ex)
                 {
                 {
@@ -4417,42 +4418,42 @@ namespace Optimizer
                 DisplayCurrentDNS();
                 DisplayCurrentDNS();
                 return;
                 return;
             }
             }
-            else if (boxDNS.Text == "Cloudflare DNS")
+            else if (boxDNS.Text == "Cloudflare")
             {
             {
                 PingerHelper.SetDNS(PingerHelper.NetworkAdapters[boxAdapter.SelectedIndex].Name, PingerHelper.CloudflareDNSv4, PingerHelper.CloudflareDNSv6);
                 PingerHelper.SetDNS(PingerHelper.NetworkAdapters[boxAdapter.SelectedIndex].Name, PingerHelper.CloudflareDNSv4, PingerHelper.CloudflareDNSv6);
                 PingerHelper.GetActiveNetworkAdapters();
                 PingerHelper.GetActiveNetworkAdapters();
                 DisplayCurrentDNS();
                 DisplayCurrentDNS();
                 return;
                 return;
             }
             }
-            else if (boxDNS.Text == "Open DNS")
+            else if (boxDNS.Text == "OpenDNS")
             {
             {
                 PingerHelper.SetDNS(PingerHelper.NetworkAdapters[boxAdapter.SelectedIndex].Name, PingerHelper.OpenDNSv4, PingerHelper.OpenDNSv6);
                 PingerHelper.SetDNS(PingerHelper.NetworkAdapters[boxAdapter.SelectedIndex].Name, PingerHelper.OpenDNSv4, PingerHelper.OpenDNSv6);
                 PingerHelper.GetActiveNetworkAdapters();
                 PingerHelper.GetActiveNetworkAdapters();
                 DisplayCurrentDNS();
                 DisplayCurrentDNS();
                 return;
                 return;
             }
             }
-            else if (boxDNS.Text == "Quad9 DNS")
+            else if (boxDNS.Text == "Quad9")
             {
             {
                 PingerHelper.SetDNS(PingerHelper.NetworkAdapters[boxAdapter.SelectedIndex].Name, PingerHelper.Quad9DNSv4, PingerHelper.Quad9DNSv6);
                 PingerHelper.SetDNS(PingerHelper.NetworkAdapters[boxAdapter.SelectedIndex].Name, PingerHelper.Quad9DNSv4, PingerHelper.Quad9DNSv6);
                 PingerHelper.GetActiveNetworkAdapters();
                 PingerHelper.GetActiveNetworkAdapters();
                 DisplayCurrentDNS();
                 DisplayCurrentDNS();
                 return;
                 return;
             }
             }
-            else if (boxDNS.Text == "Google DNS")
+            else if (boxDNS.Text == "Google")
             {
             {
                 PingerHelper.SetDNS(PingerHelper.NetworkAdapters[boxAdapter.SelectedIndex].Name, PingerHelper.GoogleDNSv4, PingerHelper.GoogleDNSv6);
                 PingerHelper.SetDNS(PingerHelper.NetworkAdapters[boxAdapter.SelectedIndex].Name, PingerHelper.GoogleDNSv4, PingerHelper.GoogleDNSv6);
                 PingerHelper.GetActiveNetworkAdapters();
                 PingerHelper.GetActiveNetworkAdapters();
                 DisplayCurrentDNS();
                 DisplayCurrentDNS();
                 return;
                 return;
             }
             }
-            else if (boxDNS.Text == "Alternate DNS")
+            else if (boxDNS.Text == "AlternateDNS")
             {
             {
                 PingerHelper.SetDNS(PingerHelper.NetworkAdapters[boxAdapter.SelectedIndex].Name, PingerHelper.AlternateDNSv4, PingerHelper.AlternateDNSv6);
                 PingerHelper.SetDNS(PingerHelper.NetworkAdapters[boxAdapter.SelectedIndex].Name, PingerHelper.AlternateDNSv4, PingerHelper.AlternateDNSv6);
                 PingerHelper.GetActiveNetworkAdapters();
                 PingerHelper.GetActiveNetworkAdapters();
                 DisplayCurrentDNS();
                 DisplayCurrentDNS();
                 return;
                 return;
             }
             }
-            else if (boxDNS.Text == "Adguard DNS")
+            else if (boxDNS.Text == "Adguard")
             {
             {
                 PingerHelper.SetDNS(PingerHelper.NetworkAdapters[boxAdapter.SelectedIndex].Name, PingerHelper.AdguardDNSv4, PingerHelper.AdguardDNSv6);
                 PingerHelper.SetDNS(PingerHelper.NetworkAdapters[boxAdapter.SelectedIndex].Name, PingerHelper.AdguardDNSv4, PingerHelper.AdguardDNSv6);
                 PingerHelper.GetActiveNetworkAdapters();
                 PingerHelper.GetActiveNetworkAdapters();
@@ -4537,11 +4538,11 @@ namespace Optimizer
         {
         {
             if (PMB.ToggleChecked)
             if (PMB.ToggleChecked)
             {
             {
-                Utilities.ImportRegistryScript(Required.ReadyMadeMenusFolder + "\\PowerMenu.reg");
+                Utilities.ImportRegistryScript(CoreHelper.ReadyMadeMenusFolder + "\\PowerMenu.reg");
             }
             }
             else
             else
             {
             {
-                Integrator.RemoveItem("Power Menu");
+                IntegratorHelper.RemoveItem("Power Menu");
             }
             }
 
 
             GetDesktopItems();
             GetDesktopItems();
@@ -4551,11 +4552,11 @@ namespace Optimizer
         {
         {
             if (AddOwnerB.ToggleChecked)
             if (AddOwnerB.ToggleChecked)
             {
             {
-                Integrator.InstallTakeOwnership(false);
+                IntegratorHelper.InstallTakeOwnership(false);
             }
             }
             else
             else
             {
             {
-                Integrator.InstallTakeOwnership(true);
+                IntegratorHelper.InstallTakeOwnership(true);
             }
             }
 
 
             GetDesktopItems();
             GetDesktopItems();
@@ -4565,11 +4566,11 @@ namespace Optimizer
         {
         {
             if (AddCMDB.ToggleChecked)
             if (AddCMDB.ToggleChecked)
             {
             {
-                Integrator.InstallOpenWithCMD();
+                IntegratorHelper.InstallOpenWithCMD();
             }
             }
             else
             else
             {
             {
-                Integrator.DeleteOpenWithCMD();
+                IntegratorHelper.DeleteOpenWithCMD();
             }
             }
 
 
             GetDesktopItems();
             GetDesktopItems();
@@ -4579,11 +4580,11 @@ namespace Optimizer
         {
         {
             if (DSB.ToggleChecked)
             if (DSB.ToggleChecked)
             {
             {
-                Utilities.ImportRegistryScript(Required.ReadyMadeMenusFolder + "\\DesktopShortcuts.reg");
+                Utilities.ImportRegistryScript(CoreHelper.ReadyMadeMenusFolder + "\\DesktopShortcuts.reg");
             }
             }
             else
             else
             {
             {
-                Integrator.RemoveItem("DesktopShortcuts");
+                IntegratorHelper.RemoveItem("DesktopShortcuts");
             }
             }
 
 
             GetDesktopItems();
             GetDesktopItems();
@@ -4593,11 +4594,11 @@ namespace Optimizer
         {
         {
             if (STB.ToggleChecked)
             if (STB.ToggleChecked)
             {
             {
-                Utilities.ImportRegistryScript(Required.ReadyMadeMenusFolder + "\\SystemTools.reg");
+                Utilities.ImportRegistryScript(CoreHelper.ReadyMadeMenusFolder + "\\SystemTools.reg");
             }
             }
             else
             else
             {
             {
-                Integrator.RemoveItem("SystemTools");
+                IntegratorHelper.RemoveItem("SystemTools");
             }
             }
 
 
             GetDesktopItems();
             GetDesktopItems();
@@ -4607,11 +4608,11 @@ namespace Optimizer
         {
         {
             if (WAB.ToggleChecked)
             if (WAB.ToggleChecked)
             {
             {
-                Utilities.ImportRegistryScript(Required.ReadyMadeMenusFolder + "\\WindowsApps.reg");
+                Utilities.ImportRegistryScript(CoreHelper.ReadyMadeMenusFolder + "\\WindowsApps.reg");
             }
             }
             else
             else
             {
             {
-                Integrator.RemoveItem("WindowsApps");
+                IntegratorHelper.RemoveItem("WindowsApps");
             }
             }
 
 
             GetDesktopItems();
             GetDesktopItems();
@@ -4621,11 +4622,11 @@ namespace Optimizer
         {
         {
             if (SSB.ToggleChecked)
             if (SSB.ToggleChecked)
             {
             {
-                Utilities.ImportRegistryScript(Required.ReadyMadeMenusFolder + "\\SystemShortcuts.reg");
+                Utilities.ImportRegistryScript(CoreHelper.ReadyMadeMenusFolder + "\\SystemShortcuts.reg");
             }
             }
             else
             else
             {
             {
-                Integrator.RemoveItem("SystemShortcuts");
+                IntegratorHelper.RemoveItem("SystemShortcuts");
             }
             }
 
 
             GetDesktopItems();
             GetDesktopItems();

+ 1 - 1
Optimizer/Forms/MainForm.resx

@@ -722,7 +722,7 @@ any application only by typing your desired keyword.</value>
         AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
         AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
         LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
         LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
         ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAC0
         ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAC0
-        GgAAAk1TRnQBSQFMAgEBCQEAAUABDgFAAQ4BIAEAASABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAGA
+        GgAAAk1TRnQBSQFMAgEBCQEAAUgBDgFIAQ4BIAEAASABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAGA
         AwABYAMAAQEBAAEgBgABwP8A/wD/AP8A/wD/AP8A/wAeAANHAYB0//8AiQADRwGAdP//AIkAAyoBQANH
         AwABYAMAAQEBAAEgBgABwP8A/wD/AP8A/wD/AP8A/wAeAANHAYB0//8AiQADRwGAdP//AIkAAyoBQANH
         AYADRwGAA0cBgANHAYADRwGAA0cBgANHAYADRwGAA0cBgANHAYADRwGAA0cBgANHAYADRwGAA0cBgANH
         AYADRwGAA0cBgANHAYADRwGAA0cBgANHAYADRwGAA0cBgANHAYADRwGAA0cBgANHAYADRwGAA0cBgANH
         AYADRwGAA0cBgANHAYADRwGAA0cBgANHAYADRwGAA0cBgANHAYADRwGAA0cBgANHAYADRwGA/wD/AP8A
         AYADRwGAA0cBgANHAYADRwGAA0cBgANHAYADRwGAA0cBgANHAYADRwGAA0cBgANHAYADRwGA/wD/AP8A

+ 1 - 1
Optimizer/Forms/StartupRestoreForm.cs

@@ -27,7 +27,7 @@ namespace Optimizer
 
 
         private void RefreshBackups()
         private void RefreshBackups()
         {
         {
-            _backups = Directory.GetFiles(Required.StartupItemsBackupFolder, "*.json");
+            _backups = Directory.GetFiles(CoreHelper.StartupItemsBackupFolder, "*.json");
             Array.Reverse(_backups);
             Array.Reverse(_backups);
             listRestoreItems.Items.Clear();
             listRestoreItems.Items.Clear();
 
 

+ 3 - 2
Optimizer/HostsHelper.cs

@@ -198,11 +198,12 @@ namespace Optimizer
             return entries;
             return entries;
         }
         }
 
 
-        internal static void AddEntry(string entry)
+        internal static void AddEntry(string entry, string comment = null)
         {
         {
             try
             try
             {
             {
-                File.AppendAllText(HostsFile, NewLine + entry);
+                comment = (!string.IsNullOrEmpty(comment)) ? $"#{comment}" : string.Empty;
+                File.AppendAllText(HostsFile, NewLine + $"{entry} {comment}");
             }
             }
             catch (Exception ex)
             catch (Exception ex)
             {
             {

+ 12 - 12
Optimizer/Integrator.cs → Optimizer/IntegratorHelper.cs

@@ -9,7 +9,7 @@ using System.Windows.Forms;
 
 
 namespace Optimizer
 namespace Optimizer
 {
 {
-    public static class Integrator
+    public static class IntegratorHelper
     {
     {
         internal static string FolderDefaultIcon = @"%systemroot%\system32\imageres.dll,-112";
         internal static string FolderDefaultIcon = @"%systemroot%\system32\imageres.dll,-112";
 
 
@@ -168,10 +168,10 @@ namespace Optimizer
                 Icon ico = Icon.ExtractAssociatedIcon(fileName);
                 Icon ico = Icon.ExtractAssociatedIcon(fileName);
 
 
                 Clipboard.SetImage(ico.ToBitmap());
                 Clipboard.SetImage(ico.ToBitmap());
-                Clipboard.GetImage().Save(Required.ExtractedIconsFolder + itemName + ".ico", ImageFormat.Bmp);
+                Clipboard.GetImage().Save(CoreHelper.ExtractedIconsFolder + itemName + ".ico", ImageFormat.Bmp);
                 Clipboard.Clear();
                 Clipboard.Clear();
 
 
-                iconPath = Required.ExtractedIconsFolder + itemName + ".ico";
+                iconPath = CoreHelper.ExtractedIconsFolder + itemName + ".ico";
             }
             }
 
 
             return iconPath;
             return iconPath;
@@ -186,9 +186,9 @@ namespace Optimizer
                 Uri url = new Uri(link);
                 Uri url = new Uri(link);
                 if (url.HostNameType == UriHostNameType.Dns)
                 if (url.HostNameType == UriHostNameType.Dns)
                 {
                 {
-                    Image.FromStream(((HttpWebResponse)WebRequest.Create("http://" + url.Host + "/favicon.ico").GetResponse()).GetResponseStream()).Save(Required.FavIconsFolder + name + ".ico", ImageFormat.Bmp);
+                    Image.FromStream(((HttpWebResponse)WebRequest.Create("http://" + url.Host + "/favicon.ico").GetResponse()).GetResponseStream()).Save(CoreHelper.FavIconsFolder + name + ".ico", ImageFormat.Bmp);
 
 
-                    favicon = Required.FavIconsFolder + name + ".ico";
+                    favicon = CoreHelper.FavIconsFolder + name + ".ico";
                 }
                 }
             }
             }
             catch (Exception ex)
             catch (Exception ex)
@@ -248,7 +248,7 @@ namespace Optimizer
 
 
         internal static void InstallOpenWithCMD()
         internal static void InstallOpenWithCMD()
         {
         {
-            Utilities.ImportRegistryScript(Required.ScriptsFolder + "AddOpenWithCMD.reg");
+            Utilities.ImportRegistryScript(CoreHelper.ScriptsFolder + "AddOpenWithCMD.reg");
         }
         }
 
 
         internal static void DeleteOpenWithCMD()
         internal static void DeleteOpenWithCMD()
@@ -260,22 +260,22 @@ namespace Optimizer
 
 
         internal static void InstallTakeOwnership(bool remove)
         internal static void InstallTakeOwnership(bool remove)
         {
         {
-            if (!File.Exists(Required.ReadyMadeMenusFolder + "InstallTakeOwnership.reg"))
+            if (!File.Exists(CoreHelper.ReadyMadeMenusFolder + "InstallTakeOwnership.reg"))
             {
             {
                 try
                 try
                 {
                 {
-                    File.WriteAllText(Required.ReadyMadeMenusFolder + "InstallTakeOwnership.reg", Properties.Resources.InstallTakeOwnership);
+                    File.WriteAllText(CoreHelper.ReadyMadeMenusFolder + "InstallTakeOwnership.reg", Properties.Resources.InstallTakeOwnership);
                 }
                 }
                 catch (Exception ex)
                 catch (Exception ex)
                 {
                 {
                     ErrorLogger.LogError("Integrator.TakeOwnership", ex.Message, ex.StackTrace);
                     ErrorLogger.LogError("Integrator.TakeOwnership", ex.Message, ex.StackTrace);
                 }
                 }
             }
             }
-            if (!File.Exists(Required.ReadyMadeMenusFolder + "RemoveTakeOwnership.reg"))
+            if (!File.Exists(CoreHelper.ReadyMadeMenusFolder + "RemoveTakeOwnership.reg"))
             {
             {
                 try
                 try
                 {
                 {
-                    File.WriteAllText(Required.ReadyMadeMenusFolder + "RemoveTakeOwnership.reg", Properties.Resources.RemoveTakeOwnership);
+                    File.WriteAllText(CoreHelper.ReadyMadeMenusFolder + "RemoveTakeOwnership.reg", Properties.Resources.RemoveTakeOwnership);
                 }
                 }
                 catch (Exception ex)
                 catch (Exception ex)
                 {
                 {
@@ -285,11 +285,11 @@ namespace Optimizer
 
 
             if (!remove)
             if (!remove)
             {
             {
-                Utilities.ImportRegistryScript(Required.ReadyMadeMenusFolder + "InstallTakeOwnership.reg");
+                Utilities.ImportRegistryScript(CoreHelper.ReadyMadeMenusFolder + "InstallTakeOwnership.reg");
             }
             }
             else
             else
             {
             {
-                Utilities.ImportRegistryScript(Required.ReadyMadeMenusFolder + "RemoveTakeOwnership.reg");
+                Utilities.ImportRegistryScript(CoreHelper.ReadyMadeMenusFolder + "RemoveTakeOwnership.reg");
             }
             }
         }
         }
     }
     }

+ 26 - 27
Optimizer/OptimizeHelper.cs

@@ -1,7 +1,6 @@
 using Microsoft.Win32;
 using Microsoft.Win32;
 using System;
 using System;
 using System.Diagnostics;
 using System.Diagnostics;
-using System.Drawing;
 using System.IO;
 using System.IO;
 
 
 namespace Optimizer
 namespace Optimizer
@@ -553,7 +552,7 @@ namespace Optimizer
 
 
         internal static void UninstallOneDrive()
         internal static void UninstallOneDrive()
         {
         {
-            Utilities.RunBatchFile(Required.ScriptsFolder + "OneDrive_Uninstaller.cmd");
+            Utilities.RunBatchFile(CoreHelper.ScriptsFolder + "OneDrive_Uninstaller.cmd");
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\OneDrive", "DisableFileSyncNGSC", "1", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\OneDrive", "DisableFileSyncNGSC", "1", RegistryValueKind.DWord);
 
 
             using (RegistryKey localMachine = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64))
             using (RegistryKey localMachine = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64))
@@ -739,7 +738,7 @@ namespace Optimizer
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\XboxGipSvc", "Start", "4", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\XboxGipSvc", "Start", "4", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\xbgm", "Start", "4", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\xbgm", "Start", "4", RegistryValueKind.DWord);
 
 
-            Utilities.RunBatchFile(Required.ScriptsFolder + "DisableXboxTasks.bat");
+            Utilities.RunBatchFile(CoreHelper.ScriptsFolder + "DisableXboxTasks.bat");
         }
         }
 
 
         internal static void EnableXboxLive()
         internal static void EnableXboxLive()
@@ -752,9 +751,9 @@ namespace Optimizer
 
 
             try
             try
             {
             {
-                if (!File.Exists(Required.ScriptsFolder + "EnableXboxTasks.bat"))
+                if (!File.Exists(CoreHelper.ScriptsFolder + "EnableXboxTasks.bat"))
                 {
                 {
-                    File.WriteAllText(Required.ScriptsFolder + "EnableXboxTasks.bat", Properties.Resources.EnableXboxTasks);
+                    File.WriteAllText(CoreHelper.ScriptsFolder + "EnableXboxTasks.bat", Properties.Resources.EnableXboxTasks);
                 }
                 }
             }
             }
             catch (Exception ex)
             catch (Exception ex)
@@ -762,7 +761,7 @@ namespace Optimizer
                 ErrorLogger.LogError("Optimize.EnableXboxLive", ex.Message, ex.StackTrace);
                 ErrorLogger.LogError("Optimize.EnableXboxLive", ex.Message, ex.StackTrace);
             }
             }
 
 
-            Utilities.RunBatchFile(Required.ScriptsFolder + "EnableXboxTasks.bat");
+            Utilities.RunBatchFile(CoreHelper.ScriptsFolder + "EnableXboxTasks.bat");
         }
         }
 
 
         internal static void DisableAutomaticUpdates()
         internal static void DisableAutomaticUpdates()
@@ -862,16 +861,16 @@ namespace Optimizer
             Utilities.RunCommand(string.Format("icacls {0} /deny SYSTEM:`(OI`)`(CI`)F", DiagnosisAutoLoggerFolder));
             Utilities.RunCommand(string.Format("icacls {0} /deny SYSTEM:`(OI`)`(CI`)F", DiagnosisAutoLoggerFolder));
 
 
             DisableTelemetryRunner();
             DisableTelemetryRunner();
-            Utilities.RunBatchFile(Required.ScriptsFolder + "DisableTelemetryTasks.bat");
+            Utilities.RunBatchFile(CoreHelper.ScriptsFolder + "DisableTelemetryTasks.bat");
         }
         }
 
 
         internal static void EnableTelemetryTasks()
         internal static void EnableTelemetryTasks()
         {
         {
             try
             try
             {
             {
-                if (!File.Exists(Required.ScriptsFolder + "EnableTelemetryTasks.bat"))
+                if (!File.Exists(CoreHelper.ScriptsFolder + "EnableTelemetryTasks.bat"))
                 {
                 {
-                    File.WriteAllText(Required.ScriptsFolder + "EnableTelemetryTasks.bat", Properties.Resources.EnableTelemetryTasks);
+                    File.WriteAllText(CoreHelper.ScriptsFolder + "EnableTelemetryTasks.bat", Properties.Resources.EnableTelemetryTasks);
                 }
                 }
             }
             }
             catch (Exception ex)
             catch (Exception ex)
@@ -879,21 +878,21 @@ namespace Optimizer
                 ErrorLogger.LogError("Optimize.EnableTelemetryTasks", ex.Message, ex.StackTrace);
                 ErrorLogger.LogError("Optimize.EnableTelemetryTasks", ex.Message, ex.StackTrace);
             }
             }
 
 
-            Utilities.RunBatchFile(Required.ScriptsFolder + "EnableTelemetryTasks.bat");
+            Utilities.RunBatchFile(CoreHelper.ScriptsFolder + "EnableTelemetryTasks.bat");
         }
         }
 
 
         internal static void DisableOffice2016Telemetry()
         internal static void DisableOffice2016Telemetry()
         {
         {
             try
             try
             {
             {
-                if (!File.Exists(Required.ScriptsFolder + "DisableOfficeTelemetryTasks.reg"))
+                if (!File.Exists(CoreHelper.ScriptsFolder + "DisableOfficeTelemetryTasks.reg"))
                 {
                 {
-                    File.WriteAllText(Required.ScriptsFolder + "EnableOfficeTelemetryTasks.reg", Properties.Resources.EnableOfficeTelemetry);
+                    File.WriteAllText(CoreHelper.ScriptsFolder + "EnableOfficeTelemetryTasks.reg", Properties.Resources.EnableOfficeTelemetry);
                 }
                 }
 
 
-                if (!File.Exists(Required.ScriptsFolder + "DisableOfficeTelemetryTasks.bat"))
+                if (!File.Exists(CoreHelper.ScriptsFolder + "DisableOfficeTelemetryTasks.bat"))
                 {
                 {
-                    File.WriteAllText(Required.ScriptsFolder + "EnableOfficeTelemetryTasks.bat", Properties.Resources.EnableOfficeTelemetryTasks);
+                    File.WriteAllText(CoreHelper.ScriptsFolder + "EnableOfficeTelemetryTasks.bat", Properties.Resources.EnableOfficeTelemetryTasks);
                 }
                 }
             }
             }
             catch (Exception ex)
             catch (Exception ex)
@@ -901,22 +900,22 @@ namespace Optimizer
                 ErrorLogger.LogError("Optimize.DisableOffice2016Telemetry", ex.Message, ex.StackTrace);
                 ErrorLogger.LogError("Optimize.DisableOffice2016Telemetry", ex.Message, ex.StackTrace);
             }
             }
 
 
-            Utilities.RunBatchFile(Required.ScriptsFolder + "DisableOfficeTelemetryTasks.bat");
-            Utilities.ImportRegistryScript(Required.ScriptsFolder + "DisableOfficeTelemetryTasks.reg");
+            Utilities.RunBatchFile(CoreHelper.ScriptsFolder + "DisableOfficeTelemetryTasks.bat");
+            Utilities.ImportRegistryScript(CoreHelper.ScriptsFolder + "DisableOfficeTelemetryTasks.reg");
         }
         }
 
 
         internal static void EnableOffice2016Telemetry()
         internal static void EnableOffice2016Telemetry()
         {
         {
             try
             try
             {
             {
-                if (!File.Exists(Required.ScriptsFolder + "EnableOfficeTelemetryTasks.reg"))
+                if (!File.Exists(CoreHelper.ScriptsFolder + "EnableOfficeTelemetryTasks.reg"))
                 {
                 {
-                    File.WriteAllText(Required.ScriptsFolder + "EnableOfficeTelemetryTasks.reg", Properties.Resources.EnableOfficeTelemetry);
+                    File.WriteAllText(CoreHelper.ScriptsFolder + "EnableOfficeTelemetryTasks.reg", Properties.Resources.EnableOfficeTelemetry);
                 }
                 }
 
 
-                if (!File.Exists(Required.ScriptsFolder + "EnableOfficeTelemetryTasks.bat"))
+                if (!File.Exists(CoreHelper.ScriptsFolder + "EnableOfficeTelemetryTasks.bat"))
                 {
                 {
-                    File.WriteAllText(Required.ScriptsFolder + "EnableOfficeTelemetryTasks.bat", Properties.Resources.EnableOfficeTelemetryTasks);
+                    File.WriteAllText(CoreHelper.ScriptsFolder + "EnableOfficeTelemetryTasks.bat", Properties.Resources.EnableOfficeTelemetryTasks);
                 }
                 }
             }
             }
             catch (Exception ex)
             catch (Exception ex)
@@ -924,8 +923,8 @@ namespace Optimizer
                 ErrorLogger.LogError("Optimize.EnableOffice2016Telemetry", ex.Message, ex.StackTrace);
                 ErrorLogger.LogError("Optimize.EnableOffice2016Telemetry", ex.Message, ex.StackTrace);
             }
             }
 
 
-            Utilities.RunBatchFile(Required.ScriptsFolder + "EnableOfficeTelemetryTasks.bat");
-            Utilities.ImportRegistryScript(Required.ScriptsFolder + "EnableOfficeTelemetryTasks.reg");
+            Utilities.RunBatchFile(CoreHelper.ScriptsFolder + "EnableOfficeTelemetryTasks.bat");
+            Utilities.ImportRegistryScript(CoreHelper.ScriptsFolder + "EnableOfficeTelemetryTasks.reg");
         }
         }
 
 
         internal static void EnhancePrivacy()
         internal static void EnhancePrivacy()
@@ -934,7 +933,7 @@ namespace Optimizer
             Registry.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager", "RotatingLockScreenEnabled", "0", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager", "RotatingLockScreenEnabled", "0", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager", "DisableWindowsSpotlightFeatures", "1", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager", "DisableWindowsSpotlightFeatures", "1", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager", "DisableTailoredExperiencesWithDiagnosticData", "1", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager", "DisableTailoredExperiencesWithDiagnosticData", "1", RegistryValueKind.DWord);
-            
+
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent", "DisableCloudOptimizedContent", 1);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent", "DisableCloudOptimizedContent", 1);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection", "DoNotShowFeedbackNotifications", 1);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection", "DoNotShowFeedbackNotifications", 1);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Feeds", "EnableFeeds", 0);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Feeds", "EnableFeeds", 0);
@@ -1063,7 +1062,7 @@ namespace Optimizer
             Utilities.TryDeleteRegistryValue(false, @"Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager", "RotatingLockScreenEnabled");
             Utilities.TryDeleteRegistryValue(false, @"Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager", "RotatingLockScreenEnabled");
             Utilities.TryDeleteRegistryValue(false, @"Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager", "DisableWindowsSpotlightFeatures");
             Utilities.TryDeleteRegistryValue(false, @"Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager", "DisableWindowsSpotlightFeatures");
             Utilities.TryDeleteRegistryValue(false, @"Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager", "DisableTailoredExperiencesWithDiagnosticData");
             Utilities.TryDeleteRegistryValue(false, @"Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager", "DisableTailoredExperiencesWithDiagnosticData");
-            
+
             Utilities.TryDeleteRegistryValue(true, @"SOFTWARE\Policies\Microsoft\Windows\CloudContent", "DisableCloudOptimizedContent");
             Utilities.TryDeleteRegistryValue(true, @"SOFTWARE\Policies\Microsoft\Windows\CloudContent", "DisableCloudOptimizedContent");
             Utilities.TryDeleteRegistryValue(true, @"SOFTWARE\Policies\Microsoft\Windows\DataCollection", "DoNotShowFeedbackNotifications");
             Utilities.TryDeleteRegistryValue(true, @"SOFTWARE\Policies\Microsoft\Windows\DataCollection", "DoNotShowFeedbackNotifications");
             Utilities.TryDeleteRegistryValue(true, @"SOFTWARE\Policies\Microsoft\Windows\Windows Feeds", "EnableFeeds");
             Utilities.TryDeleteRegistryValue(true, @"SOFTWARE\Policies\Microsoft\Windows\Windows Feeds", "EnableFeeds");
@@ -1079,7 +1078,7 @@ namespace Optimizer
             Utilities.TryDeleteRegistryValue(true, @"SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\TextInput", "AllowLinguisticDataCollection");
             Utilities.TryDeleteRegistryValue(true, @"SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\TextInput", "AllowLinguisticDataCollection");
 
 
             Utilities.TryDeleteRegistryValue(true, @"SOFTWARE\Policies\Microsoft\InputPersonalization", "AllowInputPersonalization");
             Utilities.TryDeleteRegistryValue(true, @"SOFTWARE\Policies\Microsoft\InputPersonalization", "AllowInputPersonalization");
-            
+
             Utilities.TryDeleteRegistryValue(true, @"SOFTWARE\Policies\Microsoft\Windows\System", "UploadUserActivities");
             Utilities.TryDeleteRegistryValue(true, @"SOFTWARE\Policies\Microsoft\Windows\System", "UploadUserActivities");
 
 
             Utilities.TryDeleteRegistryValue(true, @"SOFTWARE\Policies\Microsoft\Windows\System", "AllowCrossDeviceClipboard");
             Utilities.TryDeleteRegistryValue(true, @"SOFTWARE\Policies\Microsoft\Windows\System", "AllowCrossDeviceClipboard");
@@ -1449,7 +1448,7 @@ namespace Optimizer
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer", "SmartScreenEnabled", "Off", RegistryValueKind.String);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer", "SmartScreenEnabled", "Off", RegistryValueKind.String);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\PhishingFilter", "EnabledV9", "0", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\PhishingFilter", "EnabledV9", "0", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\AppHost", "PreventOverride", 0, RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\AppHost", "PreventOverride", 0, RegistryValueKind.DWord);
-            
+
             using (RegistryKey localMachine = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64))
             using (RegistryKey localMachine = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64))
             {
             {
                 localMachine.CreateSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.SecurityAndMaintenance").SetValue("Enabled", 0);
                 localMachine.CreateSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.SecurityAndMaintenance").SetValue("Enabled", 0);
@@ -1757,7 +1756,7 @@ namespace Optimizer
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\VisualStudio\Feedback", "DisableScreenshotCapture", 1);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\VisualStudio\Feedback", "DisableScreenshotCapture", 1);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\VisualStudio\SQM", "OptIn", 0);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\VisualStudio\SQM", "OptIn", 0);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\VisualStudio\Setup", "ConcurrentDownloads", 2, RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\VisualStudio\Setup", "ConcurrentDownloads", 2, RegistryValueKind.DWord);
-            
+
             if (Environment.Is64BitOperatingSystem)
             if (Environment.Is64BitOperatingSystem)
             {
             {
                 Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VSCommon\14.0\SQM", "OptIn", 0);
                 Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VSCommon\14.0\SQM", "OptIn", 0);

+ 2 - 2
Optimizer/Optimizer.csproj

@@ -195,7 +195,7 @@
     <Compile Include="Forms\InfoForm.Designer.cs">
     <Compile Include="Forms\InfoForm.Designer.cs">
       <DependentUpon>InfoForm.cs</DependentUpon>
       <DependentUpon>InfoForm.cs</DependentUpon>
     </Compile>
     </Compile>
-    <Compile Include="Integrator.cs" />
+    <Compile Include="IntegratorHelper.cs" />
     <Compile Include="Controls\ListViewColumnSorter.cs" />
     <Compile Include="Controls\ListViewColumnSorter.cs" />
     <Compile Include="Forms\MainForm.cs">
     <Compile Include="Forms\MainForm.cs">
       <SubType>Form</SubType>
       <SubType>Form</SubType>
@@ -215,7 +215,7 @@
       <DesignTime>True</DesignTime>
       <DesignTime>True</DesignTime>
       <DependentUpon>Resources.resx</DependentUpon>
       <DependentUpon>Resources.resx</DependentUpon>
     </Compile>
     </Compile>
-    <Compile Include="Required.cs" />
+    <Compile Include="CoreHelper.cs" />
     <Compile Include="SilentConfig.cs" />
     <Compile Include="SilentConfig.cs" />
     <Compile Include="SilentOps.cs" />
     <Compile Include="SilentOps.cs" />
     <Compile Include="Forms\SplashForm.cs">
     <Compile Include="Forms\SplashForm.cs">

+ 1 - 1
Optimizer/Options.cs

@@ -106,7 +106,7 @@ namespace Optimizer
         internal static Color TextColor;
         internal static Color TextColor;
 
 
         readonly static string _themeFlag = "themeable";
         readonly static string _themeFlag = "themeable";
-        internal readonly static string SettingsFile = Required.CoreFolder + "\\Optimizer.json";
+        internal readonly static string SettingsFile = CoreHelper.CoreFolder + "\\Optimizer.json";
 
 
         internal static SettingsJson CurrentOptions = new SettingsJson();
         internal static SettingsJson CurrentOptions = new SettingsJson();
 
 

+ 30 - 0
Optimizer/PingerHelper.cs

@@ -4,11 +4,25 @@ using System.Linq;
 using System.Net;
 using System.Net;
 using System.Net.NetworkInformation;
 using System.Net.NetworkInformation;
 using System.Net.Sockets;
 using System.Net.Sockets;
+using System.Windows.Forms;
 
 
 namespace Optimizer
 namespace Optimizer
 {
 {
     internal static class PingerHelper
     internal static class PingerHelper
     {
     {
+        internal static string[] DNSOptions =
+        {
+            "Automatic",
+            "Cloudflare",
+            "OpenDNS",
+            "Quad9",
+            "Google",
+            "AlternateDNS",
+            "Adguard",
+            "CleanBrowsing",
+            "CleanBrowsing (adult filter)"
+        };
+
         internal static string[] GoogleDNSv4 = { "8.8.8.8", "8.8.4.4" };
         internal static string[] GoogleDNSv4 = { "8.8.8.8", "8.8.4.4" };
         internal static string[] GoogleDNSv6 = { "2001:4860:4860::8888", "2001:4860:4860::8844" };
         internal static string[] GoogleDNSv6 = { "2001:4860:4860::8888", "2001:4860:4860::8844" };
 
 
@@ -96,6 +110,22 @@ namespace Optimizer
             Utilities.RunCommand(cmdv6);
             Utilities.RunCommand(cmdv6);
         }
         }
 
 
+        internal static void ResetDefaultDNSForAllNICs()
+        {
+            foreach (string nic in NetworkAdapters.Select(x => x.Name))
+            {
+                ResetDefaultDNS(nic);
+            }
+        }
+
+        internal static void SetDNSForAllNICs(string[] dnsv4, string[] dnsv6)
+        {
+            foreach (string nic in NetworkAdapters.Select(x => x.Name))
+            {
+                SetDNS(nic, dnsv4, dnsv6);
+            }
+        }
+
         internal static PingReply PingHost(string nameOrAddress)
         internal static PingReply PingHost(string nameOrAddress)
         {
         {
             PingReply reply;
             PingReply reply;

+ 26 - 50
Optimizer/Program.cs

@@ -1,10 +1,8 @@
-using Newtonsoft.Json.Linq;
-using System;
+using System;
 using System.Diagnostics;
 using System.Diagnostics;
 using System.IO;
 using System.IO;
 using System.Linq;
 using System.Linq;
 using System.Reflection;
 using System.Reflection;
-using System.Text;
 using System.Threading;
 using System.Threading;
 using System.Windows.Forms;
 using System.Windows.Forms;
 
 
@@ -16,7 +14,7 @@ namespace Optimizer
         /* DO NOT LEAVE THEM EMPTY */
         /* DO NOT LEAVE THEM EMPTY */
 
 
         internal readonly static float Major = 15;
         internal readonly static float Major = 15;
-        internal readonly static float Minor = 2;
+        internal readonly static float Minor = 3;
 
 
         internal readonly static bool EXPERIMENTAL_BUILD = false;
         internal readonly static bool EXPERIMENTAL_BUILD = false;
         internal static int DPI_PREFERENCE;
         internal static int DPI_PREFERENCE;
@@ -98,8 +96,8 @@ namespace Optimizer
                 Environment.Exit(0);
                 Environment.Exit(0);
                 return;
                 return;
             }
             }
-          
-            Required.Deploy();
+
+            CoreHelper.Deploy();
             FontHelper.LoadFont();
             FontHelper.LoadFont();
 
 
             if (switches.Length == 1)
             if (switches.Length == 1)
@@ -181,17 +179,13 @@ namespace Optimizer
                 // disable defender automatically
                 // disable defender automatically
                 if (arg == "/restart=disabledefender")
                 if (arg == "/restart=disabledefender")
                 {
                 {
-                    // set RunOnce instruction
-                    Microsoft.Win32.Registry.SetValue(@"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce", "*OptimizerDisableDefender", Assembly.GetExecutingAssembly().Location + " /silentdisabledefender", Microsoft.Win32.RegistryValueKind.String);
-                    RestartInSafeMode();
+                    SetRunOnceDisableDefender();
                 }
                 }
 
 
                 // enable defender automatically
                 // enable defender automatically
                 if (arg == "/restart=enabledefender")
                 if (arg == "/restart=enabledefender")
                 {
                 {
-                    // set RunOnce instruction
-                    Microsoft.Win32.Registry.SetValue(@"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce", "*OptimizerEnableDefender", Assembly.GetExecutingAssembly().Location + " /silentenabledefender", Microsoft.Win32.RegistryValueKind.String);
-                    RestartInSafeMode();
+                    SetRunOnceEnableDefender();
                 }
                 }
 
 
                 // return from safe-mode automatically
                 // return from safe-mode automatically
@@ -251,54 +245,22 @@ namespace Optimizer
                     }
                     }
 
 
                     SilentOps.GetSilentConfig(fileName);
                     SilentOps.GetSilentConfig(fileName);
+
                     if (SilentOps.CurrentSilentConfig == null)
                     if (SilentOps.CurrentSilentConfig == null)
                     {
                     {
                         MessageBox.Show(_confInvalidFormatMsg, "Optimizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
                         MessageBox.Show(_confInvalidFormatMsg, "Optimizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
                         Environment.Exit(0);
                         Environment.Exit(0);
                         return;
                         return;
                     }
                     }
-
-                    if (SilentOps.CurrentSilentConfig.WindowsVersion == 7 && Utilities.CurrentWindowsVersion == WindowsVersion.Windows7)
-                    {
-                        LoadSettings();
-                        SilentOps.ProcessSilentConfigGeneral();
-                        SilentOps.SilentUpdateOptionsGeneral();
-                        Options.SaveSettings();
-                    }
-                    else if (SilentOps.CurrentSilentConfig.WindowsVersion == 8 && Utilities.CurrentWindowsVersion == WindowsVersion.Windows8)
-                    {
-                        LoadSettings();
-                        SilentOps.ProcessSilentConfigGeneral();
-                        SilentOps.ProcessSilentConfigWindows8();
-                        SilentOps.SilentUpdateOptionsGeneral();
-                        SilentOps.SilentUpdateOptions8();
-                        Options.SaveSettings();
-                    }
-                    else if (SilentOps.CurrentSilentConfig.WindowsVersion == 10 && Utilities.CurrentWindowsVersion == WindowsVersion.Windows10)
-                    {
-                        LoadSettings();
-                        SilentOps.ProcessSilentConfigGeneral();
-                        SilentOps.ProcessSilentConfigWindows10();
-                        SilentOps.SilentUpdateOptionsGeneral();
-                        SilentOps.SilentUpdateOptions10();
-                        Options.SaveSettings();
-                    }
-                    else if (SilentOps.CurrentSilentConfig.WindowsVersion == 11 && Utilities.CurrentWindowsVersion == WindowsVersion.Windows11)
-                    {
-                        LoadSettings();
-                        SilentOps.ProcessSilentConfigGeneral();
-                        SilentOps.ProcessSilentConfigWindows10();
-                        SilentOps.ProcessSilentConfigWindows11();
-                        SilentOps.SilentUpdateOptionsGeneral();
-                        SilentOps.SilentUpdateOptions10();
-                        SilentOps.SilentUpdateOptions11();
-                        Options.SaveSettings();
-                    }
-                    else
+                    if (!SilentOps.ProcessWindowsVersionCompatibility())
                     {
                     {
                         MessageBox.Show(_confInvalidVersionMsg, "Optimizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
                         MessageBox.Show(_confInvalidVersionMsg, "Optimizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
                         Environment.Exit(0);
                         Environment.Exit(0);
+                        return;
                     }
                     }
+                    LoadSettings();
+                    //SilentOps.ProcessAllActions();
+                    Options.SaveSettings();
                 }
                 }
             }
             }
             else
             else
@@ -390,6 +352,20 @@ namespace Optimizer
             File.Delete("EnableDefenderSafeMode.bat");
             File.Delete("EnableDefenderSafeMode.bat");
         }
         }
 
 
+        internal static void SetRunOnceDisableDefender()
+        {
+            // set RunOnce instruction
+            Microsoft.Win32.Registry.SetValue(@"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce", "*OptimizerDisableDefender", Assembly.GetExecutingAssembly().Location + " /silentdisabledefender", Microsoft.Win32.RegistryValueKind.String);
+            RestartInSafeMode();
+        }
+
+        internal static void SetRunOnceEnableDefender()
+        {
+            // set RunOnce instruction
+            Microsoft.Win32.Registry.SetValue(@"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce", "*OptimizerEnableDefender", Assembly.GetExecutingAssembly().Location + " /silentenabledefender", Microsoft.Win32.RegistryValueKind.String);
+            RestartInSafeMode();
+        }
+
         private static void StartMainForm()
         private static void StartMainForm()
         {
         {
             LoadSettings();
             LoadSettings();

+ 188 - 1
Optimizer/SilentConfig.cs

@@ -1,12 +1,199 @@
-using System;
+using Newtonsoft.Json;
+using System;
 
 
 namespace Optimizer
 namespace Optimizer
 {
 {
     [Serializable]
     [Serializable]
     public sealed class SilentConfig
     public sealed class SilentConfig
     {
     {
+        [JsonProperty("WindowsVersion", Required = Required.Always, NullValueHandling = NullValueHandling.Ignore)]
         public int WindowsVersion { get; set; }
         public int WindowsVersion { get; set; }
 
 
+        [JsonProperty("PostAction", NullValueHandling = NullValueHandling.Ignore)]
+        public PostAction PostAction { get; set; }
+
+        [JsonProperty("Cleaner", NullValueHandling = NullValueHandling.Ignore)]
+        public Cleaner Cleaner { get; set; }
+
+        [JsonProperty("Pinger", NullValueHandling = NullValueHandling.Ignore)]
+        public Pinger Pinger { get; set; }
+
+        [JsonProperty("ProcessControl", NullValueHandling = NullValueHandling.Ignore)]
+        public ProcessControl ProcessControl { get; set; }
+
+        [JsonProperty("HostsEditor", NullValueHandling = NullValueHandling.Ignore)]
+        public HostsEditor HostsEditor { get; set; }
+
+        [JsonProperty("RegistryFix", NullValueHandling = NullValueHandling.Ignore)]
+        public RegistryFix RegistryFix { get; set; }
+
+        [JsonProperty("Integrator", NullValueHandling = NullValueHandling.Ignore)]
+        public Integrator Integrator { get; set; }
+
+        [JsonProperty("UnlockAllCores", NullValueHandling = NullValueHandling.Ignore)]
+        public bool? UnlockAllCores { get; set; }
+
+        [JsonProperty("SvchostProcessSplitting", NullValueHandling = NullValueHandling.Ignore)]
+        public SvchostProcessSplitting SvchostProcessSplitting { get; set; }
+
+        [JsonProperty("Tweaks", NullValueHandling = NullValueHandling.Ignore)]
+        public Tweaks Tweaks { get; set; }
+    }
+
+    [Serializable]
+    public sealed class Cleaner
+    {
+        [JsonProperty("TempFiles", NullValueHandling = NullValueHandling.Ignore)]
+        public bool? TempFiles { get; set; }
+
+        [JsonProperty("BsodDumps", NullValueHandling = NullValueHandling.Ignore)]
+        public bool? BsodDumps { get; set; }
+
+        [JsonProperty("ErrorReports", NullValueHandling = NullValueHandling.Ignore)]
+        public bool? ErrorReports { get; set; }
+
+        [JsonProperty("RecycleBin", NullValueHandling = NullValueHandling.Ignore)]
+        public bool? RecycleBin { get; set; }
+
+        [JsonProperty("GoogleChrome", NullValueHandling = NullValueHandling.Ignore)]
+        public BaseBrowser GoogleChrome { get; set; }
+
+        [JsonProperty("MozillaFirefox", NullValueHandling = NullValueHandling.Ignore)]
+        public BaseBrowser MozillaFirefox { get; set; }
+
+        [JsonProperty("MicrosoftEdge", NullValueHandling = NullValueHandling.Ignore)]
+        public BaseBrowser MicrosoftEdge { get; set; }
+
+        [JsonProperty("BraveBrowser", NullValueHandling = NullValueHandling.Ignore)]
+        public BaseBrowser BraveBrowser { get; set; }
+
+        [JsonProperty("InternetExplorer", NullValueHandling = NullValueHandling.Ignore)]
+        public bool? InternetExplorer { get; set; }
+    }
+
+    [Serializable]
+    public sealed class BaseBrowser
+    {
+        [JsonProperty("Cache", NullValueHandling = NullValueHandling.Ignore)]
+        public bool? Cache { get; set; }
+
+        [JsonProperty("Cookies", NullValueHandling = NullValueHandling.Ignore)]
+        public bool? Cookies { get; set; }
+
+        [JsonProperty("History", NullValueHandling = NullValueHandling.Ignore)]
+        public bool? History { get; set; }
+
+        [JsonProperty("Session", NullValueHandling = NullValueHandling.Ignore)]
+        public bool? Session { get; set; }
+
+        [JsonProperty("Passwords", NullValueHandling = NullValueHandling.Ignore)]
+        public bool? Passwords { get; set; }
+    }
+
+    [Serializable]
+    public sealed class HostsEditor
+    {
+        [JsonProperty("Block", NullValueHandling = NullValueHandling.Ignore)]
+        public string[] Block { get; set; }
+
+        [JsonProperty("Add", NullValueHandling = NullValueHandling.Ignore)]
+        public AddHostsEntry[] Add { get; set; }
+    }
+
+    [Serializable]
+    public sealed class AddHostsEntry
+    {
+        [JsonProperty("Domain", NullValueHandling = NullValueHandling.Ignore)]
+        public string Domain { get; set; }
+
+        [JsonProperty("IPAddress", NullValueHandling = NullValueHandling.Ignore)]
+        public string IpAddress { get; set; }
+
+        [JsonProperty("Comment", NullValueHandling = NullValueHandling.Ignore)]
+        public string Comment { get; set; }
+    }
+
+    [Serializable]
+    public sealed class Integrator
+    {
+        [JsonProperty("TakeOwnership", NullValueHandling = NullValueHandling.Ignore)]
+        public bool? TakeOwnership { get; set; }
+
+        [JsonProperty("OpenWithCMD", NullValueHandling = NullValueHandling.Ignore)]
+        public bool? OpenWithCmd { get; set; }
+    }
+
+    [Serializable]
+    public sealed class Pinger
+    {
+        [JsonProperty("SetDNS", NullValueHandling = NullValueHandling.Ignore)]
+        public string SetDns { get; set; }
+
+        [JsonProperty("FlushDNSCache", NullValueHandling = NullValueHandling.Ignore)]
+        public bool? FlushDnsCache { get; set; }
+    }
+
+    [Serializable]
+    public sealed class PostAction
+    {
+        [JsonProperty("Restart", NullValueHandling = NullValueHandling.Ignore)]
+        public bool? Restart { get; set; }
+
+        [JsonProperty("RestartType", NullValueHandling = NullValueHandling.Ignore)]
+        public string RestartType { get; set; }
+    }
+
+    [Serializable]
+    public sealed class ProcessControl
+    {
+        [JsonProperty("Prevent", NullValueHandling = NullValueHandling.Ignore)]
+        public string[] Prevent { get; set; }
+
+        [JsonProperty("Allow", NullValueHandling = NullValueHandling.Ignore)]
+        public string[] Allow { get; set; }
+    }
+
+    [Serializable]
+    public sealed class RegistryFix
+    {
+        [JsonProperty("TaskManager", NullValueHandling = NullValueHandling.Ignore)]
+        public bool? TaskManager { get; set; }
+
+        [JsonProperty("CommandPrompt", NullValueHandling = NullValueHandling.Ignore)]
+        public bool? CommandPrompt { get; set; }
+
+        [JsonProperty("ControlPanel", NullValueHandling = NullValueHandling.Ignore)]
+        public bool? ControlPanel { get; set; }
+
+        [JsonProperty("FolderOptions", NullValueHandling = NullValueHandling.Ignore)]
+        public bool? FolderOptions { get; set; }
+
+        [JsonProperty("RunDialog", NullValueHandling = NullValueHandling.Ignore)]
+        public bool? RunDialog { get; set; }
+
+        [JsonProperty("RightClickMenu", NullValueHandling = NullValueHandling.Ignore)]
+        public bool? RightClickMenu { get; set; }
+
+        [JsonProperty("WindowsFirewall", NullValueHandling = NullValueHandling.Ignore)]
+        public bool? WindowsFirewall { get; set; }
+
+        [JsonProperty("RegistryEditor", NullValueHandling = NullValueHandling.Ignore)]
+        public bool? RegistryEditor { get; set; }
+    }
+
+    [Serializable]
+    public sealed class SvchostProcessSplitting
+    {
+        [JsonProperty("Disable", NullValueHandling = NullValueHandling.Ignore)]
+        public bool? Disable { get; set; }
+
+        [JsonProperty("RAM", NullValueHandling = NullValueHandling.Ignore)]
+        public int? Ram { get; set; }
+    }
+
+    [Serializable]
+    public sealed class Tweaks
+    {
         public bool? EnablePerformanceTweaks { get; set; }
         public bool? EnablePerformanceTweaks { get; set; }
         public bool? DisableNetworkThrottling { get; set; }
         public bool? DisableNetworkThrottling { get; set; }
         public bool? DisableWindowsDefender { get; set; }
         public bool? DisableWindowsDefender { get; set; }

File diff suppressed because it is too large
+ 406 - 127
Optimizer/SilentOps.cs


+ 3 - 4
Optimizer/Utilities.cs

@@ -1,6 +1,5 @@
 using Microsoft.Win32;
 using Microsoft.Win32;
 using Newtonsoft.Json.Linq;
 using Newtonsoft.Json.Linq;
-using Newtonsoft.Json;
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.Diagnostics;
@@ -11,10 +10,10 @@ using System.Reflection;
 using System.Security.AccessControl;
 using System.Security.AccessControl;
 using System.Security.Principal;
 using System.Security.Principal;
 using System.ServiceProcess;
 using System.ServiceProcess;
+using System.Text;
 using System.Threading;
 using System.Threading;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
 using System.Windows.Forms;
 using System.Windows.Forms;
-using System.Text;
 
 
 namespace Optimizer
 namespace Optimizer
 {
 {
@@ -444,7 +443,7 @@ namespace Optimizer
         {
         {
             try
             try
             {
             {
-                Directory.Delete(Required.CoreFolder, true);
+                Directory.Delete(CoreHelper.CoreFolder, true);
             }
             }
             catch (Exception ex)
             catch (Exception ex)
             {
             {
@@ -486,7 +485,7 @@ namespace Optimizer
         // attempt to enable Local Group Policy Editor on Windows 10 Home editions
         // attempt to enable Local Group Policy Editor on Windows 10 Home editions
         internal static void EnableGPEDitor()
         internal static void EnableGPEDitor()
         {
         {
-            Utilities.RunBatchFile(Required.ScriptsFolder + "GPEditEnablerInHome.bat");
+            Utilities.RunBatchFile(CoreHelper.ScriptsFolder + "GPEditEnablerInHome.bat");
         }
         }
 
 
         internal static void TryDeleteRegistryValue(bool localMachine, string path, string valueName)
         internal static void TryDeleteRegistryValue(bool localMachine, string path, string valueName)

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