Flavio Tordini
Updater
This is an extensible updater for Qt apps. It can wrap Sparkle on macOS and use its own implementation on Windows and Linux.
Design
The main interface is Updater. A shared Updater subclass instance should be set on startup using Updater::setInstance()
. Available implementations are:
-
updater::DefaultUpdater
, the default Qt-based implementation. -
updater::SparkleUpdater
, a Sparkle-based implementation for macOS
User Interface
Built-in Widgets
Updater provides ready-to-use widgets:
-
Updater::getAction()
returns a QAction suitable to be inserted in a QMenu. -
Updater::getLabel()
returns a QLabel that automatically changes its message. Typically used in the about box. -
Updater::getButton()
returns a QPushButton that autohides or automatically changes its function depending on the Updater status.
When the user triggers the action or pushes the button a dialog will show which is dependent on the Updater implementation.
Entension Points
updater::DefaultUpdater has a number of extension points so it can be adapted to different release manifest formats and update mechanisms.
Parser
Implement updater::Parser to parse your own manifest format. There are two ready-to-use parsers:
- updater::AppcastParser. This the appcast format also used by Sparkle. It's a RSS feed with Sparkle extensions.
- updater::SimpleXmlParser. This is a very simple XML format
Set the desired Parser implementation using updater::DefaultUpdater::setParser
. The default is [updater::AppcastParser].
Installer
updater::Installer is the abstraction responsible for preparing and running the update process. Currently the only available Installer implementation is updater::RunInstaller. It just runs an executable update payload, optionally with arguments.
Installer can be implemented in other ways, for example an Installer that unzips a payload and moves files. Or one that invokes an update helper. Another idea is signature validation.
Set the desired Installer implementation using updater::DefaultUpdater::setInstaller
. The default is [updater::RunInstaller].
Security
Always serve your manifest files and binary updates via HTTPS.
License
You can use this library under the GPLv3 license terms. If you do, you're welcome contributing your changes and fixes.