ifw.rst 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529
  1. CPack IFW Generator
  2. -------------------
  3. .. versionadded:: 3.1
  4. Configure and run the Qt Installer Framework to generate a Qt installer.
  5. .. only:: html
  6. .. contents::
  7. Overview
  8. ^^^^^^^^
  9. This :manual:`cpack generator <cpack-generators(7)>` generates
  10. configuration and meta information for the `Qt Installer Framework
  11. <https://doc.qt.io/qtinstallerframework/index.html>`_ (QtIFW),
  12. and runs QtIFW tools to generate a Qt installer.
  13. QtIFW provides tools and utilities to create installers for
  14. the platforms supported by `Qt <https://www.qt.io>`_: Linux,
  15. Microsoft Windows, and macOS.
  16. To make use of this generator, QtIFW needs to be installed.
  17. The :module:`CPackIFW` module looks for the location of the
  18. QtIFW command-line utilities, and defines several commands to
  19. control the behavior of this generator. See `Hints for Finding QtIFW`_.
  20. Variables
  21. ^^^^^^^^^
  22. You can use the following variables to change the behavior of the CPack ``IFW``
  23. generator.
  24. Debug
  25. """""
  26. .. variable:: CPACK_IFW_VERBOSE
  27. .. versionadded:: 3.3
  28. Set to ``ON`` to enable addition debug output.
  29. By default is ``OFF``.
  30. Package
  31. """""""
  32. .. variable:: CPACK_IFW_PACKAGE_TITLE
  33. Name of the installer as displayed on the title bar.
  34. If not specified, it defaults to :variable:`CPACK_PACKAGE_DESCRIPTION_SUMMARY`.
  35. .. variable:: CPACK_IFW_PACKAGE_PUBLISHER
  36. Publisher of the software (as shown in the Windows Control Panel).
  37. If not specified, it defaults to :variable:`CPACK_PACKAGE_VENDOR`.
  38. .. variable:: CPACK_IFW_PRODUCT_URL
  39. URL to a page that contains product information on your web site.
  40. .. variable:: CPACK_IFW_PACKAGE_ICON
  41. Filename for a custom installer icon. It must be an absolute path.
  42. This should be a ``.icns`` file on macOS and a ``.ico`` file on Windows.
  43. It is ignored on other platforms.
  44. .. variable:: CPACK_IFW_PACKAGE_WINDOW_ICON
  45. Filename for a custom window icon in PNG format for the Installer
  46. application. It must be an absolute path.
  47. .. variable:: CPACK_IFW_PACKAGE_LOGO
  48. Filename for a logo image in PNG format, used as ``QWizard::LogoPixmap``.
  49. It must be an absolute path.
  50. .. variable:: CPACK_IFW_PACKAGE_WATERMARK
  51. .. versionadded:: 3.8
  52. Filename for a watermark image in PNG format, used as
  53. ``QWizard::WatermarkPixmap``. It must be an absolute path.
  54. .. variable:: CPACK_IFW_PACKAGE_BANNER
  55. .. versionadded:: 3.8
  56. Filename for a banner image in PNG format, used as ``QWizard::BannerPixmap``.
  57. It must be an absolute path.
  58. .. variable:: CPACK_IFW_PACKAGE_BACKGROUND
  59. .. versionadded:: 3.8
  60. Filename for a background image in PNG format, used as
  61. ``QWizard::BackgroundPixmap`` (only used by ``MacStyle``). It must be an
  62. absolute path.
  63. .. variable:: CPACK_IFW_PACKAGE_WIZARD_STYLE
  64. .. versionadded:: 3.8
  65. Wizard style to be used (``Modern``, ``Mac``, ``Aero`` or ``Classic``).
  66. .. variable:: CPACK_IFW_PACKAGE_WIZARD_DEFAULT_WIDTH
  67. .. versionadded:: 3.8
  68. Default width of the wizard in pixels. Setting a banner image will override
  69. this.
  70. .. variable:: CPACK_IFW_PACKAGE_WIZARD_DEFAULT_HEIGHT
  71. .. versionadded:: 3.8
  72. Default height of the wizard in pixels. Setting a watermark image will
  73. override this.
  74. .. variable:: CPACK_IFW_PACKAGE_WIZARD_SHOW_PAGE_LIST
  75. .. versionadded:: 3.20
  76. Set to ``OFF`` if the widget listing installer pages on the left side of the
  77. wizard should not be shown.
  78. It is ``ON`` by default, but will only have an effect if using QtIFW 4.0 or
  79. later.
  80. .. variable:: CPACK_IFW_PACKAGE_TITLE_COLOR
  81. .. versionadded:: 3.8
  82. Color of the titles and subtitles (takes an HTML color code, such as
  83. ``#88FF33``).
  84. .. variable:: CPACK_IFW_PACKAGE_STYLE_SHEET
  85. .. versionadded:: 3.15
  86. Filename for a stylesheet. It must be an absolute path.
  87. .. variable:: CPACK_IFW_TARGET_DIRECTORY
  88. Default target directory for installation.
  89. If :variable:`CPACK_PACKAGE_INSTALL_DIRECTORY` is set, this defaults to
  90. ``@ApplicationsDir@/${CPACK_PACKAGE_INSTALL_DIRECTORY}``. If that variable
  91. isn't set either, the default used is ``@RootDir@/usr/local``.
  92. Predefined variables of the form ``@...@`` are expanded by the
  93. `QtIFW scripting engine <https://doc.qt.io/qtinstallerframework/scripting.html>`_.
  94. .. variable:: CPACK_IFW_ADMIN_TARGET_DIRECTORY
  95. Default target directory for installation with administrator rights.
  96. You can use predefined variables.
  97. .. variable:: CPACK_IFW_PACKAGE_REMOVE_TARGET_DIR
  98. .. versionadded:: 3.11
  99. Set to ``OFF`` if the target directory should not be deleted when uninstalling.
  100. Is ``ON`` by default
  101. .. variable:: CPACK_IFW_PACKAGE_GROUP
  102. The group, which will be used to configure the root package.
  103. .. variable:: CPACK_IFW_PACKAGE_NAME
  104. The root package name, which will be used if the configuration group is not
  105. specified.
  106. .. variable:: CPACK_IFW_PACKAGE_START_MENU_DIRECTORY
  107. .. versionadded:: 3.3
  108. Name of the default program group for the product in the Windows Start menu.
  109. If not specified, it defaults to :variable:`CPACK_IFW_PACKAGE_NAME`.
  110. .. variable:: CPACK_IFW_PACKAGE_MAINTENANCE_TOOL_NAME
  111. .. versionadded:: 3.3
  112. Filename of the generated maintenance tool.
  113. The platform-specific executable file extension will be appended.
  114. If not specified, QtIFW provides a default name (``maintenancetool``).
  115. .. variable:: CPACK_IFW_PACKAGE_MAINTENANCE_TOOL_INI_FILE
  116. .. versionadded:: 3.3
  117. Filename for the configuration of the generated maintenance tool.
  118. If not specified, QtIFW uses a default file name (``maintenancetool.ini``).
  119. .. variable:: CPACK_IFW_PACKAGE_ALLOW_NON_ASCII_CHARACTERS
  120. .. versionadded:: 3.3
  121. Set to ``ON`` if the installation path can contain non-ASCII characters.
  122. Only supported for QtIFW 2.0 and later. Older QtIFW versions will always
  123. allow non-ASCII characters.
  124. .. variable:: CPACK_IFW_PACKAGE_ALLOW_SPACE_IN_PATH
  125. .. versionadded:: 3.3
  126. Set to ``OFF`` if the installation path cannot contain space characters.
  127. Is ``ON`` for QtIFW less 2.0 tools.
  128. .. variable:: CPACK_IFW_PACKAGE_DISABLE_COMMAND_LINE_INTERFACE
  129. .. versionadded:: 3.23
  130. Set to ``ON`` if command line interface features should be disabled.
  131. It is ``OFF`` by default and will only have an effect if using QtIFW 4.0 or
  132. later.
  133. .. variable:: CPACK_IFW_PACKAGE_CONTROL_SCRIPT
  134. .. versionadded:: 3.3
  135. Filename for a custom installer control script.
  136. .. variable:: CPACK_IFW_PACKAGE_RESOURCES
  137. .. versionadded:: 3.7
  138. List of additional resources (``.qrc`` files) to include in the installer
  139. binary. They should be specified as absolute paths and no two resource files
  140. can have the same file name.
  141. You can use the :command:`cpack_ifw_add_package_resources` command to resolve
  142. relative paths.
  143. .. variable:: CPACK_IFW_PACKAGE_FILE_EXTENSION
  144. .. versionadded:: 3.10
  145. The target binary extension.
  146. On Linux, the name of the target binary is automatically extended with
  147. ``.run``, if you do not specify the extension.
  148. On Windows, the target is created as an application with the extension
  149. ``.exe``, which is automatically added, if not supplied.
  150. On Mac, the target is created as an DMG disk image with the extension
  151. ``.dmg``, which is automatically added, if not supplied.
  152. .. variable:: CPACK_IFW_REPOSITORIES_ALL
  153. The list of remote repositories.
  154. The default value of this variable is computed by CPack and contains
  155. all repositories added with :command:`cpack_ifw_add_repository`
  156. or updated with :command:`cpack_ifw_update_repository`.
  157. .. variable:: CPACK_IFW_DOWNLOAD_ALL
  158. If this is ``ON``, all components will be downloaded. If not set, the
  159. behavior is determined by whether :command:`cpack_configure_downloads` has
  160. been called with the ``ALL`` option or not.
  161. .. variable:: CPACK_IFW_PACKAGE_PRODUCT_IMAGES
  162. .. versionadded:: 3.23
  163. A list of images to be shown on the ``PerformInstallationPage``. These
  164. must be absolute paths and the images must be in PNG format.
  165. This feature is available for QtIFW 4.0.0 and later.
  166. .. variable:: CPACK_IFW_PACKAGE_PRODUCT_IMAGE_URLS
  167. .. versionadded:: 3.31
  168. A list of URLs associated with the ProductImages.
  169. Only used if ``CPACK_IFW_PACKAGE_PRODUCT_IMAGES`` is defined
  170. and it has the same size.
  171. This feature is available for QtIFW 4.0.0 and later.
  172. .. variable:: CPACK_IFW_PACKAGE_RUN_PROGRAM
  173. .. versionadded:: 3.23
  174. Command executed after the installer is finished, if the user accepts the
  175. action. Provide the full path to the application, as found when installed.
  176. This typically means the path should begin with the QtIFW predefined variable
  177. ``@TargetDir@``.
  178. This feature is available for QtIFW 4.0.0 and later.
  179. .. variable:: CPACK_IFW_PACKAGE_RUN_PROGRAM_ARGUMENTS
  180. .. versionadded:: 3.23
  181. List of arguments passed to the program specified in
  182. :variable:`CPACK_IFW_PACKAGE_RUN_PROGRAM`.
  183. This feature is available for QtIFW 4.0.0 and later.
  184. .. variable:: CPACK_IFW_PACKAGE_RUN_PROGRAM_DESCRIPTION
  185. .. versionadded:: 3.23
  186. Text shown next to the check box for running the program after the
  187. installation. If :variable:`CPACK_IFW_PACKAGE_RUN_PROGRAM` is set but no
  188. description is provided, QtIFW will use a default message like
  189. ``Run <Name> now``.
  190. This feature is available for QtIFW 4.0.0 and later.
  191. .. variable:: CPACK_IFW_PACKAGE_SIGNING_IDENTITY
  192. .. versionadded:: 3.23
  193. Allows specifying a code signing identity to be used for signing the generated
  194. app bundle. Only available on macOS, ignored on other platforms.
  195. .. variable:: CPACK_IFW_ARCHIVE_FORMAT
  196. .. versionadded:: 3.23
  197. Set the format used when packaging new component data archives. If you omit
  198. this option, the ``7z`` format will be used as a default. Supported formats:
  199. * 7z
  200. * zip
  201. * tar.gz
  202. * tar.bz2
  203. * tar.xz
  204. .. note::
  205. If the Qt Installer Framework tools were built without libarchive support,
  206. only ``7z`` format is supported.
  207. This feature is available for QtIFW 4.2.0 and later.
  208. .. variable:: CPACK_IFW_ARCHIVE_COMPRESSION
  209. .. versionadded:: 3.23
  210. Archive compression level. The allowable values are:
  211. * 0 (*No compression*)
  212. * 1 (*Fastest compression*)
  213. * 3 (*Fast compression*)
  214. * 5 (*Normal compression*)
  215. * 7 (*Maximum compression*)
  216. * 9 (*Ultra compression*)
  217. If this variable is not set, QtIFW will use a default compression level,
  218. which will typically be 5 (*Normal compression*).
  219. .. note::
  220. Some formats do not support all the possible values. For example ``zip``
  221. compression only supports values from 1 to 7.
  222. This feature is available for QtIFW 4.2.0 and later.
  223. Components
  224. """"""""""
  225. .. variable:: CPACK_IFW_RESOLVE_DUPLICATE_NAMES
  226. Resolve duplicate names when installing components with groups.
  227. .. variable:: CPACK_IFW_PACKAGES_DIRECTORIES
  228. Additional prepared packages directories that will be used to resolve
  229. dependent components.
  230. .. variable:: CPACK_IFW_REPOSITORIES_DIRECTORIES
  231. .. versionadded:: 3.10
  232. Additional prepared repository directories that will be used to resolve and
  233. repack dependent components.
  234. This feature is available for QtIFW 3.1 and later.
  235. QtIFW Tools
  236. """""""""""
  237. .. variable:: CPACK_IFW_FRAMEWORK_VERSION
  238. .. versionadded:: 3.3
  239. The version of the QtIFW tools that will be used. This variable is set
  240. by the :module:`CPackIFW` module.
  241. The following variables provide the locations of the QtIFW
  242. command-line tools as discovered by the :module:`CPackIFW` module.
  243. These variables are cached, and may be configured if needed.
  244. .. variable:: CPACK_IFW_ARCHIVEGEN_EXECUTABLE
  245. .. versionadded:: 3.19
  246. The path to ``archivegen``.
  247. .. variable:: CPACK_IFW_BINARYCREATOR_EXECUTABLE
  248. The path to ``binarycreator``.
  249. .. variable:: CPACK_IFW_REPOGEN_EXECUTABLE
  250. The path to ``repogen``.
  251. .. variable:: CPACK_IFW_INSTALLERBASE_EXECUTABLE
  252. The path to ``installerbase``.
  253. .. variable:: CPACK_IFW_DEVTOOL_EXECUTABLE
  254. The path to ``devtool``.
  255. Hints for Finding QtIFW
  256. """""""""""""""""""""""
  257. Generally, the CPack ``IFW`` generator automatically finds QtIFW tools.
  258. The following (in order of precedence) can also be set to augment the
  259. locations normally searched by :command:`find_program`:
  260. .. variable:: CPACK_IFW_ROOT
  261. .. versionadded:: 3.9
  262. CMake variable
  263. .. envvar:: CPACK_IFW_ROOT
  264. .. versionadded:: 3.9
  265. Environment variable
  266. .. variable:: QTIFWDIR
  267. CMake variable
  268. .. envvar:: QTIFWDIR
  269. Environment variable
  270. .. note::
  271. The specified path should not contain ``bin`` at the end
  272. (for example: ``D:\\DevTools\\QtIFW2.0.5``).
  273. Other Settings
  274. ^^^^^^^^^^^^^^
  275. Online installer
  276. """"""""""""""""
  277. By default, this generator generates an *offline installer*. This means
  278. that all packaged files are fully contained in the installer executable.
  279. In contrast, an *online installer* will download some or all components from
  280. a remote server.
  281. The ``DOWNLOADED`` option in the :command:`cpack_add_component` command
  282. specifies that a component is to be downloaded. Alternatively, the ``ALL``
  283. option in the :command:`cpack_configure_downloads` command specifies that
  284. ``all`` components are to be be downloaded.
  285. The :command:`cpack_ifw_add_repository` command and the
  286. :variable:`CPACK_IFW_DOWNLOAD_ALL` variable allow for more specific
  287. configuration.
  288. When there are online components, CPack will write them to archive files.
  289. The help page of the :module:`CPackComponent` module, especially the section
  290. on the :command:`cpack_configure_downloads` function, explains how to make
  291. these files accessible from a download URL.
  292. Internationalization
  293. """"""""""""""""""""
  294. .. versionadded:: 3.9
  295. Some variables and command arguments support internationalization via
  296. CMake script. This is an optional feature.
  297. Installers created by QtIFW tools have built-in support for
  298. internationalization and many phrases are localized to many languages,
  299. but this does not apply to the description of your components and groups.
  300. Localization of the description of your components and groups is useful for
  301. users of your installers.
  302. A localized variable or argument can contain a single default value, and
  303. after that a set of pairs with the name of the locale and the localized value.
  304. For example:
  305. .. code-block:: cmake
  306. set(LOCALIZABLE_VARIABLE "Default value"
  307. en "English value"
  308. en_US "American value"
  309. en_GB "Great Britain value"
  310. )
  311. See Also
  312. ^^^^^^^^
  313. Qt Installer Framework Manual:
  314. * Index page:
  315. https://doc.qt.io/qtinstallerframework/index.html
  316. * Component Scripting:
  317. https://doc.qt.io/qtinstallerframework/scripting.html
  318. * Predefined Variables:
  319. https://doc.qt.io/qtinstallerframework/scripting.html#predefined-variables
  320. * Promoting Updates:
  321. https://doc.qt.io/qtinstallerframework/ifw-updates.html
  322. Download Qt Installer Framework for your platform from Qt site:
  323. https://download.qt.io/official_releases/qt-installer-framework