Skip to content

Commit 185609b

Browse files
committed
wip backends
1 parent e9fc852 commit 185609b

File tree

9 files changed

+177
-17
lines changed

9 files changed

+177
-17
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The Qt auto updater library is a library to automatically check for updates and
1010
[![Appveyor Build status](https://ci.appveyor.com/api/projects/status/5iw2byrvnsdfytxv/branch/master?svg=true)](https://ci.appveyor.com/project/Skycoder42/qtautoupdater/branch/master)
1111
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/a5b2e3cc66c644869515d2f3a5c3ff49)](https://www.codacy.com/app/Skycoder42/QtAutoUpdater)
1212

13-
> The library was recently updated to version 3.0. That release differes strongly from 2.*. Use the [Porting Guide](port_to_3_0.md) to get your application from 2.* to 3.0!
13+
> The library was recently updated to version 3.0. That release differes strongly from 2.1. Use the [Porting Guide](port_to_3_0.md) to get your application from 2.1 to 3.0!
1414
1515
## Features
1616
### Core Library

doc/backends.dox

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
/*!
2+
@page qtautoupdater_backends Backends overview
3+
4+
@brief An overview of the avialable backends
5+
6+
This page lists the different backends that are available, together with their features and how to use them. Refer
7+
to this page if you want to know details about a particular plugin.
8+
9+
@tableofcontents
10+
11+
@section qtautoupdater_backends_types Special Types
12+
This pages uses a few special types, which wrap different formats in which you can provide the arguments, mapped to
13+
a certain Qt type. Those are:
14+
15+
- `list`: is processed by QtAutoUpdater::UpdaterBackend::readStringList. If a symbol is specified in parenthesis
16+
(e.g. `(;)`), that symbol is used as seperator instead of the default `,`
17+
- `pathList`: is processed by QtAutoUpdater::ProcessBackend::readPathList
18+
- `argList`: is processed by QtAutoUpdater::ProcessBackend::readArgumentList
19+
20+
@section qtautoupdater_backends_qtifw Qt Installer Framework
21+
The QtIFW-Plugin allows you to use a maintenancetool of an
22+
[Qt Installer Framework](https://doc.qt.io/qtinstallerframework/index.html) installation to check for updates and to
23+
install them. It requires that an application was installed using a QtIFW installer that uses an online repository
24+
for the installation. The plugin focusses around the maintenancetool that is deployed with every QtIFW based
25+
installation.
26+
27+
@subsection qtautoupdater_backends_qtifw_features Features
28+
- QtAutoUpdater::UpdaterBackend::Feature::CheckUpdates
29+
- QtAutoUpdater::UpdaterBackend::Feature::TriggerInstall
30+
- On linux and macOs:
31+
- QtAutoUpdater::UpdaterBackend::Feature::ParallelTrigger
32+
33+
@subsection qtautoupdater_backends_qtifw_config Configuration
34+
Parameter | Type | Default Value | Description
35+
--------------------|-----------------------------------------------|---------------|-------------
36+
backend | QString | `"qtifw"` | The id of the backend. Must be that value
37+
path | QString | _special_ | The path to the maintenancetool that is used by the backend
38+
extraCheckArgs | @ref qtautoupdater_backends_types "argList" | _empty_ | Additional arguments to be passed to the maintenancetool when checking for updates
39+
silent | bool | `false` | Run the installer silently in the background
40+
extraInstallArgs | @ref qtautoupdater_backends_types "argList" | _empty_ | Additional arguments to be passed to the maintenancetool when installing updates
41+
runAsAdmin | bool | _special_ | Specifies, if the maintenancetool should be executed with elevated rights, when running it as installer
42+
43+
The default value of the `path` depends on the platform beeing used. It is the path, where to expect the
44+
maintenancetool, assuming the current application is the primary binary that was installed using QtIFW.
45+
46+
The default value of the `runAsAdmin` depends of the result of
47+
QtAutoUpdater::AdminAuthoriser::needsAdminPermission(path). The path here is the maintenancetool as specified in the
48+
settings. While this may work for most systems, it is recommended to always explicitly set this parameter to avoid
49+
problems.
50+
51+
@section qtautoupdater_backends_pkgkit PackageKit
52+
The plugin based on [PackageKit](https://www.freedesktop.org/software/PackageKit/) is a general plugin that can work
53+
with any package managing system that supports PackageKit. This includes most popular linux distros like Arch,
54+
Debian or Fedora. Check the website to see if your distro supports PackageKit and how to configure it properly.
55+
56+
On supported platforms, this plugin can be used to check for updates for certain packages and even install updates,
57+
if available.
58+
59+
@subsection qtautoupdater_backends_pkgkit_features Features
60+
- QtAutoUpdater::UpdaterBackend::Feature::CheckUpdates
61+
- QtAutoUpdater::UpdaterBackend::Feature::CheckProgress
62+
- QtAutoUpdater::UpdaterBackend::Feature::PerformInstall
63+
64+
@subsection qtautoupdater_backends_pkgkit_config Configuration
65+
Parameter | Type | Default Value | Description
66+
--------------------|-----------------------------------------------|-------------------|-------------
67+
backend | QString | `"packagekit"` | The id of the backend. Must be that value
68+
packages | @ref qtautoupdater_backends_types "list (;)" | _required_ | The list of packages that your application consists of
69+
70+
To use the plugin correctly, you **must** specify the `packages` parameter. It should contain a _semicolon_ seperated
71+
list of all the packages that make your application (e.g. the primary package, extensions, language packages etc.).
72+
When checking for updates, only updates for the packages listed here are considered by the plugin. You must always
73+
enter the packages by the full name. Wildcards are not possible for now.
74+
75+
@section qtautoupdater_backends_choco Chocolatey
76+
This plugin uses the [Chocolatey](https://chocolatey.org/) package manager for windows to check for updates and
77+
install them if requested. It is based around the `choco` executable and supports the
78+
[Chocolatey GUI](https://chocolatey.org/packages/ChocolateyGUI) as GUI to be shown to install updates.
79+
80+
@subsection qtautoupdater_backends_choco_features Features
81+
- QtAutoUpdater::UpdaterBackend::Feature::CheckUpdates
82+
- If Chocolatey GUI is installed
83+
- QtAutoUpdater::UpdaterBackend::Feature::TriggerInstall
84+
85+
@subsection qtautoupdater_backends_choco_config Configuration
86+
Parameter | Type | Default Value | Description
87+
--------------------|-----------------------------------------------|---------------------------------------------------------------|-------------
88+
backend | QString | `"chocolatey"` | The id of the backend. Must be that value
89+
packages | @ref qtautoupdater_backends_types "list" | _required_ | The list of packages that your application consists of
90+
path | @ref qtautoupdater_backends_types "pathList" | _system-path_ | A list of paths where to search for the `choco` executable. If not specified, the `PATH` environment variable is used
91+
extraCheckArgs | @ref qtautoupdater_backends_types "argList" | _empty_ | Additional arguments to be passed to choco when checking for updates
92+
guiExePath | QString | `"C:\Program Files (x86)\Chocolatey GUI\ChocolateyGui.exe"` | The path to the Chocolatey GUI binary
93+
extraGuiArgs | @ref qtautoupdater_backends_types "argList" | _empty_ | Additional arguments to be passed to Chocolatey GUI when installing updates
94+
runAsAdmin | bool | `true` | Specifies, if the Chocolatey GUI should be executed with elevated rights
95+
96+
To use the plugin correctly, you **must** specify the `packages` parameter. It should contain a comma seperated
97+
list of all the packages that make your application, which is typically just a single package name. When checking
98+
for updates, only updates for the packages listed here are considered by the plugin. You must always enter the
99+
packages by the full name. Wildcards are not possible for now.
100+
101+
@section qtautoupdater_backends_brew Homebrew
102+
The plugin uses the [Homebrew](https://brew.sh/) package manager for macOs to check for updates and install them.
103+
It can install updates in parallel, but also supports launching [Cakebrew](https://www.cakebrew.com/) as external
104+
install tool, if it is installed.
105+
106+
@subsection qtautoupdater_backends_brew_features Features
107+
- QtAutoUpdater::UpdaterBackend::Feature::CheckUpdates
108+
- QtAutoUpdater::UpdaterBackend::Feature::PerformInstall
109+
- If Cakebrew is installed:
110+
- QtAutoUpdater::UpdaterBackend::Feature::TriggerInstall
111+
- QtAutoUpdater::UpdaterBackend::Feature::ParallelTrigger
112+
113+
@subsection qtautoupdater_backends_brew_config Configuration
114+
Parameter | Type | Default Value | Description
115+
--------------------|-----------------------------------------------|---------------|-------------
116+
backend | QString | `"homebrew"` | The id of the backend. Must be that value
117+
packages | @ref qtautoupdater_backends_types "list" | _required_ | The list of packages that your application consists of
118+
cask | bool | `false` | The package is a cask instead of a normal homebrew package
119+
path | @ref qtautoupdater_backends_types "pathList" | _system-path_ | A list of paths where to search for the `brew` executable. If not specified, the `PATH` environment variable is used
120+
extraUpdateArgs | @ref qtautoupdater_backends_types "argList" | _empty_ | Additional arguments to be passed to `brew update` when checking for updates
121+
extraOutdatedArgs | @ref qtautoupdater_backends_types "argList" | _empty_ | Additional arguments to be passed to `brew outdated` when checking for updates
122+
extraInstallArgs | @ref qtautoupdater_backends_types "argList" | _empty_ | Additional arguments to be passed to `brew install` when installing updates
123+
cakebrewPath | @ref qtautoupdater_backends_types "pathList" | _system-apps_ | A list of paths where to search for the `Cakebrew` app bundle. If not specified, the systems standard app locations (QStandardPaths::ApplicationsLocation) are searched
124+
extraCakebrewArgs | @ref qtautoupdater_backends_types "argList" | _empty_ | Additional arguments to be passed to Cakebrew when installing updates
125+
126+
To use the plugin correctly, you **must** specify the `packages` parameter. It should contain a comma seperated
127+
list of all the packages that make your application, which is typically just a single package name. When checking
128+
for updates, only updates for the packages listed here are considered by the plugin. You must always enter the
129+
packages by the full name. Wildcards are not possible for now. If your package is a cask, set the variable.
130+
131+
@section qtautoupdater_backends_play Google Playstore
132+
When deploying your app via the [Google Playstore](https://play.google.com/store) for Android, you can use this
133+
plugin to check for updates and even install them. This works fine for most phones, but be aware that some might
134+
have disabled various APIs required for this plugin to work.
135+
136+
@subsection qtautoupdater_backends_play_features Features
137+
- QtAutoUpdater::UpdaterBackend::Feature::CheckUpdates
138+
- QtAutoUpdater::UpdaterBackend::Feature::PerformInstall
139+
- QtAutoUpdater::UpdaterBackend::Feature::TriggerInstall
140+
- QtAutoUpdater::UpdaterBackend::Feature::ParallelTrigger
141+
142+
@subsection qtautoupdater_backends_play_config Configuration
143+
Parameter | Type | Default Value | Description
144+
--------------------|-----------|---------------|-------------
145+
backend | QString | `"playstore"` | The id of the backend. Must be that value
146+
debug | bool | `false` | If set to true, the [FakeAppUpdateManager](https://developer.android.com/reference/com/google/android/play/core/appupdate/testing/FakeAppUpdateManager.html) is used to simulate an update installation
147+
autoResumeInstall | bool | _special_ | If enabled, the plugin will check if installations need to be continued on it's initialization and do so, if required.
148+
149+
The `autoResumeInstall` will be set to true by default if initialized from an activity. When run from the
150+
background, it is false instead.
151+
152+
@section qtautoupdater_backends_webquery Custom WebQuery backend
153+
This backend can be used if none of the other backends fit your distribution method. While it is recommended to
154+
create a custom plugin for such cases, for many variants this plugin suffices. It can query a webserver for
155+
JSON-encoded information about available updates, download a binary or update package of any kind and execute a
156+
selected binary to perform the update installation.
157+
*/

doc/doc.pro

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,6 @@ docInst1.CONFIG += no_check_exist
2020
docInst2.path = $$[QT_INSTALL_DOCS]
2121
docInst2.files = $$OUT_PWD/qtautoupdater
2222
INSTALLS += docInst1 docInst2
23+
24+
DISTFILES += \
25+
backends.dox

doc/updateinfo.dox

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ A data gadget that holds details about updates. It is used to present updates in
55
id, name and version are common to all backends, any additional information, like size, old versions,
66
etc. are different for each backend and stored within the data property.
77

8-
@sa @ref backends_TODO "Updater Backend Plugins"
8+
@sa @ref qtautoupdater_backends "Updater Backend Plugins"
99
*/
1010

1111
/*!
@@ -65,12 +65,12 @@ segments only.
6565
@default{`<empty map>`}
6666

6767
What this map contains depends fully on the backend and any additional information it may provide.
68-
Check the @ref backends_TODO "Updater Backend Plugins" documentation for more details.
68+
Check the @ref qtautoupdater_backends "Updater Backend Plugins" documentation for more details.
6969

7070
@accessors{
7171
@readAc{data()}
7272
@writeAc{setData()}
7373
}
7474

75-
@sa UpdateInfo::version, @ref backends_TODO "Updater Backend Plugins"
75+
@sa UpdateInfo::version, @ref qtautoupdater_backends "Updater Backend Plugins"
7676
*/

doc/updater.dox

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ feature set of the updater depends on the backend used, but all backends support
77
for updates.
88

99
@sa @ref index REAMDE.md, QtAutoUpdater::UpdaterBackend, Updater::features,
10-
@ref backends_TODO "Updater Backend Plugins"
10+
@ref qtautoupdater_backends "Updater Backend Plugins"
1111
*/
1212

1313
/*!
@@ -134,7 +134,7 @@ application. This only works if the updater lives long enough to catch the
134134
QCoreApplication::aboutToQuit signal! This means when creating an updater for a backend that may need
135135
to be run on exit, you should use either `qApp` or `nullptr` as parent for the updater.
136136

137-
@sa Updater::supportedUpdaterBackends, @ref backends_TODO "Updater Backend Plugins"
137+
@sa Updater::supportedUpdaterBackends, @ref qtautoupdater_backends "Updater Backend Plugins"
138138
*/
139139

140140
/*!
@@ -154,7 +154,7 @@ application. This only works if the updater lives long enough to catch the
154154
QCoreApplication::aboutToQuit signal! This means when creating an updater for a backend that may need
155155
to be run on exit, you should use either `qApp` or `nullptr` as parent for the updater.
156156

157-
@sa Updater::supportedUpdaterBackends, @ref backends_TODO "Updater Backend Plugins"
157+
@sa Updater::supportedUpdaterBackends, @ref qtautoupdater_backends "Updater Backend Plugins"
158158
*/
159159

160160
/*!
@@ -173,7 +173,7 @@ application. This only works if the updater lives long enough to catch the
173173
QCoreApplication::aboutToQuit signal! This means when creating an updater for a backend that may need
174174
to be run on exit, you should use either `qApp` or `nullptr` as parent for the updater.
175175

176-
@sa Updater::supportedUpdaterBackends, @ref backends_TODO "Updater Backend Plugins"
176+
@sa Updater::supportedUpdaterBackends, @ref qtautoupdater_backends "Updater Backend Plugins"
177177
*/
178178

179179
/*!
@@ -192,7 +192,7 @@ application. This only works if the updater lives long enough to catch the
192192
QCoreApplication::aboutToQuit signal! This means when creating an updater for a backend that may need
193193
to be run on exit, you should use either `qApp` or `nullptr` as parent for the updater.
194194

195-
@sa Updater::supportedUpdaterBackends, @ref backends_TODO "Updater Backend Plugins"
195+
@sa Updater::supportedUpdaterBackends, @ref qtautoupdater_backends "Updater Backend Plugins"
196196
*/
197197

198198
/*!
@@ -214,7 +214,7 @@ application. This only works if the updater lives long enough to catch the
214214
QCoreApplication::aboutToQuit signal! This means when creating an updater for a backend that may need
215215
to be run on exit, you should use either `qApp` or `nullptr` as parent for the updater.
216216

217-
@sa Updater::supportedUpdaterBackends, @ref backends_TODO "Updater Backend Plugins",
217+
@sa Updater::supportedUpdaterBackends, @ref qtautoupdater_backends "Updater Backend Plugins",
218218
UpdaterBackend::IConfigReader
219219
*/
220220

doc/updaterbackend.dox

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ details etc., it is recommended to use ProcessBackend instead, as it simplifies
1313
amount.
1414

1515
@sa UpdaterPlugin, ProcessBackend, ProcessBackend::features,
16-
@ref backends_TODO "Updater Backend Plugins"
16+
@ref qtautoupdater_backends "Updater Backend Plugins"
1717
*/
1818

1919
/*!

doc/updaterplugin.dox

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Q_PLUGIN_METADATA(IID QtAutoUpdater_UpdaterPlugin_iid FILE "my-backend.json")
1818
Q_INTERFACES(QtAutoUpdater::UpdaterPlugin)
1919
@endcode
2020

21-
@sa UpdaterBackend, #QtAutoUpdater_UpdaterPlugin_iid, @ref backends_TODO "Updater Backend Plugins"
21+
@sa UpdaterBackend, #QtAutoUpdater_UpdaterPlugin_iid, @ref qtautoupdater_backends "Updater Backend Plugins"
2222
*/
2323

2424
/*!

src/autoupdatercore/updater.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class Q_AUTOUPDATERCORE_EXPORT Updater : public QObject
112112
Q_INVOKABLE int scheduleUpdate(int delaySeconds, bool repeated = false);
113113
//! @copydoc Updater::scheduleUpdate(std::chrono::seconds, bool)
114114
template <typename TRep, typename TPeriod>
115-
int scheduleUpdate(const std::chrono::duration<TRep, TPeriod> &delay, bool repeated = false);
115+
int scheduleUpdate(const std::chrono::duration<TRep, TPeriod> &delaySeconds, bool repeated = false);
116116
//! Schedules an update for a specific timepoint
117117
Q_INVOKABLE int scheduleUpdate(const QDateTime &when);
118118
//! @copydoc Updater::scheduleUpdate(const QDateTime &)
@@ -170,10 +170,10 @@ public Q_SLOTS:
170170
};
171171

172172
template<typename TRep, typename TPeriod>
173-
int Updater::scheduleUpdate(const std::chrono::duration<TRep, TPeriod> &delay, bool repeated)
173+
int Updater::scheduleUpdate(const std::chrono::duration<TRep, TPeriod> &delaySeconds, bool repeated)
174174
{
175175
using namespace std::chrono;
176-
return scheduleUpdate(duration_cast<seconds>(delay), repeated);
176+
return scheduleUpdate(duration_cast<seconds>(delaySeconds), repeated);
177177
}
178178

179179
template<typename TClock, typename TDur>

src/imports/autoupdatercore/qmlautoupdatersingleton.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class QmlAutoUpdaterSingleton : public QObject
6464
* QCoreApplication::aboutToQuit signal! This means when creating an updater for a backend that may need
6565
* to be run on exit, you should use either `qApp` or `nullptr` as parent for the updater.
6666
*
67-
* @sa Updater::supportedUpdaterBackends, @ref backends_TODO "Updater Backend Plugins", Qt.labs.settings.Settings
67+
* @sa Updater::supportedUpdaterBackends, @ref qtautoupdater_backends "Updater Backend Plugins", Qt.labs.settings.Settings
6868
*/
6969
Q_INVOKABLE QtAutoUpdater::Updater *createUpdater(QObject *qmlConfigOrParent = nullptr) const;
7070
/*! @brief Creates an updater instance using the given QML configuration and parent
@@ -85,7 +85,7 @@ class QmlAutoUpdaterSingleton : public QObject
8585
* QCoreApplication::aboutToQuit signal! This means when creating an updater for a backend that may need
8686
* to be run on exit, you should use either `qApp` or `nullptr` as parent for the updater.
8787
*
88-
* @sa Updater::supportedUpdaterBackends, @ref backends_TODO "Updater Backend Plugins", Qt.labs.settings.Settings,
88+
* @sa Updater::supportedUpdaterBackends, @ref qtautoupdater_backends "Updater Backend Plugins", Qt.labs.settings.Settings,
8989
* QSettings
9090
*/
9191
Q_INVOKABLE QtAutoUpdater::Updater *createUpdater(QObject *qmlConfig,

0 commit comments

Comments
 (0)