-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
runinstaller.h
50 lines (38 loc) · 1.27 KB
/
runinstaller.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef UPDATER_IMPL_RUNINSTALLER_H
#define UPDATER_IMPL_RUNINSTALLER_H
#include <QtCore>
#include "installer.h"
namespace updater {
/**
* Installer implementation that executes a command with arguments
*/
class RunInstaller : public Installer {
Q_OBJECT
public:
RunInstaller();
void setCommand(const QString &value) { command = value; }
void setArguments(const QStringList &value) { arguments = value; };
/**
* Currently supported on Linux only using pkexec. Does not work together with fork.
*/
void setRunAsAdmin(bool value) { runAsAdmin = value; }
/**
* This will cause the update process to run while the app is still running. Then the app will
* self-restart. Does not work together with fork.
*/
void setAutoRestart(bool value) { autoRestart = value; }
/**
* When true the update process will be detached from the app process (i.e. the app can quit
* without killing it). Does not work together with autoRestart.
*/
void setFork(bool value) { fork = value; }
void start(const QString &filename);
private:
QString command;
QStringList arguments;
bool runAsAdmin = false;
bool autoRestart = false;
bool fork = false;
};
} // namespace updater
#endif // UPDATER_IMPL_RUNINSTALLER_H