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
> 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!
14
+
11
15
## Features
12
16
### Core Library
13
-
- Automatic Check for updates using the maintenancetool
14
-
- Can automatically run the maintenancetool after the application finished
15
-
- To run as admin/root, either use the GUI library or implement it yourself (via an interface)
16
-
- Simple update scheduling mechanism for the running instance
17
-
18
-
### GUI Library
19
-
- Requires Widgets (no direct QML-support, and I'm not intending to create one. The library can be used for QML applications, since it operates mostly with own windows. If you want to use the updater in QML, do the connection yourself!)
20
-
- Automated controller to guide the user through the check-for-updates process
17
+
- Automatic Check for updates
18
+
- Install updates in parallel or after exit
19
+
- Simple update scheduling mechanism for the running instance
- Qt Installer Framework: The updater requires the application to be installed using the framework and will use the frameworks update mechanism to check for updates (https://doc.qt.io/qtinstallerframework/, download at via Qt MaintenanceTool)
40
-
- Since the Installer Framework supports Windows, Mac and X11 only, it's the same for this library
51
+
- The core library only depends on QtCore
52
+
- The widgets library only depends on QtWidgets
53
+
- The quick library requires Qt Quick Controls 2
54
+
- The plugins have different requirements. Typically the package managers and/or libraries associated with that plugin
41
55
42
56
## Download/Installation
43
57
There are multiple ways to install the Qt module, sorted by preference:
44
58
45
-
1. Simply add my repository to your Qt MaintenanceTool (Image-based How-To here: [Add custom repository](https://github.com/Skycoder42/QtModules/blob/master/README.md#add-my-repositories-to-qt-maintenancetool)):
46
-
1. Start the MaintenanceTool from the commandline using `/path/to/MaintenanceTool --addTempRepository <url>` with one of the following urls (GUI-Method is currently broken, see [QTIFW-1156](https://bugreports.qt.io/browse/QTIFW-1156)) - This must be done *every time* you start the tool:
59
+
1. Package Managers: The library is available via:
- Tap: [`brew tap Skycoder42/qt-modules`](https://github.com/Skycoder42/homebrew-qt-modules)
63
+
- Package: `qtautoupdater`
64
+
- **IMPORTANT:** Due to limitations of homebrew, you must run `source /usr/local/opt/qtautoupdater/bashrc.sh` before you can use the module.
65
+
2. Simply add my repository to your Qt MaintenanceTool (Image-based How-To here: [Add custom repository](https://github.com/Skycoder42/QtModules/blob/master/README.md#add-my-repositories-to-qt-maintenancetool)):
66
+
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):
47
67
- On Linux: https://install.skycoder42.de/qtmodules/linux_x64
48
68
- On Windows: https://install.skycoder42.de/qtmodules/windows_x86
49
69
- On Mac: https://install.skycoder42.de/qtmodules/mac_x64
50
-
2. A new entry appears under all supported Qt Versions (e.g. `Qt > Qt 5.11 > Skycoder42 Qt modules`)
51
-
3. You can install either all of my modules, or select the one you need: `Qt Auto Updater`
70
+
2. A new entry appears under all supported Qt Versions (e.g. `Qt > Qt 5.13 > Skycoder42 Qt modules`)
71
+
3. You can install either all of my modules, or select the one you need: `Qt Autoupdater`
52
72
4. Continue the setup and thats it! you can now use the module for all of your installed Kits for that Qt
53
-
2. 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!
54
-
3. 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:
73
+
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!
74
+
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:
55
75
- Install and prepare [qdep](https://github.com/Skycoder42/qdep#installation)
76
+
- Install any potential dependencies for the plugins you need
77
+
- 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.
56
78
- `qmake`
57
79
- `make` (If you want the tests/examples/etc. run `make all`)
58
-
- Optional step: `make doxygen` to generate the documentation
80
+
- Optional steps:
81
+
- `make doxygen` to generate the documentation
82
+
- `make -j1 run-tests` to build and run all tests
59
83
- `make install`
60
84
85
+
61
86
## Usage
62
-
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 += autoupdatergui` to your .pro file - depending on what you need!
87
+
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`.
63
88
64
89
### Getting started
65
-
The usage of this library is not that complicated. However, to make this work you will have to use the Qt Installer Framework to create an installer/updater. If you already know how to to that, just check out the examples below. If not, here are some links that
66
-
will explain how to create an online-installer using the framework. Once you have figured out how to do that, it's only a small step
67
-
to the updater library:
90
+
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.
91
+
92
+
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:
68
93
-[QtIFW - Tutorial: Creating an Installer](https://doc.qt.io/qtinstallerframework/ifw-tutorial.html): Check this to learn how to create an installer in general. Don't be afraid, it's a very short tutorial
69
94
-[QtIFW - Creating Online Installers](https://doc.qt.io/qtinstallerframework/ifw-online-installers.html): This page will tell you how to create an online installer from your offline installer - in just 2 steps
70
95
-[QtIFW - Promoting Updates](https://doc.qt.io/qtinstallerframework/ifw-updates.html): And this site explains how to create updates
71
96
72
97
### Examples
73
-
**Important:**<br>
74
-
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 use this library, the maintenancetool will be available for your final application. For testing purpose or the examples, I 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.
98
+
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.
75
99
76
100
#### Updater
77
101
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.
78
102
79
103
```cpp
80
104
#include<QCoreApplication>
81
105
#include<QDebug>
82
-
#include<updater.h>
106
+
#include<QtAutoUpdaterCore/Updater>
83
107
84
108
intmain(int argc, char *argv[])
85
109
{
86
-
QCoreApplication a(argc, argv);
110
+
QCoreApplication a{argc, argv};
87
111
//create the updater with the application as parent -> will live long enough start the tool on exit
88
-
QtAutoUpdater::Updater *updater = new QtAutoUpdater::Updater("C:/Qt/MaintenanceTool", &a);//.exe is automatically added
112
+
auto updater = new QtAutoUpdater::Updater::create("qtifw", {
113
+
{"path", "C:/Qt/MaintenanceTool"} //.exe or .app is automatically added on the platform
@@ -104,55 +130,80 @@ int main(int argc, char *argv[])
104
130
}
105
131
```
106
132
107
-
#### UpdateController
108
-
This example will show you the full dialog flow of the controller. Both libraries are required for this example. 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.
133
+
#### UpdateController (QtWidgets)
134
+
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.
109
135
110
136
```cpp
111
137
#include <QApplication>
112
-
#include <updatecontroller.h>
138
+
#include <QtAutoUpdaterWidgets/UpdateController>
113
139
114
140
int main(int argc, char *argv[])
115
141
{
116
-
QApplication a(argc, argv);
142
+
QApplication a{argc, argv};
117
143
//Since there is no mainwindow, the various dialogs should not quit the app
118
144
QApplication::setQuitOnLastWindowClosed(false);
119
-
//create the update controller with the application as parent -> will live long enough start the tool on exit
145
+
//first create an updater as usual
146
+
auto updater = new QtAutoUpdater::Updater::create(...);
147
+
//then create the update controller with the application as parent -> will live long enough start the tool on exit
120
148
//since there is no parent window, all dialogs will be top-level windows
121
-
QtAutoUpdater::UpdateController *controller = new QtAutoUpdater::UpdateController("C:/Qt/MaintenanceTool", &a);//.exe is automatically added
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.
The documentation is available on [github pages](https://skycoder42.github.io/QtAutoUpdater/). It was created using [doxygen](http://www.doxygen.org/). The HTML-documentation and Qt-Help files are shipped
138
-
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.
192
+
The documentation is available on [github pages](https://skycoder42.github.io/QtAutoUpdater/). It was created using [doxygen](http://www.doxygen.org/). 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.
139
193
140
194
## Translations
141
-
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 german and spanish translations are provided. However, you can easily create the translations yourself. The file `src/autoupdatergui/translations/QtAutoUpdaterController_template.ts` is a ready-made TS file. Just rename it (e.g. to `QtAutoUpdaterController_jp.ts`) and open it with the QtLinguist to create the translations.
195
+
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.
142
196
143
197
### Contributed translations:
144
-
- French by @aalex420
145
-
- Spanish by @checor
146
-
- Arabic by @abdullah-radwan
198
+
- French by [@aalex420](https://github.com/aalex420)
199
+
- Spanish by [@checor](https://github.com/checor)
200
+
- Arabic by [@abdullah-radwan](https://github.com/abdullah-radwan)
0 commit comments