• Stars
    star
    753
  • Rank 59,864 (Top 2 %)
  • Language
    C++
  • License
    BSD 3-Clause "New...
  • Created almost 9 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Qt library to automatically check for updates and install them

QtAutoUpdater

Looking for a Maintainer! See #39

The Qt auto updater library is a library to automatically check for updates and install them based on various backends. This repository includes:

  • A library with the basic updater (without any GUI)
  • An automated Widgets GUI
  • An automated Quick GUI

Travis Build Status Appveyor Build status Codacy Badge

The library was recently updated to version 3.0. That release differes strongly from 2.1. Use the Porting Guide to get your application from 2.1 to 3.0!

Features

Core Library

  • Automatic Check for updates
  • Install updates in parallel or after exit
  • Simple update scheduling mechanism for the running instance
  • Currently 7 different backends are supported:
    • Qt Installer Framework (For cross platform desktop)
    • PackageKit (Works with most linux package managers)
    • Chocolatey (A package manager for Windows)
    • Homebrew (A package manager for macOs)
    • Google Playstore (for Android apps)
    • A custom backend that checks for updates based on a HTTP-request and can download and execute any update tool

GUI Libraries

  • Applies for both, the widgets and the quick GUI
  • Automated classes that show dialogs etc. based on a configuration and guide the user through the update process
    • customizable: you can decide what to show
    • extended information dialog or simple dialog to show basic information about the update
  • A custom menu action and button for easy integration into the GUI
  • Prepared for translation and fully translated for:
    • German
    • French
    • Spanish (outdated)
    • Arabic

Screenshots

Here some random sample screenshots of the gui (The rocket of the information dialog is the "application icon" and depends on your application). These are various parts of the GUI in various different styles. The first row shows elements from the widgets module, the second from quick

Element Widgets Screenshots Quick Screenshots
Progress Dialog macOs Style Default Style
Information Dialog Windows Style Material Style
Update Button Fusion Style Imagine Style
Install Wizard KDE Style Universal Style

Requirements

  • The core library only depends on QtCore
  • The widgets library only depends on QtWidgets
  • The quick library requires Qt Quick Controls 2
  • The plugins have different requirements. Typically the package managers and/or libraries associated with that plugin

Download/Installation

There are multiple ways to install the Qt module, sorted by preference:

  1. Package Managers: The library is available via:
    • Arch-Linux: AUR-Repository: qt5-autoupdater
    • MacOs:
      • Tap: brew tap Skycoder42/qt-modules
      • Package: qtautoupdater
      • IMPORTANT: Due to limitations of homebrew, you must run source /usr/local/opt/qtautoupdater/bashrc.sh before you can use the module.
  2. Simply add my repository to your Qt MaintenanceTool (Image-based How-To here: Add custom repository):
    1. Start the MaintenanceTool from the commandline using /path/to/MaintenanceTool --addRepository <url> with one of the following urls (Alternatively you can add it via the GUI, as stated in the previously linked GUI):
    2. A new entry appears under all supported Qt Versions (e.g. Qt > Qt 5.13 > Skycoder42 Qt modules)
    3. You can install either all of my modules, or select the one you need: Qt Autoupdater
    4. Continue the setup and thats it! you can now use the module for all of your installed Kits for that Qt
  3. Download the compiled modules from the release page. Note: You will have to add the correct ones yourself and may need to adjust some paths to fit your installation!
  4. Build it yourself! Note: This requires perl to be installed. If you don't have/need cmake, you can ignore the related warnings. To automatically build and install to your Qt installation, run:
    • Install and prepare qdep
    • Install any potential dependencies for the plugins you need
    • Download the sources. Either use git clone or download from the releases. If you choose the second option, you have to manually create a folder named .git in the projects root directory, otherwise the build will fail.
    • qmake
    • make (If you want the tests/examples/etc. run make all)
    • Optional steps:
      • make doxygen to generate the documentation
      • make -j1 run-tests to build and run all tests
    • make install

Usage

The autoupdater is provided as a Qt module. Thus, all you have to do is add the module, and then, in your project, add QT += autoupdatercore or QT += autoupdaterwidgets to your .pro file - depending on what you need! For QML, you can import the library as de.skycoder42.QtAutoUpdater.Core and de.skycoder42.QtAutoUpdater.Quick.

Note: When preparing an application for the release, the windeployqt and macdeployqt will not include the plugins! You have to manually copy matching libraries from <QT_PLUGIN_DIR>/updaters. The d suffix is used on windows and the _debug suffix on macos for the debug version of the plugins.

Getting started

The following examples assumes you are using the Qt Installer Framework as backend. The usage is similar for all backends, as you only have to adjust the configuration. This document expects you to already know the installation system you are using. If you are new to all of this, I can personally recommend you to use the Qt Installer Framework. It is relatively easy to use and works for Linux, Windows and macOs.

Here are some links that will explain how to create an online-installer using the QtIFW framework. Once you have figured out how to do that, it's only a small step to the updater library:

Examples

Since this library requires the maintenancetool that is deployed with every Qt Installer Framework installation, the examples cannot be tested without a maintenancetool! If you intend to recreate this example, set the path to the MaintenanceTool that is deployed with the installation of Qt (or any other maintenancetool). So make shure to adjust the path if you try to run the examples.

Updater

The following example shows the basic usage of the updater. Only the core library is required for this example. It creates a new updater instance that is connected to the maintenancetool located at "C:/Qt/MaintenanceTool". As soon as the application starts, it will check for updates and print the update result. If updates are available, their details will be printed and the maintenancetool is scheduled to start on exit. In both cases, the application will quit afterwards.

#include <QCoreApplication>
#include <QDebug>
#include <QtAutoUpdaterCore/Updater>

int main(int argc, char *argv[])
{
	QCoreApplication a{argc, argv};
	//create the updater with the application as parent -> will live long enough start the tool on exit
	auto updater = new QtAutoUpdater::Updater::create("qtifw", {
		{"path", "C:/Qt/MaintenanceTool"} //.exe or .app is automatically added on the platform
	}, &a);

	QObject::connect(updater, &QtAutoUpdater::Updater::checkUpdatesDone, [updater](QtAutoUpdater::Updater::State state) {
		qDebug() << "Update result:" << state;
		if (state == QtAutoUpdater::Updater::State::NewUpdates) {
			//As soon as the application quits, the maintenancetool will be started in update mode
			qDebug() << "Update info:" << updater->updateInfo();
			updater->runUpdater();
		}
		//Quit the application
		qApp->quit();
	});

	//start the update check
	updater->checkForUpdates();
	return a.exec();
}

UpdateController (QtWidgets)

This example will show you the full dialog flow of the update controller, which is used by the widgets library to control the update GUI flow. Since there is no mainwindow in this example, you will only see the controller dialogs. Please note that you can control how much of that dialogset will be shown to the user. This example is reduced! for a full example with all parts of the controller, check the examples/autoupdatergui/WidgetsUpdater application.

#include <QApplication>
#include <QtAutoUpdaterWidgets/UpdateController>

int main(int argc, char *argv[])
{
	QApplication a{argc, argv};
	//Since there is no mainwindow, the various dialogs should not quit the app
	QApplication::setQuitOnLastWindowClosed(false);
	//first create an updater as usual
	auto updater = new QtAutoUpdater::Updater::create(...);
	//then create the update controller with the application as parent -> will live long enough start the tool on exit
	//since there is no parent window, all dialogs will be top-level windows
	auto controller = new QtAutoUpdater::UpdateController{updater, &a};
	//start the update check -> AskLevel to give the user maximum control
	controller->start(QtAutoUpdater::UpdateController::DisplayLevel::Ask);
	return a.exec();
}

Quick GUI

Unlike the widgets variant, in quick you simply place all the components you want to be shown and attach the to an updater. The flow is created automatically, since all the components know when to show up. It was designed differently, as QML follows a declarative approach. The following shows a basic QML based GUI using simple dialogs. This example is reduced! for a full example with all parts of the controller, check the examples/autoupdaterquick/QuickUpdater application.

import de.skycoder42.QtAutoUpdater.Core 3.0
import de.skycoder42.QtAutoUpdater.Quick 3.0

ApplicationWindow {
	visible: true
	width: 360
	height: 600
	title: qsTr("Hello World")

	// Create the updater, just as you would in cpp
	property Updater globalUpdater: QtAutoUpdater.createUpdater(...)

	// the button to start the update check
	UpdateButton {
		anchors.centerIn: parent
		updater: globalUpdater
	}

	// dialog to show the check progress
	ProgressDialog {
		updater: globalUpdater
	}

	// dialog to show the update result
	UpdateResultDialog {
		updater: globalUpdater
		autoRunUpdater: true
	}
}

Documentation

The documentation is available on github pages. It was created using doxygen. The HTML-documentation and Qt-Help files are shipped together with the module for both the custom repository and the package on the release page. Please note that doxygen docs do not perfectly integrate with QtCreator/QtAssistant.

Translations

The core library does not need any translation, because it won't show anything to the user. The Gui library however does. The project is prepared for translation. Only a few translations are provided. However, you can easily create the translations yourself. The file src/translations/qtautoupdater_template.ts is a ready-made TS file. Just rename it (e.g. to qtautoupdater_jp.ts) and open it with the QtLinguist to create the translations.

Contributed translations:

Icon sources/Links

Test Project

More Repositories

1

QHotkey

A global shortcut/hotkey for Desktop Qt-Applications
C++
549
star
2

QtMvvm

A mvvm oriented library for Qt, to create Projects for Widgets and Quick in parallel
C++
332
star
3

QtService

A platform independent library to easily create system services and use some of their features
C++
154
star
4

QtJsonSerializer

A library to perform generic seralization and deserialization of QObjects from and to JSON and CBOR
C++
143
star
5

QtApng

An apng image plugin for Qt to support animated PNGs
C++
102
star
6

QtRestClient

A library for generic JSON-based REST-APIs, with a mechanism to map JSON to Qt objects
C++
88
star
7

QtDataSync

A simple offline-first synchronisation framework, to synchronize data of Qt applications between devices
C++
87
star
8

QtIFW-Advanced-Setup

Create "Qt Installer Framework" installers from your project via qmake
JavaScript
58
star
9

QTaskbarControl

A class to create a taskbar/launcher progress and more, for all desktop platforms
C++
43
star
10

libsodium_dart_bindings

Dart bindings for libsodium, supporting both the VM and JS without flutter dependencies.
Dart
28
star
11

AndroidUtils

Utils for easy c++ and qml integration of common android features
C++
23
star
12

repkg

A tool to manage rebuilding of AUR packages based on their dependencies
C++
19
star
13

QAutoStart

A class to easily register your application as autostart application
C++
19
star
14

qdep

A very basic yet simple to use dependency management tool for qmake based projects
Python
18
star
15

qpmx

A frontend for qpm, to provide source and build caching
C++
16
star
16

QSslServer

An extension of QTcpServer to support ssl. The counterpart to QSslSocket
C++
16
star
17

QuickExtras

Additional Stuff for Qt Quick Controls 2, to make it work event better
QML
14
star
18

KeepassTransfer

A collection of tools to securely transfer passwords to your browser
C++
14
star
19

firebase_auth_rest

A platform independent Dart/Flutter Wrapper for the Firebase Authentication API based on REST
Dart
14
star
20

QSingleInstance

A simple single instance application for Qt
C++
13
star
21

QPluginFactory

A factory class to easily load generic plugins
C++
12
star
22

QPathEdit

A Qt-Widget to get local file and folder-paths in an optimized and simple way
C++
12
star
23

QTinyAes

A Qt-Wrapper for the AES-implementation kokke/tiny-AES128-C
C++
11
star
24

QSettingsDialog

Has been replaced by https://github.com/Skycoder42/QtMvvm
C++
11
star
25

qsshfs

A gui wrapper around sshfs
C++
10
star
26

QtUtils

A collection of various Qt-Classes, branch-sorted
C++
10
star
27

QObjectListModel

A Collection of classes to easily create models with QObject and Q_GADGET classes for widgets and quick
C++
10
star
28

qt-json

A basic package for simple json serialization between json and qt classes
C++
10
star
29

QtBackgroundProcess

A Library to create background applications with simple, automated foreground control
C++
10
star
30

dolphin-seafile-plugin

A plugin for dolphin to show the seafile synchronization status
C++
9
star
31

QConsole

A non-blocking Qt Style console class to easily handle stdin/out/err
C++
9
star
32

dart_pre_commit

A small collection of pre commit hooks to format and lint dart code
Dart
9
star
33

QtModules

A collection of ci and deployment scripts to create and deploy Qt modules with travis/appveyor
Python
8
star
34

Syrem

A simple reminder application for desktop and mobile, with synchronized reminders
C++
8
star
35

action-setup-qt

A Github workflow action to install Qt from their online installer
JavaScript
7
star
36

QUrlValidator

A class that provides a QValidator to validate urls
C++
6
star
37

QSettingsGenerator

A qmake extension to generate a C++ settings wrapper for easier, stringless access
Python
5
star
38

keepassxc-client-library

A C++ library to access the browser-plugin-API of KeePassXC to retrieve or create entries.
C++
5
star
39

DialogMaster

A utility to create optimized dialogs with Qt
C++
4
star
40

QCliParser

An extension of QCommandlineParser to make context based CLIs easier
C++
4
star
41

QtRemoteObjectsSslBackend

A backend for QtRemoteObjects to connect via an encrypted SSL connection
C++
4
star
42

cryptopp-qt

A collection of pro/pri files to build and integrate Crypto++ via qmake
QMake
4
star
43

IconThemeBrowser

A small application to browse Qt icon themes
C++
4
star
44

QCtrlSignals

A library to catch and handle windows and unix signals, in a cross platform manner
C++
4
star
45

AndroidContentDevice

A QIODevice implementation to be able to open "content://" urls on android
C++
4
star
46

etebase-dart

Dart/Flutter bindings for libetebase
Dart
3
star
47

QGenericTree

A generic tree data structure for Qt
C++
3
star
48

QIpcPointer

A smart pointer for Qt to create any type on managed shared memory
C++
3
star
49

ApngProject

A collection of projects, all around making apng available in Qt
C++
3
star
50

AniRem

A tool to passivly check for updates on seasons, for proxer.me
C++
3
star
51

flutter_data_extensions

A collection of packages that extend functionally of flutter_data. Namely firebase, encryption and sync.
Dart
3
star
52

openssl-android

qdep package to compile openssl for android and add it to your app
Prolog
3
star
53

qtrng

Qt Random number generator wrapper around "secure" os RNGS
C++
2
star
54

QPipeDevice

A collection of QIODevice classes used for "piping" things between devices
C++
2
star
55

QtProFileParser

A small library to parse Qt Project Files and provide easy handling of those
C++
2
star
56

PWatcher

C++
1
star
57

ClipboardSync

A small tool for clipboard synchronization
C++
1
star
58

action-dart-release

An action to create a github release from a dart package
TypeScript
1
star
59

action-deploy-qt

A Github workflow action to upload qt modules to a server via sshfs
JavaScript
1
star
60

UniInsert

An application to easily insert unicode characters EVERYWHERE
C++
1
star
61

Conflip

A tool to synchronize settings/configurations across multiple machines
C++
1
star
62

qt-rest

A basic package for simple, generic, builder-based asynchronous rest calls
C++
1
star
63

MangaConvert

Download and convert mangas from single images to pdf
C++
1
star
64

deployment

Meta-Repo containing various scripts and files fo generic deployment
QMake
1
star
65

improved-initiative-interceptor

Dart
1
star
66

settings_builder

A dart builder that generates automatic accessors for reading and writing shared preferences.
Dart
1
star
67

dart_test_tools

Additional tools and helpers for writing dart unit tests
Dart
1
star
68

image_galery

Dart
1
star
69

QtMvvmQuick

Has been replaced by https://github.com/Skycoder42/QtMvvm
C++
1
star
70

paxchange

Simple dart script to passively synchronize installed pacman packages between systems
Dart
1
star
71

QtModules-LTS

Build-Repo to build my Qt modules as LTS independent of the primary modules
Shell
1
star
72

QColorEdit

A simple widget to inline-edit colors
C++
1
star
73

QtMvvmWidgets

Has been replaced by https://github.com/Skycoder42/QtMvvm
C++
1
star
74

QtMvvmSettingsWidgets

Has been replaced by https://github.com/Skycoder42/QtMvvm
C++
1
star
75

QtMvvmCore

Has been replaced by https://github.com/Skycoder42/QtMvvm
C++
1
star
76

QExceptionStream

A wrapper around QDebug that allows you to create exception messages like you would write to QDebug
C++
1
star
77

QXmlCodeGen

A simple python script to generate C++ bindings from an XML Schema definition, with support for bootstrapped Qt
Python
1
star
78

aha-dart

Dart client for the AVM Home Automation HTTP Interface + Login
Dart
1
star