How to Deploy Your Qt Cross-Platform Applications to Windows Operating System With the Qt Installer Framework
This tutorial explains the manner to deploy cross-platform projects you made with the Qt framework ( Qt Core, Qt Widgets, and Qt Quick alike) to Windows Operating Systems using the Qt Installer Framework.
Set up the environment
- operating system information (Windows OS)
- a set-up of Qt Creator IDE
If you do not have it already, Qt Creator IDE can be downloaded and installed from :
- Qt code from a simple application
If you wish to get conversant with the Qt cross-platform framework, I recommend following along the courses on Udemy from the following authors:
Daniel Gakwaya | Software Engineer at Blikoon Technologies| Udemy
Daniel is a Senior Software Engineer at Blikoon Technologies. He has been writing software since 2011 and Qt is one of…
Bryan Cairns | Computer Guru| Udemy
I am a highly trained computer professional with the following skills: Languages - C, C++, Dart, Flutter, QML, Java…
Go deploy Qt cross-platform application using Qt Installer Framework
Step 1. Verify if Qt Installer Framework is installed on your machine, if not, then use “Qt Maintenance Tool” to add it
The Qt Installer Framework provides a set of tools and utilities to create installers for the supported desktop Qt platforms: Linux, Microsoft Windows, and macOS. Check more at :
An example of a successful installation of Qt Installation Framework
We will run later the
binarycreator executable to build the installer for our Qt application.
Step 2. Create a directory structure that will contain configuration files and installable packages
Create a directory structure that reflects the design of the installer and allows the installer to be extended in the future. The directory must contain the subdirectories called config and packages.
It is not important where you place the directory for deployment with Qt Installer Framework, only mind it must have this required structure.
Step 3. Create a configuration file that contains information about how to build the installer binaries and online repositories
In the config directory, create a file called config.xml with the following contents:
- The <Title> element specifies the installer name displayed on the title bar.
- The <Name> element specifies the application name that is added to the page name and introduction text.
- The <Version> element specifies the application version number.
- The <Publisher> element specifies the publisher of the software (as shown in the Windows Control Panel, for example).
- The <StartMenuDir> element specifies the name of the default program group for the product in the Windows Start menu.
- The <TargetDir> element specifies that the default target directory displayed to users is InstallationDirectory in the home directory of the current user (because the predefined variable @HomeDir@ is used as a part of the value).
A complete list of all Windows Qt Installation Framework defined variables can be read here:
Step 4. Create a package information file that contains information about the installable components
In this easy scenario, the installer handles only one component that is called com.vendor.product’ . To provide the installer with information about the component, create a file called package.xml with the following contents and place it in the meta directory.
A default example of package.xml:
For more information about the package information file, see
How to interpret the content in package.xml
The information from the following elements is displayed on the component selection page, during installation:
- The <DisplayName> element specifies the name of the component in the list of components
- The <Description> element specifies the text that is displayed when the component is selected
- The <Version> element enables you to promote updates to users when they become available.
- The <Default> element specifies whether the component is selected by default. The value true sets the component as selected.
Step 5. Add Licensing Information
The <License> element specifies the name of the file that contains the text for the license agreement that is displayed on the license check page:
Step 6. Copy whatever you want to ship to your users in the ‘package/data’ directory
Content to be installed is stored in the data directory of a component.
At this stage, copy all the files and directories which were generated with windeployqt.
If you just landed here and you did not go through the deployment of Qt cross-platform applications using windeployqt, then use tutorial:
Step 7. Use the ‘binarycreator’ tool to create the installer.
Copy the path to the directory of the installer.
Open the command prompt and change to the installer directory.
Verify the content of the directory:
Copy the path to the Qt Installer Framework ‘binarycreator’ file.
Execute ‘binarycreator’ command with arguments in the terminal.
This is the example for my test deployment setup (location of files, directories, etc):
C:\Qt\Tools\QtInstallerFramework\4.0\bin\binarycreator.exe -c config/config.xml -p packages whatever.exe
The result after executing this command will be the generation of an executable file which is the installer of the application.
Test run the installer
Verify the deployment directory for the installer file
Run the installer
Install the application.
Run the Application
Locate the application’s executables in the user’s home directory (I set it up like this in the config.xml within the <TargetDir></TargetDir> node).
My example of the installer does not place information in the Start Menu. Other types of installers do so.
Check for the complete list of templates with installers that can be used with the Qt Installation Framework here: https://doc.qt.io/qtinstallerframework/qtifwexamples.html
Run the app.
You may find the app in Add/Remove Programs:
You may use the ‘maintenance tool’ executable deployed with the application or the ‘Modify’ option from “Add/Remove Programs” to update, uninstall, add components in the application.
Use the following alternative methods to deploy Qt cross-platform applications to Windows Operating System:
How to Deploy Your Qt Cross-Platform Applications to Windows Operating System By Using windeployqt
This tutorial explains the manner to deploy cross-platform projects you made with the Qt framework with windeployqt.
How to Deploy Your Qt Cross-Platform Applications to Windows Operating System By Adding Manually…
This tutorial guides you to deploy Qt cross-platform projects to Windows OS by adding manually the needed library…
In case you wish to deploy your application to Linux Operating System, feel free to use either solution of the following:
How to Deploy Your Qt Cross-Platform Applications to Linux Operating System With linuxdeployqt
This tutorial explains how we can deploy the projects you worked on with the Qt framework ( Qt Core, Qt Widgets, and Qt…