Qt Installer Framwork¶
General rules for using Qt Installer Framwork
What is Qt Installer Framwork¶
The Qt Installer Framework (QIF) provides a set of tools and utilities to create installers for the supported desktop Qt platforms: Linux, Microsoft Windows, and OS X. In CQtDeployer QIF availabel in the qtifw option.
Note: the Qt Installer Framework tools (binarycreator and installerbase) are stored in the CQtDeployer repository for all supported platforms (including macOS), so the
qtifwoption works on macOS hosts as well. The release artifact for macOS is a DMG archive. See the CQtDeployer for macOS page.Note (macOS): on the macOS hosts the Qt Installer Framework binarycreator creates the installer as an .app bundle (a directory). The bundle name is the
qifOutname with the.appsuffix - CQtDeployer adds the suffix to theqifOutvalue (or to the default installer name) when it is missing, e.g.-qifOut MyInstallercreatesMyInstaller.appin the target directory.Note (macOS, code signing): the Mach-O rewrite of the deployed binaries (issue #166) invalidates the code signature of the generated installer, so the app bundle must be signed before the release. The
qifSignoption is given in two forms (issue #865, #908): the singleqifSignoption without the value creates the ad-hoc signature (no signing certificate required) and the-qifSign <identity>option signs the bundle with the specified identity (e.g. the "Developer ID Application" identity): the identity is passed to the-soption of the Qt Installer Framework binarycreator. The command line parser of the binarycreator rejects the identity values with the leading-character (thestartsWith('-')guard of the binarycreator of the qtproject/installer-framework repository, present in all the released versions), so the ad-hoc signature is created by the codesign step of the cqtdeployer after the bundle is created (the samecodesign --force --deep --sign - <bundle>command the binarycreator runs internally). The option is available on the macOS hosts only (issue #865). See the code signing of the QtIFW installer article for the full description and the identity values.
How to use qtifw option¶
The qtifw option invoke with path to custo qt installer template or with default installer template.
For example:¶
cqtdeployer ... qtifw
Where: * ... - is list of other options. * qtifw - option for use qt installer framework with default template.
By default, cqtdeployer will create an installation file with one package in which your entire distribution kit will lie. If you want to configure it, you should use Controll of packages options To create a new package, use the -targetPackage [package; tar1] option
Where:
- package - it is package name
- tar1 - it is name of the target that should be included in this package.
Or you can describe packages in configuration file
{
"targetPackage": [
[
"package",
"tar1"
]
],
}
License agreement¶
Starting from the version of the CQtDeployer with the -license option (issue #456) you can
insert the license file into the Qt Installer Framework installer. The installer shows the
license as an agreement before the installation starts.
The -license option sets the path to the license file (plain text, for example
LICENSE.txt). During the deploy the license file is copied into the meta directory of
the package of the installer template (the original file name is kept) and the Licenses
element is added to the package.xml of the package, for example:
<Licenses>
<License name="LICENSE" file="LICENSE.txt" />
</Licenses>
Where:
- name - the title of the license agreement (the base name of the license file).
- file - the path to the license file relative to the meta directory of the package of the installer template.
Note: the Qt Installer Framework versions 4.x read the license agreement from the
package.xml file of the packages (the meta directory of the package), the
config.xml file of the installer does not support the license agreement elements:
the binarycreator tool rejects the unknown elements of the config.xml file.
For example:¶
cqtdeployer ... qtifw -license ./LICENSE.txt
Where:
- ... - is list of other options.
- qtifw - option for use qt installer framework with default template.
- -license ./LICENSE.txt - the license file that is shown as an agreement before the installation starts.
If your custom installer template already contains the Licenses element in the
package.xml file of the package then CQtDeployer copies the license file into the
meta directory of the package only and keeps the Licenses element of your template.
Custom Template for QIF¶
Starting with CQtDeployer Version 1.5 you can use your own installer template. To do this, you must pass the path to your template to the qtifw parameter.
cqtdeployer ... -qtifw /path/to/my/custom/qif/template
Template¶
The QIF template should contain 2 folders: * packages * config
Attention¶
The name of the packages in the packages folder must match the names of the packages during deployment.
For example:
"targetPackage": [
[
"myCustomInstaller",
"tar1"
]
],
.
├── config
│ ├── config.xml
│ └── style.qss
└── packages
└── myCustomInstaller
└── meta
├── installscript.qs
└── package.xml
4 directories, 4 files
If the folder names do not match the package names then CQtDeployer will use the standard QIF package.
If you have only one package then you can use the name option for set name the application.
cqtdeployer ... -qtifw /path/to/my/custom/qif/template -name myCustomInstaller
Do not forget to rename the your package folder to the packaga name of the name option.¶
.
├── config
│ ├── config.xml
│ └── style.qss
└── packages
└── myCustomInstaller << "This is folder of the your package"
└── meta
├── installscript.qs
└── package.xml
4 directories, 4 files
Initialization of the qifw template¶
For initialize default templates you can use the getDefaultTemplate option. The getDefaultTemplate option extract default template of the cqtdeployer. This is can be very convinion if you want override default behavior of the installer or anothe distribution package.
Example¶
Getting default qt installer framwork template.¶
cqtdeployer getDefaultTemplate qtifw
Note¶
CQtDeployer will skip create a packages directory for the template because this commmnad do not contains any deploying data. If you want to prepare template with packages configurations then you should add deployed data to your command or your config.json file using bin or extraData options. If you create multi packages distribution then you need to configure your packages in your deploying command.
Example:¶
Extracting template with packages:
cqtdeployer getDefaultTemplate qtifw -bin myExecutable
Extracting template for multi packages distribution
cqtdeployer getDefaultTemplate qtifw -bin myExecutable1,myExecutable2 -targetPackage p1;myExecutable1,p2;myExecutable2
You also can use the config file for configure templates.
Config.json
{
"qtifw": true,
"bin": [
"myExecutable1",
"myExecutable2"
],
"targetPackage": [
["p1", "myExecutable1"],
["p2", "myExecutable2"]
]
}
Run CQtDeployer for generate template:
cqtdeployer -confFile Config.json getDefaultTemplate