Skip to content

Commit b529579

Browse files
committed
wip doc fix
1 parent 408770a commit b529579

File tree

5 files changed

+209
-199
lines changed

5 files changed

+209
-199
lines changed

README.md

Lines changed: 47 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
# QtAutoUpdater
22

3-
[![BSD3 License](https://img.shields.io/badge/license-BSD3-blue.svg?style=flat)](https://opensource.org/licenses/BSD-3-Clause)
4-
53
The Qt auto updater library is a library to automatically check for updates and install them. This repository includes:
64
- A library with the basic updater (without any GUI)
75
- A second library that requires the first one and adds basic GUI features
86

9-
Github repository: https://github.com/Skycoder42/QtAutoUpdater
10-
11-
## Main Features
7+
## Features
128
### Core Library
139
- Automatic Check for updates using the maintenancetool
1410
- Can automatically run the maintenancetool after the application finished
@@ -30,19 +26,19 @@ Here some sample screenshots of the gui (The rocket of the information dialog is
3026

3127
| Dialog Sample | Windows | Mac | X11 |
3228
|--------------------|----------------------------------------------------------|----------------------------------------------------------|----------------------------------------------------------|
33-
| Progress Dialog | ![Progress Dialog](./doc/images/win_dialog_progress.png) | ![Progress Dialog](./doc/images/mac_dialog_progress.png) | ![Progress Dialog](./doc/images/x11_dialog_progress.png) |
29+
| Progress Dialog | ![Progress Dialog](./doc/images/win_dialog_progress.png) | ![Progress Dialog](./doc/images/mac_dialog_progress.png) | ![Progress Dialog](./doc/images/x11_dialog_progress.png) |
3430
| Information Dialog | ![Information Dialog](./doc/images/win_dialog_info.png) | ![Information Dialog](./doc/images/mac_dialog_info.png) | ![Information Dialog](./doc/images/x11_dialog_info.png) |
35-
| Update Button | ![Update Button](./doc/images/win_button_checking.png) | ![Update Button](./doc/images/mac_button_checking.png) | ![Update Button](./doc/images/x11_button_checking.png) |
36-
| Update Action | ![Update Action](./doc/images/win_action.png) | ![Update Action](./doc/images/mac_action.png) | ![Update Action](./doc/images/x11_action.png) |
31+
| Update Button | ![Update Button](./doc/images/win_button_checking.png) | ![Update Button](./doc/images/mac_button_checking.png) | ![Update Button](./doc/images/x11_button_checking.png) |
32+
| Update Action | ![Update Action](./doc/images/win_action.png) | ![Update Action](./doc/images/mac_action.png) | ![Update Action](./doc/images/x11_action.png) |
3733

3834
## Requirements
39-
- 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 https://download.qt.io/official_releases/qt-installer-framework/)
40-
- C++11 - The library makes heavy use of it's features
41-
- Qt 5.6 (Since I'm using new features of 5.6, older Versions won't work without modification)
42-
- If you are using Qt 5.5, you can download version 1.0.0. It's the only one that supports it
35+
- 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)
4336
- Since the Installer Framework supports Windows, Mac and X11 only, it's the same for this library
4437

45-
## Getting started
38+
## Usage
39+
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!
40+
41+
### Getting started
4642
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 and installer/updater. If you already now how to to that, just check out the examples below. If not, here are some links that
4743
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
4844
to the updater library:
@@ -67,24 +63,24 @@ The following example shows the basic usage of the updater. Only the core librar
6763

6864
int main(int argc, char *argv[])
6965
{
70-
QCoreApplication a(argc, argv);
71-
//create the updater with the application as parent -> will live long enough start the tool on exit
72-
QtAutoUpdater::Updater *updater = new QtAutoUpdater::Updater("C:/Qt/MaintenanceTool", &a);//.exe is automatically added
73-
74-
QObject::connect(updater, &QtAutoUpdater::Updater::checkUpdatesDone, [updater](bool hasUpdate, bool hasError) {
75-
qDebug() << "Has updates:" << hasUpdate << "\nHas errors:" << hasError;
76-
if(hasUpdate) {
77-
//As soon as the application quits, the maintenancetool will be started in update mode
78-
updater->runUpdaterOnExit();
79-
qDebug() << "Update info:" << updater->updateInfo();
80-
}
81-
//Quit the application
82-
qApp->quit();
83-
});
84-
85-
//start the update check
86-
updater->checkForUpdates();
87-
return a.exec();
66+
QCoreApplication a(argc, argv);
67+
//create the updater with the application as parent -> will live long enough start the tool on exit
68+
QtAutoUpdater::Updater *updater = new QtAutoUpdater::Updater("C:/Qt/MaintenanceTool", &a);//.exe is automatically added
69+
70+
QObject::connect(updater, &QtAutoUpdater::Updater::checkUpdatesDone, [updater](bool hasUpdate, bool hasError) {
71+
qDebug() << "Has updates:" << hasUpdate << "\nHas errors:" << hasError;
72+
if(hasUpdate) {
73+
//As soon as the application quits, the maintenancetool will be started in update mode
74+
updater->runUpdaterOnExit();
75+
qDebug() << "Update info:" << updater->updateInfo();
76+
}
77+
//Quit the application
78+
qApp->quit();
79+
});
80+
81+
//start the update check
82+
updater->checkForUpdates();
83+
return a.exec();
8884
}
8985
```
9086
@@ -97,23 +93,23 @@ This example will show you the full dialog flow of the controller. Both librarie
9793
9894
int main(int argc, char *argv[])
9995
{
100-
QApplication a(argc, argv);
101-
//Since there is no mainwindow, the various dialogs should not quit the app
102-
QApplication::setQuitOnLastWindowClosed(false);
103-
//create the update controller with the application as parent -> will live long enough start the tool on exit
104-
//since there is no parent window, all dialogs will be top-level windows
105-
QtAutoUpdater::UpdateController *controller = new QtAutoUpdater::UpdateController("C:/Qt/MaintenanceTool", &a);//.exe is automatically added
106-
107-
QObject::connect(updater, &QtAutoUpdater::UpdateController::runningChanged, [updater](bool running) {
108-
qDebug() << "Running changed:" << running;
109-
//quit the application as soon as the updating finished
110-
if(!running)
111-
qApp->quit();
112-
});
113-
114-
//start the update check -> AskLevel to give the user maximum control
115-
controller->start(QtAutoUpdater::UpdateController::AskLevel);
116-
return a.exec();
96+
QApplication a(argc, argv);
97+
//Since there is no mainwindow, the various dialogs should not quit the app
98+
QApplication::setQuitOnLastWindowClosed(false);
99+
//create the update controller with the application as parent -> will live long enough start the tool on exit
100+
//since there is no parent window, all dialogs will be top-level windows
101+
QtAutoUpdater::UpdateController *controller = new QtAutoUpdater::UpdateController("C:/Qt/MaintenanceTool", &a);//.exe is automatically added
102+
103+
QObject::connect(updater, &QtAutoUpdater::UpdateController::runningChanged, [updater](bool running) {
104+
qDebug() << "Running changed:" << running;
105+
//quit the application as soon as the updating finished
106+
if(!running)
107+
qApp->quit();
108+
});
109+
110+
//start the update check -> AskLevel to give the user maximum control
111+
controller->start(QtAutoUpdater::UpdateController::AskLevel);
112+
return a.exec();
117113
}
118114
```
119115

@@ -134,15 +130,15 @@ Downloads are available via [github releases](https://github.com/Skycoder42/QtAu
134130
- msvc2015 x64
135131
- mingw 4.9.2
136132
- OsX
137-
- clang x64
133+
- clang x64
138134
- X11 (Linux)
139-
- gcc x64
135+
- gcc x64
140136
- The (public) header files needed for these binaries
141137
- The HTML and QtHelp documentation
142138
- The german translations and the translation template file
143139

144140
**Note:**<br>
145-
The downloads are "libraries", not dll/so/dylib files. If you want to use them as dynamic library, you will have to modify the code and build them yourself.
141+
The downloads are "libraries", not dll/so/dylib files. If you want to use them as dynamic library, you will have to modify the code and build them yourself.
146142

147143
## Building it yourself
148144
If you want to build the QtAutoUpdater yourself, make shure that you fullfill all the requirements listed above. To build it, the only other dependencies beside Qt itself is the [DialogMaster](https://github.com/Skycoder42/DialogMaster), which is referenced as submodule. Just make shure to clone the repository recursivly. But please note that the project only supports Desktop Windows, OsX and X11. Trying to build it for other configurations will propably fail!

0 commit comments

Comments
 (0)