Skip to content

Portable Tool for an Ideal Windows Setup

-fix bugs (removing packages) & edge

Greedeks2bf06a6d3fdf
diff --git a/.Source/GTweak/Languages/en/Localize.xaml b/.Source/GTweak/Languages/en/Localize.xaml
index d6e7a711..fb0234a8 100644
--- a/.Source/GTweak/Languages/en/Localize.xaml
+++ b/.Source/GTweak/Languages/en/Localize.xaml
@@ -218,7 +218,7 @@
<v:String x:Key="TglButton26_description_interface">Removes the 3D Objects item from the Explorer Overview in the left menu list (from the Explorer list tree).</v:String>
<v:String x:Key="TglButton27_description_interface">By default, when you set a jpeg image as your desktop wallpaper, Windows automatically reduces its quality to 85%. This tweak will set the jpeg wallpaper quality to 100%.</v:String>
<v:String x:Key="TglButton28_description_interface">Tweak will disable tooltips for desktop elements when hovering the mouse cursor.</v:String>
- <v:String x:Key="TglButton29_description_interface">By default, Windows sends everything you search for in the «Start» menu to its servers to provide you with Bing search results. If you don't need Bing integration in the «Start» menu, you can apply a tweak to disable web search.</v:String>
+ <v:String x:Key="TglButton29_description_interface">By default, Windows sends everything you search for in the «Start» menu to its servers to provide you with Bing search results. If you don't need Bing integration in the «Start» menu, you can apply a tweak to disable web search. Attention the screen may blink.</v:String>
<v:String x:Key="TglButton30_description_interface">By default, when you open Explorer, the first tab will be «Quick Access». And to open any disk, you need to make unnecessary movements. This tweak will make «This PC» open when opened, rather than «Quick Access».</v:String>
<!--#endregion-->
diff --git a/.Source/GTweak/Languages/ko/Localize.xaml b/.Source/GTweak/Languages/ko/Localize.xaml
index f5d24082..fdab764c 100644
--- a/.Source/GTweak/Languages/ko/Localize.xaml
+++ b/.Source/GTweak/Languages/ko/Localize.xaml
@@ -218,7 +218,7 @@
<v:String x:Key="TglButton26_description_interface">왼쪽 메뉴 목록의 탐색기 개요에서 3D 개체 항목을 제거합니다 (탐색기 목록 트리에서).</v:String>
<v:String x:Key="TglButton27_description_interface">기본적으로 jpeg 이미지를 바탕 화면 배경 화면으로 설정하면 Windows는 자동으로 품질을 85%로 낮춥니다. 이 조정은 jpeg 배경화면 품질을 100%로 설정합니다.</v:String>
<v:String x:Key="TglButton28_description_interface">조정은 마우스 커서를 마우스오버할 때 바탕화면 요소의 도구 설명을 비활성화합니다.</v:String>
- <v:String x:Key="TglButton29_description_interface">기본적으로 Windows는 «시작» 메뉴에서 검색하는 모든 내용을 서버로 전송하여 Bing 검색 결과를 제공합니다. «시작» 메뉴에서 Bing 통합이 필요하지 않은 경우 웹 검색을 비활성화하도록 조정할 수 있습니다.</v:String>
+ <v:String x:Key="TglButton29_description_interface">기본적으로 Windows는 «시작» 메뉴에서 검색하는 모든 내용을 서버로 전송하여 Bing 검색 결과를 제공합니다. «시작» 메뉴에서 Bing 통합이 필요하지 않은 경우 웹 검색을 비활성화하도록 조정할 수 있습니다. 화면이 깜박일 수 있으니 주의하세요.</v:String>
<v:String x:Key="TglButton30_description_interface">기본적으로 탐색기를 열면 첫 번째 탭은 «빠른 액세스»입니다. 그리고 디스크를 열려면 불필요한 이동을 해야 합니다. 이 조정을 통해 디스크를 열면 '빠른 액세스'가 아닌 «내 PC»가 열리게 됩니다.</v:String>
<!--#endregion-->
diff --git a/.Source/GTweak/Languages/ru/Localize.xaml b/.Source/GTweak/Languages/ru/Localize.xaml
index 905941cc..d7501f50 100644
--- a/.Source/GTweak/Languages/ru/Localize.xaml
+++ b/.Source/GTweak/Languages/ru/Localize.xaml
@@ -218,7 +218,7 @@
<v:String x:Key="TglButton26_description_interface">Уберёт из Обзора Проводника в левом списке меню (из дерева списка проводника) пункт 3D Objects (Объёмные объекты).</v:String>
<v:String x:Key="TglButton27_description_interface">По умолчанию, при установке jpeg изображения в качестве обоев рабочего стола, Windows автоматически уменьшает его качество до 85%. Данный твик выставит качество обоев jpeg на 100%.</v:String>
<v:String x:Key="TglButton28_description_interface">Твик отключит всплывающие подсказки для элементов рабочего стола при наведении курсора мыши.</v:String>
- <v:String x:Key="TglButton29_description_interface">По умолчанию Windows отправляет всё, что вы ищете в меню «Пуск», на свои серверы, чтобы предоставить вам результаты поиска в Bing. Если вам не нужна интеграция с Bing в меню «Пуск», вы можете применить твик, чтобы отключить веб-поиск.</v:String>
+ <v:String x:Key="TglButton29_description_interface">По умолчанию Windows отправляет всё, что вы ищете в меню «Пуск», на свои серверы, чтобы предоставить вам результаты поиска в Bing. Если вам не нужна интеграция с Bing в меню «Пуск», вы можете применить твик, чтобы отключить веб-поиск. Внимание может моргать экран.</v:String>
<v:String x:Key="TglButton30_description_interface">По умолчанию, когда вы открываете проводник, первая вкладка будет «Быстрый доступ». И чтобы открыть какой-либо диск, нужно сделать лишние движения. Данный твик сделает, чтобы при открытии открывался «Этот компьютер», а не «Быстрый доступ».</v:String>
<!--#endregion-->
diff --git a/.Source/GTweak/Languages/uk/Localize.xaml b/.Source/GTweak/Languages/uk/Localize.xaml
index 6089949e..37cd0ec6 100644
--- a/.Source/GTweak/Languages/uk/Localize.xaml
+++ b/.Source/GTweak/Languages/uk/Localize.xaml
@@ -218,7 +218,7 @@
<v:String x:Key="TglButton26_description_interface">Це налаштування видаляє елемент 3D Objects з області переходів провідника (деревоподібний список в лівій частині вікна).</v:String>
<v:String x:Key="TglButton27_description_interface">Як усталено, Windows знижує якість зображень шпалер робочого столу в форматі JPEG до 85%. Це налаштування встановлює для шпалер в форматі JPEG якість 100%.</v:String>
<v:String x:Key="TglButton28_description_interface">Це налаштування вимикає спливні підказки для елементів Робочого столу під час наведення на них вказівника миші.</v:String>
- <v:String x:Key="TglButton29_description_interface">Як усталено, Windows надсилає все, що ви шукаєте у меню «Пуск», на свої сервери, щоб надавати вам результати пошуку в Bing. Якщо вам не потрібна інтеграція з Bing у меню «Пуск», застосуйте це налаштування, щоб вимкнути пошук у веб.</v:String>
+ <v:String x:Key="TglButton29_description_interface">Як усталено, Windows надсилає все, що ви шукаєте у меню «Пуск», на свої сервери, щоб надавати вам результати пошуку в Bing. Якщо вам не потрібна інтеграція з Bing у меню «Пуск», застосуйте це налаштування, щоб вимкнути пошук у веб. Увага, екран може мерехтіти.</v:String>
<v:String x:Key="TglButton30_description_interface">Як усталено, файловий провідник відкривається на вкладці «Швидкий доступ». Щоб відкрити будь-який диск, потрібно виконати додаткові дії. Якщо це налаштування вимкнено, файловий провідник відкриває вкладку «Цей ПК», а не «Швидкий доступ».</v:String>
<!--#endregion-->
diff --git a/.Source/GTweak/Utilities/Tweaks/InterfaceTweaks.cs b/.Source/GTweak/Utilities/Tweaks/InterfaceTweaks.cs
index d303c280..f2d59241 100644
--- a/.Source/GTweak/Utilities/Tweaks/InterfaceTweaks.cs
+++ b/.Source/GTweak/Utilities/Tweaks/InterfaceTweaks.cs
@@ -224,12 +224,10 @@ namespace GTweak.Utilities.Tweaks
break;
case "TglButton7":
RegistryHelp.Write(Registry.CurrentUser, @"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize", "SystemUsesLightTheme", isChoose ? 1 : 0, RegistryValueKind.DWord);
-
RestartExplorer(new Process());
break;
case "TglButton8":
RegistryHelp.Write(Registry.CurrentUser, @"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize", "AppsUseLightTheme", isChoose ? 1 : 0, RegistryValueKind.DWord);
-
RestartExplorer(new Process());
break;
case "TglButton9":
@@ -445,6 +443,7 @@ namespace GTweak.Utilities.Tweaks
RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows\Explorer", "DisableSearchBoxSuggestions", 1, RegistryValueKind.DWord);
else
RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows\Explorer");
+ RestartExplorer(new Process());
break;
case "TglButton30":
if (isChoose)
diff --git a/.Source/GTweak/Utilities/Tweaks/UninstallingPakages.cs b/.Source/GTweak/Utilities/Tweaks/UninstallingPakages.cs
index 77649fb4..0e7c6ddd 100644
--- a/.Source/GTweak/Utilities/Tweaks/UninstallingPakages.cs
+++ b/.Source/GTweak/Utilities/Tweaks/UninstallingPakages.cs
@@ -33,9 +33,9 @@ namespace GTweak.Utilities.Tweaks
["OneNote"] = (null, false, new List<string> { "Microsoft.Office.OneNote" }),
["People"] = (null, false, new List<string> { "Microsoft.People" }),
["MicrosoftStickyNotes"] = (null, false, new List<string> { "Microsoft.MicrosoftStickyNotes" }),
- ["Widgets"] = ("Windows.Client.WebExperience", false, new List<string> { "MicrosoftWindows.Client.WebExperience" }),
+ ["Widgets"] = ("Windows.Client.WebExperience", false, new List<string> { "MicrosoftWindows.Client.WebExperience", "Microsoft.WidgetsPlatformRuntime" }),
["ScreenSketch"] = (null, false, new List<string> { "Microsoft.ScreenSketch" }),
- ["Phone"] = (null, false, new List<string> { "Microsoft.YourPhone" }),
+ ["Phone"] = (null, false, new List<string> { "Microsoft.YourPhone", "MicrosoftWindows.CrossDevice" }),
["Photos"] = (null, false, new List<string> { "Microsoft.Windows.Photos" }),
["FeedbackHub"] = ("feedback", false, new List<string> { "Microsoft.WindowsFeedbackHub" }),
["SoundRecorder"] = (null, false, new List<string> { "Microsoft.WindowsSoundRecorder" }),
@@ -133,14 +133,62 @@ namespace GTweak.Utilities.Tweaks
RegistryHelp.Write(Registry.CurrentUser, @"Software\Microsoft\Windows\CurrentVersion\Windows Search", "CortanaConsent", 0, RegistryValueKind.DWord);
break;
case "Edge":
+ string script = $@"
+ $region = (Get-ItemProperty -Path 'Registry::HKEY_USERS\.DEFAULT\Control Panel\International\Geo').Name
+ $policyFile = '{StoragePaths.SystemDisk}Windows\System32\IntegratedServicesRegionPolicySet.json'
+
+ if (Test-Path $policyFile) {{
+ $json = Get-Content -Path $policyFile -Raw | ConvertFrom-Json
+
+ if (-not $json.Policies) {{
+ exit 1
+ }}
+
+ $policy = $json.Policies | Where-Object {{ $_.'$comment' -eq 'Edge is uninstallable.' }}
+
+ if ($policy) {{
+ if ($policy.defaultState -ne 'enabled') {{
+ $policy.defaultState = 'enabled'
+ }}
+
+ if ($policy.conditions.region.enabled -notcontains $region) {{
+ $policy.conditions.region.enabled += $region
+ $policy.conditions.region.enabled = $policy.conditions.region.enabled | Sort-Object -Unique
+
+ $json | ConvertTo-Json -Depth 10 | Set-Content -Path $policyFile -Encoding UTF8
+ }}
+ }}
+ }} else {{
+ exit 1
+ }}";
+
+ TrustedInstaller.CreateProcessAsTrustedInstaller(SettingsRepository.PID, $"{Path.Combine(Environment.SystemDirectory, "WindowsPowerShell\\v1.0\\powershell.exe")} {script}");
+
+ foreach (Process process in Process.GetProcessesByName("msedge"))
+ process.Kill();
+
+ try
+ {
+ Process.Start(new ProcessStartInfo
+ {
+ FileName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), "Microsoft", "Edge", "Application", "msedge.exe"),
+ Arguments = "--uninstall --force-uninstall --system-level --verbose-logging",
+ UseShellExecute = true,
+ WindowStyle = ProcessWindowStyle.Hidden
+ })?.WaitForExit();
+ }
+ catch (Exception ex) { Debug.WriteLine(ex); }
+
DeletingTask(edgeTasks);
+ TrustedInstaller.CreateProcessAsTrustedInstaller(SettingsRepository.PID, @"cmd.exe /с rmdir /s /q %LocalAppData%\Microsoft\Edge");
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 ""{StoragePaths.SystemDisk}Users"" %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.DeleteValue(Registry.CurrentUser, @"Software\Microsoft\Windows\CurrentVersion\Run", "MicrosoftEdgeAutoLaunch_03AF54719E0271FA0A92D5F15CBA10EA");
+ RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"SOFTWARE\Microsoft\Active Setup\Installed Components\{9459C573-B17A-45AE-9F64-1857B5D58CEE}", true);
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);
@@ -151,6 +199,31 @@ namespace GTweak.Utilities.Tweaks
RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft EdgeWebView", true);
RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"SOFTWARE\Classes\MSEdgeHTM", true);
RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"SOFTWARE\Clients\StartMenuInternet\Microsoft Edge", true);
+
+ foreach (var path in new[] { Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), "Microsoft", "Edge"), Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), "Microsoft", "EdgeWebView") })
+ {
+ TakingOwnership.GrantAdministratorsAccess(path, TakingOwnership.SE_OBJECT_TYPE.SE_FILE_OBJECT);
+ CommandExecutor.RunCommand($@"/c rmdir /s /q ""{path}""");
+ }
+
+ try
+ {
+ using RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\InboxApplications");
+ foreach (string subKey in key?.GetSubKeyNames() ?? Array.Empty<string>())
+ {
+ using RegistryKey subKeyEntry = key.OpenSubKey(subKey);
+ string path = subKeyEntry?.GetValue("Path") as string;
+ if (!string.IsNullOrEmpty(path) && path.Contains("MicrosoftEdgeDevToolsClient"))
+ {
+ path = path.Replace(@"\AppxManifest.xml", "").Trim();
+ TakingOwnership.GrantAdministratorsAccess(path, TakingOwnership.SE_OBJECT_TYPE.SE_FILE_OBJECT);
+ TrustedInstaller.CreateProcessAsTrustedInstaller(SettingsRepository.PID, $@"cmd.exe /c rmdir /s /q ""{path}""");
+ key.DeleteSubKey(subKey);
+ return;
+ }
+ }
+ }
+ catch (Exception ex) { Debug.WriteLine(ex); }
break;
}
});
diff --git a/.Source/GTweak/View/PakagesView.xaml.cs b/.Source/GTweak/View/PakagesView.xaml.cs
index f55eebf8..b9e3a454 100644
--- a/.Source/GTweak/View/PakagesView.xaml.cs
+++ b/.Source/GTweak/View/PakagesView.xaml.cs
@@ -147,9 +147,9 @@ namespace GTweak.View
OneNote.Source = AvailabilityInstalledPackage("OneNote", "Microsoft.Office.OneNote");
People.Source = AvailabilityInstalledPackage("People", "Microsoft.People");
MicrosoftStickyNotes.Source = AvailabilityInstalledPackage("MicrosoftStickyNotes", "Microsoft.MicrosoftStickyNotes");
- Widgets.Source = AvailabilityInstalledPackage("Widgets", "MicrosoftWindows.Client.WebExperience");
+ Widgets.Source = AvailabilityInstalledPackage("Widgets", "MicrosoftWindows.Client.WebExperience|Microsoft.WidgetsPlatformRuntime");
ScreenSketch.Source = AvailabilityInstalledPackage("ScreenSketch", "Microsoft.ScreenSketch");
- Phone.Source = AvailabilityInstalledPackage("Phone", "Microsoft.YourPhone");
+ Phone.Source = AvailabilityInstalledPackage("Phone", "Microsoft.YourPhone|MicrosoftWindows.CrossDevice");
Photos.Source = AvailabilityInstalledPackage("Photos", "Microsoft.Windows.Photos");
FeedbackHub.Source = AvailabilityInstalledPackage("FeedbackHub", "Microsoft.WindowsFeedbackHub");
SoundRecorder.Source = AvailabilityInstalledPackage("SoundRecorder", "Microsoft.WindowsSoundRecorder");