浏览代码

Updated to 6.1

deadmoon 4 年之前
父节点
当前提交
8392650127

+ 7 - 0
CHANGELOG.md

@@ -2,6 +2,13 @@
 
 All notable changes to this project will be documented in this file.
 
+## [6.1] - 2021-02-14
+- Improved: Disable Windows Defender
+- Improved: Uninstall OneDrive and removing all leftovers
+- Improved: Hide non-uninstallables UWP Apps option
+- Updated Chromium links
+- Minor UI fixes
+
 ## [6.0] - 2021-01-20
 - Smaller window size, scrollable app list in Common Apps
 

+ 2 - 15
Optimizer/AboutForm.cs

@@ -87,10 +87,7 @@ namespace Optimizer
             string s7 = "deadmoo";
             string s8 = "deadmoon";
             string s9 = "deadmoon © ";
-            string s10 = "deadmoon © 2";
-            string s11 = "deadmoon © 20";
-            string s12 = "deadmoon © 202";
-            string s13 = "deadmoon © 2021";
+            string s10 = "deadmoon © ∞";
 
             switch (l2.Text)
             {
@@ -123,19 +120,9 @@ namespace Optimizer
                     break;
                 case "deadmoon © ":
                     l2.Text = s10;
-                    break;
-                case "deadmoon © 2":
-                    l2.Text = s11;
-                    break;
-                case "deadmoon © 20":
-                    l2.Text = s12;
-                    break;
-                case "deadmoon © 202":
-                    l2.Text = s13;
                     t2.Stop();
-                    //t1.Start();
                     break;
-                case "deadmoon © 2021":
+                case "deadmoon © ∞":
                     l2.Text = s0;
                     break;
             }

+ 2 - 2
Optimizer/AppLinks.cs

@@ -101,8 +101,8 @@ namespace Optimizer
         {
             // BROWSERS
             Chromium.Title = "Chromium";
-            Chromium.Link64 = new Uri("https://github.com/Hibbiki/chromium-win64/releases/download/v87.0.4280.88-r812852/mini_installer.sync.exe");
-            Chromium.Link = new Uri("https://github.com/Hibbiki/chromium-win32/releases/download/v87.0.4280.88-r812852/mini_installer.sync.exe");
+            Chromium.Link64 = new Uri("https://github.com/Hibbiki/chromium-win64/releases/download/v88.0.4324.150-r827102/mini_installer.sync.exe");
+            Chromium.Link = new Uri("https://github.com/Hibbiki/chromium-win32/releases/download/v88.0.4324.150-r827102/mini_installer.sync.exe");
             Chromium.Tag = "cChromium";
 
             Firefox.Title = "Mozilla Firefox";

+ 0 - 7
Optimizer/Enums.cs

@@ -14,13 +14,6 @@
         Windows10
     }
 
-    internal enum RegistryHive
-    {
-        CurrentUser,
-        LocalMachine
-    }
-
-
     internal enum StartupItemLocation
     {
         Folder,

+ 30 - 10
Optimizer/MainForm.Designer.cs

@@ -97,6 +97,7 @@
             this.toggleSwitch31 = new Optimizer.ToggleSwitch();
             this.button44 = new System.Windows.Forms.Button();
             this.modernAppsTab = new System.Windows.Forms.TabPage();
+            this.chkOnlyRemovable = new System.Windows.Forms.CheckBox();
             this.chkSelectAllModernApps = new System.Windows.Forms.CheckBox();
             this.label28 = new System.Windows.Forms.Label();
             this.button74 = new System.Windows.Forms.Button();
@@ -1528,6 +1529,7 @@
             // modernAppsTab
             // 
             this.modernAppsTab.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
+            this.modernAppsTab.Controls.Add(this.chkOnlyRemovable);
             this.modernAppsTab.Controls.Add(this.chkSelectAllModernApps);
             this.modernAppsTab.Controls.Add(this.label28);
             this.modernAppsTab.Controls.Add(this.button74);
@@ -1541,6 +1543,22 @@
             this.modernAppsTab.TabIndex = 11;
             this.modernAppsTab.Text = "UWP Apps";
             // 
+            // chkOnlyRemovable
+            // 
+            this.chkOnlyRemovable.AutoSize = true;
+            this.chkOnlyRemovable.Checked = true;
+            this.chkOnlyRemovable.CheckState = System.Windows.Forms.CheckState.Checked;
+            this.chkOnlyRemovable.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.chkOnlyRemovable.ForeColor = System.Drawing.Color.White;
+            this.chkOnlyRemovable.Location = new System.Drawing.Point(503, 140);
+            this.chkOnlyRemovable.Margin = new System.Windows.Forms.Padding(2);
+            this.chkOnlyRemovable.Name = "chkOnlyRemovable";
+            this.chkOnlyRemovable.Size = new System.Drawing.Size(170, 25);
+            this.chkOnlyRemovable.TabIndex = 53;
+            this.chkOnlyRemovable.Text = "Only uninstall-ables";
+            this.chkOnlyRemovable.UseVisualStyleBackColor = true;
+            this.chkOnlyRemovable.CheckedChanged += new System.EventHandler(this.chkOnlyRemovable_CheckedChanged);
+            // 
             // chkSelectAllModernApps
             // 
             this.chkSelectAllModernApps.AutoSize = true;
@@ -1560,7 +1578,7 @@
             this.label28.AutoSize = true;
             this.label28.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
             this.label28.ForeColor = System.Drawing.Color.Silver;
-            this.label28.Location = new System.Drawing.Point(499, 158);
+            this.label28.Location = new System.Drawing.Point(499, 195);
             this.label28.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label28.Name = "label28";
             this.label28.Size = new System.Drawing.Size(160, 231);
@@ -1769,7 +1787,7 @@
             this.button32.FlatAppearance.MouseOverBackColor = System.Drawing.Color.RoyalBlue;
             this.button32.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
             this.button32.ForeColor = System.Drawing.Color.White;
-            this.button32.Location = new System.Drawing.Point(533, 521);
+            this.button32.Location = new System.Drawing.Point(326, 522);
             this.button32.Margin = new System.Windows.Forms.Padding(2);
             this.button32.Name = "button32";
             this.button32.Size = new System.Drawing.Size(101, 31);
@@ -1786,7 +1804,7 @@
             this.button22.FlatAppearance.MouseOverBackColor = System.Drawing.Color.RoyalBlue;
             this.button22.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
             this.button22.ForeColor = System.Drawing.Color.White;
-            this.button22.Location = new System.Drawing.Point(638, 521);
+            this.button22.Location = new System.Drawing.Point(431, 522);
             this.button22.Margin = new System.Windows.Forms.Padding(2);
             this.button22.Name = "button22";
             this.button22.Size = new System.Drawing.Size(101, 31);
@@ -3582,7 +3600,7 @@
             this.cAutoInstall.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
             this.cAutoInstall.Font = new System.Drawing.Font("Segoe UI Semibold", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
             this.cAutoInstall.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
-            this.cAutoInstall.Location = new System.Drawing.Point(461, 537);
+            this.cAutoInstall.Location = new System.Drawing.Point(462, 541);
             this.cAutoInstall.Name = "cAutoInstall";
             this.cAutoInstall.Size = new System.Drawing.Size(198, 24);
             this.cAutoInstall.TabIndex = 107;
@@ -3617,7 +3635,7 @@
             this.button6.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
             this.button6.Font = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
             this.button6.ForeColor = System.Drawing.Color.White;
-            this.button6.Location = new System.Drawing.Point(462, 566);
+            this.button6.Location = new System.Drawing.Point(462, 570);
             this.button6.Margin = new System.Windows.Forms.Padding(2);
             this.button6.Name = "button6";
             this.button6.Size = new System.Drawing.Size(143, 35);
@@ -3760,7 +3778,7 @@
             this.btnDownloadApps.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
             this.btnDownloadApps.Font = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
             this.btnDownloadApps.ForeColor = System.Drawing.Color.White;
-            this.btnDownloadApps.Location = new System.Drawing.Point(609, 566);
+            this.btnDownloadApps.Location = new System.Drawing.Point(609, 570);
             this.btnDownloadApps.Margin = new System.Windows.Forms.Padding(2);
             this.btnDownloadApps.Name = "btnDownloadApps";
             this.btnDownloadApps.Size = new System.Drawing.Size(143, 35);
@@ -4768,7 +4786,7 @@
             this.tabPage8.Margin = new System.Windows.Forms.Padding(2);
             this.tabPage8.Name = "tabPage8";
             this.tabPage8.Padding = new System.Windows.Forms.Padding(2);
-            this.tabPage8.Size = new System.Drawing.Size(1073, 711);
+            this.tabPage8.Size = new System.Drawing.Size(746, 579);
             this.tabPage8.TabIndex = 1;
             this.tabPage8.Text = "Add/Modify";
             // 
@@ -5115,7 +5133,7 @@
             this.tabPage9.Margin = new System.Windows.Forms.Padding(2);
             this.tabPage9.Name = "tabPage9";
             this.tabPage9.Padding = new System.Windows.Forms.Padding(2);
-            this.tabPage9.Size = new System.Drawing.Size(1073, 711);
+            this.tabPage9.Size = new System.Drawing.Size(746, 579);
             this.tabPage9.TabIndex = 2;
             this.tabPage9.Text = "Remove";
             // 
@@ -5229,7 +5247,7 @@
             this.tabPage10.Margin = new System.Windows.Forms.Padding(2);
             this.tabPage10.Name = "tabPage10";
             this.tabPage10.Padding = new System.Windows.Forms.Padding(2);
-            this.tabPage10.Size = new System.Drawing.Size(1073, 711);
+            this.tabPage10.Size = new System.Drawing.Size(746, 579);
             this.tabPage10.TabIndex = 3;
             this.tabPage10.Text = "Ready Menus";
             // 
@@ -5473,7 +5491,7 @@
             this.tabPage11.Margin = new System.Windows.Forms.Padding(2);
             this.tabPage11.Name = "tabPage11";
             this.tabPage11.Padding = new System.Windows.Forms.Padding(2);
-            this.tabPage11.Size = new System.Drawing.Size(1073, 711);
+            this.tabPage11.Size = new System.Drawing.Size(746, 579);
             this.tabPage11.TabIndex = 4;
             this.tabPage11.Text = "Run Dialog";
             // 
@@ -5892,6 +5910,7 @@
             this.ForeColor = System.Drawing.Color.White;
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
             this.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
+            this.MinimumSize = new System.Drawing.Size(784, 744);
             this.Name = "MainForm";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
             this.Text = "Optimizer";
@@ -6451,6 +6470,7 @@
         private System.Windows.Forms.Panel panelApps6;
         private System.Windows.Forms.Panel panelApps5;
         private System.Windows.Forms.Panel panelApps4;
+        private System.Windows.Forms.CheckBox chkOnlyRemovable;
     }
 }
 

+ 13 - 6
Optimizer/MainForm.cs

@@ -310,6 +310,8 @@ namespace Optimizer
 
             ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
 
+            chkOnlyRemovable.Checked = true;
+
             if (Utilities.CurrentWindowsVersion == WindowsVersion.Unsupported)
             {
                 tabCollection.TabPages.Remove(universalTab);
@@ -331,7 +333,7 @@ namespace Optimizer
                 LoadUniversalToggleStates();
                 LoadWindowsVIIIToggleStates();
                 tabCollection.TabPages.Remove(windowsXTab);
-                GetModernApps();
+                GetModernApps(false);
             }
 
             if (Utilities.CurrentWindowsVersion == WindowsVersion.Windows10)
@@ -339,7 +341,7 @@ namespace Optimizer
                 LoadUniversalToggleStates();
                 LoadWindowsXToggleStates();
                 tabCollection.TabPages.Remove(windowsVIIITab);
-                GetModernApps();
+                GetModernApps(false);
             }
 
             _columnSorter = new ListViewColumnSorter();
@@ -622,14 +624,14 @@ namespace Optimizer
             }
         }
 
-        private void GetModernApps()
+        private void GetModernApps(bool showAll)
         {
             button74.Enabled = false;
             button75.Enabled = false;
             listModernApps.Enabled = false;
 
             listModernApps.Items.Clear();
-            _modernApps = Utilities.GetModernApps();
+            _modernApps = Utilities.GetModernApps(showAll);
 
             foreach (string x in _modernApps)
             {
@@ -683,7 +685,7 @@ namespace Optimizer
                         MessageBox.Show(_errorModernAppsMessage + failedApps, "Optimizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
                     }
 
-                    GetModernApps();
+                    GetModernApps(!chkOnlyRemovable.Checked);
                 }
             }
         }
@@ -1500,7 +1502,7 @@ namespace Optimizer
 
         private void button75_Click(object sender, EventArgs e)
         {
-            GetModernApps();
+            GetModernApps(!chkOnlyRemovable.Checked);
         }
 
         private void button74_Click(object sender, EventArgs e)
@@ -2205,5 +2207,10 @@ namespace Optimizer
             Options.CurrentOptions.AppsFolder = txtDownloadFolder.Text;
             Options.SaveSettings();
         }
+
+        private void chkOnlyRemovable_CheckedChanged(object sender, EventArgs e)
+        {
+            GetModernApps(!chkOnlyRemovable.Checked);
+        }
     }
 }

+ 89 - 1
Optimizer/Optimize.cs

@@ -302,7 +302,17 @@ namespace Optimizer
                 tmp.DeleteValue("SecurityHealth", false);
             }
 
-            Utilities.RunCommand("regsvr32 /u /s \"C:\\Program Files\\Windows Defender\\shellext.dll\"");
+            string rootPath;
+            if (Environment.Is64BitOperatingSystem)
+            {
+                rootPath = Environment.ExpandEnvironmentVariables("%ProgramW6432%");
+            }
+            else
+            {
+                rootPath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
+            }
+
+            Utilities.RunCommand(@"regsvr32 /u /s """ + rootPath + "\"");
         }
 
         internal static void EnableDefender()
@@ -377,6 +387,80 @@ namespace Optimizer
         {
             Utilities.RunBatchFile(Required.ScriptsFolder + "OneDrive_Uninstaller.cmd");
             Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\OneDrive", "DisableFileSyncNGSC", "1", RegistryValueKind.DWord);
+
+            // delete OneDrive folders
+            string[] oneDriveFolders =
+            {
+                Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + "\\OneDrive",
+                Path.GetPathRoot(Environment.GetFolderPath(Environment.SpecialFolder.System)) + "OneDriveTemp",
+                Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\Microsoft\\OneDrive",
+                Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\Microsoft OneDrive"
+            };
+
+            foreach (string x in oneDriveFolders)
+            {
+                if (Directory.Exists(x))
+                {
+                    try
+                    {
+                        Directory.Delete(x, true);
+                    }
+                    catch { }
+                }
+            }
+
+            // delete scheduled tasks
+            Utilities.RunCommand(@"SCHTASKS /Delete /TN ""OneDrive Standalone Update Task"" /F");
+            Utilities.RunCommand(@"SCHTASKS /Delete /TN ""OneDrive Standalone Update Task v2"" /F");
+
+            // remove OneDrive from Windows Explorer
+            string rootKey = @"CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}";
+            Registry.ClassesRoot.CreateSubKey(rootKey);
+            int byteArray = BitConverter.ToInt32(BitConverter.GetBytes(0xb090010d), 0);
+            var reg = RegistryKey.OpenBaseKey(RegistryHive.ClassesRoot, RegistryView.Registry64);
+            
+            try
+            {
+                using (var key = Registry.ClassesRoot.OpenSubKey(rootKey, true))
+                {
+                    key.SetValue("System.IsPinnedToNameSpaceTree", 0, RegistryValueKind.DWord);
+                }
+
+                using (var key = Registry.ClassesRoot.OpenSubKey(rootKey + "\\ShellFolder", true))
+                {
+                    if (key != null)
+                    {
+                        key.SetValue("Attributes", byteArray, RegistryValueKind.DWord);
+                    }
+                }
+
+                var reg2 = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Registry64);
+                using (var key = reg2.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", true))
+                {
+                    key.DeleteValue("OneDriveSetup", false);
+                }
+
+                // 64-bit Windows modifications
+                if (Environment.Is64BitOperatingSystem)
+                {
+                    using (var key = reg.OpenSubKey(rootKey, true))
+                    {
+                        if (key != null)
+                        { 
+                            key.SetValue("System.IsPinnedToNameSpaceTree", 0, RegistryValueKind.DWord);
+                        }
+                    }
+
+                    using (var key = reg.OpenSubKey(rootKey + "\\ShellFolder", true))
+                    {
+                        if (key != null)
+                        {
+                            key.SetValue("Attributes", byteArray, RegistryValueKind.DWord);
+                        }
+                    }
+                }
+            }
+            catch { }
         }
 
         internal static void InstallOneDrive()
@@ -800,6 +884,8 @@ 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", "FeatureManagementEnabled", "0", RegistryValueKind.DWord);
+
+            Registry.SetValue(@"HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Explorer", "DisableSearchBoxSuggestions", 1, RegistryValueKind.DWord);
         }
 
         internal static void EnableStartMenuAds()
@@ -813,6 +899,8 @@ 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", "FeatureManagementEnabled", "1", RegistryValueKind.DWord);
+
+            Registry.SetValue(@"HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Explorer", "DisableSearchBoxSuggestions", 0, RegistryValueKind.DWord);
         }
 
         internal static void DisableSilentAppInstall()

+ 1 - 1
Optimizer/Program.cs

@@ -13,7 +13,7 @@ namespace Optimizer
         // Enter current version here
 
         internal readonly static float Major = 6;
-        internal readonly static float Minor = 0;
+        internal readonly static float Minor = 1;
 
         internal static string GetCurrentVersionTostring()
         {

+ 2 - 2
Optimizer/Properties/AssemblyInfo.cs

@@ -7,9 +7,9 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyTitle("Optimizer")]
 [assembly: AssemblyDescription("Make Windows faster and more secure")]
 [assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("deadmoon © 2021")]
+[assembly: AssemblyCompany("deadmoon © ")]
 [assembly: AssemblyProduct("Optimizer")]
-[assembly: AssemblyCopyright("deadmoon © 2021")]
+[assembly: AssemblyCopyright("deadmoon © ")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 

+ 1 - 1
Optimizer/Properties/Settings.Designer.cs

@@ -12,7 +12,7 @@ namespace Optimizer.Properties {
     
     
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.7.0.0")]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")]
     internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
         
         private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));

+ 12 - 5
Optimizer/Utilities.cs

@@ -509,21 +509,28 @@ namespace Optimizer
             catch { }
         }
 
-        internal static List<string> GetModernApps()
+        internal static List<string> GetModernApps(bool showAll)
         {
             List<string> modernApps = new List<string>();
 
             using (PowerShell script = PowerShell.Create())
             {
-                script.AddScript("Get-AppxPackage | Select Name | Out-String -Stream");
+                if (showAll)
+                {
+                    script.AddScript("Get-AppxPackage -AllUsers | Select -Unique Name | Out-String -Stream");
+                }
+                else
+                {
+                    script.AddScript(@"Get-AppxPackage -AllUsers | Where {$_.NonRemovable -like ""False""} | Select -Unique Name | Out-String -Stream");
+                }
 
                 string tmp = string.Empty;
                 foreach (PSObject x in script.Invoke())
                 {
                     tmp = x.ToString().Trim();
-                    if (!string.IsNullOrEmpty(tmp) && !tmp.Contains("---"))
+                    if (!string.IsNullOrEmpty(tmp) && !tmp.Contains("---") && !tmp.Equals("Name"))
                     {
-                        if (tmp != "Name") modernApps.Add(tmp);
+                        modernApps.Add(tmp);
                     }
                 }
             }
@@ -535,7 +542,7 @@ namespace Optimizer
         {
             using (PowerShell script = PowerShell.Create())
             {
-                script.AddScript(string.Format("Get-AppxPackage *{0}* | Remove-AppxPackage", appName));
+                script.AddScript(string.Format("Get-AppxPackage -AllUsers *{0}* | Remove-AppxPackage", appName));
 
                 script.Invoke();
 

+ 2 - 2
README.md

@@ -44,5 +44,5 @@ https://github.com/hellzerg/optimizer/blob/master/CHANGELOG.md
 
 ## Details: ##
 
-* Latest version: 6.0
-* Released: January 20, 2021
+* Latest version: 6.1
+* Released: February 14, 2021

+ 1 - 1
version.txt

@@ -1 +1 @@
-6.0
+6.1