You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<b>oldVersions</b> | QVariantList | array | no | The currently installed versions that will be replaced by the new one. Is a list of QVersionNumber. Not available for casks
148
+
<b>oldVersion</b> | QVersionNumber | string | yes | The currently installed version that will be replaced by the new one. Only available for casks
149
+
131
150
@section qtautoupdater_backends_play Google Playstore
132
151
When deploying your app via the [Google Playstore](https://play.google.com/store) for Android, you can use this
133
152
plugin to check for updates and even install them. This works fine for most phones, but be aware that some might
@@ -154,4 +173,159 @@ This backend can be used if none of the other backends fit your distribution met
154
173
create a custom plugin for such cases, for many variants this plugin suffices. It can query a webserver for
155
174
JSON-encoded information about available updates, download a binary or update package of any kind and execute a
156
175
selected binary to perform the update installation.
176
+
177
+
@subsection qtautoupdater_backends_webquery_features Features
check/url | QUrl | _required_ | The URL to query to check for updates. Must be a URL unterstood and supported by QNetworkAccessManager
190
+
check/autoQuery | bool | `true` | If enabled, additional information is added as query to the URL. See @ref qtautoupdater_backends_webquery_config_query for more details
191
+
check/spdy | bool | `false` | Enables the use of the SPDY-Protocol
192
+
check/http2 | bool | `false` | Enables the use of the HTTP2-Protocol
193
+
check/hsts | bool | `false` | Enables the use of HSTS for TLS-based requests (e.g. HTTPS)
194
+
check/sslConfiguration | QSslConfiguration | `QSslConfiguration::defaultConfiguration()` | The SSL configuration to use for TLS-based requests (e.g. HTTPS)
195
+
check/headers | @ref qtautoupdater_backends_webquery_config_headers "Headers" | _empty_ | Additional HTTP-Headers to be added to the request. See @ref qtautoupdater_backends_webquery_config_headers for how to specify headers
196
+
check/verb | QByteArray | `"GET"` | The HTTP-Verb to use for HTTP or HTTPS requests
197
+
check/body | QByteArray / QIODevice / QHttpMultiPart | _empty_ | The body to send to the server with the request. By default, no body is sent (empty request)
198
+
check/parser | QString | `"auto"` | The parser to use to parse the received data. Can be `"auto"`, `"json"` or `"version"`. See @ref qtautoupdater_backends_webquery_formats for more details
199
+
install/download | bool | `false` | Specifies if the installation requires the previous download of a file (typically the installer itself)
200
+
install/tool | QString | _empty_ | The binary to execute as installer. Can be left empty if the installer is downloaded or `url` is used
201
+
install/parallel | bool | `false` | Specifies if the installer can be run in parallel to the running application
202
+
install/url | QUrl | _empty_ | The URL to invoke to start the installer. Typically an app-specific URL to for example trigger an app store. Can be used instead of `tool`
203
+
install/path | @ref qtautoupdater_backends_types "pathList" | _system-path_ | A list of paths where to search for the `tool` executable. If not specified, the `PATH` environment variable is used
204
+
install/arguments | @ref qtautoupdater_backends_types "argList" | _empty_ | Additional arguments to be passed to `tool` when running the installer
205
+
install/pwd | QString | _empty_ | The working directory to be used by `tool`. If unset, the calling processes current working directory is used
206
+
install/runAsAdmin | bool | _special_ | Specifies, if the `tool` should be executed with elevated rights
207
+
install/addDataArgs | bool | `false` | Specify if additional arguments of the downloaded JSON file are allowed to be added to the installer invokation. See @ref qtautoupdater_backends_webquery_info_extras for the syntax
208
+
install/downloadUrl | QUrl | _empty_ | The URL to download the installer from. Can contain @ref qtautoupdater_backends_webquery_config_placeholders "placeholders"
209
+
install/useInfoDownload | bool | `false` | Specify if additional arguments of the downloaded JSON file are allowed to be used as download URL. See @ref qtautoupdater_backends_webquery_info_extras for the syntax. Relative URLs are resolve to the `downloadUrl`
210
+
install/headers | @ref qtautoupdater_backends_webquery_config_headers "Headers" | _empty_ | The headers to be added to the installer download request. See @ref qtautoupdater_backends_webquery_config_headers for how to specify headers
211
+
install/execDownload | bool | `false` | Specify if the downloaded installer data should be used as executable and executed or if instead the path should be passed to the installer tool
212
+
213
+
All parameter that start with `check/` are used when checking for updates. They are used to construct a web request
214
+
(typically HTTP or HTTPS) to download some kind of information about new updates. This information must be in a
215
+
predefined format (See @ref qtautoupdater_backends_webquery_formats) and is parsed to provide the update
216
+
information.
217
+
218
+
Optionally, one can specify installer information to allow the user to install updates. All parameters that start
219
+
with `install/` are used for that. There are three ways to launch an installer:
220
+
221
+
1. **As URL:** Specify a URL as `install/url` when the user triggers the installation, the plugin will use the
222
+
QDesktopServices::openUrl to open that url and launch the corresponding app. You can use this to invoke a certain
223
+
local application (like steam) or open a website in the browser. If `addDataArgs` is set to true, additional
224
+
query parameters can be added to the URL.
225
+
2. **As local tool:** If the installer or updater is a locally available tool (i.e. executable), you can use the
226
+
`install/tool` parameter to specify the binary and the `path`, `arguments`, `pwd` and `runAsAdmin` to customize
227
+
how that tool is executed. If `addDataArgs` is set to true, additional arguments can be added from the JSON to the
228
+
arguments.
229
+
3. **As downloaded tool:** Basically the same as 2, but you use the `install/downloadUrl` to download some file
230
+
before running the installer. If `tool` is set, then this tool is executed and the downloaded file is simply
231
+
passed as argument to that tool. Use the `%{downloadPath}` placeholder somewhere as an argument (even multiple
232
+
times, if required), and this string will be replaced with the temporary path to the downloaded file. If however
233
+
the `tool` is unset, and `execDownload` is set to true, the downloaded file will be made executable and executed
234
+
as the tool (with arguments, path, etc. all just like for a normal tool). But be careful to only use HTTPS for the
235
+
update info and always add a hashsum to the update info to prevent malicious code from beeing downloaded and
236
+
executed!
237
+
238
+
The default value of the `runAsAdmin` depends of the result of
239
+
QtAutoUpdater::AdminAuthoriser::needsAdminPermission(path). The path here is the maintenancetool as specified in the
240
+
settings. While this may work for most systems, it is recommended to always explicitly set this parameter to avoid
241
+
problems.
242
+
243
+
@subsubsection qtautoupdater_backends_webquery_config_headers The Headers type
244
+
The headers type is basically just a simple QSettings array. It has a size and various elements. Each element has
245
+
a `key` and a `value` member, defining the header pair. The following example should be helpful to understand it:
The reply to the check for upates request can have one of two formats: `json` or `version`. There is also `auto`,
292
+
which will guess the format based on the returned `Content-Type` header.
293
+
294
+
If the `version` format is used, the returned data should be a single, undecorated version string (e.g. `1.1.5`).
295
+
This version is then combined with QCoreApplication::applicationName and QGuiApplication::applicationDisplayName
296
+
to create an QtAutoUpdater::UpdateInfo representing the update to the application. You cannot specify additional
297
+
data via this format.
298
+
299
+
The second and recommended format is `json`. This format allows you to specify multiple update infos and to add
300
+
extra data. The following shows the JSON scheme:
301
+
302
+
@code
303
+
[
304
+
{
305
+
"identifier": any,
306
+
"name": string,
307
+
"version": string,
308
+
"data": object
309
+
},
310
+
...
311
+
]
312
+
@endcode
313
+
314
+
The json members are mapped directly to the equally named properties of QtAutoUpdater::UpdateInfo. The `data` is
315
+
converted using QJsonValue::toVariant. To see what arguments can be passed via `data`, see
316
+
@ref qtautoupdater_backends_webquery_info_extras
317
+
318
+
@subsection qtautoupdater_backends_webquery_info_extras Arguments for QtAutoUpdater::UpdateInfo::data
319
+
Unlike for most other backends, many of the data arguments are process internally and thus are used to control
320
+
the plugins behaviour. The following table shows all arguments with special meaning for the plugin and how they
321
+
are processed by it. Of course, you can add whatever data you want in addition to those and they will be simply
322
+
parsed and added to the UpdateInfo, so you can process them in your application code how you like.
323
+
324
+
Parameter | Type | JSON-Type | Usage
325
+
------------|---------------|-----------|-------
326
+
query | QVariantMap | object | A map of keys and values, that are added as URL query parameters to the `install/url` that is used to invoke an installer. The values will be automatically escaped. Is only processed, if `install/addDataArgs` is set to true
327
+
arguments | QStringList | array | A list of extra arguments to be added to `install/arguments` that are used to run `install/tool`. Is only processed, if `install/addDataArgs` is set to true
328
+
eulas | QVariantList | array | A list of EULAs to be show via the installer before downloading an installer. Are only shown if a download is done. Each element can either be a simple QString (for a required EULA) or a QVariantMap, with `text` beeing the EULA text and `required` a boolean to specify if the EULA must be accepted or not
329
+
download | QUrl | string | A URL to be used as download URL for a downloaded installer. If the URL is relative, it is resolved via `install/downloadUrl`. Is only used if `install/useInfoDownload` is set to true.
330
+
exec | bool | bool | Specifies if the downloaded data of this info can be executed. Both this and `install/execDownload` must be true in order for this to be allowed.
0 commit comments