mirror of
https://github.com/tnodir/fort
synced 2024-11-15 06:35:23 +00:00
UI: FortManager: Refactor driver/service setup on startup
This commit is contained in:
parent
bad901842f
commit
4466fee813
@ -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>();
|
||||
|
@ -50,7 +50,6 @@ private:
|
||||
void checkRemoveDriver();
|
||||
|
||||
void checkReinstallDriver();
|
||||
void checkDriverOpened();
|
||||
void checkStartService();
|
||||
|
||||
void setupEnvManager();
|
||||
|
Loading…
Reference in New Issue
Block a user