]> git.sur5r.net Git - minitube/blob - lib/updater/src/impl/runinstaller.h
New upstream version 3.8
[minitube] / lib / updater / src / impl / runinstaller.h
1 #ifndef UPDATER_IMPL_RUNINSTALLER_H
2 #define UPDATER_IMPL_RUNINSTALLER_H
3
4 #include <QtCore>
5
6 #include "installer.h"
7
8 namespace updater {
9
10 /**
11  * Installer implementation that executes a command with arguments
12  */
13 class RunInstaller : public Installer {
14     Q_OBJECT
15
16 public:
17     RunInstaller();
18     void setCommand(const QString &value) { command = value; }
19     void setArguments(const QStringList &value) { arguments = value; };
20     /**
21      * Currently supported on Linux only using PackageKit (pkexec)
22      */
23     void setRunAsAdmin(bool value) { runAsAdmin = value; }
24     /**
25      * This will cause the update process to run while the app is still running. Then the app will
26      * self-restart.
27      */
28     void setAutoRestart(bool value) { autoRestart = value; }
29
30     void setRelaunchArguments(const QStringList &value) { autoRestartArguments = value; }
31
32     void start(const QString &filename);
33
34 private:
35     QString command;
36     QStringList arguments;
37     bool runAsAdmin = false;
38     bool autoRestart = false;
39     QStringList autoRestartArguments;
40 };
41
42 } // namespace updater
43
44 #endif // UPDATER_IMPL_RUNINSTALLER_H