Skip to content

Portable Tool for an Ideal Windows Setup

-deleting the edge

Greedeks97a68f256ee9
diff --git a/.Source/GTweak/Utilities/Helpers/RegistryHelp.cs b/.Source/GTweak/Utilities/Helpers/RegistryHelp.cs
index 9171cc32..177e5ce8 100644
--- a/.Source/GTweak/Utilities/Helpers/RegistryHelp.cs
+++ b/.Source/GTweak/Utilities/Helpers/RegistryHelp.cs
@@ -71,12 +71,18 @@ namespace GTweak.Utilities.Helpers
}).Wait();
}
- internal static void DeleteFolderTree(RegistryKey registrykey, string subkey)
+ internal static void DeleteFolderTree(RegistryKey registrykey, string subkey, bool isTakingOwner = false)
{
- Task.Run(delegate
+ Task.Run(async delegate
{
try
{
+ if (isTakingOwner)
+ {
+ GrantAdministratorsAccess($"{GeneralRegistry(registrykey)}{subkey}", SE_OBJECT_TYPE.SE_REGISTRY_KEY);
+ await Task.Delay(200);
+ }
+
RegistryKey registryFolder = registrykey.OpenSubKey(subkey, true);
if (registryFolder != null)
diff --git a/.Source/GTweak/Utilities/Helpers/Storage/TaskStorage.cs b/.Source/GTweak/Utilities/Helpers/Storage/TaskStorage.cs
index 09698ee6..5fd0d7dc 100644
--- a/.Source/GTweak/Utilities/Helpers/Storage/TaskStorage.cs
+++ b/.Source/GTweak/Utilities/Helpers/Storage/TaskStorage.cs
@@ -37,5 +37,10 @@
internal static readonly string restoreTask = @"Microsoft\Windows\SystemRestore\SR";
internal static readonly string defragTask = @"Microsoft\Windows\Defrag\ScheduledDefrag";
+
+ internal static readonly string[] edgeTasks = {
+ @"\MicrosoftEdgeUpdateTaskMachineCore",
+ @"\MicrosoftEdgeUpdateTaskMachineUA",
+ @"\MicrosoftEdgeUpdateTaskUser*" };
}
}
diff --git a/.Source/GTweak/Utilities/Tweaks/UninstallingPakages.cs b/.Source/GTweak/Utilities/Tweaks/UninstallingPakages.cs
index 3c27f4c2..19c3cd98 100644
--- a/.Source/GTweak/Utilities/Tweaks/UninstallingPakages.cs
+++ b/.Source/GTweak/Utilities/Tweaks/UninstallingPakages.cs
@@ -9,7 +9,7 @@ using System.Threading.Tasks;
namespace GTweak.Utilities.Tweaks
{
- internal sealed class UninstallingPakages
+ internal sealed class UninstallingPakages : TaskSchedulerManager
{
internal static string InstalledPackages { get; private set; }
@@ -111,7 +111,8 @@ namespace GTweak.Utilities.Tweaks
["WindowsTerminal"] = new List<string>(1) { "Microsoft.WindowsTerminal" },
["LinkedIn"] = new List<string>(1) { "Microsoft.LinkedIn" },
["WebMediaExtensions"] = new List<string>(1) { "Microsoft.WebMediaExtensions" },
- ["OneConnect"] = new List<string>(1) { "Microsoft.OneConnect" }
+ ["OneConnect"] = new List<string>(1) { "Microsoft.OneConnect" },
+ ["Edge"] = new List<string>(2) { "Microsoft.MicrosoftEdge.Stable", "Microsoft.MicrosoftEdge.*" }
};
private static readonly SortedList<string, string> PackageAliases = new SortedList<string, string>
@@ -124,7 +125,8 @@ namespace GTweak.Utilities.Tweaks
["Music"] = "zunemusic",
["Video"] = "zunevideo",
["Widgets"] = "Windows.Client.WebExperience",
- ["LinkedIn"] = "LinkedInforWindows"
+ ["LinkedIn"] = "LinkedInforWindows",
+ ["Edge"] = "MicrosoftEdge"
};
#endregion
@@ -186,6 +188,23 @@ namespace GTweak.Utilities.Tweaks
RegistryHelp.Write(Registry.CurrentUser, @"Software\Microsoft\Personalization\Settings", "AcceptedPrivacyPolicy", 0, RegistryValueKind.DWord);
RegistryHelp.Write(Registry.CurrentUser, @"Software\Microsoft\Windows\CurrentVersion\Windows Search", "CortanaConsent", 0, RegistryValueKind.DWord);
break;
+ case "Edge":
+ SetTaskState(false, edgeTasks);
+ TrustedInstaller.CreateProcessAsTrustedInstaller(SettingsRepository.PID, $@"cmd.exe /c for /r ""%AppData%\Microsoft\Internet Explorer\Quick Launch"" %f in (*Edge*) do del ""%f""");
+ TrustedInstaller.CreateProcessAsTrustedInstaller(SettingsRepository.PID, $@"cmd.exe /c for /r ""{StoragePaths.SystemDisk}\ProgramData\Microsoft\Windows\Start Menu\Programs"" %f in (*Edge*) do del ""%f""");
+ TrustedInstaller.CreateProcessAsTrustedInstaller(SettingsRepository.PID, $@"cmd.exe /c for /r ""%UserProfile%"" %f in (*edge*) do @if exist ""%f"" del /f /q ""%f""");
+ RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"SOFTWARE\Microsoft\Active Setup\Installed Components\{9459C573-B17A-45AE-9F64-1857B5D58CEE}", true);
+ TrustedInstaller.CreateProcessAsTrustedInstaller(SettingsRepository.PID, $@"cmd.exe /c for /d %d in (""{StoragePaths.SystemDisk}\Program Files (x86)\Microsoft\*Edge*"") do rmdir /s /q ""%d""");
+ TrustedInstaller.CreateProcessAsTrustedInstaller(SettingsRepository.PID, $@"cmd.exe /c for /f ""delims="" %i in ('dir /b /s ""{StoragePaths.SystemDisk}\Windows\System32\Tasks\*Edge*""') do (if exist ""%i"" (if exist ""%i\"" (rmdir /s /q ""%i"") else (del /f /q ""%i"")))");
+ RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"SYSTEM\CurrentControlSet\Services\edgeupdate", true);
+ RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"SYSTEM\CurrentControlSet\Services\edgeupdatem", true);
+ RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"SYSTEM\CurrentControlSet\Services\MicrosoftEdgeElevationService", true);
+ RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate", true);
+ RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"SOFTWARE\WOW6432Node\Microsoft\Edge", true);
+ RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge", true);
+ RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge Update", true);
+ RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft EdgeWebView", true);
+ break;
}
});
}
diff --git a/.Source/GTweak/View/PakagesView.xaml.cs b/.Source/GTweak/View/PakagesView.xaml.cs
index 2b28bf93..32b79499 100644
--- a/.Source/GTweak/View/PakagesView.xaml.cs
+++ b/.Source/GTweak/View/PakagesView.xaml.cs
@@ -181,6 +181,7 @@ namespace GTweak.View
LinkedIn.Source = AvailabilityInstalledPackage("LinkedIn", "Microsoft.LinkedIn");
WebMediaExtensions.Source = AvailabilityInstalledPackage("WebMediaExtensions", "Microsoft.WebMediaExtensions");
OneConnect.Source = AvailabilityInstalledPackage("OneConnect", "Microsoft.OneConnect");
+ Edge.Source = AvailabilityInstalledPackage("Edge", "Microsoft.MicrosoftEdge.Stable");
}
}
}