ifw.rst 11 KB

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