Skip to content

A set of scripts which install Qt without user interaction, e.g. on a continuous integration server.

License

Notifications You must be signed in to change notification settings

MEONMedical/non-interactive-qt-installer

 
 

Repository files navigation

Non-interactive Qt Installer

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).

Usage

Tip: Use .travis.yml as an example.

Step 1: Choosing online installer

Decide which online installer should be used. They all are listed here: https://download.qt.io/official_releases/online_installers/.

Step 2: Finding Updates.xml

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.

Step 3: Finding package identifiers

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.

Step 4: Creating configuration script

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";

Step 5: Running the script

# Online installer file name (from step 1)
export QT_INSTALLER_DOWNLOAD_NAME="qt-unified-windows-x86-online.exe"
# Absolute path to configuration file (from step 4)
export QT_INSTALLER_VARS="/absolute/path/to/configuration/script.js"

./qt_installer.sh

TODO

  • 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.

About

A set of scripts which install Qt without user interaction, e.g. on a continuous integration server.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 43.2%
  • PowerShell 33.1%
  • Shell 23.7%