Online Installer 4.x

From Qt Wiki
Jump to navigation Jump to search

Overview

Qt Installer and Maintenance Tool 4.0 has a new command line interface. With command line interface you can install, uninstall and update components and perform a full uninstall. You can also list installed components, search updatable components, and search components available for install.

Use command

<installer_executable> --help

to study the commands and options available. Please note that we have renamed several options to make them uniform. For example doing a default install, for all components marked as 'Default' and 'ForcedInstallation' the command would be:

installer(.exe) install --root C:\Qt\MyQtInstall

Installing unattended with CLI

There are several options which can be given to installer to perform full unattended installation. For example license and opensource oblications acceptancies:

--accept-licenses

-> Accepts all licenses without user input.

--accept-obligations

-> Accepts Qt Open Source usage obligations without user input.

Also there are queries which require user input from command line. In case you don't want to type them you can give the answer as an option to installer. Simpliest way is to use:

--default-answer

which will automatically select the default answer for the messages. In case you want different answers to certain queries, you can use

--auto-answer <identifier=value>

, for example

--auto-answer telemetry-question=Yes,AssociateCommonFiletypes=Yes

When starting to install or update, installer lists the components it is about to be install or update. In case you are sure what you are installing and don't want to double check what is about to be installed, you can skip that query with command:

--confirm-command

There might be also a case where the installer asks for a file or a folder location.

--file-query <identifier=value>

can be used in that case, for example for SDP7 path:

--file-query PathForSDP7=<path_to_sdp>

The identifiers are printed into console before the actual question and message type so you can pick up the identifiers from there.

Qt Installer and MaintenanceTool still have a forced login. If

qtaccount.ini

is found from cache that will be used.

Optionally you can login either from command line using switches

--email <your_email>
--pw <your_pw>

or save jwt token to env variable

JWT_TOKEN

(for installers built in 8 Jun, after that the env variable will be

QT_INSTALLER_JWT_TOKEN

. You can check the build date with

--version

)

Example commands and options for Qt Installer

Here are examples for using command line interface with Qt Online Installer and Maintenance Tool:

Install

Install will install default set of components if no components are given as parameter. If components are given, then the default set and the given components are installed. If no default set is wanted, then add option --no-default-installations. Note that there are forced components, such as QtCreator which will always be installed. Option --no-force-installations can be used to not install the forced components but it is not adviced to be used. They are forced for a reason and no guarantee how the install will work if that option is used.

installer(.exe) install --root C:\Qt\MyQt --auto-answer telemetry-question=Yes,AssociateCommonFiletypes=Yes --default-answer --accept-licenses --accept-obligations --file-query PathForSDP7=<path_to_sdp> --email <your_email --pw <your_pw> --confirm-command

maintenancetool(.exe) install qt.qt5.5150.qtcharts qt.qt5.5150.win64_mingw81 --default-answer --accept-licenses --confirm-command

Search

Search searches all components which are available in repositories. It uses regular expression. For example searching all Qt5.13.0 and Qt5.13.1 components:

installer(.exe) or maintenancetool(.exe) search "(5130|5131)"

The --filter-packages <element=regex,...> option can be used by itself or in conjunction with the search command argument to specify additional filters for the search operation:

installer(.exe) or maintenancetool(.exe) search --filter-packages "DisplayName=Qt 5.15.2"

The filter element can be any package information element, the full list can be found from:

https://doc.qt.io/qtinstallerframework/ifw-component-description.html#package-information-file-syntax

The element is case sensitive. The searchabe string is case insensitive (from 4.3.x onwards).

List

List will list all components you have installed:

maintenancetool(.exe) list

Check updates

maintenancetool(.exe) check-updates

Update

Update without parameters will update all components that have an update. Essential components are always updated first, same way as it is done when launching updater from GUI. Alternatively you can give a list of components you want to update:

maintenancetool(.exe) update or

maintenancetool(.exe) update qt.qt5.5150.qtcharts qt.qt5.5150.win64_mingw81

Remove

Remove uninstalls listed components, their children and other components depending on the uninstalled components.

maintenancetool(.exe) remove qt.qt5.5150.qtcharts qt.qt5.5150.win64_mingw81

Full uninstall

maintenancetool(.exe) purge

Identifiers reference

Message identifiers

The following table lists known identifiers and values used for --auto-answer option.

ID Values Default
OperationDoesNotExistError Abort, Ignore Ignore
OverwriteTargetDirectory Yes, No No
stopProcessesForUpdates Retry, Ignore, Cancel Cancel
installationErrorWithCancel Retry, Ignore, Cancel Cancel
installationErrorWithIgnore Retry, Ignore Ignore
AssociateCommonFiletypes Yes, No Yes
telemetry-question Yes, No Yes

File query identifiers

The following table lists known identifiers and values used for --file-query option.

ID Type
PathForSDP7 Directory

Selecting a mirror for opensource

Installer version 4.0.1-1 has new option for selecting a mirror for opensource metadata and downloads. The mirror can be set from terminal using option --mirror.

Examples:

installer(.exe) --mirror http://www.nic.funet.fi/pub/mirrors/download.qt-project.org

installer(.exe) --mirror http://ftp2.nluug.nl/languages/qt

maintenancetool(.exe) --mirror http://qt.mirror.constant.com

As the example shows, don't use the full path but use the path before '/online' (no forward slash at the end)

Available mirrors can be found from https://download.qt.io/online/qtsdkrepository/windows_x86/root/qt/Updates.xml.mirrorlist