Portable Tool for an Ideal Windows Setup
C# activatorbloatware-removalcsharpdebloatdebloaterdisable-servicesmonitoring-systemportableprivacy-toolsregistry-tweakssystem-tuningsystem-utilitytelemetrytweakerwindows-10windows-11windows-debloatwindows-defenderwindows-optimizationwindows-tweaks
ref & forced update for taskbar alignment
Greedeksc6845e03d550
diff --git a/.Source/GTweak/Utilities/Maintenance/ClearingMemory.cs b/.Source/GTweak/Utilities/Maintenance/ClearingMemory.csindex 8271bffc..8095bae8 100644--- a/.Source/GTweak/Utilities/Maintenance/ClearingMemory.cs+++ b/.Source/GTweak/Utilities/Maintenance/ClearingMemory.cs@@ -213,7 +213,7 @@ namespace GTweak.Utilities.Maintenance$@"for /D %D in (""{PathLocator.Folders.SystemDrive}ProgramData\Microsoft\Windows\WER\*"") do (del /s /q ""%D\*.*"" & for /D %E in (""%D\*"") do rd /s /q ""%E"") & " +$@"del /f /q {PathLocator.Folders.SystemDrive}Windows\INF\setupapi.app.log & del /f /q {PathLocator.Folders.SystemDrive}Windows\INF\setupapi.dev.log & del /f /q {PathLocator.Folders.SystemDrive}Windows\INF\setupapi.offline.log");- ExplorerManager.Restart(new Process(), async () =>+ ExplorerManager.Restart(async () =>{CommandExecutor.RunCommandAsTrustedInstaller(@"/c attrib -h -r -s %localappdata%\IconCache.db & del /a /f /q %localappdata%\IconCache.db & " +@"del /a /f /q %localappdata%\Microsoft\Windows\Explorer\iconcache* & del /a /f /q %localappdata%\Microsoft\Windows\Explorer\thumbcache* & " +diff --git a/.Source/GTweak/Utilities/Managers/ExplorerManager.cs b/.Source/GTweak/Utilities/Managers/ExplorerManager.csindex 44dd7fba..8a323fd1 100644--- a/.Source/GTweak/Utilities/Managers/ExplorerManager.cs+++ b/.Source/GTweak/Utilities/Managers/ExplorerManager.cs@@ -13,6 +13,7 @@ namespace GTweak.Utilities.Managers{new { Button = "TglButton7", NeedRestart = true },new { Button = "TglButton8", NeedRestart = true },+ new { Button = "TglButton15", NeedRestart = true },new { Button = "TglButton16", NeedRestart = true },new { Button = "TglButton17", NeedRestart = true },new { Button = "TglButton21", NeedRestart = true },@@ -24,12 +25,12 @@ namespace GTweak.Utilities.Managers}.ToDictionary(x => x.Button, x => x.NeedRestart);internal static readonly Dictionary<string, bool> PackageMapping = new[]-{+ {new { Package = "Widgets", NeedRestart = true },new { Package = "Edge", NeedRestart = true }}.ToDictionary(x => x.Package, x => x.NeedRestart);- internal static void Restart(Process launchExplorer, Action action = null)+ internal static void Restart(Action action = null){Task.Run(delegate{@@ -41,19 +42,17 @@ namespace GTweak.Utilities.Managers{process.Kill();action?.Invoke();- process.Start();}}catch (Exception ex) { ErrorLogging.LogDebug(ex); }- finally++ if (Process.GetProcessesByName("explorer").Length == 0){- if (Process.GetProcessesByName("explorer").Length == 0 && launchExplorer != null)- {- launchExplorer.StartInfo.FileName = PathLocator.Executable.Explorer;- launchExplorer.StartInfo.Arguments = "/factory,{EFD469A7-7E0A-4517-8B39-45873948DA31}";- launchExplorer.StartInfo.UseShellExecute = true;- launchExplorer.Start();- }+ using Process launchExplorer = new Process();+ launchExplorer.StartInfo.FileName = PathLocator.Executable.Explorer;+ launchExplorer.StartInfo.Arguments = "/factory,{EFD469A7-7E0A-4517-8B39-45873948DA31}";+ launchExplorer.StartInfo.UseShellExecute = true;+ launchExplorer.Start();}}});diff --git a/.Source/GTweak/Utilities/Tweaks/InterfaceTweaks.cs b/.Source/GTweak/Utilities/Tweaks/InterfaceTweaks.csindex 2bccb94e..ff6785a9 100644--- a/.Source/GTweak/Utilities/Tweaks/InterfaceTweaks.cs+++ b/.Source/GTweak/Utilities/Tweaks/InterfaceTweaks.cs@@ -258,7 +258,6 @@ namespace GTweak.Utilities.Tweaks{RegistryHelp.DeleteValue(Registry.CurrentUser, @"Software\Microsoft\Windows\CurrentVersion\Explorer", "link");}-break;case "TglButton13":if (isDisabled)@@ -269,7 +268,6 @@ namespace GTweak.Utilities.Tweaks{RegistryHelp.Write(Registry.CurrentUser, @"Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel", "{20D04FE0-3AEA-1069-A2D8-08002B30309D}", 0, RegistryValueKind.DWord);}-break;case "TglButton14":RegistryHelp.Write(Registry.CurrentUser, @"Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel", "{645FF040-5081-101B-9F08-00AA002F954E}", isDisabled ? 1 : 0, RegistryValueKind.DWord);@@ -305,7 +303,6 @@ namespace GTweak.Utilities.Tweaks{RegistryHelp.DeleteFolderTree(Registry.CurrentUser, @"Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}");}-break;case "TglButton18":RegistryHelp.Write(Registry.CurrentUser, @"SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager", "SoftLandingEnabled", isDisabled ? 0 : 1, RegistryValueKind.DWord);@@ -502,7 +499,6 @@ namespace GTweak.Utilities.Tweaks{RegistryHelp.Write(Registry.CurrentUser, @"Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "PersistBrowsers", 1, RegistryValueKind.DWord);}-break;case "TglButton26":@@ -578,7 +574,6 @@ namespace GTweak.Utilities.Tweaks{RegistryHelp.DeleteValue(Registry.CurrentUser, @"Control Panel\Desktop", "JPEGImportQuality");}-break;case "TglButton30":RegistryHelp.Write(Registry.CurrentUser, @"Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "ShowInfoTip", isDisabled ? 0 : 1, RegistryValueKind.DWord);@@ -592,7 +587,6 @@ namespace GTweak.Utilities.Tweaks{RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows\Explorer");}-break;case "TglButton32":if (isDisabled)diff --git a/.Source/GTweak/Utilities/Tweaks/SystemTweaks.cs b/.Source/GTweak/Utilities/Tweaks/SystemTweaks.csindex 03aa53d1..96148e5c 100644--- a/.Source/GTweak/Utilities/Tweaks/SystemTweaks.cs+++ b/.Source/GTweak/Utilities/Tweaks/SystemTweaks.cs@@ -289,7 +289,6 @@ namespace GTweak.Utilities.Tweaks{WindowsDefender.SetProtectionState(isDisabled);}-break;case "TglButton4":RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System", "ConsentPromptBehaviorAdmin", isDisabled ? 0 : 5, RegistryValueKind.DWord);@@ -312,7 +311,6 @@ namespace GTweak.Utilities.Tweaks{RegistryHelp.DeleteValue(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\WindowsStore", "AutoDownload");}-break;case "TglButton7":trydiff --git a/.Source/GTweak/View/InterfaceView.xaml.cs b/.Source/GTweak/View/InterfaceView.xaml.csindex 1e31300f..ab1bd1e4 100644--- a/.Source/GTweak/View/InterfaceView.xaml.cs+++ b/.Source/GTweak/View/InterfaceView.xaml.cs@@ -1,4 +1,3 @@-using System.Diagnostics;using System.Windows;using System.Windows.Controls;using System.Windows.Input;@@ -44,7 +43,7 @@ namespace GTweak.Viewif (ExplorerManager.IntfMapping.TryGetValue(toggleButton.Name, out bool needRestart)){- ExplorerManager.Restart(new Process());+ ExplorerManager.Restart();}if (NotificationManager.IntfActions.TryGetValue(toggleButton.Name, out NotificationManager.NoticeAction action))diff --git a/.Source/GTweak/View/PakagesView.xaml.cs b/.Source/GTweak/View/PakagesView.xaml.csindex 675fa86b..54825837 100644--- a/.Source/GTweak/View/PakagesView.xaml.cs+++ b/.Source/GTweak/View/PakagesView.xaml.cs@@ -1,6 +1,5 @@using System;using System.ComponentModel;-using System.Diagnostics;using System.Windows.Controls;using System.Windows.Controls.Primitives;using System.Windows.Input;@@ -105,7 +104,7 @@ namespace GTweak.View{if (ExplorerManager.PackageMapping.TryGetValue(packageName, out bool needRestart)){- ExplorerManager.Restart(new Process());+ ExplorerManager.Restart();}}), DispatcherPriority.ApplicationIdle);});diff --git a/.Source/GTweak/Windows/ImportWindow.xaml.cs b/.Source/GTweak/Windows/ImportWindow.xaml.csindex 13313f69..3cc6042c 100644--- a/.Source/GTweak/Windows/ImportWindow.xaml.cs+++ b/.Source/GTweak/Windows/ImportWindow.xaml.cs@@ -1,6 +1,5 @@using System;using System.Collections.Generic;-using System.Diagnostics;using System.Linq;using System.Threading;using System.Threading.Tasks;@@ -55,7 +54,7 @@ namespace GTweak.Windows{if (_isExpRestartNeed){- ExplorerManager.Restart(new Process());+ ExplorerManager.Restart();}if (_requiredActions.Count != 0)