The Qt Installer Framework

Jeff Tranter


Jeff Tranter is a Qt Consulting Manager at ICS. Jeff oversees the architectural and high-level design of software systems for clients. Jeff’s leadership organizes global teams of developers on desktop and embedded applications.

By Jeff Tranter | Wednesday, July 31, 2013

In this blog post, we'll take a very brief look at the Qt Installer Framework.

Introduction

The Qt Installer Framework allows you to create cross-platform graphical software installers. It supports the desktop platforms supported by Qt: Windows, Mac OS X, and Linux. It allows you to easily create the standard type of graphical installers with multiple pages that guide a user through the process of installation. It also supports uninstalls and the ability to update components.

You can customize the installer pages to support a special user interface for user entered options and you can run scripts (in JavaScript using the QScriptEngine) to perform special operations.

The framework supports off-line installers that include all of the installable components and do not require a network connection. It also supports on-line installers that download the components from a server at install time.

It was developed as part of the Qt Project and is licensed in the same way as Qt is licensed. Digia uses it to create the official Qt, Qt Creator, and Qt SDK binary installers. The source code is hosted in gitorious and comes with some examples including a tutorial.

Often you will want to use a statically built version of Qt for the installer so that it will run standalone without requiring Qt to be installed on the end user's system. The documentation gives some details on how to do this.

As I write this, the framework supports Qt 4. There is, however,  a known issue that prevents it from linking under Qt 5 unless you configure Qt for a developer build. That issue should be corrected in the future.

Examples

Below are several example screen shots of pages produced by the installer tutorial running on a Linux desktop.

Conclusions

A graphical installer is not always desirable. On Linux systems, one or more native packages (e.g. RPM or DEB format) are often preferred. However, if you need to support many Linux distributions with differing package formats or if your application requires user input to install it, it can be a good choice.

On Macintosh platforms, the best practice is generally to provide a DMG (Disk Image) file that the user will click on and drag and drop to their Applications folder.

On Windows, a graphical installer is generally the preferred option.

It is not necessary to use the Qt Installer Framework to install Qt programs. There are other installer frameworks (some free and some commercial) that also work fine. The main advantage of this particular framework is it is free, it is cross-platform and should be familiar to Qt developers.

In summary, if you need a graphical installer for your Qt-based application, the Qt Installer Framework may be just what you are looking for.

References

  1. Documentation
  2. Source code

Comments

Comment: 

I'm trying to write my first QT installer and having truble.

In my installer, in one of the packages, i need to run an .exe file at the end of the installation

and add an enviorment variable as well.

I think the way to do it is with the script option in the package.xml file

but i don't know how to write that script, I cannot find anywhare a step by step explanation of how to do it.

can someone help?

Comment: 
The best place to ask for help is on the Qt interest mailing list. See http://lists.qt-project.org/mailman/listinfo/interest