Portable Tool for an Ideal Windows Setup
C# activatorbloatware-removalcsharpdebloatdebloaterdisable-servicesmonitoring-systemportableprivacy-toolsregistry-tweakssystem-tuningsystem-utilitytelemetrytweakerwindows-10windows-11windows-debloatwindows-defenderwindows-optimizationwindows-tweaks
fix deadlock in registry calls & defender re-enable crash fix defender import notification shown on wrong state improve TrustedInstaller stability and process validation
Greedeksd37c743f9233
diff --git a/.Source/GTweak/Languages/en/Localize.xaml b/.Source/GTweak/Languages/en/Localize.xamlindex 1c040827..76651858 100644--- a/.Source/GTweak/Languages/en/Localize.xaml+++ b/.Source/GTweak/Languages/en/Localize.xaml@@ -52,7 +52,6 @@<v:String x:Key="error_onedrive_noty">OneDrive setup file missing, recovery impossible</v:String><v:String x:Key="warn_wd_noty">Await the process completion followed by system restart</v:String><v:String x:Key="info_wd_noty">It will take some time, please wait a bit</v:String>- <v:String x:Key="warn_firewall_noty">Your firewall is disabled, turn it on and apply the tweak again</v:String><v:String x:Key="ready_activate_noty">Your operating system does not need to be activated</v:String><v:String x:Key="win_activate_noty">The Windows activation process has started, it will take some time</v:String><v:String x:Key="success_activate_noty">Activation was successful, a reboot is recommended</v:String>diff --git a/.Source/GTweak/Languages/fr/Localize.xaml b/.Source/GTweak/Languages/fr/Localize.xamlindex 525f5ba4..04798042 100644--- a/.Source/GTweak/Languages/fr/Localize.xaml+++ b/.Source/GTweak/Languages/fr/Localize.xaml@@ -52,7 +52,6 @@<v:String x:Key="error_onedrive_noty">Fichier de configuration OneDrive manquant, récupération impossible</v:String><v:String x:Key="warn_wd_noty">Attendez la fin du processus, puis redémarrez le système</v:String><v:String x:Key="info_wd_noty">Le processus prendra un certain temps, veuillez patienter</v:String>- <v:String x:Key="warn_firewall_noty">Votre pare-feu est désactivé, activez-le et appliquez à nouveau le réglage</v:String><v:String x:Key="ready_activate_noty">Votre système d’exploitation n’a pas besoin d’être activé</v:String><v:String x:Key="win_activate_noty">Le processus d’activation de Windows a commencé, cela prendra un certain temps</v:String><v:String x:Key="success_activate_noty">L’activation a réussi, un redémarrage est recommandé</v:String>diff --git a/.Source/GTweak/Languages/he/Localize.xaml b/.Source/GTweak/Languages/he/Localize.xamlindex 78a49830..c6ca730c 100644--- a/.Source/GTweak/Languages/he/Localize.xaml+++ b/.Source/GTweak/Languages/he/Localize.xaml@@ -52,7 +52,6 @@<v:String x:Key="error_onedrive_noty">קובץ ההתקנה של OneDrive חסר, השחזור בלתי אפשרי</v:String><v:String x:Key="warn_wd_noty">המתן לסיום התהליך ולאחריו לאתחול המערכת</v:String><v:String x:Key="info_wd_noty">זה ייקח זמן מה, אנא המתן מעט</v:String>- <v:String x:Key="warn_firewall_noty">חומת האש שלך מושבתת, הפעל אותה והחל את הטוויק שוב</v:String><v:String x:Key="ready_activate_noty">מערכת ההפעלה שלך אינה זקוקה לאקטיבציה</v:String><v:String x:Key="win_activate_noty">תהליך האקטיבציה של Windows החל, פעולה זו תיקח זמן מה</v:String><v:String x:Key="success_activate_noty">האקטיבציה הצליחה, מומלץ לאתחל את המחשב</v:String>diff --git a/.Source/GTweak/Languages/hu/Localize.xaml b/.Source/GTweak/Languages/hu/Localize.xamlindex 2d258b9e..6dc83866 100644--- a/.Source/GTweak/Languages/hu/Localize.xaml+++ b/.Source/GTweak/Languages/hu/Localize.xaml@@ -52,7 +52,6 @@<v:String x:Key="error_onedrive_noty">A OneDrive telepítőfájlja hiányzik, a helyreállítás lehetetlen</v:String><v:String x:Key="warn_wd_noty">Várja meg a folyamat befejezését, majd a rendszer újraindulását.</v:String><v:String x:Key="info_wd_noty">Eltart egy ideig, kérlek, várj egy kicsit</v:String>- <v:String x:Key="warn_firewall_noty">A tűzfal le van tiltva, kapcsolja be, és alkalmazza újra a módosítást</v:String><v:String x:Key="ready_activate_noty">Az operációs rendszert nem kell aktiválni</v:String><v:String x:Key="win_activate_noty">A Windows aktiválási folyamata elindult, eltart egy ideig</v:String><v:String x:Key="success_activate_noty">Az aktiválás sikeres volt, újraindítás javasolt</v:String>@@ -218,8 +217,7 @@<v:String x:Key="chk_trash_intf">Lomtár</v:String><v:String x:Key="chk_panel_intf">Vezérlőpult</v:String><v:String x:Key="chk_user_intf">Felhasználói fájlok</v:String>-- <!--not translated-->+<v:String x:Key="exblock4_intf">Folders in «This PC»:</v:String><v:String x:Key="chk_folder_3d_intf">3D Objects</v:String><v:String x:Key="chk_folder_desktop_intf">Desktop</v:String>@@ -262,7 +260,7 @@<v:String x:Key="exblock1_desc_intf">Módosítja a beépített rendszer-elemek megjelenését a Fájlkezelő navigációs paneljén, amelyeket nem lehet a szokásos módon eltávolítani.</v:String><v:String x:Key="exblock2_desc_intf">Módosítja a rendszer megjelenítési szabályait a Fájlkezelőben, beleértve a rejtett elemek, kiterjesztések és meghajtók láthatóságát. Figyelem, a képernyő villoghat.</v:String><v:String x:Key="exblock3_desc_intf">Módosítja a rendszerikonok megjelenítését az asztalon — ezek beépített rendszerobjektumok, nem rendes parancsikonok.</v:String>- <!--not translated--> <v:String x:Key="exblock4_desc_intf">Changes the display of standard user folders within «This PC». Allows you to hide them so that only connected drives are shown in the list. Attention the screen may blink.</v:String>+ <v:String x:Key="exblock4_desc_intf">Changes the display of standard user folders within «This PC». Allows you to hide them so that only connected drives are shown in the list. Attention the screen may blink.</v:String><v:String x:Key="tgl1_desc_intf">Ez a módosítás csökkenti a Minimalizálás, a Maximalizálás és a Bezárás gombok méretét, így kevésbé terjedelmesek. Beállítja az összes ablak méretét, beleértve a Fájlkezelőt, a Fényképeket, a böngészőket és más ismerős programokat.</v:String><v:String x:Key="tgl2_desc_intf">Ez a beállítás növeli a szövegkurzor villogásának gyakoriságát. Alapértelmezés szerint a kurzor 530 ezredmásodpercenként villog.</v:String><v:String x:Key="tgl3_desc_intf">A módosítás csökkenti a görgetősávok vastagságát a klasszikus Windows-alkalmazásokban, beleértve a File Explorert, a böngészőket és más régi programokat. Ez azonban nem érinti a modern interfészeket, mivel azok a rendszerbeállításoktól független saját vezérlőelemeiket használják.</v:String>@@ -424,7 +422,7 @@<v:String x:Key="tgl8_desc_svc">Tiltsa le, ha nincs nyomtatója.</v:String><v:String x:Key="tgl9_desc_svc">Tiltsa le, ha nincs szkenner.</v:String><v:String x:Key="tgl10_desc_svc">Tiltsa le, ha nincs faxkészüléke.</v:String>- <!--not translated--> <v:String x:Key="tgl11_desc_svc">Tiltsa le, ha asztali számítógépe, laptopja vagy netbookja van. By default, these services are set to "Manual" start and do not run constantly. However, disabling them will crash the "Power" page in Windows Settings, as the system fails to poll the sensors when opened. The classic Control Panel will continue to work normally. If you need the modern Power settings, turn the services back on.</v:String>+ <v:String x:Key="tgl11_desc_svc">Tiltsa le, ha asztali számítógépe, laptopja vagy netbookja van. By default, these services are set to "Manual" start and do not run constantly. However, disabling them will crash the "Power" page in Windows Settings, as the system fails to poll the sensors when opened. The classic Control Panel will continue to work normally. If you need the modern Power settings, turn the services back on.</v:String><v:String x:Key="tgl12_desc_svc">Tiltsa le, ha csak egy monitora van, és nem tervezi további monitorok csatlakoztatását.</v:String><v:String x:Key="tgl13_desc_svc">Ha nem használja ezeket az alkalmazásokat, tiltsa le: „Virtuális asztalok”, „Az Ön telefonja” és az „Éjszakai fény”. Ez a szolgáltatás feldolgozza a felhasználói adatokat, és szinkronizálja azokat a Microsoft szerverekkel. A rendszer működése szempontjából nem kritikus, azonban egyes funkciók, például a Windows 10 „Éjszakai fény” funkciója, teljesen vagy részben leállhat, ha ezt a szolgáltatást letiltja.</v:String><v:String x:Key="tgl14_desc_svc">Tiltsa le, ha nem használ vagy nem tervez helyi hálózatot használni.</v:String>diff --git a/.Source/GTweak/Languages/it/Localize.xaml b/.Source/GTweak/Languages/it/Localize.xamlindex c371202d..ff9e8d5e 100644--- a/.Source/GTweak/Languages/it/Localize.xaml+++ b/.Source/GTweak/Languages/it/Localize.xaml@@ -52,7 +52,6 @@<v:String x:Key="error_onedrive_noty">File di configurazione di OneDrive mancante, ripristino impossibile</v:String><v:String x:Key="warn_wd_noty">Attendere il completamento del processo seguito dal riavvio del sistema</v:String><v:String x:Key="info_wd_noty">Ci vorrà un po' di tempo, attendi</v:String>- <v:String x:Key="warn_firewall_noty">Il tuo firewall è disattivato, attivalo e applica nuovamente la modifica</v:String><v:String x:Key="ready_activate_noty">Il tuo sistema operativo non necessita di attivazione</v:String><v:String x:Key="win_activate_noty">Il processo di attivazione di Windows è iniziato, richiederà del tempo</v:String><v:String x:Key="success_activate_noty">Attivazione riuscita, è consigliato un riavvio</v:String>diff --git a/.Source/GTweak/Languages/ko/Localize.xaml b/.Source/GTweak/Languages/ko/Localize.xamlindex 084a83f7..ed68bff7 100644--- a/.Source/GTweak/Languages/ko/Localize.xaml+++ b/.Source/GTweak/Languages/ko/Localize.xaml@@ -52,7 +52,6 @@<v:String x:Key="error_onedrive_noty">OneDrive 설정 파일이 누락되어 복구가 불가능합니다</v:String><v:String x:Key="warn_wd_noty">프로세스 완료 후 시스템 재시작을 기다립니다</v:String><v:String x:Key="info_wd_noty">이 과정은 다소 시간이 걸리므로 잠시 기다려주세요</v:String>- <v:String x:Key="warn_firewall_noty">방화벽이 비활성화되어 있으면 방화벽을 켜고 다시 조정을 적용하세요</v:String><v:String x:Key="ready_activate_noty">운영 체제를 활성화할 필요가 없습니다</v:String><v:String x:Key="win_activate_noty">Windows 정품 인증 프로세스가 시작되었으며 시간이 다소 소요됩니다.</v:String><v:String x:Key="success_activate_noty">활성화에 성공했습니다. 재부팅을 권장합니다</v:String>@@ -219,7 +218,6 @@<v:String x:Key="chk_panel_intf">제어판</v:String><v:String x:Key="chk_user_intf">사용자 파일</v:String>- <!--not translated--><v:String x:Key="exblock4_intf">Folders in «This PC»:</v:String><v:String x:Key="chk_folder_3d_intf">3D Objects</v:String><v:String x:Key="chk_folder_desktop_intf">Desktop</v:String>@@ -262,7 +260,7 @@<v:String x:Key="exblock1_desc_intf">일반적인 방법으로 고정 해제할 수 없는 내장 시스템 항목의 탐색 창 표시 여부를 변경합니다.</v:String><v:String x:Key="exblock2_desc_intf">파일 탐색기에서 항목 표시 규칙을 변경합니다. 숨김 항목, 파일 확장자 및 드라이브 구조의 표시가 포함됩니다. 화면이 깜박일 수 있으니 주의하세요.</v:String><v:String x:Key="exblock3_desc_intf">바탕 화면에 표시되는 시스템 아이콘을 변경합니다. 이들은 일반 바로가기와 달리 시스템에 내장된 항목입니다.</v:String>- <!--not translated--><v:String x:Key="exblock4_desc_intf">Changes the display of standard user folders within «This PC». Allows you to hide them so that only connected drives are shown in the list. Attention the screen may blink.</v:String>+ <v:String x:Key="exblock4_desc_intf">Changes the display of standard user folders within «This PC». Allows you to hide them so that only connected drives are shown in the list. Attention the screen may blink.</v:String><v:String x:Key="tgl1_desc_intf">이 조정으로 축소, 확장, 닫기 버튼의 크기가 줄어들어 부피가 줄어듭니다. 탐색기, Windows 사진, 브라우저 및 기타 프로그램을 포함한 모든 창 크기를 조정합니다.</v:String><v:String x:Key="tgl2_desc_intf">이 조정은 텍스트 커서의 깜박임 빈도를 가속화합니다. 기본적으로 530밀리초마다 깜박입니다.</v:String><v:String x:Key="tgl3_desc_intf">이 조정으로 브라우저와 프로그램을 포함한 창에서 스크롤 막대의 두께가 더 얇아집니다.</v:String>@@ -424,7 +422,7 @@<v:String x:Key="tgl8_desc_svc">프린터가 없는 경우 비활성화합니다.</v:String><v:String x:Key="tgl9_desc_svc">스캐너가 없는 경우 비활성화합니다.</v:String><v:String x:Key="tgl10_desc_svc">팩스기가 없는 경우 비활성화합니다.</v:String>- <!--not translated--> <v:String x:Key="tgl11_desc_svc">데스크톱 컴퓨터, 노트북 또는 넷북을 사용하는 경우 비활성화합니다. By default, these services are set to "Manual" start and do not run constantly. However, disabling them will crash the "Power" page in Windows Settings, as the system fails to poll the sensors when opened. The classic Control Panel will continue to work normally. If you need the modern Power settings, turn the services back on.</v:String>+ <v:String x:Key="tgl11_desc_svc">데스크톱 컴퓨터, 노트북 또는 넷북을 사용하는 경우 비활성화합니다. By default, these services are set to "Manual" start and do not run constantly. However, disabling them will crash the "Power" page in Windows Settings, as the system fails to poll the sensors when opened. The classic Control Panel will continue to work normally. If you need the modern Power settings, turn the services back on.</v:String><v:String x:Key="tgl12_desc_svc">모니터가 하나뿐이고 추가 모니터를 연결할 계획이 없는 경우 비활성화합니다.</v:String><v:String x:Key="tgl13_desc_svc">이 앱을 사용하지 않는 경우 비활성화합니다: «가상 데스크톱», «휴대폰», «야간 모드». 이 서비스는 사용자 데이터를 처리하여 Microsoft 서버와 동기화합니다. 시스템 작동에는 중요하지 않지만, Windows 10의 «나이트 라이트 »와 같은 일부 기능이 비활성화되면 완전히 또는 부분적으로 작동이 중단될 수 있습니다.</v:String><v:String x:Key="tgl14_desc_svc">로컬 네트워크를 사용하지 않거나 사용할 계획이 없는 경우 비활성화합니다.</v:String>diff --git a/.Source/GTweak/Languages/pl/Localize.xaml b/.Source/GTweak/Languages/pl/Localize.xamlindex 82104776..4d58de12 100644--- a/.Source/GTweak/Languages/pl/Localize.xaml+++ b/.Source/GTweak/Languages/pl/Localize.xaml@@ -52,7 +52,6 @@<v:String x:Key="error_onedrive_noty">Brak pliku instalacyjnego OneDrive, przywracanie niemożliwe</v:String><v:String x:Key="warn_wd_noty">Poczekaj na zakończenie procesu, a następnie uruchom ponownie system</v:String><v:String x:Key="info_wd_noty">To zajmie trochę czasu, proszę chwilę poczekać</v:String>- <v:String x:Key="warn_firewall_noty">Twój firewall jest wyłączony, włącz go i zastosuj poprawkę ponownie</v:String><v:String x:Key="ready_activate_noty">Twój system operacyjny nie wymaga aktywacji</v:String><v:String x:Key="win_activate_noty">Proces aktywacji systemu Windows został uruchomiony, zajmie to chwilę</v:String><v:String x:Key="success_activate_noty">Aktywacja zakończyła się pomyślnie, zalecane jest ponowne uruchomienie</v:String>@@ -219,7 +218,6 @@<v:String x:Key="chk_panel_intf">Panel sterowania</v:String><v:String x:Key="chk_user_intf">Pliki użytkownika</v:String>- <!--not translated--><v:String x:Key="exblock4_intf">Folders in «This PC»:</v:String><v:String x:Key="chk_folder_3d_intf">3D Objects</v:String><v:String x:Key="chk_folder_desktop_intf">Desktop</v:String>@@ -262,7 +260,7 @@<v:String x:Key="exblock1_desc_intf">Zmienia widoczność wbudowanych elementów systemowych w panelu nawigacji, których nie można odpiąć zwykłymi metodami.</v:String><v:String x:Key="exblock2_desc_intf">Zmienia systemowe reguły wyświetlania elementów w Eksploratorze plików, w tym widoczność ukrytych elementów, rozszerzeń plików i struktury dysków. Uwaga: ekran może migać.</v:String><v:String x:Key="exblock3_desc_intf">Zmienia wyświetlanie ikon systemowych na pulpicie, które są wbudowanymi obiektami systemu, a nie zwykłymi skrótami.</v:String>- <!--not translated--> <v:String x:Key="exblock4_desc_intf">Changes the display of standard user folders within «This PC». Allows you to hide them so that only connected drives are shown in the list. Attention the screen may blink.</v:String>+ <v:String x:Key="exblock4_desc_intf">Changes the display of standard user folders within «This PC». Allows you to hide them so that only connected drives are shown in the list. Attention the screen may blink.</v:String><v:String x:Key="tgl1_desc_intf">Poprawka zmniejsza rozmiar przycisków Minimalizuj, Maksymalizuj i Zamknij, czyniąc je mniej masywnym. Dostosowuje rozmiar dla wszystkich okien, w tym Eksploratora plików, Zdjęć, przeglądarek i innych znanych programów.</v:String><v:String x:Key="tgl2_desc_intf">Poprawka zwiększa częstotliwość migania kursora tekstowego. Domyślnie kursor miga co 530 milisekund.</v:String><v:String x:Key="tgl3_desc_intf">Poprawka zmniejsza grubość pasków przewijania w klasycznych aplikacjach Windows, w tym w Eksploratorze plików, przeglądarkach i innych starszych programach. Nie dotyczy jednak nowoczesnych interfejsów, ponieważ korzystają one z własnych elementów sterujących niezależnych od ustawień systemowych.</v:String>@@ -424,7 +422,7 @@<v:String x:Key="tgl8_desc_svc">Wyłącz, jeśli nie masz drukarki.</v:String><v:String x:Key="tgl9_desc_svc">Wyłącz, jeśli nie masz skanera.</v:String><v:String x:Key="tgl10_desc_svc">Wyłącz, jeśli nie masz faksu.</v:String>- <!--not translated--> <v:String x:Key="tgl11_desc_svc">Wyłącz, jeśli masz komputer stacjonarny, laptop lub netbook. By default, these services are set to "Manual" start and do not run constantly. However, disabling them will crash the "Power" page in Windows Settings, as the system fails to poll the sensors when opened. The classic Control Panel will continue to work normally. If you need the modern Power settings, turn the services back on.</v:String>+ <v:String x:Key="tgl11_desc_svc">Wyłącz, jeśli masz komputer stacjonarny, laptop lub netbook. By default, these services are set to "Manual" start and do not run constantly. However, disabling them will crash the "Power" page in Windows Settings, as the system fails to poll the sensors when opened. The classic Control Panel will continue to work normally. If you need the modern Power settings, turn the services back on.</v:String><v:String x:Key="tgl12_desc_svc">Wyłącz, jeśli masz tylko jeden monitor i nie planujesz podłączać dodatkowych.</v:String><v:String x:Key="tgl13_desc_svc">Wyłącz, jeśli nie korzystasz z tych aplikacji: «Wirtualne pulpity», «Twój telefon» i «Nocne światło». Usługa ta przetwarza dane użytkownika i synchronizuje je z serwerami Microsoft. Nie jest krytyczna dla działania systemu; jednak niektóre funkcje, takie jak «Nocne światło» w systemie Windows 10, mogą przestać działać całkowicie lub częściowo po jej wyłączeniu.</v:String><v:String x:Key="tgl14_desc_svc">Wyłącz, jeśli nie korzystasz ani nie planujesz korzystać z sieci lokalnej.</v:String>diff --git a/.Source/GTweak/Languages/pt-BR/Localize.xaml b/.Source/GTweak/Languages/pt-BR/Localize.xamlindex 7abb0a43..95c4914f 100644--- a/.Source/GTweak/Languages/pt-BR/Localize.xaml+++ b/.Source/GTweak/Languages/pt-BR/Localize.xaml@@ -52,7 +52,6 @@<v:String x:Key="error_onedrive_noty">Arquivo de configuração do OneDrive ausente, recuperação impossível</v:String><v:String x:Key="warn_wd_noty">Aguarde a conclusão do processo seguida da reinicialização do sistema</v:String><v:String x:Key="info_wd_noty">Levará algum tempo, por favor, espere um pouco</v:String>- <v:String x:Key="warn_firewall_noty">Seu firewall está desativado, ative-o e aplique o ajuste novamente</v:String><v:String x:Key="ready_activate_noty">Seu sistema operacional não precisa ser ativado</v:String><v:String x:Key="win_activate_noty">O processo de ativação do Windows foi iniciado, levará algum tempo</v:String><v:String x:Key="success_activate_noty">A ativação foi bem-sucedida, uma reinicialização é recomendada</v:String>diff --git a/.Source/GTweak/Languages/ru/Localize.xaml b/.Source/GTweak/Languages/ru/Localize.xamlindex 9355c3c7..7d976952 100644--- a/.Source/GTweak/Languages/ru/Localize.xaml+++ b/.Source/GTweak/Languages/ru/Localize.xaml@@ -52,7 +52,6 @@<v:String x:Key="error_onedrive_noty">Отсутствует установочный файл OneDrive, восстановление невозможно</v:String><v:String x:Key="warn_wd_noty">Ожидайте завершения процесса с последующим перезапуском системы</v:String><v:String x:Key="info_wd_noty">Это займет некоторое время, пожалуйста, подождите немного</v:String>- <v:String x:Key="warn_firewall_noty">У вас отключен брандмауэр, включите и примените твик снова</v:String><v:String x:Key="ready_activate_noty">Ваша операционная система не нуждается в активации</v:String><v:String x:Key="win_activate_noty">Процесс активации Windows начался, это займет некоторое время</v:String><v:String x:Key="success_activate_noty">Активация прошла успешно, рекомендуется перезагрузка</v:String>diff --git a/.Source/GTweak/Languages/sl-SI/Localize.xaml b/.Source/GTweak/Languages/sl-SI/Localize.xamlindex b242ef84..b42fc74e 100644--- a/.Source/GTweak/Languages/sl-SI/Localize.xaml+++ b/.Source/GTweak/Languages/sl-SI/Localize.xaml@@ -52,7 +52,6 @@<v:String x:Key="error_onedrive_noty">Namestitvena datoteka OneDrive manjka, obnovitev ni mogoča</v:String><v:String x:Key="warn_wd_noty">Počakajte na dokončanje postopka, ki mu sledi ponovni zagon sistema</v:String><v:String x:Key="info_wd_noty">To bo trajalo nekaj časa, prosim počakajte</v:String>- <v:String x:Key="warn_firewall_noty">Vaš požarni zid je onemogočen, vklopite ga in znova uporabite popravek</v:String><v:String x:Key="ready_activate_noty">Vašega operacijskega sistema ni treba aktivirati</v:String><v:String x:Key="win_activate_noty">Postopek aktivacije Windows se je začel, trajalo bo nekaj časa</v:String><v:String x:Key="success_activate_noty">Aktivacija je uspela, priporočljiv je ponovni zagon</v:String>diff --git a/.Source/GTweak/Languages/th/Localize.xaml b/.Source/GTweak/Languages/th/Localize.xamlindex cd904b7c..d7543c80 100644--- a/.Source/GTweak/Languages/th/Localize.xaml+++ b/.Source/GTweak/Languages/th/Localize.xaml@@ -52,7 +52,6 @@<v:String x:Key="error_onedrive_noty">ไม่พบไฟล์ติดตั้ง OneDrive, ไม่สามารถกู้คืนได้</v:String><v:String x:Key="warn_wd_noty">โปรดรอจนกระทั่งกระบวนการเสร็จสิ้น จากนั้นระบบจะรีสตาร์ท</v:String><v:String x:Key="info_wd_noty">อาจใช้เวลาสักครู่, โปรดรอสักครู่</v:String>- <v:String x:Key="warn_firewall_noty">ไฟร์วอลล์ของคุณถูกปิดใช้งาน, โปรดเปิดใช้งานและใช้การปรับแต่งอีกครั้ง</v:String><v:String x:Key="ready_activate_noty">ระบบปฏิบัติการของคุณไม่จำเป็นต้องเปิดใช้งาน</v:String><v:String x:Key="win_activate_noty">กระบวนการเปิดใช้งาน Windows ได้เริ่มต้นแล้ว, อาจใช้เวลาสักครู่</v:String><v:String x:Key="success_activate_noty">การเปิดใช้งานสำเร็จ, แนะนำให้รีสตาร์ทระบบ</v:String>diff --git a/.Source/GTweak/Languages/tr/Localize.xaml b/.Source/GTweak/Languages/tr/Localize.xamlindex 2071e318..a3f9ff9c 100644--- a/.Source/GTweak/Languages/tr/Localize.xaml+++ b/.Source/GTweak/Languages/tr/Localize.xaml@@ -52,7 +52,6 @@<v:String x:Key="error_onedrive_noty">OneDrive kurulum dosyası bulunamadı, kurtarma işlemi yapılamıyor</v:String><v:String x:Key="warn_wd_noty">İşlemin tamamlanmasını bekleyin ve ardından sistemi yeniden başlatın</v:String><v:String x:Key="info_wd_noty">Bu işlem biraz zaman alabilir, lütfen bekleyin</v:String>- <v:String x:Key="warn_firewall_noty">Güvenlik duvarınız kapalı. Lütfen açıp ayarı tekrar uygulayın</v:String><v:String x:Key="ready_activate_noty">İşletim sisteminizin etkinleştirilmeye ihtiyacı yok</v:String><v:String x:Key="win_activate_noty">Windows etkinleştirme işlemi başladı, tamamlanması biraz zaman alabilir</v:String><v:String x:Key="success_activate_noty">Etkinleştirme başarılı! Sistemi yeniden başlatmanız önerilir</v:String>diff --git a/.Source/GTweak/Languages/uk/Localize.xaml b/.Source/GTweak/Languages/uk/Localize.xamlindex 8bb5be44..782223c4 100644--- a/.Source/GTweak/Languages/uk/Localize.xaml+++ b/.Source/GTweak/Languages/uk/Localize.xaml@@ -52,7 +52,6 @@<v:String x:Key="error_onedrive_noty">Не знайдено файл встановлення OneDrive, відновлення неможливе</v:String><v:String x:Key="warn_wd_noty">Очікуйте завершення процесу з наступним перезапуском системи</v:String><v:String x:Key="info_wd_noty">Процес потребує деякого часу, будь ласка, зачекайте</v:String>- <v:String x:Key="warn_firewall_noty">Ваш брандмауер вимкнено, увімкніть та застосовуйте налаштування знову</v:String><v:String x:Key="ready_activate_noty">Ваша операційна система не потребує активації</v:String><v:String x:Key="win_activate_noty">Розпочато процес активації Windows, на це потрібен деякий час</v:String><v:String x:Key="success_activate_noty">Операційну систему успішно активовано, рекомендовано перезавантажити комп'ютер</v:String>diff --git a/.Source/GTweak/Languages/zh-CN/Localize.xaml b/.Source/GTweak/Languages/zh-CN/Localize.xamlindex 69378ed2..37ac2326 100644--- a/.Source/GTweak/Languages/zh-CN/Localize.xaml+++ b/.Source/GTweak/Languages/zh-CN/Localize.xaml@@ -52,7 +52,6 @@<v:String x:Key="error_onedrive_noty">OneDrive 设置文档遗失,无法运行还原程序</v:String><v:String x:Key="warn_wd_noty">请等待程序完成后重新启动系统</v:String><v:String x:Key="info_wd_noty">此过程需耗费时间,请稍候片刻</v:String>- <v:String x:Key="warn_firewall_noty">您的防火墙已停用,请启用后重新运行调整程序</v:String><v:String x:Key="ready_activate_noty">您的操作系统无需进行授权</v:String><v:String x:Key="win_activate_noty">Windows 启用程序已启动,此过程将耗费数分钟</v:String><v:String x:Key="success_activate_noty">启用程序已成功完成,建议重新启动电脑</v:String>diff --git a/.Source/GTweak/Languages/zh-TW/Localize.xaml b/.Source/GTweak/Languages/zh-TW/Localize.xamlindex b16e1bf5..c3b645b6 100644--- a/.Source/GTweak/Languages/zh-TW/Localize.xaml+++ b/.Source/GTweak/Languages/zh-TW/Localize.xaml@@ -52,7 +52,6 @@<v:String x:Key="error_onedrive_noty">OneDrive 設定檔案遺失,無法執行復原程序</v:String><v:String x:Key="warn_wd_noty">請等待程序完成後重新啟動系統</v:String><v:String x:Key="info_wd_noty">此過程需耗費時間,請稍候片刻</v:String>- <v:String x:Key="warn_firewall_noty">您的防火牆已停用,請啟用後重新執行調整程序</v:String><v:String x:Key="ready_activate_noty">您的作業系統無需進行授權</v:String><v:String x:Key="win_activate_noty">Windows 啟用程序已啟動,此過程將耗費數分鐘</v:String><v:String x:Key="success_activate_noty">啟用程序已成功完成,建議重新啟動電腦</v:String>diff --git a/.Source/GTweak/Modules/Helpers/RegistryHelper.cs b/.Source/GTweak/Modules/Helpers/RegistryHelper.csindex cb15430a..6671e12c 100644--- a/.Source/GTweak/Modules/Helpers/RegistryHelper.cs+++ b/.Source/GTweak/Modules/Helpers/RegistryHelper.cs@@ -1,6 +1,5 @@using System;using System.Collections.Generic;-using System.Threading.Tasks;using GTweak.Modules.Common;using Microsoft.Win32;@@ -8,91 +7,77 @@ namespace GTweak.Modules.Helpers{internal sealed class RegistryHelper : TakingOwnership{- private static string GeneralRegistry(RegistryKey registrykey)+ private static string GeneralRegistry(RegistryKey registrykey) => registrykey.Name switch{- return registrykey.Name switch- {- "HKEY_LOCAL_MACHINE" => $@"MACHINE\",- "HKEY_CLASSES_ROOT" => $@"CLASSES_ROOT\",- "HKEY_CURRENT_USER" => $@"CURRENT_USER\",- "HKEY_USERS" => $@"USERS\",- _ => $@"CURRENT_CONFIG\",- };- }+ "HKEY_LOCAL_MACHINE" => @"MACHINE\",+ "HKEY_CLASSES_ROOT" => @"CLASSES_ROOT\",+ "HKEY_CURRENT_USER" => @"CURRENT_USER\",+ "HKEY_USERS" => @"USERS\",+ _ => @"CURRENT_CONFIG\",+ };internal static void DeleteValue(RegistryKey registrykey, string subkey, string value, bool isTakingOwner = false){- Task.Run(delegate+ try{- if (registrykey.OpenSubKey(subkey) == null || registrykey.OpenSubKey(subkey)?.GetValue(value, null) == null)+ using RegistryKey key = registrykey.OpenSubKey(subkey, true);+ if (key?.GetValue(value, null) == null){return;}- try+ if (isTakingOwner){- if (isTakingOwner)- {- GrantAdministratorsAccess($"{GeneralRegistry(registrykey)}{subkey}", SE_OBJECT_TYPE.SE_REGISTRY_KEY);- }-- registrykey.OpenSubKey(subkey, true)?.DeleteValue(value);+ GrantAdministratorsAccess($"{GeneralRegistry(registrykey)}{subkey}", SE_OBJECT_TYPE.SE_REGISTRY_KEY);}- catch (Exception ex) { ErrorLogger.LogDebug(ex); }- }).GetAwaiter().GetResult();++ key.DeleteValue(value);+ }+ catch (Exception ex) { ErrorLogger.LogDebug(ex); }}internal static void Write<T>(RegistryKey registrykey, string subkey, string name, T data, RegistryValueKind kind, bool isTakingOwner = false){- Task.Run(delegate+ try{- try+ if (isTakingOwner){- if (isTakingOwner)- {- GrantAdministratorsAccess($"{GeneralRegistry(registrykey)}{subkey}", SE_OBJECT_TYPE.SE_REGISTRY_KEY);- }-- registrykey.CreateSubKey(subkey, true)?.SetValue(name, data, kind);+ GrantAdministratorsAccess($"{GeneralRegistry(registrykey)}{subkey}", SE_OBJECT_TYPE.SE_REGISTRY_KEY);}- catch (Exception ex) { ErrorLogger.LogDebug(ex); }- }).GetAwaiter().GetResult();++ registrykey.CreateSubKey(subkey, true)?.SetValue(name, data, kind);+ }+ catch (Exception ex) { ErrorLogger.LogDebug(ex); }}internal static void CreateFolder(RegistryKey registrykey, string subkey){- Task.Run(delegate- {- try { registrykey.CreateSubKey(subkey); }- catch (Exception ex) { ErrorLogger.LogDebug(ex); }- }).GetAwaiter().GetResult();+ try { registrykey.CreateSubKey(subkey); }+ catch (Exception ex) { ErrorLogger.LogDebug(ex); }}internal static void DeleteFolderTree(RegistryKey registrykey, string subkey, bool isTakingOwner = false){- Task.Run(delegate+ try{- try+ if (isTakingOwner){- if (isTakingOwner)- {- GrantAdministratorsAccess($"{GeneralRegistry(registrykey)}{subkey}", SE_OBJECT_TYPE.SE_REGISTRY_KEY);- }-- using RegistryKey registryFolder = registrykey.OpenSubKey(subkey, true);+ GrantAdministratorsAccess($"{GeneralRegistry(registrykey)}{subkey}", SE_OBJECT_TYPE.SE_REGISTRY_KEY);+ }- if (registryFolder != null)+ using RegistryKey registryFolder = registrykey.OpenSubKey(subkey, true);+ if (registryFolder != null)+ {+ foreach (string value in registryFolder.GetValueNames()){- foreach (string value in registryFolder.GetValueNames())- {- try { registryFolder.DeleteValue(value); }- catch (Exception ex) { ErrorLogger.LogDebug(ex); }- }+ try { registryFolder.DeleteValue(value); }+ catch (Exception ex) { ErrorLogger.LogDebug(ex); }}- registrykey.DeleteSubKeyTree(subkey, false);}- catch (Exception ex) { ErrorLogger.LogDebug(ex); }- }).GetAwaiter().GetResult();++ registrykey.DeleteSubKeyTree(subkey, false);+ }+ catch (Exception ex) { ErrorLogger.LogDebug(ex); }}internal static bool KeyExists(RegistryKey registryKey, string subKey, bool invert = false)@@ -117,12 +102,12 @@ namespace GTweak.Modules.Helpersinternal static bool CheckValueBytes(string subkey, string valueName, string expectedValue){- if (!(Registry.GetValue(subkey, valueName, null) is byte[]))+ if (!(Registry.GetValue(subkey, valueName, null) is byte[] bytes)){return true;}- return string.Concat(Registry.GetValue(subkey, valueName, null) as byte[] ?? Array.Empty<byte>()) != expectedValue;+ return string.Concat(bytes) != expectedValue;}internal static T GetValue<T>(string subKey, string valueName, T defaultValue)@@ -131,24 +116,18 @@ namespace GTweak.Modules.Helpers{object value = Registry.GetValue(subKey, valueName, null);- switch (value)+ if (value == null){- case null:- return defaultValue;- case T t:- return t;- default:- break;+ return defaultValue;}- Type targetType = typeof(T);-- if (targetType.IsEnum)+ if (value is T t){- return (T)Enum.Parse(targetType, value.ToString());+ return t;}- return (T)Convert.ChangeType(value, targetType);+ Type targetType = typeof(T);+ return targetType.IsEnum ? (T)Enum.Parse(targetType, value.ToString()) : (T)Convert.ChangeType(value, targetType);}catch { return defaultValue; }}@@ -164,7 +143,7 @@ namespace GTweak.Modules.Helpers}T result = new T();- foreach (var name in key.GetSubKeyNames())+ foreach (string name in key.GetSubKeyNames()){result.Add(name);}@@ -174,4 +153,4 @@ namespace GTweak.Modules.Helperscatch { return new T(); }}}-}+}\ No newline at end of filediff --git a/.Source/GTweak/Modules/Helpers/TrustedInstaller.cs b/.Source/GTweak/Modules/Helpers/TrustedInstaller.csindex be84a2e2..0d4905d5 100644--- a/.Source/GTweak/Modules/Helpers/TrustedInstaller.cs+++ b/.Source/GTweak/Modules/Helpers/TrustedInstaller.cs@@ -1,6 +1,7 @@using System;using System.ComponentModel;using System.Diagnostics;+using System.Linq;using System.Runtime.InteropServices;using System.ServiceProcess;@@ -11,15 +12,27 @@ namespace GTweak.Modules.Helpers[DllImport("kernel32.dll", SetLastError = true)]private static extern bool CloseHandle(IntPtr hObject);+ [DllImport("kernel32.dll")]+ private static extern IntPtr GetCurrentProcess();+[DllImport("advapi32.dll", ExactSpelling = true, SetLastError = true)]- private static extern bool AdjustTokenPrivileges(IntPtr htok, bool disall, ref TokPrivLuid newst, int len, IntPtr prev, IntPtr relen);+ private static extern bool AdjustTokenPrivileges(IntPtr htok, bool disall, ref TOKEN_PRIVILEGES newst, int len, IntPtr prev, IntPtr relen);++ [DllImport("advapi32.dll", SetLastError = true, CharSet = CharSet.Auto)]+ private static extern bool LookupPrivilegeValue(string lpSystemName, string lpName, out LUID lpLuid);[DllImport("advapi32.dll", SetLastError = true)]private static extern bool OpenProcessToken(IntPtr ProcessHandle, uint DesiredAccess, out IntPtr TokenHandle);+ [DllImport("advapi32.dll", SetLastError = true)]+ private static extern bool DuplicateTokenEx(IntPtr hExistingToken, uint dwDesiredAccess, IntPtr lpTokenAttributes, SECURITY_IMPERSONATION_LEVEL ImpersonationLevel, TOKEN_TYPE TokenType, out IntPtr phNewToken);+[DllImport("advapi32.dll", SetLastError = true)]private static extern bool ImpersonateLoggedOnUser(IntPtr hToken);+ [DllImport("advapi32.dll", SetLastError = true)]+ private static extern bool RevertToSelf();+[DllImport("advapi32.dll", SetLastError = true, CharSet = CharSet.Unicode)]private static extern IntPtr OpenSCManager(string lpMachineName, string lpDatabaseName, uint dwDesiredAccess);@@ -35,7 +48,7 @@ namespace GTweak.Modules.Helpers[DllImport("advapi32.dll", SetLastError = true)]private static extern bool CloseServiceHandle(IntPtr hSCObject);- [DllImport("kernel32.dll")]+ [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)][return: MarshalAs(UnmanagedType.Bool)]private static extern bool CreateProcess(string lpApplicationName, string lpCommandLine, ref SECURITY_ATTRIBUTES lpProcessAttributes, ref SECURITY_ATTRIBUTES lpThreadAttributes, bool bInheritHandles, uint dwCreationFlags, IntPtr lpEnvironment, string lpCurrentDirectory, [In] ref STARTUPINFOEX lpStartupInfo, out PROCESS_INFORMATION lpProcessInformation);@@ -53,7 +66,11 @@ namespace GTweak.Modules.Helpers[DllImport("kernel32.dll", SetLastError = true)]private static extern void DeleteProcThreadAttributeList(IntPtr lpAttributeList);+ private const uint TOKEN_ADJUST_PRIVILEGES = 0x0020;+ private const uint TOKEN_QUERY = 0x0008;+ private const uint TOKEN_DUPLICATE = 0x0002;private const uint MAXIMUM_ALLOWED = 0x02000000;+ private const int SE_PRIVILEGE_ENABLED = 0x00000002;private const uint SC_MANAGER_CONNECT = 0x0001;private const uint SC_MANAGER_ENUMERATE_SERVICE = 0x0004;@@ -66,6 +83,41 @@ namespace GTweak.Modules.Helpersprivate const uint PROC_THREAD_ATTRIBUTE_PARENT_PROCESS = 0x00020000;private const uint EXTENDED_STARTUPINFO_PRESENT = 0x00080000;+ private enum SECURITY_IMPERSONATION_LEVEL+ {+ SecurityAnonymous,+ SecurityIdentification,+ SecurityImpersonation,+ SecurityDelegation+ }++ private enum TOKEN_TYPE+ {+ TokenPrimary = 1,+ TokenImpersonation+ }++ [StructLayout(LayoutKind.Sequential)]+ private struct LUID+ {+ public uint LowPart;+ public int HighPart;+ }++ [StructLayout(LayoutKind.Sequential)]+ private struct LUID_AND_ATTRIBUTES+ {+ public LUID Luid;+ public uint Attributes;+ }++ [StructLayout(LayoutKind.Sequential)]+ private struct TOKEN_PRIVILEGES+ {+ public uint PrivilegeCount;+ public LUID_AND_ATTRIBUTES Privileges;+ }+[StructLayout(LayoutKind.Sequential)]private struct SECURITY_ATTRIBUTES{@@ -120,14 +172,6 @@ namespace GTweak.Modules.Helpersinternal uint dwThreadId;}- [StructLayout(LayoutKind.Sequential)]- private struct TokPrivLuid- {- internal int Count;- internal long Luid;- internal int Attr;- }-[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]private struct STARTUPINFOEX{@@ -138,29 +182,55 @@ namespace GTweak.Modules.Helpers[Flags]private enum ProcessAccessFlags : uint{- All = 0x001F0FFF,- Terminate = 0x00000001,- CreateThread = 0x00000002,- VirtualMemoryOperation = 0x00000008,- VirtualMemoryRead = 0x00000010,- VirtualMemoryWrite = 0x00000020,- DuplicateHandle = 0x00000040,- CreateProcess = 0x000000080,- SetQuota = 0x00000100,- SetInformation = 0x00000200,- QueryInformation = 0x00000400,- QueryLimitedInformation = 0x00001000,- Synchronize = 0x00100000+ CreateProcess = 0x00000080,+ QueryLimitedInformation = 0x00001000+ }++ private static bool EnablePrivilege(string privilegeName)+ {+ if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, out IntPtr tokenHandle))+ {+ return false;+ }++ try+ {+ if (!LookupPrivilegeValue(null, privilegeName, out LUID luid))+ {+ return false;+ }++ TOKEN_PRIVILEGES tp = new TOKEN_PRIVILEGES+ {+ PrivilegeCount = 1,+ Privileges = new LUID_AND_ATTRIBUTES+ {+ Luid = luid,+ Attributes = SE_PRIVILEGE_ENABLED+ }+ };++ return AdjustTokenPrivileges(tokenHandle, false, ref tp, Marshal.SizeOf(tp), IntPtr.Zero, IntPtr.Zero);+ }+ finally+ {+ CloseHandle(tokenHandle);+ }}private static bool IsProcessRunning(int processId){+ if (processId <= 0)+ {+ return false;+ }+try{using Process process = Process.GetProcessById(processId);- return !process.HasExited;+ return !process.HasExited && string.Equals(process.ProcessName, "TrustedInstaller", StringComparison.OrdinalIgnoreCase);}- catch (ArgumentException)+ catch{return false;}@@ -168,39 +238,60 @@ namespace GTweak.Modules.Helpersprivate static bool ImpersonateSystem(){- IntPtr tokenHandle = IntPtr.Zero;- Process[] winlogonList = null;+ EnablePrivilege("SeDebugPrivilege");+ EnablePrivilege("SeImpersonatePrivilege");++ IntPtr primaryToken = IntPtr.Zero;+ IntPtr duplicateToken = IntPtr.Zero;+ IntPtr winlogonHandle = IntPtr.Zero;try{- winlogonList = Process.GetProcessesByName("winlogon");- if (winlogonList.Length == 0)+ int currentSession = Process.GetCurrentProcess().SessionId;+ Process[] winlogons = Process.GetProcessesByName("winlogon");++ Process targetWinlogon = winlogons.FirstOrDefault(p => p.SessionId == currentSession) ?? winlogons.FirstOrDefault();++ if (targetWinlogon == null){return false;}- Process winlogon = winlogonList[0];+ winlogonHandle = OpenProcess(ProcessAccessFlags.QueryLimitedInformation, false, targetWinlogon.Id);+ if (winlogonHandle == IntPtr.Zero)+ {+ return false;+ }- if (!OpenProcessToken(winlogon.Handle, MAXIMUM_ALLOWED, out tokenHandle))+ if (!OpenProcessToken(winlogonHandle, TOKEN_DUPLICATE | TOKEN_QUERY, out primaryToken)){return false;}- return ImpersonateLoggedOnUser(tokenHandle);+ if (!DuplicateTokenEx(primaryToken, MAXIMUM_ALLOWED, IntPtr.Zero,+ SECURITY_IMPERSONATION_LEVEL.SecurityImpersonation,+ TOKEN_TYPE.TokenImpersonation, out duplicateToken))+ {+ return false;+ }++ return ImpersonateLoggedOnUser(duplicateToken);}finally{- if (winlogonList != null)+ if (primaryToken != IntPtr.Zero){- foreach (Process p in winlogonList)- {- p.Dispose();- }+ CloseHandle(primaryToken);}- if (tokenHandle != IntPtr.Zero)+ if (duplicateToken != IntPtr.Zero){- CloseHandle(tokenHandle);+ CloseHandle(duplicateToken);+ }++ if (winlogonHandle != IntPtr.Zero)+ {+ CloseHandle(winlogonHandle);}}}@@ -242,7 +333,19 @@ namespace GTweak.Modules.Helpers{CloseServiceHandle(hService);CloseServiceHandle(hSCManager);- CommandExecutor.PID = (int)statusBuffer.dwProcessId;++ int pid = (int)statusBuffer.dwProcessId;+ if (pid <= 0)+ {+ Process ti = Process.GetProcessesByName("TrustedInstaller").FirstOrDefault();+ if (ti != null)+ {+ pid = ti.Id;+ ti.Dispose();+ }+ }++ CommandExecutor.PID = pid;return;}}@@ -272,20 +375,20 @@ namespace GTweak.Modules.Helperstry{- if (!impersonated)+ if (!IsProcessRunning(parentProcessId)){- impersonated = ImpersonateSystem();+ StartTrustedInstallerService();+ parentProcessId = CommandExecutor.PID;}if (!impersonated){- throw new Win32Exception("Failed to impersonate SYSTEM identity");+ impersonated = ImpersonateSystem();}- if (!IsProcessRunning(parentProcessId))+ if (!impersonated){- StartTrustedInstallerService();- parentProcessId = CommandExecutor.PID;+ throw new Win32Exception("Failed to impersonate SYSTEM identity");}attributeList = Marshal.AllocHGlobal((IntPtr)(long)lpSize);@@ -295,8 +398,7 @@ namespace GTweak.Modules.Helpersthrow new Win32Exception(Marshal.GetLastWin32Error());}- parentHandle = OpenProcess(ProcessAccessFlags.CreateProcess | ProcessAccessFlags.DuplicateHandle | ProcessAccessFlags.Synchronize, false, parentProcessId);-+ parentHandle = OpenProcess(ProcessAccessFlags.CreateProcess, false, parentProcessId);if (parentHandle == IntPtr.Zero){throw new Win32Exception(Marshal.GetLastWin32Error());@@ -319,7 +421,7 @@ namespace GTweak.Modules.HelpersSECURITY_ATTRIBUTES ps = new SECURITY_ATTRIBUTES { nLength = Marshal.SizeOf(typeof(SECURITY_ATTRIBUTES)) };SECURITY_ATTRIBUTES ts = new SECURITY_ATTRIBUTES { nLength = Marshal.SizeOf(typeof(SECURITY_ATTRIBUTES)) };- if (!CreateProcess(null, binaryPath, ref ps, ref ts, true, EXTENDED_STARTUPINFO_PRESENT, IntPtr.Zero, null, ref siEx, out PROCESS_INFORMATION pInfo))+ if (!CreateProcess(null, binaryPath, ref ps, ref ts, false, EXTENDED_STARTUPINFO_PRESENT, IntPtr.Zero, null, ref siEx, out PROCESS_INFORMATION pInfo)){throw new Win32Exception(Marshal.GetLastWin32Error());}@@ -331,6 +433,7 @@ namespace GTweak.Modules.Helperscatch (Exception ex){lastException = ex;+ parentProcessId = 0;}finally{@@ -349,10 +452,15 @@ namespace GTweak.Modules.HelpersDeleteProcThreadAttributeList(attributeList);Marshal.FreeHGlobal(attributeList);}+ if (impersonated)+ {+ RevertToSelf();+ impersonated = false;+ }}}throw lastException ?? new Win32Exception("CreateProcessAsTrustedInstaller failed after 3 attempts");}}-}+}\ No newline at end of filediff --git a/.Source/GTweak/Modules/Managers/FirewallManager.cs b/.Source/GTweak/Modules/Managers/FirewallManager.csindex 09180136..9791db43 100644--- a/.Source/GTweak/Modules/Managers/FirewallManager.cs+++ b/.Source/GTweak/Modules/Managers/FirewallManager.cs@@ -64,7 +64,7 @@ namespace GTweak.Modules.ManagersChangeRules(state, path, ruleName, NET_FW_RULE_DIRECTION_.NET_FW_RULE_DIR_OUT);});}- catch { NotificationManager.Show("warn", "warn_firewall_noty").Perform(); }+ catch (Exception ex) { ErrorLogger.LogDebug(ex); }}@@ -99,7 +99,7 @@ namespace GTweak.Modules.Managersprotected static void BlockSpyDomain(in bool state){try { RulesHosts(state); }- catch { NotificationManager.Show("warn", "warn_firewall_noty").Perform(); }+ catch (Exception ex) { ErrorLogger.LogDebug(ex); }}private static void RulesHosts(in bool state)diff --git a/.Source/GTweak/Modules/Managers/NotificationManager.cs b/.Source/GTweak/Modules/Managers/NotificationManager.csindex ae45a37b..e31be0e1 100644--- a/.Source/GTweak/Modules/Managers/NotificationManager.cs+++ b/.Source/GTweak/Modules/Managers/NotificationManager.cs@@ -53,7 +53,7 @@ namespace GTweak.Modules.Managers[SystemToggle.MultiPlaneOverlay] = NoticeAction.Restart};- private static int _isNotificationOpen;+ private static volatile int _isNotificationOpen;internal static NotificationBuilder Show(string titleKey = "", string textKey = ""){diff --git a/.Source/GTweak/Modules/Tweaks/AppxPackageHandler.cs b/.Source/GTweak/Modules/Tweaks/AppxPackageHandler.csindex 1ce66a8f..87885071 100644--- a/.Source/GTweak/Modules/Tweaks/AppxPackageHandler.cs+++ b/.Source/GTweak/Modules/Tweaks/AppxPackageHandler.cs@@ -15,7 +15,7 @@ namespace GTweak.Modules.Tweaks{internal sealed class AppxPackageHandler : TaskSchedulerManager{- private static bool _isLocalAccount = false;+ private static volatile bool _isLocalAccount = false;internal static event Action DataChanged;internal static void OnPackagesChanged() => DataChanged?.Invoke();@@ -135,9 +135,9 @@ namespace GTweak.Modules.Tweaksif (isUnavailable.HasValue){details.IsUnavailable = isUnavailable.Value;+ OnPackagesChanged();}- OnPackagesChanged();return details.IsUnavailable;}diff --git a/.Source/GTweak/Modules/Tweaks/ConfidentialityTweaks.cs b/.Source/GTweak/Modules/Tweaks/ConfidentialityTweaks.csindex b0a4ec5b..623875ab 100644--- a/.Source/GTweak/Modules/Tweaks/ConfidentialityTweaks.cs+++ b/.Source/GTweak/Modules/Tweaks/ConfidentialityTweaks.cs@@ -563,7 +563,7 @@ namespace GTweak.Modules.Tweaksif (_tglTweaks.TryGetValue(tweakKey, out var action)){- action.Apply(state);+ Task.Run(() => action.Apply(state));}}}diff --git a/.Source/GTweak/Modules/Tweaks/Defender/DefenderTweaks.cs b/.Source/GTweak/Modules/Tweaks/Defender/DefenderTweaks.csindex 136c337c..b90ec985 100644--- a/.Source/GTweak/Modules/Tweaks/Defender/DefenderTweaks.cs+++ b/.Source/GTweak/Modules/Tweaks/Defender/DefenderTweaks.cs@@ -146,7 +146,7 @@ namespace GTweak.Modules.Tweaks.DefenderRegistryHelper.DeleteValue(Registry.LocalMachine, @"SOFTWARE\Microsoft\Windows defender\Windows defender Exploit Guard\Controlled Folder Access", "EnableControlledFolderAccess");RegistryHelper.DeleteValue(Registry.LocalMachine, @"SOFTWARE\Microsoft\Windows Defender\Windows Defender Exploit Guard\Network Protection", "EnableNetworkProtection");- CommandExecutor.RunCommandAsTrustedInstaller($@"""{PathTargets.Executable.NSudo}"" -U:T -P:E -CreatePath:S -ShowWindowMode:Hide cmd /c " ++ CommandExecutor.RunCommandAsTrustedInstaller($@"""{PathTargets.Executable.NSudo}"" -U:T -P:E -CreatePath:S -ShowWindowMode:Hide -Wait cmd /c " +@"reg delete HKLM\SYSTEM\CurrentControlSet\Services\WinDefend /v AutorunsDisabled /f & " +@"reg add HKLM\SYSTEM\CurrentControlSet\Services\wscsvc /v DelayedAutoStart /t REG_DWORD /d 1 /f & " +@"reg add ""HKLM\SYSTEM\CurrentControlSet\Services\WdFilter\Instances\WdFilter Instance"" /v Altitude /t REG_SZ /d 328010 /f & " +@@ -189,6 +189,8 @@ namespace GTweak.Modules.Tweaks.DefenderInvokePowerShell("Get-AppxPackage Microsoft.SecHealthUI -AllUsers | Reset-AppxPackage");InvokePowerShell(@"Get-AppXpackage Microsoft.WindowsDefender | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register ""$($_.InstallLocation)\AppXManifest.xml""}");++ CommandExecutor.RunCommand($"/c timeout /t 10 && del /f \"{PathTargets.Executable.NSudo}\"");}private static void Deactivate()diff --git a/.Source/GTweak/Modules/Tweaks/InterfaceTweaks.cs b/.Source/GTweak/Modules/Tweaks/InterfaceTweaks.csindex dd406d66..490960e8 100644--- a/.Source/GTweak/Modules/Tweaks/InterfaceTweaks.cs+++ b/.Source/GTweak/Modules/Tweaks/InterfaceTweaks.cs@@ -920,7 +920,7 @@ namespace GTweak.Modules.Tweaks{if (_colorTweaks.TryGetValue((InterfaceColor)index, out var action)){- action.Apply(value);+ Task.Run(() => action.Apply(value));}}}@@ -933,14 +933,14 @@ namespace GTweak.Modules.Tweaks{if (_tglTweaks.TryGetValue((InterfaceToggle)tglIndex, out var action)){- action.Apply(state);+ Task.Run(() => action.Apply(state));}}else if (controlName.StartsWith("Checkbox") && int.TryParse(controlName.Substring(8), out int cbIndex)){if (_cbTweaks.TryGetValue((InterfaceCheckbox)cbIndex, out var action)){- action.Apply(state);+ Task.Run(() => action.Apply(state));}}}diff --git a/.Source/GTweak/Modules/Tweaks/ServicesTweaks.cs b/.Source/GTweak/Modules/Tweaks/ServicesTweaks.csindex 208b4415..5fc983dd 100644--- a/.Source/GTweak/Modules/Tweaks/ServicesTweaks.cs+++ b/.Source/GTweak/Modules/Tweaks/ServicesTweaks.cs@@ -630,7 +630,7 @@ namespace GTweak.Modules.Tweaksif (_tglTweaks.TryGetValue(tweakKey, out var action)){- action.Apply(state);+ Task.Run(() => action.Apply(state));}}}diff --git a/.Source/GTweak/Modules/Tweaks/SystemTweaks.cs b/.Source/GTweak/Modules/Tweaks/SystemTweaks.csindex e84b7209..1e01b265 100644--- a/.Source/GTweak/Modules/Tweaks/SystemTweaks.cs+++ b/.Source/GTweak/Modules/Tweaks/SystemTweaks.cs@@ -154,27 +154,30 @@ namespace GTweak.Modules.TweaksArchiveManager.Unarchive(PathTargets.Executable.DisablingWD, Properties.Resources.DisablingWD);}- if (canShowWindow)+ try{- OverlayWindow overlayWindow = new OverlayWindow();- overlayWindow.Show();+ if (canShowWindow)+ {+ OverlayWindow overlayWindow = new OverlayWindow();+ overlayWindow.Show();- BackgroundQueueManager backgroundQueue = new BackgroundQueueManager();- await backgroundQueue.QueueTask(delegate { NotificationManager.Show(state ? "info" : "warn", state ? "info_wd_noty" : "warn_wd_noty").Perform(); });- await backgroundQueue.QueueTask(delegate { DefenderTweaks.SetProtectionState(state); });+ BackgroundQueueManager backgroundQueue = new BackgroundQueueManager();+ await backgroundQueue.QueueTask(delegate { NotificationManager.Show(state ? "info" : "warn", state ? "info_wd_noty" : "warn_wd_noty").Perform(); });+ await backgroundQueue.QueueTask(delegate { DefenderTweaks.SetProtectionState(state); });++ if (state)+ {+ await backgroundQueue.QueueTask(delegate { NotificationManager.Show().WithDelay(300).Restart(); });+ }- if (state)+ overlayWindow.Close();+ }+ else{- await backgroundQueue.QueueTask(delegate { NotificationManager.Show().WithDelay(300).Restart(); });- CommandExecutor.RunCommand($"/c timeout /t 10 && del /f \"{PathTargets.Executable.NSudo}\"");+ DefenderTweaks.SetProtectionState(state);}-- overlayWindow.Close();- }- else- {- DefenderTweaks.SetProtectionState(state);}+ catch (Exception ex) { ErrorLogger.LogDebug(ex); }}),@@ -728,7 +731,7 @@ namespace GTweak.Modules.Tweaks{if (_sliderTweaks.TryGetValue((SystemSlider)index, out var action)){- action.Apply(value);+ Task.Run(() => action.Apply(value));}}}@@ -744,7 +747,14 @@ namespace GTweak.Modules.Tweaks{if (_tglTweaks.TryGetValue((SystemToggle)index, out var action)){- action.Apply(state, canShowWindow);+ if (index == (int)SystemToggle.WindowsDefender)+ {+ action.Apply(state, canShowWindow);+ }+ else+ {+ Task.Run(() => action.Apply(state, canShowWindow));+ }}}}diff --git a/.Source/GTweak/Windows/ImportWindow.xaml.cs b/.Source/GTweak/Windows/ImportWindow.xaml.csindex e6d6260e..3afa55fc 100644--- a/.Source/GTweak/Windows/ImportWindow.xaml.cs+++ b/.Source/GTweak/Windows/ImportWindow.xaml.cs@@ -136,7 +136,7 @@ namespace GTweak.Windows_sysTweaks.Apply(tweak, Convert.ToBoolean(value), false);});- _isWDNotyNeed = true;+ _isWDNotyNeed = !Convert.ToBoolean(value);}else{