Browse Source

Quality of life update (v11.3)

deadmoon 3 years ago
parent
commit
ccb8d2edc1

+ 4 - 0
CHANGELOG.md

@@ -2,6 +2,10 @@
 
 
 All notable changes to this project will be documented in this file.
 All notable changes to this project will be documented in this file.
 
 
+## [11.3] - 2022-01-29
+- Quality improvements in many aspects (Telemetry services, Enhanced privacy, etc.)
+- Visual changes
+
 ## [11.2] - 2022-01-28
 ## [11.2] - 2022-01-28
 - New: Interface has been slightly reworked to be easy on eyes
 - New: Interface has been slightly reworked to be easy on eyes
 - Couple of bug fixes
 - Couple of bug fixes

+ 1 - 21
Optimizer/Controls/MoonCheck.cs

@@ -21,27 +21,7 @@ namespace Optimizer
                 this.Tag = "themeable";
                 this.Tag = "themeable";
                 this.Font = new Font(this.Font, FontStyle.Underline);
                 this.Font = new Font(this.Font, FontStyle.Underline);
 
 
-                switch (Options.CurrentOptions.Color)
-                {
-                    case Theme.Caramel:
-                        this.ForeColor = Color.DarkOrange;
-                        break;
-                    case Theme.Lime:
-                        this.ForeColor = Color.LimeGreen;
-                        break;
-                    case Theme.Magma:
-                        this.ForeColor = Color.Tomato;
-                        break;
-                    case Theme.Minimal:
-                        this.ForeColor = Color.Gray;
-                        break;
-                    case Theme.Ocean:
-                        this.ForeColor = Color.DodgerBlue;
-                        break;
-                    case Theme.Zerg:
-                        this.ForeColor = Color.MediumOrchid;
-                        break;
-                }
+                this.ForeColor = Options.ForegroundColor;
             }
             }
             else
             else
             {
             {

+ 1 - 23
Optimizer/Controls/MoonCheckList.cs

@@ -13,29 +13,7 @@ namespace Optimizer
         protected override void OnDrawItem(DrawItemEventArgs e)
         protected override void OnDrawItem(DrawItemEventArgs e)
         {
         {
             Color foreColor = Color.White;
             Color foreColor = Color.White;
-            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;
-            }
+            Color accentColor = Options.ForegroundColor;
 
 
             if (this.Items.Count > 0)
             if (this.Items.Count > 0)
             {
             {

+ 1 - 21
Optimizer/Controls/MoonRadio.cs

@@ -21,27 +21,7 @@ namespace Optimizer
                 this.Tag = "themeable";
                 this.Tag = "themeable";
                 this.Font = new Font(this.Font, FontStyle.Underline);
                 this.Font = new Font(this.Font, FontStyle.Underline);
 
 
-                switch (Options.CurrentOptions.Color)
-                {
-                    case Theme.Caramel:
-                        this.ForeColor = Color.DarkOrange;
-                        break;
-                    case Theme.Lime:
-                        this.ForeColor = Color.LimeGreen;
-                        break;
-                    case Theme.Magma:
-                        this.ForeColor = Color.Tomato;
-                        break;
-                    case Theme.Minimal:
-                        this.ForeColor = Color.Gray;
-                        break;
-                    case Theme.Ocean:
-                        this.ForeColor = Color.DodgerBlue;
-                        break;
-                    case Theme.Zerg:
-                        this.ForeColor = Color.MediumOrchid;
-                        break;
-                }
+                this.ForeColor = Options.ForegroundColor;
             }
             }
             else
             else
             {
             {

+ 53 - 0
Optimizer/Controls/MoonTip.cs

@@ -0,0 +1,53 @@
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Windows.Forms;
+
+namespace Optimizer
+{
+    class MoonTip : ToolTip
+    {
+        TextFormatFlags toolTipFlags = TextFormatFlags.VerticalCenter | TextFormatFlags.LeftAndRightPadding | TextFormatFlags.HorizontalCenter | TextFormatFlags.NoClipping;
+
+        Font font = new Font("Segoe UI Semibold", 10f, FontStyle.Regular);
+
+        public MoonTip()
+        {
+            this.OwnerDraw = true;
+            this.IsBalloon = false;
+            this.Popup += new PopupEventHandler(this.OnPopup);
+            this.Draw += new DrawToolTipEventHandler(this.OnDraw);
+        }
+
+        private void OnPopup(object sender, PopupEventArgs e) // use this event to set the size of the tool tip
+        {
+            string toolTipText = (sender as ToolTip).GetToolTip(e.AssociatedControl);
+            using (var g = e.AssociatedControl.CreateGraphics())
+            {
+                var textSize = Size.Add(TextRenderer.MeasureText(
+                    g, toolTipText, font, Size.Empty, toolTipFlags), new Size(10, 10));
+
+                e.ToolTipSize = textSize;
+            }
+            // e.ToolTipSize = new Size(400, 400);
+        }
+
+        private void OnDraw(object sender, DrawToolTipEventArgs e) // use this event to customise the tool tip
+        {
+            Graphics g = e.Graphics;
+
+            LinearGradientBrush b = new LinearGradientBrush(e.Bounds,
+                Color.FromArgb(40,40,40), Color.FromArgb(40, 40, 40), 45f);
+
+            g.FillRectangle(b, e.Bounds);
+
+            g.DrawRectangle(new Pen(Color.FromArgb(40, 40, 40), 1), new Rectangle(e.Bounds.X, e.Bounds.Y,
+                e.Bounds.Width - 1, e.Bounds.Height - 1));
+
+            
+            g.DrawString(e.ToolTipText, font, Brushes.White,
+                new PointF(e.Bounds.X + 6, e.Bounds.Y + 6)); // top layer
+
+            b.Dispose();
+        }
+    }
+}

+ 1 - 0
Optimizer/Forms/FirstRunForm.Designer.cs

@@ -102,6 +102,7 @@ namespace Optimizer
             | System.Windows.Forms.AnchorStyles.Right)));
             | System.Windows.Forms.AnchorStyles.Right)));
             this.btnStart.BackColor = System.Drawing.Color.MediumOrchid;
             this.btnStart.BackColor = System.Drawing.Color.MediumOrchid;
             this.btnStart.DialogResult = System.Windows.Forms.DialogResult.Cancel;
             this.btnStart.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+            this.btnStart.FlatAppearance.BorderColor = System.Drawing.Color.DarkOrchid;
             this.btnStart.FlatAppearance.BorderSize = 0;
             this.btnStart.FlatAppearance.BorderSize = 0;
             this.btnStart.FlatAppearance.MouseDownBackColor = System.Drawing.Color.DarkOrchid;
             this.btnStart.FlatAppearance.MouseDownBackColor = System.Drawing.Color.DarkOrchid;
             this.btnStart.FlatAppearance.MouseOverBackColor = System.Drawing.Color.DarkOrchid;
             this.btnStart.FlatAppearance.MouseOverBackColor = System.Drawing.Color.DarkOrchid;

+ 10 - 10
Optimizer/Forms/FirstRunForm.resx

@@ -340,16 +340,16 @@
   </data>
   </data>
   <data name="pictureBox7.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
   <data name="pictureBox7.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
     <value>
-        iVBORw0KGgoAAAANSUhEUgAAAMwAAAB4BAMAAABMVwCiAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
-        YQUAAAAYUExUReYnDupICe1dCPB3A/aYAPm2APvFAP/cAgCKn4QAAAGwSURBVGje7ZjPa8IwFMdf2lSv
-        Y7h5FZR57RjSq7BBrjoZvW5D9Dp/1Pfvr7H+aJqexnuByfsc1ETIB5NvXmJBEIT/ih7wO9QzZHf8GjCv
-        GMACfQyiiRH3LLOmnFE7iPjNoYnTeivHA0/SklmtoRejPYsF+hunqZg02c5tv/Bo8sJtKxaLQgyx7cuN
-        kvqd5OYEceZrtjCh1ZTVZeN1KpzsaDUZYsuIiJ+0mhyx8Dqf2hbsb8RvR8oahtWntG7BLyINGHSo7/7h
-        Gg9UYYvWdYtbMbP5cEqksVm+4qaa9KTOrpZG2nqEFlCXaWuuBG1h02fNFFjJWqeMHB3kx0C30vwwa8aV
-        ZsusMX4F4OCctGZ/RGqJbI18LF+adzPavwX6OF/Gj1qHNHvd47kS+4dYnzR7Y5zbt4dG1Hof60P1DQ3m
-        tP0zN2oqpw3f6rTS0crt13SHtB39csgkboWOSTW1cu9qdGGIbzatdFL1HkBzz3Vjv1WSAA41ABNAA6ub
-        esphj4YAj6DshTfAzjRcTzkc4uWo4LfYErOEIPTCaKRmCoIgCIIgCIIgCIIgCIIgCEJQAH4BUzZ24qP/
-        9tcAAAAASUVORK5CYII=
+        iVBORw0KGgoAAAANSUhEUgAAAMwAAAB4BAMAAABMVwCiAAAABGdBTUEAALGPC/xhBQAAABhQTFRF5icO
+        6kgJ7V0I8HcD9pgA+bYA+8UA/9wCAIqfhAAAAbBJREFUaN7tmM9rwjAUx1/aVK9juHkVlHntGNKrsEGu
+        Ohm9bkP0On/U9++vsf5omp7Ge4HJ+xzURMgHk29eYkEQhP+KHvA71DNkd/waMK8YwAJ9DKKJEfcss6ac
+        UTuI+M2hidN6K8cDT9KSWa2hF6M9iwX6G6epmDTZzm2/8Gjywm0rFotCDLHty42S+p3k5gRx5mu2MKHV
+        lNVl43UqnOxoNRliy4iIn7SaHLHwOp/aFuxvxG9HyhqG1ae0bsEvIg0YdKjv/uEaD1Rhi9Z1i1sxs/lw
+        SqSxWb7ippr0pM6ulkbaeoQWUJdpa64EbWHTZ80UWMlap4wcHeTHQLfS/DBrxpVmy6wxfgXg4Jy0Zn9E
+        aolsjXwsX5p3M9q/Bfo4X8aPWoc0e93juRL7h1ifNHtjnNu3h0bUeh/rQ/UNDea0/TM3aiqnDd/qtNLR
+        yu3XdIe0Hf1yyCRuhY5JNbVy72p0YYhvNq10UvUeQHPPdWO/VZIADjUAE0ADq5t6ymGPhgCPoOyFN8DO
+        NFxPORzi5ajgt9gSs4Qg9MJopGYKgiAIgiAIgiAIgiAIgiAIQlAAfgFTNnbio//21wAAAABJRU5ErkJg
+        gg==
 </value>
 </value>
   </data>
   </data>
   <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
   <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">

+ 30 - 26
Optimizer/Forms/MainForm.Designer.cs

@@ -33,6 +33,7 @@ namespace Optimizer
             this.components = new System.ComponentModel.Container();
             this.components = new System.ComponentModel.Container();
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
             this.tpanel = new System.Windows.Forms.Panel();
             this.tpanel = new System.Windows.Forms.Panel();
+            this.picUpdate = new System.Windows.Forms.PictureBox();
             this.txtNetFw = new System.Windows.Forms.Label();
             this.txtNetFw = new System.Windows.Forms.Label();
             this.txtBitness = new System.Windows.Forms.Label();
             this.txtBitness = new System.Windows.Forms.Label();
             this.txtOS = new System.Windows.Forms.Label();
             this.txtOS = new System.Windows.Forms.Label();
@@ -62,8 +63,6 @@ namespace Optimizer
             this.trayRestartExplorer = new System.Windows.Forms.ToolStripMenuItem();
             this.trayRestartExplorer = new System.Windows.Forms.ToolStripMenuItem();
             this.trayExit = new System.Windows.Forms.ToolStripMenuItem();
             this.trayExit = new System.Windows.Forms.ToolStripMenuItem();
             this.launcherIcon = new System.Windows.Forms.NotifyIcon(this.components);
             this.launcherIcon = new System.Windows.Forms.NotifyIcon(this.components);
-            this.helpBox = new System.Windows.Forms.ToolTip(this.components);
-            this.picUpdate = new System.Windows.Forms.PictureBox();
             this.tabCollection = new Optimizer.MoonTabs();
             this.tabCollection = new Optimizer.MoonTabs();
             this.universalTab = new System.Windows.Forms.TabPage();
             this.universalTab = new System.Windows.Forms.TabPage();
             this.reportingSw = new Optimizer.ToggleCard();
             this.reportingSw = new Optimizer.ToggleCard();
@@ -371,11 +370,12 @@ namespace Optimizer
             this.btnUpdate = new System.Windows.Forms.Button();
             this.btnUpdate = new System.Windows.Forms.Button();
             this.btnResetConfig = new System.Windows.Forms.Button();
             this.btnResetConfig = new System.Windows.Forms.Button();
             this.lblTheming = new System.Windows.Forms.Label();
             this.lblTheming = new System.Windows.Forms.Label();
+            this.helpBox = new Optimizer.MoonTip();
             this.tpanel.SuspendLayout();
             this.tpanel.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.picUpdate)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
             this.bpanel.SuspendLayout();
             this.bpanel.SuspendLayout();
             this.launcherMenu.SuspendLayout();
             this.launcherMenu.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.picUpdate)).BeginInit();
             this.tabCollection.SuspendLayout();
             this.tabCollection.SuspendLayout();
             this.universalTab.SuspendLayout();
             this.universalTab.SuspendLayout();
             this.windows10Tab.SuspendLayout();
             this.windows10Tab.SuspendLayout();
@@ -451,6 +451,19 @@ namespace Optimizer
             this.tpanel.Size = new System.Drawing.Size(1009, 64);
             this.tpanel.Size = new System.Drawing.Size(1009, 64);
             this.tpanel.TabIndex = 1;
             this.tpanel.TabIndex = 1;
             // 
             // 
+            // picUpdate
+            // 
+            this.picUpdate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.picUpdate.Image = ((System.Drawing.Image)(resources.GetObject("picUpdate.Image")));
+            this.picUpdate.Location = new System.Drawing.Point(963, 15);
+            this.picUpdate.Name = "picUpdate";
+            this.picUpdate.Size = new System.Drawing.Size(30, 30);
+            this.picUpdate.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
+            this.picUpdate.TabIndex = 71;
+            this.picUpdate.TabStop = false;
+            this.picUpdate.Visible = false;
+            this.picUpdate.Click += new System.EventHandler(this.picUpdate_Click);
+            // 
             // txtNetFw
             // txtNetFw
             // 
             // 
             this.txtNetFw.AutoSize = true;
             this.txtNetFw.AutoSize = true;
@@ -606,7 +619,7 @@ namespace Optimizer
             this.trayExit});
             this.trayExit});
             this.launcherMenu.Name = "launcherMenu";
             this.launcherMenu.Name = "launcherMenu";
             this.launcherMenu.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
             this.launcherMenu.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
-            this.launcherMenu.Size = new System.Drawing.Size(194, 266);
+            this.launcherMenu.Size = new System.Drawing.Size(194, 244);
             // 
             // 
             // trayStartup
             // trayStartup
             // 
             // 
@@ -721,26 +734,6 @@ namespace Optimizer
             this.launcherIcon.Text = "Optimizer";
             this.launcherIcon.Text = "Optimizer";
             this.launcherIcon.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.launcherIcon_MouseDoubleClick);
             this.launcherIcon.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.launcherIcon_MouseDoubleClick);
             // 
             // 
-            // helpBox
-            // 
-            this.helpBox.IsBalloon = true;
-            this.helpBox.ToolTipIcon = System.Windows.Forms.ToolTipIcon.Info;
-            this.helpBox.UseAnimation = false;
-            this.helpBox.UseFading = false;
-            // 
-            // picUpdate
-            // 
-            this.picUpdate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
-            this.picUpdate.Image = ((System.Drawing.Image)(resources.GetObject("picUpdate.Image")));
-            this.picUpdate.Location = new System.Drawing.Point(963, 15);
-            this.picUpdate.Name = "picUpdate";
-            this.picUpdate.Size = new System.Drawing.Size(30, 30);
-            this.picUpdate.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
-            this.picUpdate.TabIndex = 71;
-            this.picUpdate.TabStop = false;
-            this.picUpdate.Visible = false;
-            this.picUpdate.Click += new System.EventHandler(this.picUpdate_Click);
-            // 
             // tabCollection
             // tabCollection
             // 
             // 
             this.tabCollection.Controls.Add(this.universalTab);
             this.tabCollection.Controls.Add(this.universalTab);
@@ -5230,6 +5223,17 @@ namespace Optimizer
             this.lblTheming.Tag = "themeable";
             this.lblTheming.Tag = "themeable";
             this.lblTheming.Text = "Choose your theme";
             this.lblTheming.Text = "Choose your theme";
             // 
             // 
+            // helpBox
+            // 
+            this.helpBox.AutoPopDelay = 90000;
+            this.helpBox.InitialDelay = 0;
+            this.helpBox.OwnerDraw = true;
+            this.helpBox.ReshowDelay = 0;
+            this.helpBox.ShowAlways = true;
+            this.helpBox.ToolTipIcon = System.Windows.Forms.ToolTipIcon.Info;
+            this.helpBox.UseAnimation = false;
+            this.helpBox.UseFading = false;
+            // 
             // MainForm
             // MainForm
             // 
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
             this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
@@ -5251,10 +5255,10 @@ namespace Optimizer
             this.Load += new System.EventHandler(this.Main_Load);
             this.Load += new System.EventHandler(this.Main_Load);
             this.tpanel.ResumeLayout(false);
             this.tpanel.ResumeLayout(false);
             this.tpanel.PerformLayout();
             this.tpanel.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.picUpdate)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
             this.bpanel.ResumeLayout(false);
             this.bpanel.ResumeLayout(false);
             this.launcherMenu.ResumeLayout(false);
             this.launcherMenu.ResumeLayout(false);
-            ((System.ComponentModel.ISupportInitialize)(this.picUpdate)).EndInit();
             this.tabCollection.ResumeLayout(false);
             this.tabCollection.ResumeLayout(false);
             this.universalTab.ResumeLayout(false);
             this.universalTab.ResumeLayout(false);
             this.windows10Tab.ResumeLayout(false);
             this.windows10Tab.ResumeLayout(false);
@@ -5573,7 +5577,7 @@ namespace Optimizer
         private Panel panel9;
         private Panel panel9;
         private PictureBox pictureBox87;
         private PictureBox pictureBox87;
         private PictureBox pictureBox86;
         private PictureBox pictureBox86;
-        private ToolTip helpBox;
+        private MoonTip helpBox;
         private PictureBox pictureBox88;
         private PictureBox pictureBox88;
         private MoonnRadio radioHellenic;
         private MoonnRadio radioHellenic;
         private MoonnRadio radioEnglish;
         private MoonnRadio radioEnglish;

+ 2 - 2
Optimizer/Forms/MainForm.cs

@@ -357,7 +357,7 @@ namespace Optimizer
             helpBox.SetToolTip(classicRibbonSw.Label, Options.TranslationList["classicRibbonTip"].ToString());
             helpBox.SetToolTip(classicRibbonSw.Label, Options.TranslationList["classicRibbonTip"].ToString());
             helpBox.SetToolTip(classicContextSw.Label, Options.TranslationList["classicContextTip"].ToString());
             helpBox.SetToolTip(classicContextSw.Label, Options.TranslationList["classicContextTip"].ToString());
 
 
-            helpBox.ToolTipTitle = Options.TranslationList["tipWhatsThis"].ToString();
+            //helpBox.ToolTipTitle = Options.TranslationList["tipWhatsThis"].ToString();
         }
         }
 
 
         private void ToggleSwitch7_Click(object sender, EventArgs e)
         private void ToggleSwitch7_Click(object sender, EventArgs e)
@@ -998,7 +998,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()

+ 142 - 44
Optimizer/Optimize.cs

@@ -8,48 +8,19 @@ namespace Optimizer
 {
 {
     public static class Optimize
     public static class Optimize
     {
     {
-        readonly static string CompatTelRunnerFile = Path.Combine(Path.GetPathRoot(Environment.SystemDirectory), @"Windows\System32\CompatTelRunner.exe");
-
-        readonly static string CompatTelRunnerFileOff = Path.Combine(Path.GetPathRoot(Environment.SystemDirectory), @"Windows\System32\CompatTelRunner.exe.OFF");
-
-        readonly static string CompatTelRunnerFileName = "CompatTelRunner.exe";
-        readonly static string CompatTelRunnerFileNameOff = "CompatTelRunner.exe.OFF";
-
         readonly static string DiagnosisAutoLoggerFolder = Path.Combine(CleanHelper.ProgramData, @"Microsoft\Diagnosis\ETLLogs\AutoLogger");
         readonly static string DiagnosisAutoLoggerFolder = Path.Combine(CleanHelper.ProgramData, @"Microsoft\Diagnosis\ETLLogs\AutoLogger");
 
 
         internal static void DisableTelemetryRunner()
         internal static void DisableTelemetryRunner()
         {
         {
-            try
-            {
-                if (File.Exists(CompatTelRunnerFileOff)) File.Delete(CompatTelRunnerFileOff);
-
-                if (File.Exists(CompatTelRunnerFile))
-                {
-                    Utilities.RunCommand(string.Format("takeown /F {0}", CompatTelRunnerFile));
-                    Utilities.RunCommand(string.Format("icacls \"{0}\" /grant administrators:F", CompatTelRunnerFile));
-
-                    FileSystem.RenameFile(CompatTelRunnerFile, CompatTelRunnerFileNameOff);
-                }
-            }
-            catch (Exception ex)
-            {
-                ErrorLogger.LogError("Optimize.DisableTelemetryRunner", ex.Message, ex.StackTrace);
-            }
-        }
+            Registry.SetValue(
+               @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\CompatTelRunner.exe",
+               "Debugger", @"%windir%\System32\taskkill.exe"
+            );
 
 
-        internal static void EnableTelemetryRunner()
-        {
-            try
-            {
-                if (File.Exists(CompatTelRunnerFileOff))
-                {
-                    FileSystem.RenameFile(CompatTelRunnerFileOff, CompatTelRunnerFileName);
-                }
-            }
-            catch (Exception ex)
-            {
-                ErrorLogger.LogError("Optimize.EnableTelemetryRunner", ex.Message, ex.StackTrace);
-            }
+            Registry.SetValue(
+                @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\DeviceCensus.exe",
+                "Debugger", @"%windir%\System32\taskkill.exe"
+            );
         }
         }
 
 
         internal static void EnablePerformanceTweaks()
         internal static void EnablePerformanceTweaks()
@@ -84,12 +55,14 @@ namespace Optimizer
             Registry.SetValue("HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control", "WaitToKillServiceTimeout", "2000");
             Registry.SetValue("HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control", "WaitToKillServiceTimeout", "2000");
 
 
             Utilities.StopService("DiagTrack");
             Utilities.StopService("DiagTrack");
+            Utilities.StopService("diagsvc");
             Utilities.StopService("diagnosticshub.standardcollector.service");
             Utilities.StopService("diagnosticshub.standardcollector.service");
             Utilities.StopService("dmwappushservice");
             Utilities.StopService("dmwappushservice");
 
 
             Utilities.RunCommand("sc config \"RemoteRegistry\" start= disabled");
             Utilities.RunCommand("sc config \"RemoteRegistry\" start= disabled");
 
 
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DiagTrack", "Start", "4", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DiagTrack", "Start", "4", RegistryValueKind.DWord);
+            Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\diagsvc", "Start", "4", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\diagnosticshub.standardcollector.service", "Start", "4", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\diagnosticshub.standardcollector.service", "Start", "4", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\dmwappushservice", "Start", "4", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\dmwappushservice", "Start", "4", RegistryValueKind.DWord);
 
 
@@ -180,13 +153,11 @@ namespace Optimizer
             Utilities.StopService("diagnosticshub.standardcollector.service");
             Utilities.StopService("diagnosticshub.standardcollector.service");
             Utilities.StopService("dmwappushservice");
             Utilities.StopService("dmwappushservice");
             Utilities.StopService("DcpSvc");
             Utilities.StopService("DcpSvc");
-            Utilities.StopService("DPS");
 
 
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DiagTrack", "Start", "4", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DiagTrack", "Start", "4", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\diagnosticshub.standardcollector.service", "Start", "4", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\diagnosticshub.standardcollector.service", "Start", "4", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\dmwappushservice", "Start", "4", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\dmwappushservice", "Start", "4", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DcpSvc", "Start", "4", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DcpSvc", "Start", "4", RegistryValueKind.DWord);
-            Utilities.RunCommand("sc config \"DPS\" start=disabled");
 
 
             Utilities.RunCommand("reg add \"HKLM\\Software\\Microsoft\\PolicyManager\\default\\WiFi\\AllowAutoConnectToWiFiSenseHotspots\" /v value /t REG_DWORD /d 0 /f");
             Utilities.RunCommand("reg add \"HKLM\\Software\\Microsoft\\PolicyManager\\default\\WiFi\\AllowAutoConnectToWiFiSenseHotspots\" /v value /t REG_DWORD /d 0 /f");
             Utilities.RunCommand("reg add \"HKLM\\Software\\Microsoft\\PolicyManager\\default\\WiFi\\AllowWiFiHotSpotReporting\" /v value /t REG_DWORD /d 0 /f");
             Utilities.RunCommand("reg add \"HKLM\\Software\\Microsoft\\PolicyManager\\default\\WiFi\\AllowWiFiHotSpotReporting\" /v value /t REG_DWORD /d 0 /f");
@@ -194,10 +165,17 @@ namespace Optimizer
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System", "PublishUserActivities", "0", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System", "PublishUserActivities", "0", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows", "CEIPEnable", "0", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows", "CEIPEnable", "0", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppCompat", "AITEnable", "0", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppCompat", "AITEnable", "0", RegistryValueKind.DWord);
+            Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppCompat", "DisableInventory", "1", RegistryValueKind.DWord);
+            Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppCompat", "DisablePCA", "1", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppCompat", "DisableUAR", "1", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppCompat", "DisableUAR", "1", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Device Metadata", "PreventDeviceMetadataFromNetwork", "1", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Device Metadata", "PreventDeviceMetadataFromNetwork", "1", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MRT", "DontOfferThroughWUAU", "1", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MRT", "DontOfferThroughWUAU", "1", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\WMI\AutoLogger\SQMLogger", "Start", "0", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\WMI\AutoLogger\SQMLogger", "Start", "0", RegistryValueKind.DWord);
+            Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PolicyManager\current\device\System", "AllowExperimentation", 0);
+
+            Utilities.DisableProtectedService("DPS");
+            Utilities.DisableProtectedService("WdiSystemHost");
+            Utilities.DisableProtectedService("WdiServiceHost");
         }
         }
 
 
         internal static void EnableTelemetryServices()
         internal static void EnableTelemetryServices()
@@ -206,13 +184,15 @@ namespace Optimizer
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\diagnosticshub.standardcollector.service", "Start", "2", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\diagnosticshub.standardcollector.service", "Start", "2", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\dmwappushservice", "Start", "2", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\dmwappushservice", "Start", "2", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DcpSvc", "Start", "2", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DcpSvc", "Start", "2", RegistryValueKind.DWord);
-            Utilities.RunCommand("sc config \"DPS\" start=demand");
 
 
             Utilities.StartService("DiagTrack");
             Utilities.StartService("DiagTrack");
             Utilities.StartService("diagnosticshub.standardcollector.service");
             Utilities.StartService("diagnosticshub.standardcollector.service");
             Utilities.StartService("dmwappushservice");
             Utilities.StartService("dmwappushservice");
             Utilities.StartService("DcpSvc");
             Utilities.StartService("DcpSvc");
-            Utilities.StartService("DPS");
+
+            Utilities.EnableProtectedService("DPS");
+            Utilities.EnableProtectedService("WdiSystemHost");
+            Utilities.EnableProtectedService("WdiServiceHost");
         }
         }
 
 
         internal static void DisableMediaPlayerSharing()
         internal static void DisableMediaPlayerSharing()
@@ -368,6 +348,14 @@ namespace Optimizer
 
 
         internal static void DisableDefender()
         internal static void DisableDefender()
         {
         {
+            Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender", "DisableAntiVirus", "1", RegistryValueKind.DWord);
+            Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender", "DisableSpecialRunningModes", "1", RegistryValueKind.DWord);
+            Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender", "DisableRoutinelyTakingAction", "1", RegistryValueKind.DWord);
+            Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender", "ServiceKeepAlive", "0", RegistryValueKind.DWord);
+            Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection", "DisableRealtimeMonitoring", "1", RegistryValueKind.DWord);
+            Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Signature Updates", "ForceUpdateFromMU", 0);
+            Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet", "DisableBlockAtFirstSeen", 1);
+
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\MpEngine", "MpEnablePus", "0", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\MpEngine", "MpEnablePus", "0", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender", "PUAProtection", "0", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender", "PUAProtection", "0", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Policy Manager", "DisableScanningNetworkFiles", "1", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Policy Manager", "DisableScanningNetworkFiles", "1", RegistryValueKind.DWord);
@@ -376,6 +364,7 @@ namespace Optimizer
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Spynet", "SpyNetReporting", "0", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Spynet", "SpyNetReporting", "0", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Spynet", "SubmitSamplesConsent", "0", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Spynet", "SubmitSamplesConsent", "0", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\MRT", "DontReportInfectionInformation", "1", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\MRT", "DontReportInfectionInformation", "1", RegistryValueKind.DWord);
+            Registry.SetValue(@"HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\MRT", "DontOfferThroughWUAU", "1", RegistryValueKind.DWord);
             Registry.ClassesRoot.DeleteSubKeyTree(@"\CLSID\{09A47860-11B0-4DA5-AFA5-26D86198A780}", false);
             Registry.ClassesRoot.DeleteSubKeyTree(@"\CLSID\{09A47860-11B0-4DA5-AFA5-26D86198A780}", false);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection", "DisableBehaviorMonitoring", "1", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection", "DisableBehaviorMonitoring", "1", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection", "DisableOnAccessProtection", "1", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection", "DisableOnAccessProtection", "1", RegistryValueKind.DWord);
@@ -413,23 +402,44 @@ namespace Optimizer
             Registry.LocalMachine.OpenSubKey(@"Software\Policies\Microsoft\Windows Defender\Spynet", true).DeleteValue("SpyNetReporting", false);
             Registry.LocalMachine.OpenSubKey(@"Software\Policies\Microsoft\Windows Defender\Spynet", true).DeleteValue("SpyNetReporting", false);
             Registry.LocalMachine.OpenSubKey(@"Software\Policies\Microsoft\Windows Defender\Spynet", true).DeleteValue("SubmitSamplesConsent", false);
             Registry.LocalMachine.OpenSubKey(@"Software\Policies\Microsoft\Windows Defender\Spynet", true).DeleteValue("SubmitSamplesConsent", false);
             Registry.LocalMachine.OpenSubKey(@"Software\Policies\Microsoft\MRT", true).DeleteValue("DontReportInfectionInformation", false);
             Registry.LocalMachine.OpenSubKey(@"Software\Policies\Microsoft\MRT", true).DeleteValue("DontReportInfectionInformation", false);
+            Registry.LocalMachine.OpenSubKey(@"Software\Policies\Microsoft\MRT", true).DeleteValue("DontOfferThroughWUAU", false);
             Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection", true).DeleteValue("DisableBehaviorMonitoring", false);
             Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection", true).DeleteValue("DisableBehaviorMonitoring", false);
             Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection", true).DeleteValue("DisableOnAccessProtection", false);
             Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection", true).DeleteValue("DisableOnAccessProtection", false);
             Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection", true).DeleteValue("DisableScanOnRealtimeEnable", false);
             Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection", true).DeleteValue("DisableScanOnRealtimeEnable", false);
 
 
+            Utilities.TryDeleteRegistryValue(true, @"SOFTWARE\Policies\Microsoft\Windows Defender", "DisableAntiVirus");
+            Utilities.TryDeleteRegistryValue(true, @"SOFTWARE\Policies\Microsoft\Windows Defender", "DisableSpecialRunningModes");
+            Utilities.TryDeleteRegistryValue(true, @"SOFTWARE\Policies\Microsoft\Windows Defender", "DisableRoutinelyTakingAction");
+            Utilities.TryDeleteRegistryValue(true, @"SOFTWARE\Policies\Microsoft\Windows Defender", "ServiceKeepAlive");
+            Utilities.TryDeleteRegistryValue(true, @"SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection", "DisableRealtimeMonitoring");
+            Utilities.TryDeleteRegistryValue(true, @"SOFTWARE\Policies\Microsoft\Windows Defender\Signature Updates", "ForceUpdateFromMU");
+            Utilities.TryDeleteRegistryValue(true, @"SOFTWARE\Policies\Microsoft\Windows Defender\Spynet", "DisableBlockAtFirstSeen");
+
             Utilities.RunCommand("Gpupdate /Force");
             Utilities.RunCommand("Gpupdate /Force");
         }
         }
 
 
         internal static void DisableErrorReporting()
         internal static void DisableErrorReporting()
         {
         {
+            Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting", "Disabled", 1);
+            Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\PCHealth\ErrorReporting", "DoReport", 0);
+            Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting", "Disabled", 1);
+
             Utilities.StopService("WerSvc");
             Utilities.StopService("WerSvc");
+            Utilities.StopService("wercplsupport");
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WerSvc", "Start", "4", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WerSvc", "Start", "4", RegistryValueKind.DWord);
+            Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\wercplsupport", "Start", "4", RegistryValueKind.DWord);
         }
         }
 
 
         internal static void EnableErrorReporting()
         internal static void EnableErrorReporting()
         {
         {
+            Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting", true).DeleteValue("Disabled", false);
+            Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Policies\Microsoft\PCHealth\ErrorReporting", true).DeleteValue("DoReport", false);
+            Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\Windows Error Reporting", true).DeleteValue("Disabled", false);
+
+            Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\wercplsupport", "Start", "3", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WerSvc", "Start", "2", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WerSvc", "Start", "2", RegistryValueKind.DWord);
             Utilities.StartService("WerSvc");
             Utilities.StartService("WerSvc");
+            Utilities.StartService("wercplsupport");
         }
         }
 
 
         // not used
         // not used
@@ -493,6 +503,14 @@ namespace Optimizer
             Utilities.RunBatchFile(Required.ScriptsFolder + "OneDrive_Uninstaller.cmd");
             Utilities.RunBatchFile(Required.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 key = localMachine.CreateSubKey(@"SOFTWARE\Microsoft\OneDrive"))
+                {
+                    key.SetValue("PreventNetworkTrafficPreUserSignIn", 1);
+                }
+            }
+
             // delete OneDrive folders
             // delete OneDrive folders
             string[] oneDriveFolders =
             string[] oneDriveFolders =
             {
             {
@@ -580,6 +598,14 @@ namespace Optimizer
             {
             {
                 Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\OneDrive", "DisableFileSyncNGSC", "0", RegistryValueKind.DWord);
                 Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\OneDrive", "DisableFileSyncNGSC", "0", RegistryValueKind.DWord);
 
 
+                using (RegistryKey localMachine = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64))
+                {
+                    using (RegistryKey key = localMachine.CreateSubKey(@"SOFTWARE\Microsoft\OneDrive"))
+                    {
+                        key.DeleteValue("PreventNetworkTrafficPreUserSignIn", false);
+                    }
+                }
+
                 string oneDriveInstaller;
                 string oneDriveInstaller;
                 if (Environment.Is64BitOperatingSystem)
                 if (Environment.Is64BitOperatingSystem)
                 {
                 {
@@ -681,6 +707,7 @@ namespace Optimizer
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU", "NoAutoRebootWithLoggedOnUsers", "1", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU", "NoAutoRebootWithLoggedOnUsers", "1", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config", "DODownloadMode", "0", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config", "DODownloadMode", "0", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DoSvc", "Start", "4", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DoSvc", "Start", "4", RegistryValueKind.DWord);
+            Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Speech", "AllowSpeechModelUpdate", 0);
 
 
             // disable silent app install
             // disable silent app install
             Registry.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager", "SilentInstalledAppsEnabled", "0", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager", "SilentInstalledAppsEnabled", "0", RegistryValueKind.DWord);
@@ -703,6 +730,7 @@ namespace Optimizer
             Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU", true).DeleteValue("NoAutoUpdate", false);
             Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU", true).DeleteValue("NoAutoUpdate", false);
             Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU", true).DeleteValue("NoAutoRebootWithLoggedOnUsers", false);
             Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU", true).DeleteValue("NoAutoRebootWithLoggedOnUsers", false);
             Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config", true).DeleteValue("DODownloadMode", false);
             Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config", true).DeleteValue("DODownloadMode", false);
+            Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Policies\Microsoft\Speech", true).DeleteValue("AllowSpeechModelUpdate", false);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DoSvc", "Start", "3", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DoSvc", "Start", "3", RegistryValueKind.DWord);
 
 
             //Utilities.StartService("DoSvc");
             //Utilities.StartService("DoSvc");
@@ -719,7 +747,6 @@ namespace Optimizer
         }
         }
 
 
         // no longer useful
         // no longer useful
-
         //internal static void RemoveWindows10Icon()
         //internal static void RemoveWindows10Icon()
         //{
         //{
         //    Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\GWX", "DisableGWX", "00000001", RegistryValueKind.DWord);
         //    Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\GWX", "DisableGWX", "00000001", RegistryValueKind.DWord);
@@ -767,8 +794,6 @@ namespace Optimizer
 
 
         internal static void EnableTelemetryTasks()
         internal static void EnableTelemetryTasks()
         {
         {
-            //EnableTelemetryRunner();
-
             try
             try
             {
             {
                 if (!File.Exists(Required.ScriptsFolder + "EnableTelemetryTasks.bat"))
                 if (!File.Exists(Required.ScriptsFolder + "EnableTelemetryTasks.bat"))
@@ -815,6 +840,40 @@ namespace Optimizer
 
 
         internal static void EnhancePrivacy()
         internal static void EnhancePrivacy()
         {
         {
+            Registry.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager", "RotatingLockScreenOverlayEnabled", "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", "DisableTailoredExperiencesWithDiagnosticData", "1", RegistryValueKind.DWord);
+            Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge", "SpotlightExperiencesAndRecommendationsEnabled", 0);
+            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\Windows Feeds", "EnableFeeds", 0);
+
+            // Account->Sign-in options->Privacy
+            Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System", "DisableAutomaticRestartSignOn", 1);
+
+            Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo", "DisabledByGroupPolicy", 1);
+            Registry.SetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "Start_TrackProgs", 0);
+            Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC", "PreventHandwritingDataSharing", 1);
+            Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\TextInput", "AllowLinguisticDataCollection", 0);
+
+            // Privacy -> Speech
+            Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\InputPersonalization", "AllowInputPersonalization", 0);
+
+            // Microsoft Edge settings -> Privacy, search and services -> Personalize your web experience
+            Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge", "PersonalizationReportingEnabled", 0);
+
+            // Privacy -> Activity history -> Send my activity history to Microsoft
+            Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System", "UploadUserActivities", 0);
+
+            Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System", "AllowCrossDeviceClipboard", 0);
+            Registry.SetValue(@"HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Messaging", "AllowMessageSync", 0);
+            Registry.SetValue(@"HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\SettingSync", "DisableCredentialsSettingSync", 2);
+            Registry.SetValue(@"HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\SettingSync", "DisableCredentialsSettingSyncUserOverride", 1);
+            Registry.SetValue(@"HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\SettingSync", "DisableApplicationSettingSync", 2);
+            Registry.SetValue(@"HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\SettingSync", "DisableApplicationSettingSyncUserOverride", 1);
+            Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy", "LetAppsActivateWithVoice", 2);
+
             // Find my device
             // Find my device
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\FindMyDevice", "AllowFindMyDevice", "0", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\FindMyDevice", "AllowFindMyDevice", "0", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Settings\FindMyDevice", "LocationSyncEnabled", "0", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Settings\FindMyDevice", "LocationSyncEnabled", "0", RegistryValueKind.DWord);
@@ -902,6 +961,35 @@ namespace Optimizer
 
 
         internal static void CompromisePrivacy()
         internal static void CompromisePrivacy()
         {
         {
+            Utilities.TryDeleteRegistryValue(false, @"Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager", "RotatingLockScreenOverlayEnabled");
+            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", "DisableTailoredExperiencesWithDiagnosticData");
+            Utilities.TryDeleteRegistryValue(true, @"SOFTWARE\Policies\Microsoft\Edge", "SpotlightExperiencesAndRecommendationsEnabled");
+            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\Windows Feeds", "EnableFeeds");
+
+            // Account->Sign-in options->Privacy
+            Utilities.TryDeleteRegistryValue(true, @"SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System", "DisableAutomaticRestartSignOn");
+
+            Utilities.TryDeleteRegistryValue(true, @"SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo", "DisabledByGroupPolicy");
+            Utilities.TryDeleteRegistryValue(false, @"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "Start_TrackProgs");
+            Utilities.TryDeleteRegistryValue(true, @"SOFTWARE\Policies\Microsoft\Windows\TabletPC", "PreventHandwritingDataSharing");
+            Utilities.TryDeleteRegistryValue(true, @"SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\TextInput", "AllowLinguisticDataCollection");
+
+            Utilities.TryDeleteRegistryValue(true, @"SOFTWARE\Policies\Microsoft\InputPersonalization", "AllowInputPersonalization");
+            Utilities.TryDeleteRegistryValue(true, @"SOFTWARE\Policies\Microsoft\Edge", "PersonalizationReportingEnabled");
+            
+
+            Utilities.TryDeleteRegistryValue(true, @"SOFTWARE\Policies\Microsoft\Windows\System", "AllowCrossDeviceClipboard");
+            Utilities.TryDeleteRegistryValue(true, @"Software\Policies\Microsoft\Windows\Messaging", "AllowMessageSync");
+            Utilities.TryDeleteRegistryValue(true, @"Software\Policies\Microsoft\Windows\SettingSync", "DisableCredentialsSettingSync");
+            Utilities.TryDeleteRegistryValue(true, @"Software\Policies\Microsoft\Windows\SettingSync", "DisableCredentialsSettingSyncUserOverride");
+            Utilities.TryDeleteRegistryValue(true, @"Software\Policies\Microsoft\Windows\SettingSync", "DisableApplicationSettingSync");
+            Utilities.TryDeleteRegistryValue(true, @"Software\Policies\Microsoft\Windows\SettingSync", "DisableApplicationSettingSyncUserOverride");
+            Utilities.TryDeleteRegistryValue(true, @"SOFTWARE\Policies\Microsoft\Windows\AppPrivacy", "LetAppsActivateWithVoice");
+
             // Find my device
             // Find my device
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\FindMyDevice", "AllowFindMyDevice", "1", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\FindMyDevice", "AllowFindMyDevice", "1", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Settings\FindMyDevice", "LocationSyncEnabled", "1", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Settings\FindMyDevice", "LocationSyncEnabled", "1", RegistryValueKind.DWord);
@@ -1087,6 +1175,7 @@ namespace Optimizer
             Registry.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager", "SoftLandingEnabled", "0", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager", "SoftLandingEnabled", "0", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager", "FeatureManagementEnabled", "0", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager", "FeatureManagementEnabled", "0", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Explorer", "DisableSearchBoxSuggestions", 1, RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Explorer", "DisableSearchBoxSuggestions", 1, RegistryValueKind.DWord);
+            Registry.SetValue(@"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "AllowOnlineTips", 0);
         }
         }
 
 
         internal static void EnableStartMenuAds()
         internal static void EnableStartMenuAds()
@@ -1108,6 +1197,7 @@ namespace Optimizer
             Registry.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager", "SoftLandingEnabled", "1", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager", "SoftLandingEnabled", "1", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager", "FeatureManagementEnabled", "1", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager", "FeatureManagementEnabled", "1", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Explorer", "DisableSearchBoxSuggestions", 0, RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Explorer", "DisableSearchBoxSuggestions", 0, RegistryValueKind.DWord);
+            Registry.SetValue(@"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "AllowOnlineTips", 1);
         }
         }
 
 
         internal static void DisableMyPeople()
         internal static void DisableMyPeople()
@@ -1247,6 +1337,12 @@ namespace Optimizer
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System", "EnableSmartScreen", "0", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System", "EnableSmartScreen", "0", RegistryValueKind.DWord);
             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\Edge\SmartScreenEnabled", "", 0);
+            Registry.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Edge\SmartScreenPuaEnabled", "", 0);
+            using (RegistryKey localMachine = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64))
+            {
+                localMachine.CreateSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.SecurityAndMaintenance").SetValue("Enabled", 0);
+            }
         }
         }
 
 
         internal static void EnableSmartScreen()
         internal static void EnableSmartScreen()
@@ -1256,6 +1352,8 @@ namespace Optimizer
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System", "EnableSmartScreen", "1", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System", "EnableSmartScreen", "1", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer", "SmartScreenEnabled", "On", RegistryValueKind.String);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer", "SmartScreenEnabled", "On", RegistryValueKind.String);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\PhishingFilter", "EnabledV9", "1", RegistryValueKind.DWord);
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\PhishingFilter", "EnabledV9", "1", RegistryValueKind.DWord);
+            Registry.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Edge\SmartScreenEnabled", "", 1);
+            Registry.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Edge\SmartScreenPuaEnabled", "", 1);
         }
         }
 
 
         internal static void DisableCloudClipboard()
         internal static void DisableCloudClipboard()

+ 4 - 0
Optimizer/Optimizer.csproj

@@ -92,6 +92,9 @@
       <SubType>Component</SubType>
       <SubType>Component</SubType>
     </Compile>
     </Compile>
     <Compile Include="Controls\ColorOverrider.cs" />
     <Compile Include="Controls\ColorOverrider.cs" />
+    <Compile Include="Controls\MoonTip.cs">
+      <SubType>Component</SubType>
+    </Compile>
     <Compile Include="Controls\MoonToggle.cs">
     <Compile Include="Controls\MoonToggle.cs">
       <SubType>Component</SubType>
       <SubType>Component</SubType>
     </Compile>
     </Compile>
@@ -204,6 +207,7 @@
     </Compile>
     </Compile>
     <Compile Include="StartupBackupItem.cs" />
     <Compile Include="StartupBackupItem.cs" />
     <Compile Include="StartupItem.cs" />
     <Compile Include="StartupItem.cs" />
+    <Compile Include="TokenPrivilege.cs" />
     <Compile Include="Utilities.cs" />
     <Compile Include="Utilities.cs" />
     <EmbeddedResource Include="Controls\ToggleCard.resx">
     <EmbeddedResource Include="Controls\ToggleCard.resx">
       <DependentUpon>ToggleCard.cs</DependentUpon>
       <DependentUpon>ToggleCard.cs</DependentUpon>

+ 4 - 7
Optimizer/Options.cs

@@ -96,9 +96,9 @@ namespace Optimizer
                     ForegroundAccentColor = Color.Chocolate;
                     ForegroundAccentColor = Color.Chocolate;
                     break;
                     break;
                 case Theme.Lime:
                 case Theme.Lime:
-                    SetTheme(f, Color.LimeGreen, Color.ForestGreen);
-                    ForegroundColor = Color.LimeGreen;
-                    ForegroundAccentColor = Color.ForestGreen;
+                    SetTheme(f, Color.ForestGreen, Color.FromArgb(39, 159, 39));
+                    ForegroundColor = Color.ForestGreen;
+                    ForegroundAccentColor = Color.FromArgb(39, 159, 39);
                     break;
                     break;
                 case Theme.Magma:
                 case Theme.Magma:
                     SetTheme(f, Color.Tomato, Color.Red);
                     SetTheme(f, Color.Tomato, Color.Red);
@@ -178,10 +178,7 @@ namespace Optimizer
                     }
                     }
                 }
                 }
 
 
-                if (x is MoonTabs)
-                {
-                    c.Invalidate();
-                }
+                c.Invalidate();
             });
             });
         }
         }
 
 

+ 1 - 1
Optimizer/Program.cs

@@ -12,7 +12,7 @@ namespace Optimizer
         /* DO NOT LEAVE THEM EMPTY */
         /* DO NOT LEAVE THEM EMPTY */
 
 
         internal readonly static float Major = 11;
         internal readonly static float Major = 11;
-        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;
 
 

+ 2 - 2
Optimizer/Resources/DisableDefenderSafeMode1903Plus.bat

@@ -14,10 +14,10 @@ rem Exclusion in WD can be easily set with an elevated cmd, so that makes it sup
 rem WMIC /NAMESPACE:\\root\Microsoft\Windows\Defender PATH MSFT_MpPreference call Add ExclusionPath="xxxxxx
 rem WMIC /NAMESPACE:\\root\Microsoft\Windows\Defender PATH MSFT_MpPreference call Add ExclusionPath="xxxxxx
 
 
 rem To disable System Guard Runtime Monitor Broker
 rem To disable System Guard Runtime Monitor Broker
-rem reg add "HKLM\System\CurrentControlSet\Services\SgrmBroker" /v "Start" /t REG_DWORD /d "4" /f
+reg add "HKLM\System\CurrentControlSet\Services\SgrmBroker" /v "Start" /t REG_DWORD /d "4" /f
 
 
 rem To disable Windows Defender Security Center include this
 rem To disable Windows Defender Security Center include this
-rem reg add "HKLM\System\CurrentControlSet\Services\SecurityHealthService" /v "Start" /t REG_DWORD /d "4" /f
+reg add "HKLM\System\CurrentControlSet\Services\SecurityHealthService" /v "Start" /t REG_DWORD /d "4" /f
 
 
 rem 1 - Disable Real-time protection
 rem 1 - Disable Real-time protection
 reg delete "HKLM\Software\Policies\Microsoft\Windows Defender" /f
 reg delete "HKLM\Software\Policies\Microsoft\Windows Defender" /f

+ 13 - 1
Optimizer/Resources/DisableTelemetryTasks.bat

@@ -48,4 +48,16 @@ schtasks /end /tn "\Microsoft\Windows\AppID\SmartScreenSpecific"
 schtasks /change /tn "\Microsoft\Windows\AppID\SmartScreenSpecific" /disable
 schtasks /change /tn "\Microsoft\Windows\AppID\SmartScreenSpecific" /disable
 schtasks /Change /TN "\Microsoft\Windows\WindowsUpdate\Automatic App Update" /Disable
 schtasks /Change /TN "\Microsoft\Windows\WindowsUpdate\Automatic App Update" /Disable
 schtasks /Change /TN "\Microsoft\Windows\Time Synchronization\ForceSynchronizeTime" /Disable
 schtasks /Change /TN "\Microsoft\Windows\Time Synchronization\ForceSynchronizeTime" /Disable
-schtasks /Change /TN "\Microsoft\Windows\Time Synchronization\SynchronizeTime" /Disable
+schtasks /Change /TN "\Microsoft\Windows\Time Synchronization\SynchronizeTime" /Disable
+schtasks /end /tn "\Microsoft\Windows\HelloFace\FODCleanupTask"
+schtasks /change /tn "\Microsoft\Windows\HelloFace\FODCleanupTask" /disable
+schtasks /end /tn "\Microsoft\Windows\Feedback\Siuf\DmClient"
+schtasks /change /tn "\Microsoft\Windows\Feedback\Siuf\DmClient" /disable
+schtasks /end /tn "\Microsoft\Windows\Feedback\Siuf\DmClientOnScenarioDownload"
+schtasks /change /tn "\Microsoft\Windows\Feedback\Siuf\DmClientOnScenarioDownload" /disable
+schtasks /end /tn "\Microsoft\Windows\Application Experience\PcaPatchDbTask"
+schtasks /change /tn "\Microsoft\Windows\Application Experience\PcaPatchDbTask" /disable
+schtasks /end /tn "\Microsoft\Windows\Device Information\Device"
+schtasks /change /tn "\Microsoft\Windows\Device Information\Device" /disable
+schtasks /end /tn "\Microsoft\Windows\Device Information\Device User"
+schtasks /change /tn "\Microsoft\Windows\Device Information\Device User" /disable

+ 6 - 0
Optimizer/Resources/EnableTelemetryTasks.bat

@@ -22,3 +22,9 @@ schtasks /change /tn "\Microsoft\Windows\FileHistory\File History (maintenance m
 schtasks /change /tn "\Microsoft\Windows\PI\Sqm-Tasks" /enable
 schtasks /change /tn "\Microsoft\Windows\PI\Sqm-Tasks" /enable
 schtasks /change /tn "\Microsoft\Windows\NetTrace\GatherNetworkInfo" /enable
 schtasks /change /tn "\Microsoft\Windows\NetTrace\GatherNetworkInfo" /enable
 schtasks /change /tn "\Microsoft\Windows\AppID\SmartScreenSpecific" /enable
 schtasks /change /tn "\Microsoft\Windows\AppID\SmartScreenSpecific" /enable
+schtasks /change /tn "\Microsoft\Windows\HelloFace\FODCleanupTask" /enable
+schtasks /change /tn "\Microsoft\Windows\Feedback\Siuf\DmClientOnScenarioDownload" /enable
+schtasks /change /tn "\Microsoft\Windows\Feedback\Siuf\DmClient" /enable
+schtasks /change /tn "\Microsoft\Windows\Application Experience\PcaPatchDbTask" /enable
+schtasks /change /tn "\Microsoft\Windows\Device Information\Device" /enable
+schtasks /change /tn "\Microsoft\Windows\Device Information\Device User" /enable

+ 1 - 0
Optimizer/Resources/OneDrive_Uninstaller.bin

@@ -23,6 +23,7 @@ echo.
 rd "%USERPROFILE%\OneDrive" /Q /S > NUL 2>&1
 rd "%USERPROFILE%\OneDrive" /Q /S > NUL 2>&1
 rd "C:\OneDriveTemp" /Q /S > NUL 2>&1
 rd "C:\OneDriveTemp" /Q /S > NUL 2>&1
 rd "%LOCALAPPDATA%\Microsoft\OneDrive" /Q /S > NUL 2>&1
 rd "%LOCALAPPDATA%\Microsoft\OneDrive" /Q /S > NUL 2>&1
+rd "%LOCALAPPDATA%\OneDrive" /Q /S > NUL 2>&1
 rd "%PROGRAMDATA%\Microsoft OneDrive" /Q /S > NUL 2>&1 
 rd "%PROGRAMDATA%\Microsoft OneDrive" /Q /S > NUL 2>&1 
 
 
 echo Removing OneDrive from the Explorer Side Panel...
 echo Removing OneDrive from the Explorer Side Panel...

+ 111 - 0
Optimizer/TokenPrivilege.cs

@@ -0,0 +1,111 @@
+using System;
+using System.Runtime.InteropServices;
+using System.Security;
+
+namespace Optimizer
+{
+    /*
+     *  Allows clients to obtain a Windows token privilege for a well-defined scope simply by "using" an instance of this class.
+     */
+    class TokenPrivilege : IDisposable
+    {
+        private enum PrivilegeAction : uint
+        {
+            Disable = 0x0,
+            Enable = 0x2
+        }
+
+        public static TokenPrivilege Backup => new TokenPrivilege("SeBackupPrivilege");
+        public static TokenPrivilege Restore => new TokenPrivilege("SeRestorePrivilege");
+        public static TokenPrivilege TakeOwnership => new TokenPrivilege("SeTakeOwnershipPrivilege");
+
+        private readonly string privilegeName;
+
+        private TokenPrivilege(string privilegeName)
+        {
+            this.privilegeName = privilegeName;
+            Apply(PrivilegeAction.Enable);
+        }
+
+        private void Apply(PrivilegeAction action)
+        {
+            OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, out IntPtr tokenHandle);
+            LookupPrivilegeValue(null, privilegeName, out Luid luid);
+            var tokenPrivilege = new TokenPrivileges(luid, (uint)action);
+            UpdateTokenPrivileges(tokenHandle, tokenPrivilege);
+        }
+
+        private void UpdateTokenPrivileges(IntPtr tokenHandle, TokenPrivileges privilegeInfo)
+        {
+            bool successful = AdjustTokenPrivileges(tokenHandle, false, ref privilegeInfo, 0, IntPtr.Zero, IntPtr.Zero);
+            if (!successful || Marshal.GetLastWin32Error() == ERROR_NOT_ALL_ASSIGNED)
+                throw new SecurityException($"Can't adjust token privilege {privilegeName}");
+        }
+
+        public void Dispose()
+        {
+            Apply(PrivilegeAction.Disable);
+        }
+
+        #region P/Invoke structs and methods
+        private const int ERROR_NOT_ALL_ASSIGNED = 1300;
+
+        [StructLayout(LayoutKind.Sequential)]
+        private struct TokenPrivileges
+        {
+            // We can use this struct only with one privilege since CLR doesn't support marshalling dynamic-sized arrays
+            public TokenPrivileges(Luid luid, uint attributes)
+            {
+                Count = 1;
+                Privileges = new[] {
+                    new LuidAndAttributes(luid, attributes)
+                };
+            }
+
+            private uint Count;
+            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)]
+            private LuidAndAttributes[] Privileges;
+        }
+
+        [StructLayout(LayoutKind.Sequential)]
+        private readonly struct LuidAndAttributes
+        {
+            public LuidAndAttributes(Luid luid, uint attributes)
+            {
+                Luid = luid;
+                Attributes = attributes;
+            }
+
+            private readonly Luid Luid;
+            private readonly uint Attributes;
+        }
+
+        [StructLayout(LayoutKind.Sequential)]
+        private readonly struct Luid
+        {
+            private readonly uint LowPart;
+            private readonly int HighPart;
+        }
+
+        private const int TOKEN_QUERY = 0x8;
+        private const int TOKEN_ADJUST_PRIVILEGES = 0x20;
+
+        [DllImport("advapi32.dll", SetLastError = true)]
+        private static extern bool AdjustTokenPrivileges(IntPtr tokenHandle,
+                                                         bool disableAllPrivileges,
+                                                         ref TokenPrivileges newState,
+                                                         int bufferLength,
+                                                         IntPtr previousState,
+                                                         IntPtr returnLength);
+
+        [DllImport("kernel32.dll")]
+        private static extern IntPtr GetCurrentProcess();
+
+        [DllImport("advapi32.dll", SetLastError = true)]
+        private static extern bool OpenProcessToken(IntPtr processHandle, int desiredAccess, out IntPtr tokenHandle);
+
+        [DllImport("advapi32.dll", SetLastError = true)]
+        private static extern bool LookupPrivilegeValue(string systemName, string privilegeName, out Luid privilegeLuid);
+        #endregion
+    }
+}

+ 128 - 0
Optimizer/Utilities.cs

@@ -10,8 +10,10 @@ using System.Net;
 using System.Net.NetworkInformation;
 using System.Net.NetworkInformation;
 using System.Net.Sockets;
 using System.Net.Sockets;
 using System.Reflection;
 using System.Reflection;
+using System.Security.AccessControl;
 using System.Security.Principal;
 using System.Security.Principal;
 using System.ServiceProcess;
 using System.ServiceProcess;
+using System.Threading;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
 using System.Windows.Forms;
 using System.Windows.Forms;
 
 
@@ -563,6 +565,7 @@ namespace Optimizer
                 }
                 }
             }
             }
 
 
+            Thread.Sleep(TimeSpan.FromSeconds(1));
             Process.Start(explorer);
             Process.Start(explorer);
         }
         }
 
 
@@ -716,6 +719,131 @@ namespace Optimizer
             Utilities.RunBatchFile(Required.ScriptsFolder + "GPEditEnablerInHome.bat");
             Utilities.RunBatchFile(Required.ScriptsFolder + "GPEditEnablerInHome.bat");
         }
         }
 
 
+        internal static void TryDeleteRegistryValue(bool localMachine, string path, string valueName)
+        {
+            try
+            {
+                if (localMachine) Registry.LocalMachine.OpenSubKey(path, true).DeleteValue(valueName, false);
+                if (!localMachine) Registry.CurrentUser.OpenSubKey(path, true).DeleteValue(valueName, false);
+            }
+            catch { }
+        }
+
+        internal static void DisableProtectedService(string serviceName)
+        {
+            using (TokenPrivilege.TakeOwnership)
+            {
+                using (RegistryKey allServicesKey = Registry.LocalMachine.OpenSubKeyWritable(@"SYSTEM\CurrentControlSet\Services"))
+                {
+                    allServicesKey.GrantFullControlOnSubKey(serviceName);
+                    using (RegistryKey serviceKey = allServicesKey.OpenSubKeyWritable(serviceName))
+                    {
+                        foreach (string subkeyName in serviceKey.GetSubKeyNames())
+                        {
+                            serviceKey.TakeOwnershipOnSubKey(subkeyName);
+                            serviceKey.GrantFullControlOnSubKey(subkeyName);
+                        }
+                        serviceKey.SetValue("Start", "4", RegistryValueKind.DWord);
+                    }
+                }
+            }
+        }
+
+        internal static void RestoreWindowsPhotoViewer()
+        {
+            const string PHOTO_VIEWER_SHELL_COMMAND =
+                @"%SystemRoot%\System32\rundll32.exe ""%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll"", ImageView_Fullscreen %1";
+            const string PHOTO_VIEWER_CLSID = "{FFE2A43C-56B9-4bf5-9A79-CC6D4285608A}";
+
+            Registry.SetValue(@"HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open", "MuiVerb", "@photoviewer.dll,-3043");
+            Registry.SetValue(
+                @"HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open\command", valueName: null,
+                PHOTO_VIEWER_SHELL_COMMAND, RegistryValueKind.ExpandString
+            );
+            Registry.SetValue(@"HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open\DropTarget", "Clsid", PHOTO_VIEWER_CLSID);
+
+            string[] imageTypes = { "Paint.Picture", "giffile", "jpegfile", "pngfile" };
+            foreach (string type in imageTypes)
+            {
+                Registry.SetValue(
+                    $@"HKEY_CLASSES_ROOT\{type}\shell\open\command", valueName: null,
+                    PHOTO_VIEWER_SHELL_COMMAND, RegistryValueKind.ExpandString
+                );
+                Registry.SetValue($@"HKEY_CLASSES_ROOT\{type}\shell\open\DropTarget", "Clsid", PHOTO_VIEWER_CLSID);
+            }
+        }
+
+        internal static void EnableProtectedService(string serviceName)
+        {
+            using (TokenPrivilege.TakeOwnership)
+            {
+                using (RegistryKey allServicesKey = Registry.LocalMachine.OpenSubKeyWritable(@"SYSTEM\CurrentControlSet\Services"))
+                {
+                    allServicesKey.GrantFullControlOnSubKey(serviceName);
+                    using (RegistryKey serviceKey = allServicesKey.OpenSubKeyWritable(serviceName))
+                    {
+                        foreach (string subkeyName in serviceKey.GetSubKeyNames())
+                        {
+                            serviceKey.TakeOwnershipOnSubKey(subkeyName);
+                            serviceKey.GrantFullControlOnSubKey(subkeyName);
+                        }
+                        serviceKey.SetValue("Start", "2", RegistryValueKind.DWord);
+                    }
+                }
+            }
+        }
+
+        public static RegistryKey OpenSubKeyWritable(this RegistryKey registryKey, string subkeyName, RegistryRights? rights = null)
+        {
+            RegistryKey subKey = null;
+            if (rights == null)
+                subKey = registryKey.OpenSubKey(subkeyName, RegistryKeyPermissionCheck.ReadWriteSubTree);
+            else
+                subKey = registryKey.OpenSubKey(subkeyName, RegistryKeyPermissionCheck.ReadWriteSubTree, rights.Value);
+
+            if (subKey == null)
+            {
+                ErrorLogger.LogError("Utilities.OpenSubKeyWritable", $"Subkey {subkeyName} not found.", "-");
+            }
+
+            return subKey;
+        }
+
+        internal static SecurityIdentifier RetrieveCurrentUserIdentifier()
+            => WindowsIdentity.GetCurrent().User ?? throw new Exception("Unable to retrieve current user SID.");
+
+        internal static void GrantFullControlOnSubKey(this RegistryKey registryKey, string subkeyName)
+        {
+            using (RegistryKey subKey = registryKey.OpenSubKeyWritable(subkeyName,
+                RegistryRights.TakeOwnership | RegistryRights.ChangePermissions
+            ))
+            {
+                RegistrySecurity accessRules = subKey.GetAccessControl();
+                SecurityIdentifier currentUser = RetrieveCurrentUserIdentifier();
+                accessRules.SetOwner(currentUser);
+                accessRules.ResetAccessRule(
+                    new RegistryAccessRule(
+                        currentUser,
+                        RegistryRights.FullControl,
+                        InheritanceFlags.ContainerInherit | InheritanceFlags.ObjectInherit,
+                        PropagationFlags.None,
+                        AccessControlType.Allow
+                    )
+                );
+                subKey.SetAccessControl(accessRules);
+            }
+        }
+
+        internal static void TakeOwnershipOnSubKey(this RegistryKey registryKey, string subkeyName)
+        {
+            using (RegistryKey subKey = registryKey.OpenSubKeyWritable(subkeyName, RegistryRights.TakeOwnership))
+            {
+                RegistrySecurity accessRules = subKey.GetAccessControl();
+                accessRules.SetOwner(RetrieveCurrentUserIdentifier());
+                subKey.SetAccessControl(accessRules);
+            }
+        }
+
         internal static string GetNETFramework()
         internal static string GetNETFramework()
         {
         {
             string subkey = @"SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\";
             string subkey = @"SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\";

+ 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/11.2/Optimizer-11.2.exe" target="_blank">
+	<a href="https://github.com/hellzerg/optimizer/releases/download/11.3/Optimizer-11.3.exe" target="_blank">
 		<img src="download-button.png">
 		<img src="download-button.png">
 		<br>
 		<br>
 		<img src="flags.png">
 		<img src="flags.png">
@@ -82,6 +82,6 @@ https://github.com/hellzerg/optimizer/blob/master/FEED.md
 
 
 ## Details: ##
 ## Details: ##
 
 
-* Latest version: 11.2
-* Released: January 28, 2022
-* SHA256: 02ECDFF97EC9265A1BE9719469F4BE87B197ABAA17019DF991AD4466C1577439
+* Latest version: 11.3
+* Released: January 29, 2022
+* SHA256: 1B1CD410F026507791BD75E23576137A67EEEDC28EF4E1F40346A0E74EBD87A4

BIN
images/1.PNG


BIN
images/10.PNG


BIN
images/11.PNG


BIN
images/12.PNG


BIN
images/2.PNG


BIN
images/3.PNG


BIN
images/4.PNG


BIN
images/5.PNG


BIN
images/6.PNG


BIN
images/7.PNG


BIN
images/8.PNG


BIN
images/9.PNG


+ 1 - 1
version.txt

@@ -1 +1 @@
-11.2
+11.3