mirror of
https://github.com/tnodir/fort
synced 2024-11-15 08:35:08 +00:00
UI: Options: Add "Check password on Uninstall" flag
This commit is contained in:
parent
c6e1bdc1b0
commit
e1d0c281ef
@ -1321,6 +1321,12 @@ void ConfManager::saveExtFlags(const IniOptions &ini)
|
||||
if (ini.explorerIntegratedSet()) {
|
||||
StartupUtil::setExplorerIntegrated(ini.explorerIntegrated());
|
||||
}
|
||||
|
||||
// Check password on Uninstall
|
||||
if (ini.checkPasswordOnUninstallSet() || ini.hasPasswordSet()) {
|
||||
StartupUtil::setRegistryPasswordHash(
|
||||
ini.checkPasswordOnUninstall() ? IoC<FortSettings>()->passwordHash() : QString());
|
||||
}
|
||||
}
|
||||
|
||||
void ConfManager::saveTasksByIni(const IniOptions &ini)
|
||||
|
@ -22,6 +22,7 @@ public:
|
||||
void setLogConsole(bool v) { setValue("base/console", v); }
|
||||
|
||||
bool hasPasswordSet() const { return contains("base/hasPassword_"); }
|
||||
|
||||
bool hasPassword() const { return valueBool("base/hasPassword_"); }
|
||||
void setHasPassword(bool v) { setValue("base/hasPassword_", v); }
|
||||
|
||||
@ -42,6 +43,11 @@ public:
|
||||
bool noServiceControl() const { return valueBool("protect/noServiceControl"); }
|
||||
void setNoServiceControl(bool v) { setValue("protect/noServiceControl", v); }
|
||||
|
||||
bool checkPasswordOnUninstallSet() const
|
||||
{
|
||||
return contains("protect/checkPasswordOnUninstall");
|
||||
}
|
||||
|
||||
bool checkPasswordOnUninstall() const { return valueBool("protect/checkPasswordOnUninstall"); }
|
||||
void setCheckPasswordOnUninstall(bool v) { setValue("protect/checkPasswordOnUninstall", v); }
|
||||
|
||||
|
@ -269,6 +269,22 @@ void StartupUtil::setExplorerIntegrated(bool integrate)
|
||||
}
|
||||
}
|
||||
|
||||
void StartupUtil::setRegistryPasswordHash(const QString &passwordHash)
|
||||
{
|
||||
const bool isAdding = !passwordHash.isEmpty();
|
||||
|
||||
RegKey regApp(RegKey::HKLM, R"(SOFTWARE)",
|
||||
isAdding ? RegKey::DefaultCreate : RegKey::DefaultReadWrite);
|
||||
|
||||
RegKey reg(regApp, APP_NAME, RegKey::DefaultCreate);
|
||||
|
||||
if (isAdding) {
|
||||
reg.setValue("passwordHash", passwordHash);
|
||||
} else {
|
||||
reg.removeValue("passwordHash");
|
||||
}
|
||||
}
|
||||
|
||||
void StartupUtil::setPortable(bool portable)
|
||||
{
|
||||
const QString readmePortablePath = FileUtil::nativeAppBinLocation() + "/README.portable";
|
||||
|
@ -21,6 +21,8 @@ public:
|
||||
static bool isExplorerIntegrated();
|
||||
static void setExplorerIntegrated(bool integrate);
|
||||
|
||||
static void setRegistryPasswordHash(const QString &passwordHash);
|
||||
|
||||
static void setPortable(bool portable);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user