This repository contains a collection of scripts which automate Qt installation from official unified online installers. It is designed with CI/CD services in mind, and tested in Travis CI.
Windows, MacOS, and Linux systems are supported. Note that GUI capabilities are
required — it’s just an automation script, which iterates through install
wizard screens. That implies that X Window System is needed to run the script
on Linux. Xvfb should do the trick on headless servers (see .travis.yml
).
Tip: Use .travis.yml
as an example.
Decide which online installer should be used. They all are listed here: https://download.qt.io/official_releases/online_installers/.
Obtain identifiers of components which will be installed. The easiest way to do
so is to seek them in proper Updates.xml
file, which is located at URL like:
https://download.qt.io/online/qtsdkrepository/(installer_platform)/desktop/qt5_(version)/Updates.xml
Because of odd naming format, it is suggested to crawl subdirectories starting from https://download.qt.io/online/qtsdkrepository.
For example, for Windows installer and Qt 5.12.3, respective Updates.xml
is
located at https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/qt5_5123/Updates.xml. Note that windows_x86
here is matching
the installer name (qt-unified-windows-x86-online.exe
), not necessarily
the target platform architecture — this file describes packages for x64
platforms as well.
The Updates.xml
files contain identifiers of all packages that online
installers can handle.
For example, in order to install Qt 5.12.3 on Windows for MSVC 2017 64-bit
compiler, the appropriate identifier is qt.qt5.5123.win64_msvc2017_64
,
as it is defined in https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/qt5_5123/Updates.xml. And for Qt WebEngine package,
the identifier is qt.qt5.5123.qtwebengine
. Note that there is also a package
qt.qt5.5123.qtwebengine.win64_msvc2017_64
— you should skip it, as well as
any other package which has a non-empty <AutoDependOn>
element. These are
selected automatically, depending on your other choices.
Having learned package identifiers, create a configuration file, which in fact
is a piece of JavaScript with two global variable definitions:
InstallComponents
with a list of package identifiers and InstallPath
with
installation path. For example:
var InstallComponents = [
"qt.qt5.5123.win64_msvc2017_64",
"qt.qt5.5123.qtwebengine"
];
var InstallPath = "C:\\Qt";
-
Handle Archived/LTS/Preview releases in online installer (possibly difficult).
-
Handle offline installers.
-
Rewrite in PowerShell, which is available on all target platforms (Windows, Linux, MacOS) without much hassle.
Written in 2019 by Sebastian Skałacki
To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see http://creativecommons.org/publicdomain/zero/1.0.