ifw.rst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405
  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. <http://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.
  20. Variables
  21. ^^^^^^^^^
  22. You can use the following variables to change behavior of 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. By default used :variable:`CPACK_PACKAGE_DESCRIPTION_SUMMARY`.
  35. .. variable:: CPACK_IFW_PACKAGE_PUBLISHER
  36. Publisher of the software (as shown in the Windows Control Panel).
  37. By default used :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. The actual file is '.icns' (macOS),
  42. '.ico' (Windows). No functionality on Unix.
  43. .. variable:: CPACK_IFW_PACKAGE_WINDOW_ICON
  44. Filename for a custom window icon in PNG format for the Installer
  45. application.
  46. .. variable:: CPACK_IFW_PACKAGE_LOGO
  47. Filename for a logo is used as QWizard::LogoPixmap.
  48. .. variable:: CPACK_IFW_PACKAGE_WATERMARK
  49. .. versionadded:: 3.8
  50. Filename for a watermark is used as QWizard::WatermarkPixmap.
  51. .. variable:: CPACK_IFW_PACKAGE_BANNER
  52. .. versionadded:: 3.8
  53. Filename for a banner is used as QWizard::BannerPixmap.
  54. .. variable:: CPACK_IFW_PACKAGE_BACKGROUND
  55. .. versionadded:: 3.8
  56. Filename for an image used as QWizard::BackgroundPixmap (only used by MacStyle).
  57. .. variable:: CPACK_IFW_PACKAGE_WIZARD_STYLE
  58. .. versionadded:: 3.8
  59. Wizard style to be used ("Modern", "Mac", "Aero" or "Classic").
  60. .. variable:: CPACK_IFW_PACKAGE_WIZARD_DEFAULT_WIDTH
  61. .. versionadded:: 3.8
  62. Default width of the wizard in pixels. Setting a banner image will override this.
  63. .. variable:: CPACK_IFW_PACKAGE_WIZARD_DEFAULT_HEIGHT
  64. .. versionadded:: 3.8
  65. Default height of the wizard in pixels. Setting a watermark image will override this.
  66. .. variable:: CPACK_IFW_PACKAGE_WIZARD_SHOW_PAGE_LIST
  67. Set to ``OFF`` if the widget listing installer pages on the left side of the wizard should not be shown.
  68. Is ``ON`` by default.
  69. .. variable:: CPACK_IFW_PACKAGE_TITLE_COLOR
  70. .. versionadded:: 3.8
  71. Color of the titles and subtitles (takes an HTML color code, such as "#88FF33").
  72. .. variable:: CPACK_IFW_PACKAGE_STYLE_SHEET
  73. .. versionadded:: 3.15
  74. Filename for a stylesheet.
  75. .. variable:: CPACK_IFW_TARGET_DIRECTORY
  76. Default target directory for installation.
  77. By default used
  78. "@ApplicationsDir@/:variable:`CPACK_PACKAGE_INSTALL_DIRECTORY`"
  79. (variables embedded in '@' are expanded by the
  80. `QtIFW scripting engine <https://doc.qt.io/qtinstallerframework/scripting.html>`_).
  81. You can use predefined variables.
  82. .. variable:: CPACK_IFW_ADMIN_TARGET_DIRECTORY
  83. Default target directory for installation with administrator rights.
  84. You can use predefined variables.
  85. .. variable:: CPACK_IFW_PACKAGE_REMOVE_TARGET_DIR
  86. .. versionadded:: 3.11
  87. Set to ``OFF`` if the target directory should not be deleted when uninstalling.
  88. Is ``ON`` by default
  89. .. variable:: CPACK_IFW_PACKAGE_GROUP
  90. The group, which will be used to configure the root package
  91. .. variable:: CPACK_IFW_PACKAGE_NAME
  92. The root package name, which will be used if configuration group is not
  93. specified
  94. .. variable:: CPACK_IFW_PACKAGE_START_MENU_DIRECTORY
  95. .. versionadded:: 3.3
  96. Name of the default program group for the product in the Windows Start menu.
  97. By default used :variable:`CPACK_IFW_PACKAGE_NAME`.
  98. .. variable:: CPACK_IFW_PACKAGE_MAINTENANCE_TOOL_NAME
  99. .. versionadded:: 3.3
  100. Filename of the generated maintenance tool.
  101. The platform-specific executable file extension is appended.
  102. By default used QtIFW defaults (``maintenancetool``).
  103. .. variable:: CPACK_IFW_PACKAGE_MAINTENANCE_TOOL_INI_FILE
  104. .. versionadded:: 3.3
  105. Filename for the configuration of the generated maintenance tool.
  106. By default used QtIFW defaults (``maintenancetool.ini``).
  107. .. variable:: CPACK_IFW_PACKAGE_ALLOW_NON_ASCII_CHARACTERS
  108. .. versionadded:: 3.3
  109. Set to ``ON`` if the installation path can contain non-ASCII characters.
  110. Is ``ON`` for QtIFW less 2.0 tools.
  111. .. variable:: CPACK_IFW_PACKAGE_ALLOW_SPACE_IN_PATH
  112. .. versionadded:: 3.3
  113. Set to ``OFF`` if the installation path cannot contain space characters.
  114. Is ``ON`` for QtIFW less 2.0 tools.
  115. .. variable:: CPACK_IFW_PACKAGE_CONTROL_SCRIPT
  116. .. versionadded:: 3.3
  117. Filename for a custom installer control script.
  118. .. variable:: CPACK_IFW_PACKAGE_RESOURCES
  119. .. versionadded:: 3.7
  120. List of additional resources ('.qrc' files) to include in the installer
  121. binary.
  122. You can use :command:`cpack_ifw_add_package_resources` command to resolve
  123. relative paths.
  124. .. variable:: CPACK_IFW_PACKAGE_FILE_EXTENSION
  125. .. versionadded:: 3.10
  126. The target binary extension.
  127. On Linux, the name of the target binary is automatically extended with
  128. '.run', if you do not specify the extension.
  129. On Windows, the target is created as an application with the extension
  130. '.exe', which is automatically added, if not supplied.
  131. On Mac, the target is created as an DMG disk image with the extension
  132. '.dmg', which is automatically added, if not supplied.
  133. .. variable:: CPACK_IFW_REPOSITORIES_ALL
  134. The list of remote repositories.
  135. The default value of this variable is computed by CPack and contains
  136. all repositories added with command :command:`cpack_ifw_add_repository`
  137. or updated with command :command:`cpack_ifw_update_repository`.
  138. .. variable:: CPACK_IFW_DOWNLOAD_ALL
  139. If this is ``ON`` all components will be downloaded.
  140. By default is ``OFF`` or used value
  141. from ``CPACK_DOWNLOAD_ALL`` if set
  142. Components
  143. """"""""""
  144. .. variable:: CPACK_IFW_RESOLVE_DUPLICATE_NAMES
  145. Resolve duplicate names when installing components with groups.
  146. .. variable:: CPACK_IFW_PACKAGES_DIRECTORIES
  147. Additional prepared packages dirs that will be used to resolve
  148. dependent components.
  149. .. variable:: CPACK_IFW_REPOSITORIES_DIRECTORIES
  150. .. versionadded:: 3.10
  151. Additional prepared repository dirs that will be used to resolve and
  152. repack dependent components. This feature available only
  153. since QtIFW 3.1.
  154. QtIFW Tools
  155. """""""""""
  156. .. variable:: CPACK_IFW_FRAMEWORK_VERSION
  157. .. versionadded:: 3.3
  158. The version of used QtIFW tools.
  159. The following variables provide the locations of the QtIFW
  160. command-line tools as discovered by the module :module:`CPackIFW`.
  161. These variables are cached, and may be configured if needed.
  162. .. variable:: CPACK_IFW_ARCHIVEGEN_EXECUTABLE
  163. .. versionadded:: 3.19
  164. The path to ``archivegen``.
  165. .. variable:: CPACK_IFW_BINARYCREATOR_EXECUTABLE
  166. The path to ``binarycreator``.
  167. .. variable:: CPACK_IFW_REPOGEN_EXECUTABLE
  168. The path to ``repogen``.
  169. .. variable:: CPACK_IFW_INSTALLERBASE_EXECUTABLE
  170. The path to ``installerbase``.
  171. .. variable:: CPACK_IFW_DEVTOOL_EXECUTABLE
  172. The path to ``devtool``.
  173. Hints for Finding QtIFW
  174. """""""""""""""""""""""
  175. Generally, the CPack ``IFW`` generator automatically finds QtIFW tools,
  176. but if you don't use a default path for installation of the QtIFW tools,
  177. the path may be specified in either a CMake or an environment variable:
  178. .. variable:: CPACK_IFW_ROOT
  179. .. versionadded:: 3.9
  180. An CMake variable which specifies the location of the QtIFW tool suite.
  181. The variable will be cached in the ``CPackConfig.cmake`` file and used at
  182. CPack runtime.
  183. .. variable:: QTIFWDIR
  184. An environment variable which specifies the location of the QtIFW tool
  185. suite.
  186. .. note::
  187. The specified path should not contain "bin" at the end
  188. (for example: "D:\\DevTools\\QtIFW2.0.5").
  189. The :variable:`CPACK_IFW_ROOT` variable has a higher priority and overrides
  190. the value of the :variable:`QTIFWDIR` variable.
  191. Other Settings
  192. ^^^^^^^^^^^^^^
  193. Online installer
  194. """"""""""""""""
  195. By default, this generator generates an *offline installer*. This means that
  196. that all packaged files are fully contained in the installer executable.
  197. In contrast, an *online installer* will download some or all components from
  198. a remote server.
  199. The ``DOWNLOADED`` option in the :command:`cpack_add_component` command
  200. specifies that a component is to be downloaded. Alternatively, the ``ALL``
  201. option in the :command:`cpack_configure_downloads` command specifies that
  202. `all` components are to be be downloaded.
  203. The :command:`cpack_ifw_add_repository` command and the
  204. :variable:`CPACK_IFW_DOWNLOAD_ALL` variable allow for more specific
  205. configuration.
  206. When there are online components, CPack will write them to archive files.
  207. The help page of the :module:`CPackComponent` module, especially the section
  208. on the :command:`cpack_configure_downloads` function, explains how to make
  209. these files accessible from a download URL.
  210. Internationalization
  211. """"""""""""""""""""
  212. .. versionadded:: 3.9
  213. Some variables and command arguments support internationalization via
  214. CMake script. This is an optional feature.
  215. Installers created by QtIFW tools have built-in support for
  216. internationalization and many phrases are localized to many languages,
  217. but this does not apply to the description of the your components and groups
  218. that will be distributed.
  219. Localization of the description of your components and groups is useful for
  220. users of your installers.
  221. A localized variable or argument can contain a single default value, and a
  222. set of pairs the name of the locale and the localized value.
  223. For example:
  224. .. code-block:: cmake
  225. set(LOCALIZABLE_VARIABLE "Default value"
  226. en "English value"
  227. en_US "American value"
  228. en_GB "Great Britain value"
  229. )
  230. See Also
  231. ^^^^^^^^
  232. Qt Installer Framework Manual:
  233. * Index page:
  234. http://doc.qt.io/qtinstallerframework/index.html
  235. * Component Scripting:
  236. http://doc.qt.io/qtinstallerframework/scripting.html
  237. * Predefined Variables:
  238. http://doc.qt.io/qtinstallerframework/scripting.html#predefined-variables
  239. * Promoting Updates:
  240. http://doc.qt.io/qtinstallerframework/ifw-updates.html
  241. Download Qt Installer Framework for your platform from Qt site:
  242. http://download.qt.io/official_releases/qt-installer-framework