From 1cd580fcd2536270ce8e5c0f8679f576edf8069e Mon Sep 17 00:00:00 2001 From: Nodir Temirkhodjaev Date: Sun, 31 Dec 2023 13:31:16 +0300 Subject: [PATCH] UI: Remove Global Windows Explorer integration on Uninstall --- src/ui/fortmanager.cpp | 2 ++ src/ui/util/startuputil.cpp | 7 +++++++ src/ui/util/startuputil.h | 2 ++ 3 files changed, 11 insertions(+) diff --git a/src/ui/fortmanager.cpp b/src/ui/fortmanager.cpp index 59300e67..56c2f1f6 100644 --- a/src/ui/fortmanager.cpp +++ b/src/ui/fortmanager.cpp @@ -245,6 +245,8 @@ void FortManager::uninstall() StartupUtil::setAutoRunMode(StartupUtil::StartupDisabled); // Remove auto-run StartupUtil::setServiceInstalled(false); // Uninstall service StartupUtil::setExplorerIntegrated(false); // Remove Windows Explorer integration + StartupUtil::clearGlobalExplorerIntegrated(); // COMPAT: Remove Global Windows Explorer + // integration DriverCommon::provUnregister(); // Unregister booted provider } diff --git a/src/ui/util/startuputil.cpp b/src/ui/util/startuputil.cpp index d13358ac..b89bf597 100644 --- a/src/ui/util/startuputil.cpp +++ b/src/ui/util/startuputil.cpp @@ -298,6 +298,13 @@ void StartupUtil::setExplorerIntegrated(bool integrate) } } +void StartupUtil::clearGlobalExplorerIntegrated() +{ + RegKey regShell(RegKey::HKLM, regShellMenu, RegKey::DefaultReadWrite); + + regShell.removeRecursively(APP_NAME); +} + QString StartupUtil::registryPasswordHash() { const RegKey regApp(RegKey::HKLM, R"(SOFTWARE)"); diff --git a/src/ui/util/startuputil.h b/src/ui/util/startuputil.h index 50a371b9..ffc1872e 100644 --- a/src/ui/util/startuputil.h +++ b/src/ui/util/startuputil.h @@ -22,6 +22,8 @@ public: static bool isExplorerIntegrated(); static void setExplorerIntegrated(bool integrate); + static void clearGlobalExplorerIntegrated(); + static QString registryPasswordHash(); static void setRegistryPasswordHash(const QString &passwordHash);