Installers contain components that are either embedded to the installer or loaded from a remote repository. In both cases, you need to use a file format and structure for the components that the installer can read.
Place all components in the same root directory, which is called the package directory. The directory name acts as a domain-like identifier, which identifies all components. For example,
Within the root directory, create subdirectories called
A package directory can look as follows:
-packages - com.vendor.root - data - meta - com.vendor.root.component1 - data - meta - com.vendor.root.component1.subcomponent1 - data - meta - com.vendor.root.component2 - data - meta
meta directory contains files that specify settings for deployment and the installation process. The files are not extracted by the installer. The directory must contain at least a package information file and all files that you refer to in the package information file, such as scripts, user interface files, and translations.
The package.xml file is the main source of information about a component. The following is an example of a package file:
<?xml version="1.0"?> <Package> <DisplayName>QtGui</DisplayName> <Description>Qt gui libraries</Description> <Description xml:lang="de_de">Qt GUI Bibliotheken</Description> <Version>1.2.3</Version> <ReleaseDate>2009-04-23</ReleaseDate> <Name>com.vendor.root.component2</Name> <Dependencies>com.vendor.root.component1</Dependencies> <Virtual>false</Virtual> <Licenses> <License name="License Agreement" file="license.txt" /> </Licenses> <Script>installscript.qs</Script> <UserInterfaces> <UserInterface>specialpage.ui</UserInterface> <UserInterface>errorpage.ui</UserInterface> </UserInterfaces> <Translations> <Translation>sv_se.qm</Translation> <Translation>de_de.qm</Translation> </Translations> <DownloadableArchives>component2.7z, component2a.7z</DownloadableArchives> <AutoDependOn>com.vendor.root.component3</AutoDependOn> <SortingPriority>123</SortingPriority> <UpdateText>This changed compared to the last release</UpdateText> <Default>false</Default> <ForcedInstallation>false</ForcedInstallation> <Essential>false</Essential> <Replaces>com.vendor.root.component2old</Replaces> </Package>
|DisplayName||Human-readable name of the component. Required.|
|Description||Human-readable description of the component. Required. Specify translations for the description as values of additional Description tags, with the xml:lang attribute set to the correct locale. If a localization that matches the locale is not found and an untranslated version exists, that one will be used. Otherwise no Description will be shown for that locale.|
|Version||Version number of the component in the following format: [0-9]+((\.|-)[0-9]+)* such as 1-1; 1.2-2; 3.4.7. Required. If a package needs to show the version number from a child rather than it's own (due to grouping of child packages) one can specify the attribute inheritVersionFrom with the package name the version needs to be inherited from.|
|ReleaseDate||Date when this component version was released. Required.|
|Name||Domain-like identification for this component. Required.|
|Dependencies||Comma-separated list of identifiers of components that this component depends on. Optionally, you can specify version numbers, separated by a dash (-). You can prefix version numbers with a comparison operator (=, >, <, >= or <=). Keep in mind that you have to use the character reference "<" to escape the left angle bracket (use "<" instead of "<" and "<=" instead of "<="). Optional. For more information, see Component Dependencies.|
|AutoDependOn||Comma-separated list of identifiers of components that this component has an automatic dependency on. The component is installed if and only if all of the specified dependencies are fulfilled. If a component has an automatic dependency on other components, the check box will not be visible next to the component in the component tree. The selection will be performed automatically. If the component was not installed before, it will be selected for installation only when all components from this list are also selected for installation. If the component was already installed, it will be selected for uninstallation when at least one of the components from this list is also selected for uninstallation. For more information, see Component Dependencies.|
|Virtual||Set to |
|SortingPriority||Priority of the component in the tree. The tree is sorted from highest to lowest priority, with the highest priority on the top.|
|Licenses||List of license agreements to be accepted by the installing user. To add several licenses, add several |
|Script||File name of a script being loaded. Optional. For more information, see Adding Operations.|
|UserInterfaces||List of pages to load. To add several pages, add several |
|Translations||List of translation files to load. To add several language variants, specify several |
|UpdateText||Description added to the component description if this is an update to the component. Optional.|
|Default||Possible values are: |
|Essential||Marks the package as essential to force a restart of the |
|ForcedInstallation||Determines that the package must always be installed. End users cannot deselect it in the installer.|
|Replaces||Comma-separated list of components to replace. Optional.|
|DownloadableArchives||Lists the data files (separated by commas) for an online installer to download. If there is some data inside the component and the package.xml and/or the script has no DownloadableArchives value, the repogen tool registers the found data automatically.|
|RequiresAdminRights||Set to |
Components can depend on one or several real or virtual components. Dependencies are defined by using the component identifier and, optionally, component version. Use a dash (-) to separate version numbers from identifiers.
You can prefix version numbers with a comparison operator (=, >, < (<), >= or <= (<=)) to indicate that the version number of the package is compared to the required version and has to be equal to, greater than, less than, greater than or equal to, or less than or equal to the version number specified in the dependency. If no comparison operator is given, it defaults to =.
data directory contains the content that the installer extracts during the installation. You must package the data as a 7zip archive (.7z). You can use either the archivegen tool that is delivered with the Qt Installer Framework or some other tool that generates 7zip archives.
© 2017 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. The Qt Company, Qt and their respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.