From 288b55529c1ec7982a06b33348d2d3755ce805d8 Mon Sep 17 00:00:00 2001 From: Nodir Temirkhodjaev Date: Sat, 27 Mar 2021 13:40:13 +0300 Subject: [PATCH] UI: Simplify booted provider's uninstalling. --- deploy/FortFirewall.iss | 2 +- src/ui/fortsettings.cpp | 9 --------- src/ui/fortsettings.h | 2 -- src/ui/main.cpp | 12 ++++++------ 4 files changed, 7 insertions(+), 18 deletions(-) diff --git a/deploy/FortFirewall.iss b/deploy/FortFirewall.iss index 4caabeb2..a17ab976 100644 --- a/deploy/FortFirewall.iss +++ b/deploy/FortFirewall.iss @@ -74,7 +74,7 @@ Filename: "https://support.microsoft.com/en-us/help/2977003/the-latest-supported [UninstallRun] Filename: "{app}\driver\scripts\uninstall.bat"; RunOnceId: "DelDriver"; Flags: runascurrentuser -Filename: "{#APP_EXE}"; Parameters: "-b=0"; RunOnceId: "DelProvider"; Flags: runascurrentuser +Filename: "{#APP_EXE}"; Parameters: "-u"; RunOnceId: "DelProvider"; Flags: runascurrentuser [InstallDelete] Type: filesandordirs; Name: "{app}\driver" diff --git a/src/ui/fortsettings.cpp b/src/ui/fortsettings.cpp index bf737b27..7aca7cb5 100644 --- a/src/ui/fortsettings.cpp +++ b/src/ui/fortsettings.cpp @@ -27,7 +27,6 @@ FortSettings::FortSettings(QObject *parent) : m_iniExists(false), m_isPortable(false), m_noCache(false), - m_hasProvBoot(false), m_bulkUpdating(false), m_bulkIniChanged(false) { @@ -91,11 +90,6 @@ void FortSettings::processArguments(const QStringList &args, EnvManager *envMana { QCommandLineParser parser; - const QCommandLineOption provBootOption(QStringList() << "b" - << "boot", - "Unblock access to network when Fort Firewall is not running.", "boot"); - parser.addOption(provBootOption); - const QCommandLineOption profileOption(QStringList() << "p" << "profile", "Directory to store settings.", "profile"); @@ -138,9 +132,6 @@ void FortSettings::processArguments(const QStringList &args, EnvManager *envMana m_noCache = true; } - // Provider Boot - m_hasProvBoot = parser.isSet(provBootOption); - // Default Language if (parser.isSet(langOption)) { m_defaultLanguage = parser.value(langOption); diff --git a/src/ui/fortsettings.h b/src/ui/fortsettings.h index 69db9dd8..e4bb5c6d 100644 --- a/src/ui/fortsettings.h +++ b/src/ui/fortsettings.h @@ -68,7 +68,6 @@ public: bool isPortable() const { return m_isPortable; } bool noCache() const { return m_noCache; } - bool hasProvBoot() const { return m_hasProvBoot; } bool debug() const { return iniBool("base/debug"); } void setDebug(bool on) { setIniValue("base/debug", on); } @@ -329,7 +328,6 @@ private: bool m_iniExists : 1; bool m_isPortable : 1; bool m_noCache : 1; - bool m_hasProvBoot : 1; bool m_bulkUpdating : 1; bool m_bulkIniChanged : 1; diff --git a/src/ui/main.cpp b/src/ui/main.cpp index d2950dcf..c0608576 100644 --- a/src/ui/main.cpp +++ b/src/ui/main.cpp @@ -21,6 +21,12 @@ int main(int argc, char *argv[]) { + // Uninstall: Unregister booted provider and exit + if (argc > 1 && !strcmp(argv[1], "-u")) { + FortCommon::provUnregister(); + return 0; + } + FortSettings fortSettings; // Process global settings required before QApplication costruction @@ -42,12 +48,6 @@ int main(int argc, char *argv[]) // Initialize with command line arguments fortSettings.initialize(QCoreApplication::arguments(), &envManager); - // Unregister booted provider and exit - if (fortSettings.hasProvBoot()) { - FortCommon::provUnregister(); - return 0; - } - #ifdef USE_CONTROL_COMMANDS ControlManager controlManager(QApplication::applicationName(), fortSettings.controlCommand());