mirror of
https://github.com/tnodir/fort
synced 2024-11-15 07:06:08 +00:00
Installer: Add option "Block access to network when Fort Firewall is not running".
This commit is contained in:
parent
cb9897ede5
commit
ebf3f2ddeb
@ -32,20 +32,25 @@ SolidCompression=yes
|
|||||||
[Languages]
|
[Languages]
|
||||||
Name: "english"; MessagesFile: "compiler:Default.isl"
|
Name: "english"; MessagesFile: "compiler:Default.isl"
|
||||||
|
|
||||||
|
[Tasks]
|
||||||
|
Name: "provBoot"; Description: "Block access to network when Fort Firewall is not running"; Flags: unchecked
|
||||||
|
|
||||||
[Files]
|
[Files]
|
||||||
Source: ".\build\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
|
Source: ".\build\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
|
||||||
|
|
||||||
[Icons]
|
[Icons]
|
||||||
; Start menu shortcut
|
; Start menu shortcut
|
||||||
Name: "{group}\{#APP_NAME}"; Filename: "{app}\{#APP_EXE_NAME}"; IconFilename: "{app}\fort.ico"
|
Name: "{group}\{#APP_NAME}"; Filename: "{app}\{#APP_EXE_NAME}"; IconFilename: "{app}\fort.ico"
|
||||||
; Unistaller shortcut
|
; Uninstaller shortcut
|
||||||
Name: "{group}\{cm:UninstallProgram,{#APP_NAME}}"; Filename: "{uninstallexe}"; IconFilename: "{app}\fort.ico"
|
Name: "{group}\{cm:UninstallProgram,{#APP_NAME}}"; Filename: "{uninstallexe}"; IconFilename: "{app}\fort.ico"
|
||||||
|
|
||||||
[Run]
|
[Run]
|
||||||
|
Filename: "{app}\{#APP_EXE_NAME}"; Parameters: "-b=1"; Description: "Provider boot"; Flags: runascurrentuser; Tasks: provBoot
|
||||||
Filename: "{app}\driver\scripts\install.bat"; Description: "Install driver"; Flags: runascurrentuser
|
Filename: "{app}\driver\scripts\install.bat"; Description: "Install driver"; Flags: runascurrentuser
|
||||||
|
|
||||||
[UninstallRun]
|
[UninstallRun]
|
||||||
Filename: "{app}\driver\scripts\uninstall.bat"; Flags: runascurrentuser
|
Filename: "{app}\driver\scripts\uninstall.bat"; Flags: runascurrentuser
|
||||||
|
Filename: "{app}\{#APP_EXE_NAME}"; Parameters: "-b=0"; Flags: runascurrentuser
|
||||||
|
|
||||||
[UninstallDelete]
|
[UninstallDelete]
|
||||||
Type: filesandordirs; Name: "{app}"
|
Type: filesandordirs; Name: "{app}"
|
||||||
|
@ -11,7 +11,9 @@
|
|||||||
|
|
||||||
FortSettings::FortSettings(const QStringList &args,
|
FortSettings::FortSettings(const QStringList &args,
|
||||||
QObject *parent) :
|
QObject *parent) :
|
||||||
QObject(parent)
|
QObject(parent),
|
||||||
|
m_hasProvBoot(false),
|
||||||
|
m_provBoot(false)
|
||||||
{
|
{
|
||||||
processArguments(args);
|
processArguments(args);
|
||||||
setupIni();
|
setupIni();
|
||||||
@ -37,9 +39,10 @@ void FortSettings::processArguments(const QStringList &args)
|
|||||||
{
|
{
|
||||||
QCommandLineParser parser;
|
QCommandLineParser parser;
|
||||||
|
|
||||||
const QCommandLineOption bootOption(
|
const QCommandLineOption provBootOption(
|
||||||
"boot", "Block access to network when Fort Firewall is not running.");
|
QStringList() << "b" << "boot",
|
||||||
parser.addOption(bootOption);
|
"Block access to network when Fort Firewall is not running.", "boot");
|
||||||
|
parser.addOption(provBootOption);
|
||||||
|
|
||||||
const QCommandLineOption profileOption(
|
const QCommandLineOption profileOption(
|
||||||
QStringList() << "p" << "profile",
|
QStringList() << "p" << "profile",
|
||||||
@ -51,7 +54,10 @@ void FortSettings::processArguments(const QStringList &args)
|
|||||||
|
|
||||||
parser.process(args);
|
parser.process(args);
|
||||||
|
|
||||||
m_boot = parser.isSet(bootOption);
|
m_hasProvBoot = parser.isSet(provBootOption);
|
||||||
|
if (m_hasProvBoot) {
|
||||||
|
m_provBoot = QVariant(parser.value(provBootOption)).toBool();
|
||||||
|
}
|
||||||
|
|
||||||
m_profilePath = parser.value(profileOption);
|
m_profilePath = parser.value(profileOption);
|
||||||
if (m_profilePath.isEmpty()) {
|
if (m_profilePath.isEmpty()) {
|
||||||
|
@ -21,7 +21,8 @@ public:
|
|||||||
explicit FortSettings(const QStringList &args,
|
explicit FortSettings(const QStringList &args,
|
||||||
QObject *parent = nullptr);
|
QObject *parent = nullptr);
|
||||||
|
|
||||||
bool boot() const { return m_boot; }
|
bool hasProvBoot() const { return m_hasProvBoot; }
|
||||||
|
bool provBoot() const { return m_provBoot; }
|
||||||
|
|
||||||
bool debug() const { return iniBool("base/debug"); }
|
bool debug() const { return iniBool("base/debug"); }
|
||||||
void setDebug(bool on) { setIniValue("base/debug", on); }
|
void setDebug(bool on) { setIniValue("base/debug", on); }
|
||||||
@ -75,7 +76,8 @@ private:
|
|||||||
static QString startupShortcutPath();
|
static QString startupShortcutPath();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint m_boot : 1;
|
uint m_hasProvBoot : 1;
|
||||||
|
uint m_provBoot : 1;
|
||||||
|
|
||||||
QString m_profilePath;
|
QString m_profilePath;
|
||||||
|
|
||||||
|
@ -9,8 +9,6 @@
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
OsUtil::createGlobalMutex(APP_NAME);
|
|
||||||
|
|
||||||
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||||
|
|
||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
@ -21,11 +19,15 @@ int main(int argc, char *argv[])
|
|||||||
FortSettings fortSettings(qApp->arguments());
|
FortSettings fortSettings(qApp->arguments());
|
||||||
|
|
||||||
// Register booted provider and exit
|
// Register booted provider and exit
|
||||||
if (fortSettings.boot()) {
|
if (fortSettings.hasProvBoot()) {
|
||||||
FortCommon::provUnregister();
|
FortCommon::provUnregister();
|
||||||
return FortCommon::provRegister(true);
|
return fortSettings.provBoot()
|
||||||
|
? FortCommon::provRegister(true) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// To check running instance
|
||||||
|
OsUtil::createGlobalMutex(APP_NAME);
|
||||||
|
|
||||||
FortManager fortManager(&fortSettings);
|
FortManager fortManager(&fortSettings);
|
||||||
|
|
||||||
// Error: Cannot open the driver device
|
// Error: Cannot open the driver device
|
||||||
|
Loading…
Reference in New Issue
Block a user