Creating Online Installers

Online installers fetch the repository description (Updates.xml), in addition to the one stored inside of the binary. Create a repository and upload it to a web server. Then specify the location of the repository in the config.xml file that you use to create the installer.

Creating Repositories

Use the repogen tool to create online repositories of all packages of one package directory:

repogen.exe -p <package_directory> <repository_directory>

For example, to create a repository that contains only org.qt-project.sdk.qt and org.qt-project.sdk.qtcreator, enter the following command:

repogen.exe -p packages -i org.qt-project.sdk.qt,org.qt-project.sdk.qtcreator repository

When the repository has been created, upload it to a web server. You must specify the location of the repository in the installer configuration file.

Configuring Repositories

The <RemoteRepositories> element in the installer configuration file (config.xml) can contain a list of several repositories. Each of them can have the following settings:

  • <Url>, which points to a list of available components.
  • <Enabled>, with 0 disabling this repository.
  • <Username>, which is used as user on a protected repository.
  • <Password>, which sets the password to use on a protected repository.
  • <DisplayName>, which optionally sets a string to display instead of the URL.

The URL needs to point to the Updates.xml file that lists the available components. For example:

<RemoteRepositories>
     <Repository>
             <Url>http://www.example.com/packages</Url>
             <Enabled>1</Enabled>
             <Username>user</Username>
             <Password>password</Password>
             <DisplayName>Example repository</DisplayName>
     </Repository>
</RemoteRepositories>

The installer works only if it can access the repository. If the repository is accessed after the installation, the maintenance tool rejects installation. However, uninstallation is still possible. A repository can be enabled or disabled by default. For repositories requiring authentication, the details can also be set here, although entering a password here is usually not advisable as it is saved in plain text. Authentication details not set here will be gotten at runtime using a dialog. The user can work around these settings at runtime.

Configuring Repository Categories

The <RepositoryCategory> element in the installer configuration file (config.xml) can contain a list of several <RemoteRepositories> elements. Each <RemoteRepositories> element within the <RepositoryCagetory> element is considered a category. Each catecory can have a <DisplayName>, a <Tooltip>, a <Preselected> element and several <Repository> elements. Repository categories are shown in the component selection page, on the left side of the component selection widget:

"Component selection Page"

By default, only repositories with no category are shown in the component selection widget. Checking one or several repositories and pressing Fetch will update the widget to show content also from the selected categorized repositories. Components in the repository categories are marked as unstable meaning that you can install other components although some components have missing dependencies, script errors and so on. For more information about unstable components, see Summary of Configuration File Elements.

Example of creating a repository category:

<RepositoryCategories>
    <RemoteRepositories>
         <Displayname>Category 1</Displayname>
         <Preselected>true</Preselected>
         <Tooltip>Tooltip for category 1</Tooltip>
         <Repository>
                 <Url>http://www.example.com/packages</Url>
                 <Enabled>1</Enabled>
                 <Username>user</Username>
                 <Password>password</Password>
                 <DisplayName>Example repository</DisplayName>
         </Repository>
    </RemoteRepositories>
</RepositoryCategories>

Creating Installer Binaries

To create an online installer by using the binarycreator tool, enter the following command:

<location-of-ifw>\binarycreator.exe -t <location-of-ifw>\installerbase.exe -p <package_directory> -c <config_directory>\<config_file> -e <packages> <installer_name>

For example, enter the following command to create an installer binary called SDKInstaller.exe that will not contain data for org.qt-project.sdk.qt and org.qt-project.qtcreator, because those packages are downloaded from a remote repository:

binarycreator.exe -p installer-packages -c installer-config\config.xml -e org.qt-project.sdk.qt,org.qt-project.qtcreator SDKInstaller.exe

Reducing Installer Size

Even if the components are fetched from a web server, binarycreator adds them to the installer binary by default. However, when the installer checks the web server for updates, end users are spared a download if new versions are not available.

Alternatively, you can create online installers that do not contain any data and that fetch all the data from the web server. Use the -n parameter of the binarycreator tool and only add the root component to the installer. Usually the root component is empty and hence only adds the XML description of the root.

For more information about the options that you have, see Summary of binarycreator Parameters.

© 2021 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.