UI: FortManager: Refactor driver/service setup on startup

This commit is contained in:
Nodir Temirkhodjaev 2024-06-06 11:31:48 +03:00
parent bad901842f
commit 4466fee813
2 changed files with 4 additions and 19 deletions

View File

@ -192,12 +192,10 @@ void FortManager::initialize()
setupServiceInfoManager();
checkReinstallDriver();
setupDriver();
loadConf();
checkDriverOpened();
checkStartService();
setupDriver();
loadConf();
}
void FortManager::setupThreadPool()
@ -298,7 +296,7 @@ bool FortManager::installDriver()
const bool hasService = IoC<FortSettings>()->hasService();
if (hasService) {
StartupUtil::stopService();
StartupUtil::stopService(/*restarting=*/true);
} else {
closeDriver();
}
@ -377,18 +375,6 @@ void FortManager::checkReinstallDriver()
}
}
void FortManager::checkDriverOpened()
{
if (IoC<DriverManager>()->isDeviceOpened())
return;
const auto settings = IoC<FortSettings>();
if (!settings->isService() && canInstallDriver(settings)) {
installDriver();
}
}
void FortManager::checkStartService()
{
const auto settings = IoC<FortSettings>();

View File

@ -50,7 +50,6 @@ private:
void checkRemoveDriver();
void checkReinstallDriver();
void checkDriverOpened();
void checkStartService();
void setupEnvManager();