6 Configure and run the Qt Installer Framework to generate a Qt installer.
15 This :manual:`cpack generator <cpack-generators(7)>` generates
16 configuration and meta information for the `Qt Installer Framework
17 <http://doc.qt.io/qtinstallerframework/index.html>`_ (QtIFW),
18 and runs QtIFW tools to generate a Qt installer.
20 QtIFW provides tools and utilities to create installers for
21 the platforms supported by `Qt <https://www.qt.io>`_: Linux,
22 Microsoft Windows, and macOS.
24 To make use of this generator, QtIFW needs to be installed.
25 The :module:`CPackIFW` module looks for the location of the
26 QtIFW command-line utilities, and defines several commands to
27 control the behavior of this generator. See `Hints for Finding QtIFW`_.
32 You can use the following variables to change the behavior of the CPack ``IFW``
38 .. variable:: CPACK_IFW_VERBOSE
42 Set to ``ON`` to enable addition debug output.
43 By default is ``OFF``.
48 .. variable:: CPACK_IFW_PACKAGE_TITLE
50 Name of the installer as displayed on the title bar.
51 If not specified, it defaults to :variable:`CPACK_PACKAGE_DESCRIPTION_SUMMARY`.
53 .. variable:: CPACK_IFW_PACKAGE_PUBLISHER
55 Publisher of the software (as shown in the Windows Control Panel).
56 If not specified, it defaults to :variable:`CPACK_PACKAGE_VENDOR`.
58 .. variable:: CPACK_IFW_PRODUCT_URL
60 URL to a page that contains product information on your web site.
62 .. variable:: CPACK_IFW_PACKAGE_ICON
64 Filename for a custom installer icon. It must be an absolute path.
65 This should be a ``.icns`` file on macOS and a ``.ico`` file on Windows.
66 It is ignored on other platforms.
68 .. variable:: CPACK_IFW_PACKAGE_WINDOW_ICON
70 Filename for a custom window icon in PNG format for the Installer
71 application. It must be an absolute path.
73 .. variable:: CPACK_IFW_PACKAGE_LOGO
75 Filename for a logo image in PNG format, used as ``QWizard::LogoPixmap``.
76 It must be an absolute path.
78 .. variable:: CPACK_IFW_PACKAGE_WATERMARK
82 Filename for a watermark image in PNG format, used as
83 ``QWizard::WatermarkPixmap``. It must be an absolute path.
85 .. variable:: CPACK_IFW_PACKAGE_BANNER
89 Filename for a banner image in PNG format, used as ``QWizard::BannerPixmap``.
90 It must be an absolute path.
92 .. variable:: CPACK_IFW_PACKAGE_BACKGROUND
96 Filename for a background image in PNG format, used as
97 ``QWizard::BackgroundPixmap`` (only used by ``MacStyle``). It must be an
100 .. variable:: CPACK_IFW_PACKAGE_WIZARD_STYLE
102 .. versionadded:: 3.8
104 Wizard style to be used (``Modern``, ``Mac``, ``Aero`` or ``Classic``).
106 .. variable:: CPACK_IFW_PACKAGE_WIZARD_DEFAULT_WIDTH
108 .. versionadded:: 3.8
110 Default width of the wizard in pixels. Setting a banner image will override
113 .. variable:: CPACK_IFW_PACKAGE_WIZARD_DEFAULT_HEIGHT
115 .. versionadded:: 3.8
117 Default height of the wizard in pixels. Setting a watermark image will
120 .. variable:: CPACK_IFW_PACKAGE_WIZARD_SHOW_PAGE_LIST
122 .. versionadded:: 3.20
124 Set to ``OFF`` if the widget listing installer pages on the left side of the
125 wizard should not be shown.
127 It is ``ON`` by default, but will only have an effect if using QtIFW 4.0 or
130 .. variable:: CPACK_IFW_PACKAGE_TITLE_COLOR
132 .. versionadded:: 3.8
134 Color of the titles and subtitles (takes an HTML color code, such as
137 .. variable:: CPACK_IFW_PACKAGE_STYLE_SHEET
139 .. versionadded:: 3.15
141 Filename for a stylesheet. It must be an absolute path.
143 .. variable:: CPACK_IFW_TARGET_DIRECTORY
145 Default target directory for installation.
146 If :variable:`CPACK_PACKAGE_INSTALL_DIRECTORY` is set, this defaults to
147 ``@ApplicationsDir@/${CPACK_PACKAGE_INSTALL_DIRECTORY}``. If that variable
148 isn't set either, the default used is ``@RootDir@/usr/local``.
149 Predefined variables of the form ``@...@`` are expanded by the
150 `QtIFW scripting engine <https://doc.qt.io/qtinstallerframework/scripting.html>`_.
152 .. variable:: CPACK_IFW_ADMIN_TARGET_DIRECTORY
154 Default target directory for installation with administrator rights.
156 You can use predefined variables.
158 .. variable:: CPACK_IFW_PACKAGE_REMOVE_TARGET_DIR
160 .. versionadded:: 3.11
162 Set to ``OFF`` if the target directory should not be deleted when uninstalling.
166 .. variable:: CPACK_IFW_PACKAGE_GROUP
168 The group, which will be used to configure the root package.
170 .. variable:: CPACK_IFW_PACKAGE_NAME
172 The root package name, which will be used if the configuration group is not
175 .. variable:: CPACK_IFW_PACKAGE_START_MENU_DIRECTORY
177 .. versionadded:: 3.3
179 Name of the default program group for the product in the Windows Start menu.
180 If not specified, it defaults to :variable:`CPACK_IFW_PACKAGE_NAME`.
182 .. variable:: CPACK_IFW_PACKAGE_MAINTENANCE_TOOL_NAME
184 .. versionadded:: 3.3
186 Filename of the generated maintenance tool.
187 The platform-specific executable file extension will be appended.
189 If not specified, QtIFW provides a default name (``maintenancetool``).
191 .. variable:: CPACK_IFW_PACKAGE_MAINTENANCE_TOOL_INI_FILE
193 .. versionadded:: 3.3
195 Filename for the configuration of the generated maintenance tool.
197 If not specified, QtIFW uses a default file name (``maintenancetool.ini``).
199 .. variable:: CPACK_IFW_PACKAGE_ALLOW_NON_ASCII_CHARACTERS
201 .. versionadded:: 3.3
203 Set to ``ON`` if the installation path can contain non-ASCII characters.
204 Only supported for QtIFW 2.0 and later. Older QtIFW versions will always
205 allow non-ASCII characters.
207 .. variable:: CPACK_IFW_PACKAGE_ALLOW_SPACE_IN_PATH
209 .. versionadded:: 3.3
211 Set to ``OFF`` if the installation path cannot contain space characters.
213 Is ``ON`` for QtIFW less 2.0 tools.
215 .. variable:: CPACK_IFW_PACKAGE_DISABLE_COMMAND_LINE_INTERFACE
217 .. versionadded:: 3.23
219 Set to ``ON`` if command line interface features should be disabled.
220 It is ``OFF`` by default and will only have an effect if using QtIFW 4.0 or
223 .. variable:: CPACK_IFW_PACKAGE_CONTROL_SCRIPT
225 .. versionadded:: 3.3
227 Filename for a custom installer control script.
229 .. variable:: CPACK_IFW_PACKAGE_RESOURCES
231 .. versionadded:: 3.7
233 List of additional resources (``.qrc`` files) to include in the installer
234 binary. They should be specified as absolute paths and no two resource files
235 can have the same file name.
237 You can use the :command:`cpack_ifw_add_package_resources` command to resolve
240 .. variable:: CPACK_IFW_PACKAGE_FILE_EXTENSION
242 .. versionadded:: 3.10
244 The target binary extension.
246 On Linux, the name of the target binary is automatically extended with
247 ``.run``, if you do not specify the extension.
249 On Windows, the target is created as an application with the extension
250 ``.exe``, which is automatically added, if not supplied.
252 On Mac, the target is created as an DMG disk image with the extension
253 ``.dmg``, which is automatically added, if not supplied.
255 .. variable:: CPACK_IFW_REPOSITORIES_ALL
257 The list of remote repositories.
259 The default value of this variable is computed by CPack and contains
260 all repositories added with :command:`cpack_ifw_add_repository`
261 or updated with :command:`cpack_ifw_update_repository`.
263 .. variable:: CPACK_IFW_DOWNLOAD_ALL
265 If this is ``ON``, all components will be downloaded. If not set, the
266 behavior is determined by whether :command:`cpack_configure_downloads` has
267 been called with the ``ALL`` option or not.
269 .. variable:: CPACK_IFW_PACKAGE_PRODUCT_IMAGES
271 .. versionadded:: 3.23
273 A list of images to be shown on the ``PerformInstallationPage``. These
274 must be absolute paths and the images must be in PNG format.
276 This feature is available for QtIFW 4.0.0 and later.
278 .. variable:: CPACK_IFW_PACKAGE_RUN_PROGRAM
280 .. versionadded:: 3.23
282 Command executed after the installer is finished, if the user accepts the
283 action. Provide the full path to the application, as found when installed.
284 This typically means the path should begin with the QtIFW predefined variable
287 This feature is available for QtIFW 4.0.0 and later.
289 .. variable:: CPACK_IFW_PACKAGE_RUN_PROGRAM_ARGUMENTS
291 .. versionadded:: 3.23
293 List of arguments passed to the program specified in
294 :variable:`CPACK_IFW_PACKAGE_RUN_PROGRAM`.
296 This feature is available for QtIFW 4.0.0 and later.
298 .. variable:: CPACK_IFW_PACKAGE_RUN_PROGRAM_DESCRIPTION
300 .. versionadded:: 3.23
302 Text shown next to the check box for running the program after the
303 installation. If :variable:`CPACK_IFW_PACKAGE_RUN_PROGRAM` is set but no
304 description is provided, QtIFW will use a default message like
307 This feature is available for QtIFW 4.0.0 and later.
309 .. variable:: CPACK_IFW_PACKAGE_SIGNING_IDENTITY
311 .. versionadded:: 3.23
313 Allows specifying a code signing identity to be used for signing the generated
314 app bundle. Only available on macOS, ignored on other platforms.
316 .. variable:: CPACK_IFW_ARCHIVE_FORMAT
318 .. versionadded:: 3.23
320 Set the format used when packaging new component data archives. If you omit
321 this option, the ``7z`` format will be used as a default. Supported formats:
331 If the Qt Installer Framework tools were built without libarchive support,
332 only ``7z`` format is supported.
334 This feature is available for QtIFW 4.2.0 and later.
336 .. variable:: CPACK_IFW_ARCHIVE_COMPRESSION
338 .. versionadded:: 3.23
340 Archive compression level. The allowable values are:
342 * 0 (*No compression*)
343 * 1 (*Fastest compression*)
344 * 3 (*Fast compression*)
345 * 5 (*Normal compression*)
346 * 7 (*Maximum compression*)
347 * 9 (*Ultra compression*)
349 If this variable is not set, QtIFW will use a default compression level,
350 which will typically be 5 (*Normal compression*).
354 Some formats do not support all the possible values. For example ``zip``
355 compression only supports values from 1 to 7.
357 This feature is available for QtIFW 4.2.0 and later.
362 .. variable:: CPACK_IFW_RESOLVE_DUPLICATE_NAMES
364 Resolve duplicate names when installing components with groups.
366 .. variable:: CPACK_IFW_PACKAGES_DIRECTORIES
368 Additional prepared packages directories that will be used to resolve
369 dependent components.
371 .. variable:: CPACK_IFW_REPOSITORIES_DIRECTORIES
373 .. versionadded:: 3.10
375 Additional prepared repository directories that will be used to resolve and
376 repack dependent components.
378 This feature is available for QtIFW 3.1 and later.
383 .. variable:: CPACK_IFW_FRAMEWORK_VERSION
385 .. versionadded:: 3.3
387 The version of the QtIFW tools that will be used. This variable is set
388 by the :module:`CPackIFW` module.
390 The following variables provide the locations of the QtIFW
391 command-line tools as discovered by the :module:`CPackIFW` module.
392 These variables are cached, and may be configured if needed.
394 .. variable:: CPACK_IFW_ARCHIVEGEN_EXECUTABLE
396 .. versionadded:: 3.19
398 The path to ``archivegen``.
400 .. variable:: CPACK_IFW_BINARYCREATOR_EXECUTABLE
402 The path to ``binarycreator``.
404 .. variable:: CPACK_IFW_REPOGEN_EXECUTABLE
406 The path to ``repogen``.
408 .. variable:: CPACK_IFW_INSTALLERBASE_EXECUTABLE
410 The path to ``installerbase``.
412 .. variable:: CPACK_IFW_DEVTOOL_EXECUTABLE
414 The path to ``devtool``.
416 Hints for Finding QtIFW
417 """""""""""""""""""""""
419 Generally, the CPack ``IFW`` generator automatically finds QtIFW tools.
420 The following (in order of precedence) can also be set to augment the
421 locations normally searched by :command:`find_program`:
423 .. variable:: CPACK_IFW_ROOT
425 .. versionadded:: 3.9
429 .. envvar:: CPACK_IFW_ROOT
431 .. versionadded:: 3.9
435 .. variable:: QTIFWDIR
444 The specified path should not contain ``bin`` at the end
445 (for example: ``D:\\DevTools\\QtIFW2.0.5``).
453 By default, this generator generates an *offline installer*. This means
454 that all packaged files are fully contained in the installer executable.
456 In contrast, an *online installer* will download some or all components from
459 The ``DOWNLOADED`` option in the :command:`cpack_add_component` command
460 specifies that a component is to be downloaded. Alternatively, the ``ALL``
461 option in the :command:`cpack_configure_downloads` command specifies that
462 `all` components are to be be downloaded.
464 The :command:`cpack_ifw_add_repository` command and the
465 :variable:`CPACK_IFW_DOWNLOAD_ALL` variable allow for more specific
468 When there are online components, CPack will write them to archive files.
469 The help page of the :module:`CPackComponent` module, especially the section
470 on the :command:`cpack_configure_downloads` function, explains how to make
471 these files accessible from a download URL.
476 .. versionadded:: 3.9
478 Some variables and command arguments support internationalization via
479 CMake script. This is an optional feature.
481 Installers created by QtIFW tools have built-in support for
482 internationalization and many phrases are localized to many languages,
483 but this does not apply to the description of your components and groups.
485 Localization of the description of your components and groups is useful for
486 users of your installers.
488 A localized variable or argument can contain a single default value, and
489 after that a set of pairs with the name of the locale and the localized value.
493 .. code-block:: cmake
495 set(LOCALIZABLE_VARIABLE "Default value"
497 en_US "American value"
498 en_GB "Great Britain value"
504 Qt Installer Framework Manual:
507 https://doc.qt.io/qtinstallerframework/index.html
509 * Component Scripting:
510 https://doc.qt.io/qtinstallerframework/scripting.html
512 * Predefined Variables:
513 https://doc.qt.io/qtinstallerframework/scripting.html#predefined-variables
516 https://doc.qt.io/qtinstallerframework/ifw-updates.html
518 Download Qt Installer Framework for your platform from Qt site:
519 https://download.qt.io/official_releases/qt-installer-framework