Imported Upstream version 3.25.0
[platform/upstream/cmake.git] / Help / cpack_gen / ifw.rst
1 CPack IFW Generator
2 -------------------
3
4 .. versionadded:: 3.1
5
6 Configure and run the Qt Installer Framework to generate a Qt installer.
7
8 .. only:: html
9
10   .. contents::
11
12 Overview
13 ^^^^^^^^
14
15 This :manual:`cpack generator <cpack-generators(7)>` generates
16 configuration and meta information for the `Qt Installer Framework
17 <https://doc.qt.io/qtinstallerframework/index.html>`_ (QtIFW),
18 and runs QtIFW tools to generate a Qt installer.
19
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.
23
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`_.
28
29 Variables
30 ^^^^^^^^^
31
32 You can use the following variables to change the behavior of the CPack ``IFW``
33 generator.
34
35 Debug
36 """""
37
38 .. variable:: CPACK_IFW_VERBOSE
39
40  .. versionadded:: 3.3
41
42  Set to ``ON`` to enable addition debug output.
43  By default is ``OFF``.
44
45 Package
46 """""""
47
48 .. variable:: CPACK_IFW_PACKAGE_TITLE
49
50  Name of the installer as displayed on the title bar.
51  If not specified, it defaults to :variable:`CPACK_PACKAGE_DESCRIPTION_SUMMARY`.
52
53 .. variable:: CPACK_IFW_PACKAGE_PUBLISHER
54
55  Publisher of the software (as shown in the Windows Control Panel).
56  If not specified, it defaults to :variable:`CPACK_PACKAGE_VENDOR`.
57
58 .. variable:: CPACK_IFW_PRODUCT_URL
59
60  URL to a page that contains product information on your web site.
61
62 .. variable:: CPACK_IFW_PACKAGE_ICON
63
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.
67
68 .. variable:: CPACK_IFW_PACKAGE_WINDOW_ICON
69
70  Filename for a custom window icon in PNG format for the Installer
71  application. It must be an absolute path.
72
73 .. variable:: CPACK_IFW_PACKAGE_LOGO
74
75  Filename for a logo image in PNG format, used as ``QWizard::LogoPixmap``.
76  It must be an absolute path.
77
78 .. variable:: CPACK_IFW_PACKAGE_WATERMARK
79
80  .. versionadded:: 3.8
81
82  Filename for a watermark image in PNG format, used as
83  ``QWizard::WatermarkPixmap``. It must be an absolute path.
84
85 .. variable:: CPACK_IFW_PACKAGE_BANNER
86
87  .. versionadded:: 3.8
88
89  Filename for a banner image in PNG format, used as ``QWizard::BannerPixmap``.
90  It must be an absolute path.
91
92 .. variable:: CPACK_IFW_PACKAGE_BACKGROUND
93
94  .. versionadded:: 3.8
95
96  Filename for a background image in PNG format, used as
97  ``QWizard::BackgroundPixmap`` (only used by ``MacStyle``). It must be an
98  absolute path.
99
100 .. variable:: CPACK_IFW_PACKAGE_WIZARD_STYLE
101
102  .. versionadded:: 3.8
103
104  Wizard style to be used (``Modern``, ``Mac``, ``Aero`` or ``Classic``).
105
106 .. variable:: CPACK_IFW_PACKAGE_WIZARD_DEFAULT_WIDTH
107
108  .. versionadded:: 3.8
109
110  Default width of the wizard in pixels. Setting a banner image will override
111  this.
112
113 .. variable:: CPACK_IFW_PACKAGE_WIZARD_DEFAULT_HEIGHT
114
115  .. versionadded:: 3.8
116
117  Default height of the wizard in pixels. Setting a watermark image will
118  override this.
119
120 .. variable:: CPACK_IFW_PACKAGE_WIZARD_SHOW_PAGE_LIST
121
122  .. versionadded:: 3.20
123
124  Set to ``OFF`` if the widget listing installer pages on the left side of the
125  wizard should not be shown.
126
127  It is ``ON`` by default, but will only have an effect if using QtIFW 4.0 or
128  later.
129
130 .. variable:: CPACK_IFW_PACKAGE_TITLE_COLOR
131
132  .. versionadded:: 3.8
133
134  Color of the titles and subtitles (takes an HTML color code, such as
135  ``#88FF33``).
136
137 .. variable:: CPACK_IFW_PACKAGE_STYLE_SHEET
138
139  .. versionadded:: 3.15
140
141  Filename for a stylesheet. It must be an absolute path.
142
143 .. variable:: CPACK_IFW_TARGET_DIRECTORY
144
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>`_.
151
152 .. variable:: CPACK_IFW_ADMIN_TARGET_DIRECTORY
153
154  Default target directory for installation with administrator rights.
155
156  You can use predefined variables.
157
158 .. variable:: CPACK_IFW_PACKAGE_REMOVE_TARGET_DIR
159
160  .. versionadded:: 3.11
161
162  Set to ``OFF`` if the target directory should not be deleted when uninstalling.
163
164  Is ``ON`` by default
165
166 .. variable:: CPACK_IFW_PACKAGE_GROUP
167
168  The group, which will be used to configure the root package.
169
170 .. variable:: CPACK_IFW_PACKAGE_NAME
171
172  The root package name, which will be used if the configuration group is not
173  specified.
174
175 .. variable:: CPACK_IFW_PACKAGE_START_MENU_DIRECTORY
176
177  .. versionadded:: 3.3
178
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`.
181
182 .. variable:: CPACK_IFW_PACKAGE_MAINTENANCE_TOOL_NAME
183
184  .. versionadded:: 3.3
185
186  Filename of the generated maintenance tool.
187  The platform-specific executable file extension will be appended.
188
189  If not specified, QtIFW provides a default name (``maintenancetool``).
190
191 .. variable:: CPACK_IFW_PACKAGE_MAINTENANCE_TOOL_INI_FILE
192
193  .. versionadded:: 3.3
194
195  Filename for the configuration of the generated maintenance tool.
196
197  If not specified, QtIFW uses a default file name (``maintenancetool.ini``).
198
199 .. variable:: CPACK_IFW_PACKAGE_ALLOW_NON_ASCII_CHARACTERS
200
201  .. versionadded:: 3.3
202
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.
206
207 .. variable:: CPACK_IFW_PACKAGE_ALLOW_SPACE_IN_PATH
208
209  .. versionadded:: 3.3
210
211  Set to ``OFF`` if the installation path cannot contain space characters.
212
213  Is ``ON`` for QtIFW less 2.0 tools.
214
215 .. variable:: CPACK_IFW_PACKAGE_DISABLE_COMMAND_LINE_INTERFACE
216
217  .. versionadded:: 3.23
218
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
221  later.
222
223 .. variable:: CPACK_IFW_PACKAGE_CONTROL_SCRIPT
224
225  .. versionadded:: 3.3
226
227  Filename for a custom installer control script.
228
229 .. variable:: CPACK_IFW_PACKAGE_RESOURCES
230
231  .. versionadded:: 3.7
232
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.
236
237  You can use the :command:`cpack_ifw_add_package_resources` command to resolve
238  relative paths.
239
240 .. variable:: CPACK_IFW_PACKAGE_FILE_EXTENSION
241
242  .. versionadded:: 3.10
243
244  The target binary extension.
245
246  On Linux, the name of the target binary is automatically extended with
247  ``.run``, if you do not specify the extension.
248
249  On Windows, the target is created as an application with the extension
250  ``.exe``, which is automatically added, if not supplied.
251
252  On Mac, the target is created as an DMG disk image with the extension
253  ``.dmg``, which is automatically added, if not supplied.
254
255 .. variable:: CPACK_IFW_REPOSITORIES_ALL
256
257  The list of remote repositories.
258
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`.
262
263 .. variable:: CPACK_IFW_DOWNLOAD_ALL
264
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.
268
269 .. variable:: CPACK_IFW_PACKAGE_PRODUCT_IMAGES
270
271  .. versionadded:: 3.23
272
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.
275
276  This feature is available for QtIFW 4.0.0 and later.
277
278 .. variable:: CPACK_IFW_PACKAGE_RUN_PROGRAM
279
280  .. versionadded:: 3.23
281
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
285  ``@TargetDir@``.
286
287  This feature is available for QtIFW 4.0.0 and later.
288
289 .. variable:: CPACK_IFW_PACKAGE_RUN_PROGRAM_ARGUMENTS
290
291  .. versionadded:: 3.23
292
293  List of arguments passed to the program specified in
294  :variable:`CPACK_IFW_PACKAGE_RUN_PROGRAM`.
295
296  This feature is available for QtIFW 4.0.0 and later.
297
298 .. variable:: CPACK_IFW_PACKAGE_RUN_PROGRAM_DESCRIPTION
299
300  .. versionadded:: 3.23
301
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
305  ``Run <Name> now``.
306
307  This feature is available for QtIFW 4.0.0 and later.
308
309 .. variable:: CPACK_IFW_PACKAGE_SIGNING_IDENTITY
310
311  .. versionadded:: 3.23
312
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.
315
316 .. variable:: CPACK_IFW_ARCHIVE_FORMAT
317
318  .. versionadded:: 3.23
319
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:
322
323  * 7z
324  * zip
325  * tar.gz
326  * tar.bz2
327  * tar.xz
328
329  .. note::
330
331   If the Qt Installer Framework tools were built without libarchive support,
332   only ``7z`` format is supported.
333
334  This feature is available for QtIFW 4.2.0 and later.
335
336 .. variable:: CPACK_IFW_ARCHIVE_COMPRESSION
337
338  .. versionadded:: 3.23
339
340  Archive compression level. The allowable values are:
341
342   * 0 (*No compression*)
343   * 1 (*Fastest compression*)
344   * 3 (*Fast compression*)
345   * 5 (*Normal compression*)
346   * 7 (*Maximum compression*)
347   * 9 (*Ultra compression*)
348
349  If this variable is not set, QtIFW will use a default compression level,
350  which will typically be 5 (*Normal compression*).
351
352  .. note::
353
354   Some formats do not support all the possible values. For example ``zip``
355   compression only supports values from 1 to 7.
356
357  This feature is available for QtIFW 4.2.0 and later.
358
359 Components
360 """"""""""
361
362 .. variable:: CPACK_IFW_RESOLVE_DUPLICATE_NAMES
363
364  Resolve duplicate names when installing components with groups.
365
366 .. variable:: CPACK_IFW_PACKAGES_DIRECTORIES
367
368  Additional prepared packages directories that will be used to resolve
369  dependent components.
370
371 .. variable:: CPACK_IFW_REPOSITORIES_DIRECTORIES
372
373  .. versionadded:: 3.10
374
375  Additional prepared repository directories that will be used to resolve and
376  repack dependent components.
377
378  This feature is available for QtIFW 3.1 and later.
379
380 QtIFW Tools
381 """""""""""
382
383 .. variable:: CPACK_IFW_FRAMEWORK_VERSION
384
385  .. versionadded:: 3.3
386
387  The version of the QtIFW tools that will be used. This variable is set
388  by the :module:`CPackIFW` module.
389
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.
393
394 .. variable:: CPACK_IFW_ARCHIVEGEN_EXECUTABLE
395
396  .. versionadded:: 3.19
397
398  The path to ``archivegen``.
399
400 .. variable:: CPACK_IFW_BINARYCREATOR_EXECUTABLE
401
402  The path to ``binarycreator``.
403
404 .. variable:: CPACK_IFW_REPOGEN_EXECUTABLE
405
406  The path to ``repogen``.
407
408 .. variable:: CPACK_IFW_INSTALLERBASE_EXECUTABLE
409
410  The path to ``installerbase``.
411
412 .. variable:: CPACK_IFW_DEVTOOL_EXECUTABLE
413
414  The path to ``devtool``.
415
416 Hints for Finding QtIFW
417 """""""""""""""""""""""
418
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`:
422
423 .. variable:: CPACK_IFW_ROOT
424
425   .. versionadded:: 3.9
426
427   CMake variable
428
429 .. envvar:: CPACK_IFW_ROOT
430
431   .. versionadded:: 3.9
432
433   Environment variable
434
435 .. variable:: QTIFWDIR
436
437   CMake variable
438
439 .. envvar:: QTIFWDIR
440
441   Environment variable
442
443 .. note::
444   The specified path should not contain ``bin`` at the end
445   (for example: ``D:\\DevTools\\QtIFW2.0.5``).
446
447 Other Settings
448 ^^^^^^^^^^^^^^
449
450 Online installer
451 """"""""""""""""
452
453 By default, this generator generates an *offline installer*. This means
454 that all packaged files are fully contained in the installer executable.
455
456 In contrast, an *online installer* will download some or all components from
457 a remote server.
458
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.
463
464 The :command:`cpack_ifw_add_repository` command and the
465 :variable:`CPACK_IFW_DOWNLOAD_ALL` variable allow for more specific
466 configuration.
467
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.
472
473 Internationalization
474 """"""""""""""""""""
475
476 .. versionadded:: 3.9
477
478 Some variables and command arguments support internationalization via
479 CMake script. This is an optional feature.
480
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.
484
485 Localization of the description of your components and groups is useful for
486 users of your installers.
487
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.
490
491 For example:
492
493 .. code-block:: cmake
494
495    set(LOCALIZABLE_VARIABLE "Default value"
496      en "English value"
497      en_US "American value"
498      en_GB "Great Britain value"
499      )
500
501 See Also
502 ^^^^^^^^
503
504 Qt Installer Framework Manual:
505
506 * Index page:
507   https://doc.qt.io/qtinstallerframework/index.html
508
509 * Component Scripting:
510   https://doc.qt.io/qtinstallerframework/scripting.html
511
512 * Predefined Variables:
513   https://doc.qt.io/qtinstallerframework/scripting.html#predefined-variables
514
515 * Promoting Updates:
516   https://doc.qt.io/qtinstallerframework/ifw-updates.html
517
518 Download Qt Installer Framework for your platform from Qt site:
519  https://download.qt.io/official_releases/qt-installer-framework