/**************************************************************************** ** ** Copyright (C) 2023 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Installer Framework. ** ** $QT_BEGIN_LICENSE:FDL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Free Documentation License Usage ** Alternatively, this file may be used under the terms of the GNU Free ** Documentation License version 1.3 as published by the Free Software ** Foundation and appearing in the file included in the packaging of ** this file. Please review the following information to ensure ** the GNU Free Documentation License version 1.3 requirements ** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ // ********************************************************************** // NOTE: the sections are not ordered by their logical order to avoid // reshuffling the file each time the index order changes (i.e., often). // Run the fixnavi.pl script to adjust the links to the index order. // ********************************************************************** /*! \page index.html \nextpage ifw-overview.html \title Qt Installer Framework Manual \section1 Version \ifwversion Qt Installer Framework is a robust toolset for creating custom online and offline installers. It’s highly configurable and customizable and works for all supported Qt platforms: Linux, Microsoft Windows, and macOS. Here are some examples to illustrate the versatility of Qt Installer Framework. \note Report bugs and suggestions for the Qt Installer Framework project in the \l{https://bugreports.qt.io/browse/QTIFW}{Qt Bugtracker}. \list \li \l{Overview of Qt Installer Framework} \li \l{Getting Started} \li \l{End User Workflows} \list \li \l{Initial Installation} \li \l{Adding Components} \li \l{Removing Components} \li \l{Updating Components} \li \l{Specifying Settings} \li \l{Using From Command Line} \endlist \li \l{Tutorial: Creating an Installer} \li \l{Creating Installers} \list \li \l{Creating Offline Installers} \li \l{Creating Online Installers} \li \l{Promoting Updates} \li \l{Customizing Installers} \endlist \li \l{Qt Installer Framework Examples} \li \l{Reference} \list \li \l{Command Line Interface} \li \l{Configuration File} \li \l{Package Directory} \li \l{Alias Definition File} \li \l{Controller Scripting} \li \l{Component Scripting} \li \l{Operations} \li \l{Tools} \li \l{Scripting API} \li \l{C++ API} \endlist \li \l{Known Issues} \endlist */ /*! \previouspage ifw-tutorial.html \page ifw-creating-installers.html \nextpage ifw-offline-installers.html \title Creating Installers To create offline and online installers, do the following: \list 1 \li Create a \e {package directory} for the installable components. For more information, see \l{Package Directory}. \li Create a configuration file called \c config.xml in the \c config directory. It has information about how to build the installer binaries and online repositories. For more information about the file format and available settings, see \l{Configuration File}. \li Create a package information file called \c package.xml in the \c {packages\{component}\meta} directory. It has settings for deployment and the installation process. For more information, see \l{Meta Directory}. \li Create installer content and copy it to the package directory. For more information, see \l{Data Directory}. \li For online installers, use the \c repogen tool to create the repository that has the installable content and upload the repository to a web server. \li Use the \c binarycreator tool to create the installer. For more information, see \l{Tools}. \endlist For an example of how to create a simple installer that uses the predefined installer pages, see \l{Tutorial: Creating an Installer}. The following sections describe how to create different types of installers: \list \li \l{Creating Offline Installers} \li \l{Creating Online Installers} \li \l{Promoting Updates} \li \l{Customizing Installers} \endlist */ /*! \previouspage ifw-reference.html \page ifw-cli.html \nextpage ifw-globalconfig.html \title Command Line Interface Installers created with the Qt Installer Framework have the following command line interface syntax: \code installer.exe [options] command \endcode Here \c [options] is one or a combination of supported options in either short or long form. In addition some options may require mandatory value(s) that can be passed using the assignment operator or space. The \c command is one of the supported command line installer operations to be run headless in text mode. Some commands may be provided with optional \c separated by space. The \c list is used to set internal key-value pairs by the framework. Installer will return an exit code after it is executed. Exit code can be used to determine whether the installation was successful, if the installation has an mandatory update etc. See \c PackagemanagerCore::Status. \section1 Summary of Options Options marked with \c CLI are only available when running in headless mode, the rest of the options can be used also in graphical mode. For the most up-to-date list of available options with a specific version of Qt Installer Framework, refer \c --help option output of \l installerbase. \table \header \li Option \li Usage \row \li -?, -h, --help \li Displays help. \row \li -v, --version \li Displays version information. \row \li -d, --verbose \li Verbose mode. Prints out more information. \row \li -g, --logging-rules \li Enables logging according to passed rules. Comma separated logging rules have the following syntax: \c{loggingCategory=true/false}. Passing empty logging rules enables all logging categories. The following rules enable a single category: \c{ifw.*=false, ifw.category=true}. The available logging categories can be referenced with --help option. \row \li --ar, --add-repository \li Add a local or remote repository to the list of user defined repositories. \row \li --at, --add-temp-repository \li Add a local or remote repository to the list of temporary available repositories. \row \li --st, --set-temp-repository \li Set a local or remote repository as temporary repository, it is the only one used during fetch. Note: a URI must be prefixed with the protocol, i.e. file:///, https://, http:// or ftp://. \row \li --sp, --system-proxy \li Use system proxy on Windows and Linux. This option has no effect on macOS. (Default) \row \li --np, --no-proxy \li Do not use system proxy. \row \li --su, --start-updater \li Start application in updater mode. This will override the internal marker that is used to distinguish which kind of binary is currently running. \row \li --sm, --start-package-manager \li Start application in package manager mode. This will override the internal marker that is used to distinguish which kind of binary is currently running. \row \li --sr, --start-uninstaller \li Start application in uninstaller mode. This will override the internal marker that is used to distinguish which kind of binary is currently running. \row \li -t, --root \li [CLI] Set the installation root directory. \row \li --oi, --offline-installer-name \li [CLI] Set custom filename for the generated offline installer. Without this the original filename is used with an added "_offline-yyyy-MM-dd" suffix. \row \li -p, --platform \li Use the specified platform plugin. \row \li --nf, --no-force-installations \li Allow deselecting components that are marked as forced. \row \li --nd, --no-default-installations \li Deselects components that are marked as default. \row \li --ns, --no-size-checking \li Disable checking of free space for the installation target. \row \li --sv, --show-virtual-components \li Show virtual components in the installer and the package manager. \row \li -i, --install-compressed-repository \li Installs a QBSP or a 7z file. The QBSP (Board Support Package) file must be a .7z file which contains a valid repository. \row \li -c, --create-local-repository \li Create a local repository inside the installation directory. This option has no effect on online installers. \row \li --fp, --filter-packages \li [CLI] Comma separated list of additional key-value pair filters used to query packages with the search command. The keys can be any of the possible package information elements, like \c DisplayName and \c Description. \row \li --cp, --cache-path \li Sets the path used for local metadata cache. The path must be writable by the current user. \row \li --type package|alias \li [CLI] Sets the type of the given arguments for commands supporting multiple argument types, like search. Defaults to alias. \row \li --am, --accept-messages \li [CLI] Accepts all message queries without user input. \row \li --rm, --reject-messages \li [CLI] Rejects all message queries without user input. \row \li --aa, --auto-answer \li [CLI] Automatically answers the message queries with the message identifier and a button value. Several \c{identifier=value} pairs can be given separated with a comma, for example \c{--auto-answer message.id=Ok,message.id2=Cancel}. \row \li --da, --default-answer \li [CLI] Automatically answers to message queries with their default values. \row \li --al, --accept-licenses \li [CLI] Accepts all licenses without user input. \row \li --file-query \li [CLI] Automatically sets the QFileDialog values getExistingDirectory() or getOpenFileName() requested by the install script. Several \c{identifier=value} pairs can be given separated with a comma, for example \c{--file-query filedialog.id=C:Temp,filedialog.id2=C:Temp2}. \row \li -c, --confirm-command \li [CLI] Confirms starting of installation, update or removal of components without user input. \row \li -s, --script \li Execute the script given as an argument. \row \li --ss, --start-server \li Starts the application as headless process waiting for commands to execute. Mode can be DEBUG or PRODUCTION. In the DEBUG mode, the option values can be omitted. Note: The server will not shutdown on its own, you need to quit the process by hand. \row \li --sc, --start-client \li Starts the application to debug the client-server communication. If a value is omitted, the client will use a default instead. Note: The server process is not started by the client application in that case, you need to start it on your own. \row \li -q, --squish-port \li Give a port where Squish can connect to. If no port is given, default port 11233 is used. Note: To enable Squish support, you first need to build IFW with SQUISH_PATH parameter where SQUISH_PATH is pointing to your Squish installation folder: \c{/bin/qmake -r SQUISH_PATH=}. \row \li --mco, --max-concurrent-operations \li Specifies the maximum number of threads used to perform concurrent operations in the unpacking phase of components. Set to a positive number, or 0 (default) to let the application determine the ideal thread count from the amount of logical processor cores in the system. \endtable \section1 Summary of Commands \table \header \li Command \li Usage \row \li in, install \li Install packages and aliases given as an argument. If no arguments are given, install the default package set. \row \li ch, check-updates \li Show information about available updates on the \MT. \row \li up, update \li Update packages given as an argument. If no packages are given, install all available updates. \row \li rm, remove \li Uninstall selected packages and their child components. \row \li li, list \li List information about currently installed packages. \row \li se, search \li Search available aliases or packages. If no search pattern is given, show all available packages. \note The \c --filter-packages option can be used to specify additional filters for the search operation. See \l{Summary of Options}. \note The \c --type option can be used to specify the content type to search. See \l{Summary of Options}. \row \li co, create-offline \li Create offline installer from selected packages. \row \li cc, clear-cache \li Clear contents of the local metadata cache. \row \li pr, purge \li Uninstall all packages and remove the program directory. \endtable */ /*! \previouspage ifw-cli.html \page ifw-globalconfig.html \nextpage ifw-component-description.html \title Configuration File The configuration file customizes the UI and behavior of an installer. The file is typically called \c config.xml and located in the \c config directory. A minimal configuration file consists of an \c root element with \c and \c elements as children. All other elements are optional, and can appear in arbitrary order. The following example shows a typical configuration file: \quotefile examples/config.xml \section1 Summary of Configuration File Elements The following table summarizes the elements in the configuration file. \note We recommend that you place all files that you refer to in the configuration file in the \c config directory. However, you can also use relative paths, which the tools resolve relative to the location of the config.xml file. \note The filenames of the referred files must be unique. That is, if you want to use the same image for both \c and \c , you must add two copies of the image file with different filenames. You can use predefined variables (embedded in @ characters) as values of the elements. For more information, see \l{Predefined Variables}. \table \header \li Element \li Description \row \li Name \target ProductNameTarget \li Name of the product being installed. This is mandatory. \row \li Version \li Version of the product being installed in the following format: [0-9]+((\\.|-)[0-9]+)* such as 1-1; 1.2-2; 3.4.7. This is mandatory. \row \li Title \li Name of the installer as displayed on the title bar. \row \li Publisher \li Publisher of the software (as shown in the Windows Control Panel). \row \li ProductUrl \li URL to a page that contains product information on your web site. \row \li InstallerApplicationIcon \li Filename for a custom installer icon. The actual file is looked up by attaching a '.icns' (macOS), '.ico' (Windows) suffix. No functionality on Unix. \row \li InstallerWindowIcon \li Filename for a custom window icon in PNG format for the Installer application. Used on Windows and Linux, no functionality on macOS. \row \li Logo \li Filename for a logo in PNG format used as \c QWizard::LogoPixmap. \row \li Watermark \li Filename for a watermark in PNG format used as \c QWizard::WatermarkPixmap. If \c is set to \c true, the watermark is hidden. \row \li Banner \li Filename for a banner in PNG format used as \c QWizard::BannerPixmap (only used by ModernStyle). \row \li Background \li Filename for an image in PNG format used as \c QWizard::BackgroundPixmap (only used by MacStyle). If \c is set to \c true, the background is hidden. \row \li PageListPixmap \li Filename for an image in PNG format shown on top of installer page list. The image is shown only if \c is also set to \c true. \row \li WizardStyle \li Set the wizard style to be used ("Modern", "Mac", "Aero" or "Classic"). \row \li StyleSheet \li Set the stylesheet file. \row \li WizardDefaultWidth \li Sets the default width of the wizard in pixels. Setting a banner image will override this. You can add the \c em or \c ex suffix to the specified value to use the \e em or \e ex unit, as in a CSS file. \row \li WizardDefaultHeight \li Sets the default height of the wizard in pixels. Setting a watermark image will override this. You can add the \c em or \c ex suffix to the specified value to use the \e em or \e ex unit, as in a CSS file. \row \li WizardMinimumWidth \li Sets the minimum width of the wizard in pixels. You can add the \c em or \c ex suffix to the specified value to use the \e em or \e ex unit, as in a CSS file. \row \li WizardMinimumHeight \li Sets the minimum height of the wizard in pixels. You can add the \c em or \c ex suffix to the specified value to use the \e em or \e ex unit, as in a CSS file. \row \li WizardShowPageList \li Set to \c false if the widget listing installer pages on the left side of the wizard should not be shown. Defaults to \c true. If visible, this widget hides \c QWizard::WatermarkPixmap on \c QWizard::ClassicStyle and \c QWizard::ModernStyle, and \c QWizard::BackgroundPixmap on \c QWizard::MacStyle. \row \li ProductImages \li A list of images to be shown on \c PerformInstallationPage. This element can have one or several \c child elements that contain an \c child element and an optional \c child element. The \c element specifies a filename for an image in PNG format. Optional \c can be specified for each image. Clicking on the image will open the \c in a browser. If the \c is a reference to a file, it will be opened with a suitable application instead of a Web browser. \row \li TitleColor \li Set the color of the titles and subtitles (takes an HTML color code, such as "#88FF33"). \row \li RunProgram \li Command executed after the installer is done if the user accepts the action. Provide the full path to the application. \row \li RunProgramArguments \li Arguments passed to the program specified in \c . You can add several \c child elements that each specify an argument to \c . \row \li RunProgramDescription \li Text shown next to the check box for running the program after the installation. If \c is set but no description provided, the UI will display \uicontrol {Run now.} instead. \row \li StartMenuDir \li Name of the default program group for the product in the Windows \uicontrol Start menu. \row \li TargetDir \li Default target directory for installation. On Linux, this is usually the user's home directory. \row \li AdminTargetDir \li Default target directory for installation with administrator rights. Only available on Linux, where you usually do not want to install in the administrator user's home directory. \row \li LocalCacheDir \li Directory name for storing the metadata cache. This does not include the leading directories, which are determined automatically based on a suitable platform specific location for storing cache files. The user may override the path from the installer settings. The default value is a UUID generated from the name of the product being installed. \row \li PersistentLocalCache \li Set to \c false if the fetched metadata should be removed from the local cache when the installer exits. Otherwise the contents of the cache are kept to speed up subsequent fetches. Defaults to \c true. \row \li RemoteRepositories \li List of remote repositories. This element can contain several \c child elements that each contain the \c child element that specifies the URL to access the repository. For more information, see \l{Configuring Repositories}. \row \li RepositoryCategories \li Name of a category that can contain a list of \c child elements. For more information, see \l{Configuring Repository Categories}. \row \li MaintenanceToolName \li Filename of the generated \MT. Defaults to \e maintenancetool. The platform-specific executable file extension is appended. \row \li MaintenanceToolIniFile \li Filename for the configuration of the generated \MT. Defaults to \e {MaintenanceToolName}.ini. \row \li MaintenanceToolAlias \li Filename for an alias of the \MT that will be created to the Applications directory. Optional. Only used on macOS. \row \li RemoveTargetDir \li Set to \c false if the target directory should not be deleted when uninstalling. \row \li AllowNonAsciiCharacters \li Set to \c true if the installation path can contain non-ASCII characters. \row \li DisableAuthorizationFallback \li Set to \c true if the installation should not ask users to run the authorization fallback in case of authorization errors. Instead abort the installation immediately. \row \li DisableCommandLineInterface \li Set to \c true if command line interface features should be disabled. This prevents the user from passing any consumer command to installer, like \c install, \c update and \c remove. Other options can still be used normally. Defaults to \c false. \row \li RepositorySettingsPageVisible \li Set to \c false to hide the repository settings page inside the settings dialog. \row \li AllowRepositoriesForOfflineInstaller \li Set to \c false to disable usage of any temporary or user configured repositories set for offline installers. The maintenance tool written by an offline installer can still access the repositories. Defaults to \c true. \row \li AllowSpaceInPath \li Set to \c false if the installation path cannot contain space characters. \row \li DependsOnLocalInstallerBinary \li Set to \c true if you want to prohibit installation from an external resource, such as a network drive. This might make sense for e.g. very big installers. The option is only used on Windows. \row \li TargetConfigurationFile \li Filename for the configuration file on the target. Default is components.xml. \row \li AliasDefinitionsFile \li Filename for a XML document containing the definitions for component aliases. For more information about how to declare component aliases in the file, see \l{Alias Definition File}. \row \li Translations \li List of translation files to be used for translating the user interface. To add several translation files, specify several \c child elements that each specify the name of the translation. Optional. For more information, see \l{Translating Pages} and \l{Configuring and Overwriting Default Translations}. \row \li UrlQueryString \li This string needs to be in the form "key=value" and will be appended to archive download requests. This can be used to transmit information to the webserver hosting the repository. \row \li ControlScript \li Filename for a custom installer control script. See \l{Controller Scripting}. \row \li CreateLocalRepository \li Set to \c true if you want to create a local repository inside the installation directory. This option has no effect on online installers. The repository will be automatically added to the list of default repositories. \row \li InstallActionColumnVisible \li Set to \c true if you want to add an extra column into component tree showing install actions. This extra column indicates whether a component is going to be installed or uninstalled, or just stay installed or uninstalled. \row \li SupportsModify \li Set to \c false if the product does not support modifying an existing installation. \row \li SaveDefaultRepositories \li Set to \c false if default repositories \c should not be saved to \e {MaintenanceToolName}.ini. By default default repositories are saved. Not saving the repositories means than when you run \e maintenancetool there are no default repositories in use. \row \li AllowUnstableComponents \li Set to \c true if other components are allowed to be installed although there are unstable components. A component is \e unstable if it is missing a dependency, has errors in scripts, and so on. Unstable components are grayed in the component tree, and therefore cannot be selected. By default, the value is \c false which means that the installation will be aborted if unstable components are found. \endtable */ /*! \previouspage ifw-globalconfig.html \page ifw-aliasconfig.html \nextpage noninteractive.html \title Alias Definition File The alias definition file defines the available component aliases and their properties. The file is typically called \c aliases.xml and located in the \c config directory. The component names of the Qt Installer Framework follow a domain-like identifier syntax, for example \c com.vendor.root, \c com.vendor.root.subcomponent, and so on. While this allows an easy way to construct a tree from the components when running the installer in graphical mode, the names can be unintuitive for command line usage, where the components are not displayed in a tree view. Instead of relying on the domain-like names for CLI usage, the packager can also define component aliases for existing components. An alias is another name for a single component or a collection of components. It can be used to declare alternative names for existing components that are easier to type and combine multiple components under the same alias name, for easier selection. The following example shows a possible alias definition file: \quotefile examples/aliases.xml \section1 Summary of Alias Definition File Elements The following table summarizes the elements in the alias definition file. \table \header \li Element \li Description \row \li Name \li Name of component alias. \row \li DisplayName \li Human-readable name of the component alias. \row \li Description \li Human-readable description of the component alias. \row \li Version \li Version number of the component alias. \row \li Virtual \li Set to \c true to hide the component alias from the installer. This also makes the alias unselectable by the user. \row \li RequiredComponents \li Comma-separated list of identifiers of components that this component alias requires. The components are selected for installation when the component alias is selected. Note that the components must be selectable by the user, so virtual or otherwise unselectable components cannot be listed as a requirement. \row \li RequiredAliases \li Comma-separated list of aliases that this component alias requires. The required aliases are selected for installation when this component alias is selected. \row \li OptionalComponents \li Comma-separated list of identifiers of components that this component alias optionally depends on. The components are selected for installation when the component alias is selected, if the components exists and are user selectable. Even if the components cannot be found in the installer, this alias is not marked unstable. \row \li OptionalAliases \li Comma-separated list of aliases that this component alias optionally depends on. The listed aliases are selected for installation when this component alias is selected, if the aliases exist. Even if the aliases don't exists in the installer, this alias is not marked unstable. \endtable */ /*! \previouspage ifw-updates.html \page ifw-customizing-installers.html \nextpage Qt Installer Framework Examples \title Customizing Installers You can use scripting to customize installers by: \list \li Adding Qt Installer Framework \e operations that are prepared by the scripts and performed by the installer. \li Adding new pages that you specify in the package.xml file and place in the \c packages directory. \li Modifying existing pages by inserting custom user interface elements into them as single widgets. \li Adding language variants. \endlist You can use both \e {component scripts} and a \e {control script} to customize installers. A component script is associated with a particular component by specifying it in the \c Script element of the package.xml file of the component. The script is loaded when the component's metadata is fetched. For more information about component scripts, see \l{Component Scripting}. A control script is associated with the whole installer by specifying it in the \c ControlScript element of the config.xml file of the installer. Control scripts can be part of the installer resources or be passed on the command line. They can be used to modify the installer pages that are presented to users before components are loaded. Also, you can use them to modify pages in the uninstaller. For more information, see \l{Controller Scripting}. For more information about the global JavaScript objects that can be used in component and control scripts, see \l{Scripting API}. \section1 Adding Operations You can use component scripts to perform Qt Installer Framework operations during the installation process. Typically, operations manipulate files by moving, copying, or patching them. Use the QInstaller::Component::addOperation or QInstaller::Component::addElevatedOperation function to add operations. For more information, see \l {Adding Operations to Components}. In addition, you can implement methods to register custom installation operations in the installer by deriving KDUpdater::UpdateOperation. For more information, see \l {Registering Custom Operations}. For a summary of available operations, see \l {Operations}. \section1 Adding Pages A component can contain one or more user interface files, which are placed into the installer by a component or control script. The installer automatically loads all user interface files listed in the \c UserInterfaces element of the package.xml file. \section2 Using Component Scripts to Add Pages To add a new page to the installer, use the installer::addWizardPage() method and specify the location of the new page. For example, the following code adds an instance of \c MyPage before the ready for installation page: \code installer.addWizardPage( component, "MyPage", QInstaller.ReadyForInstallation ); \endcode You can use component scripts to access the loaded widgets by calling the \l component::userInterface() method with the class name of the widget, as illustrated by the following code snippet: \code component.userInterface( "MyPage" ).checkbox.checked = true; \endcode You can also have a callback for the page that is added. To access it, use the object name set in the UI file (for example, \c "MyPage"). Then create the \c{Dynamic${ObjectName}Callback} function (for example, \c {DynamicMyPageCallback}): \code Component.prototype.DynamicMyPageCallback = function() { var page = gui.pageWidgetByObjectName("DynamicMyPage"); page.myButton.click, page.myWidget.subWidget.setText("hello") } \endcode You can access widgets by using their object names that are set in the UI file. For example, \c myButton and \c myWidget are widget object names in the code above. \section1 Adding Widgets You can use component or control scripts to insert custom user interface elements into the installer as single widgets (such as a check box). To insert a single widget, use the installer::addWizardPageItem method. For example, the following code snippet adds an instance of \c MyWidget to the component selection page from within a script: \code installer.addWizardPageItem( component, "MyWidget", QInstaller.ComponentSelection ); \endcode \section1 Interacting with Installer Functionality You can use control scripts to execute installer functions automatically in tests, for example. The following snippet illustrates how to automatically click the \uicontrol Next button on the target directory selection page: \code Controller.prototype.TargetDirectoryPageCallback = function() { gui.clickButton(buttons.NextButton); } \endcode \section1 Translating Pages The installer uses the Qt Translation system to support the translation of user-readable output to several languages. To provide end users with localized versions of strings contained in the component scripts and user interfaces, create QTranslator files that the installation system loads along with the component. The installer loads the translation file that matches the current system locale. For example, if the system locale is German, the de.qm file is loaded. In addition, a localized \c license_de.txt is shown instead of the default \c license.txt if it is found. Translations need to be added to the \c package.xml file to be activated for a component: \code de.qm \endcode Use the \c {qsTranslate()} function for literal text within scripts. Additionally, you can add the \c Component.prototype.retranslateUi method to the script. It is called when the language of the installer changes and the translation file is loaded. \note The translation system can also be used to customize the UI. Use e.g. an \c en.ts file to replace any text in the installer with a custom English version. \section1 Configuring and Overwriting Default Translations The installer has been localized into several languages. System language is used to define the loaded language. In case you want to define the used language for your installer, define the languages in \c config.xml using the \c element. For example, using only German translations: \code ifw_de qt_de \endcode The default translations can be also overwritten. Write your own translation file and add it to a custom resource called \c :/translations_new. This custom resource can be added to the installer using \c binarycreator option \c -r. For more information, see \l{Summary of binarycreator Parameters}. If the translated language is not already part of the existing translations of Qt Installer Framework, you need to also include the Qt Base translation for that language in the resource file. For this you need to point to the \c qtbase_*.qm for your language from the location of \c QT_INSTALL_TRANSLATIONS and alias it in the resource file. For example, for the Czech translation a custom \c translations_new.qrc should look like this: \code ifw_cs.qm %QT_INSTALL_TRANSLATIONS%/qtbase_cs.qm \endcode The path for replacing \c QT_INSTALL_TRANSLATIONS can be retrieved from the output of \c{qmake -query} of your Qt installation. */ /*! \previouspage ifw-globalconfig.html \page ifw-component-description.html \nextpage ifw-aliasconfig.html \title Package Directory 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. \section1 Package Directory Structure Place all components in the same root directory, which is called the \e {package directory}. The directory name acts as a domain-like identifier, which identifies all components. For example, \c com.vendor.root. The directory name must not contain \c : or \c - characters as those are reserved for separating the version number from the identifier. Within the root directory, create subdirectories called \c data and \c meta. A package directory can look as follows: \code -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 \endcode \section1 Meta Directory The \c 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. \section2 Package Information File Syntax The package.xml file is the main source of information about a component. The following is an example of a package file: \quotefile examples/package.xml \section2 Summary of Package Information File Elements \table \header \li Element \li Description \row \li DisplayName \li Human-readable name of the component. Required. Specify translations for the name of the component as values of additional DisplayName tags, with the xml:lang attribute set to the correct locale. \row \li Description \li Human-readable description of the component. Required. Translations may be specified similarly to DisplayName tag. 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. User clickable external links, for example a component's homepage, can be included in component description by specifying a URL address like this: {external-link}='https://www.qt.io/'. The URL must be valid and contain a full path to the desired resource. \row \li Version \li 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. \row \li ReleaseDate \li Date when this component version was released. Required. \row \li Name \li Domain-like identification for this component. Required. \row \li Dependencies \li 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 \l{Component Dependencies}. \row \li AutoDependOn \li 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, but this does not change the visibility of the check box in the updater view where the end user may still manually select the component for update. When running an installer or a \MT in package manager mode, 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 or for update when at least one of the components from this list is also selected for uninstallation or for update. For more information, see \l{Component Dependencies}. \row \li Virtual \li Set to \c true to hide the component from the installer. This also hides any child components this component may have, including their descendants. Note that setting this on a root component does not work. \row \li SortingPriority \li Priority of the component in the tree. The tree is sorted from highest to lowest priority, with the highest priority on the top. \row \li Licenses \li List of license agreements to be accepted by the installing user. To add several licenses, add several \c child elements that each specify the license \c name and \c file and, optionally, \c priority. ASCII and UTF8 file formats are supported for license files. If there are translations listed for this component, the installer will also look for translated licenses. These need to have the same name as the original license file but with an added locale identifier. If for example the license file is called license.txt and there is German translation specified, the installer will also include a license_de_de.txt file (and show that when installing on a German system). \row \li Script \li File name of a script being loaded. Optional. Specifying the \c {postLoad="true"} attribute will cause the script to be loaded only to the component that is selected for update or install. With the attribute, the script is loaded right before the component installation starts. This will speed up the installer if there are large amounts of components with install scripts in the repository. Make sure the script does not contain anything that needs to be evaluated before the install tree view is shown. For more information, see \l{Adding Operations} and \l{Using postLoad in component script}. \row \li UserInterfaces \li List of pages to load. To add several pages, add several \c child elements that each specify the filename of a page. Optional. For more information, see \l{Adding Pages}. \row \li Translations \li List of translation files to load. To add several language variants, specify several \c child elements that each specify the filename of a language variant. The installer loads the translation file that matches the current system locale. For example, if the system locale is German, the de.qm file is loaded. Optional. For more information, see \l{Translating Pages}. \row \li UpdateText \li Description added to the component description if this is an update to the component. Optional. \row \li Default \li Possible values are: \c true, \c false, and \c script. Set to \c true to preselect the component in the installer. This takes effect only on components that have no visible child components. The boolean values are evaluated directly, while \c script is resolved during runtime. Add the name of the script as a value of the \c