ifw.rst 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498
  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_DISABLE_COMMAND_LINE_INTERFACE
  113. .. versionadded:: 3.23
  114. Set to ``ON`` if command line interface features should be disabled.
  115. Is ``OFF`` by default, but will only have an effect if using QtIFW 4.0 or later.
  116. .. variable:: CPACK_IFW_PACKAGE_ALLOW_SPACE_IN_PATH
  117. .. versionadded:: 3.3
  118. Set to ``OFF`` if the installation path cannot contain space characters.
  119. Is ``ON`` for QtIFW less 2.0 tools.
  120. .. variable:: CPACK_IFW_PACKAGE_CONTROL_SCRIPT
  121. .. versionadded:: 3.3
  122. Filename for a custom installer control script.
  123. .. variable:: CPACK_IFW_PACKAGE_RESOURCES
  124. .. versionadded:: 3.7
  125. List of additional resources ('.qrc' files) to include in the installer
  126. binary.
  127. You can use :command:`cpack_ifw_add_package_resources` command to resolve
  128. relative paths.
  129. .. variable:: CPACK_IFW_PACKAGE_FILE_EXTENSION
  130. .. versionadded:: 3.10
  131. The target binary extension.
  132. On Linux, the name of the target binary is automatically extended with
  133. '.run', if you do not specify the extension.
  134. On Windows, the target is created as an application with the extension
  135. '.exe', which is automatically added, if not supplied.
  136. On Mac, the target is created as an DMG disk image with the extension
  137. '.dmg', which is automatically added, if not supplied.
  138. .. variable:: CPACK_IFW_REPOSITORIES_ALL
  139. The list of remote repositories.
  140. The default value of this variable is computed by CPack and contains
  141. all repositories added with command :command:`cpack_ifw_add_repository`
  142. or updated with command :command:`cpack_ifw_update_repository`.
  143. .. variable:: CPACK_IFW_DOWNLOAD_ALL
  144. If this is ``ON`` all components will be downloaded.
  145. By default is ``OFF`` or used value
  146. from ``CPACK_DOWNLOAD_ALL`` if set
  147. .. variable:: CPACK_IFW_PACKAGE_PRODUCT_IMAGES
  148. .. versionadded:: 3.23
  149. A list of images to be shown on the ``PerformInstallationPage``.
  150. This feature is available for QtIFW 4.0.0 or newer.
  151. .. variable:: CPACK_IFW_PACKAGE_RUN_PROGRAM
  152. .. versionadded:: 3.23
  153. Command executed after the installer is done if the user accepts the action.
  154. Provide the full path to the application.
  155. This feature is available for QtIFW 4.0.0 and newer.
  156. .. variable:: CPACK_IFW_PACKAGE_RUN_PROGRAM_ARGUMENTS
  157. .. versionadded:: 3.23
  158. List of arguments passed to the program specified in
  159. :variable:`CPACK_IFW_PACKAGE_RUN_PROGRAM`.
  160. This feature is available for QtIFW 4.0.0 and newer.
  161. .. variable:: CPACK_IFW_PACKAGE_RUN_PROGRAM_DESCRIPTION
  162. .. versionadded:: 3.23
  163. Text shown next to the check box for running the program after the
  164. installation. If :variable:`CPACK_IFW_PACKAGE_RUN_PROGRAM` is set but no
  165. description provided, the UI will display ``Run <Name> now``. instead.
  166. This feature is available for QtIFW 4.0.0 and newer.
  167. .. variable:: CPACK_IFW_PACKAGE_SIGNING_IDENTITY
  168. .. versionadded: 3.23
  169. Allows specifying a code signing identity to be used for signing the generated
  170. app bundle. Only available on macOS.
  171. .. variable:: CPACK_IFW_ARCHIVE_FORMAT
  172. .. versionadded:: 3.23
  173. Set the format used when packaging new component data archives. If you omit
  174. this option, the ``7z`` format will be used as a default. Supported formats:
  175. * 7z
  176. * zip
  177. * tar.gz
  178. * tar.bz2
  179. * tar.xz
  180. .. note::
  181. If the Qt Installer Framework tools were built without libarchive support,
  182. only ``7z`` format is supported.
  183. This feature is available for QtIFW 4.2.0 and newer.
  184. .. variable:: CPACK_IFW_ARCHIVE_COMPRESSION
  185. .. versionadded:: 3.23
  186. Archive compression level. Defaults to 5 (*Normal compression*).
  187. * 0 (*No compression*)
  188. * 1 (*Fastest compressing*)
  189. * 3 (*Fast compressing*)
  190. * 5 (*Normal compressing*)
  191. * 7 (*Maximum compressing*)
  192. * 9 (*Ultra compressing*)
  193. .. note::
  194. Some formats do not support all the possible values. For example ``zip``
  195. compression only supports values from 1 to 7.
  196. This feature is available for QtIFW 4.2.0 and newer.
  197. Components
  198. """"""""""
  199. .. variable:: CPACK_IFW_RESOLVE_DUPLICATE_NAMES
  200. Resolve duplicate names when installing components with groups.
  201. .. variable:: CPACK_IFW_PACKAGES_DIRECTORIES
  202. Additional prepared packages dirs that will be used to resolve
  203. dependent components.
  204. .. variable:: CPACK_IFW_REPOSITORIES_DIRECTORIES
  205. .. versionadded:: 3.10
  206. Additional prepared repository dirs that will be used to resolve and
  207. repack dependent components. This feature available only
  208. since QtIFW 3.1.
  209. QtIFW Tools
  210. """""""""""
  211. .. variable:: CPACK_IFW_FRAMEWORK_VERSION
  212. .. versionadded:: 3.3
  213. The version of used QtIFW tools.
  214. The following variables provide the locations of the QtIFW
  215. command-line tools as discovered by the module :module:`CPackIFW`.
  216. These variables are cached, and may be configured if needed.
  217. .. variable:: CPACK_IFW_ARCHIVEGEN_EXECUTABLE
  218. .. versionadded:: 3.19
  219. The path to ``archivegen``.
  220. .. variable:: CPACK_IFW_BINARYCREATOR_EXECUTABLE
  221. The path to ``binarycreator``.
  222. .. variable:: CPACK_IFW_REPOGEN_EXECUTABLE
  223. The path to ``repogen``.
  224. .. variable:: CPACK_IFW_INSTALLERBASE_EXECUTABLE
  225. The path to ``installerbase``.
  226. .. variable:: CPACK_IFW_DEVTOOL_EXECUTABLE
  227. The path to ``devtool``.
  228. Hints for Finding QtIFW
  229. """""""""""""""""""""""
  230. Generally, the CPack ``IFW`` generator automatically finds QtIFW tools,
  231. but if you don't use a default path for installation of the QtIFW tools,
  232. the path may be specified in either a CMake or an environment variable:
  233. .. variable:: CPACK_IFW_ROOT
  234. .. versionadded:: 3.9
  235. An CMake variable which specifies the location of the QtIFW tool suite.
  236. The variable will be cached in the ``CPackConfig.cmake`` file and used at
  237. CPack runtime.
  238. .. variable:: QTIFWDIR
  239. An environment variable which specifies the location of the QtIFW tool
  240. suite.
  241. .. note::
  242. The specified path should not contain "bin" at the end
  243. (for example: "D:\\DevTools\\QtIFW2.0.5").
  244. The :variable:`CPACK_IFW_ROOT` variable has a higher priority and overrides
  245. the value of the :variable:`QTIFWDIR` variable.
  246. Other Settings
  247. ^^^^^^^^^^^^^^
  248. Online installer
  249. """"""""""""""""
  250. By default, this generator generates an *offline installer*. This means that
  251. that all packaged files are fully contained in the installer executable.
  252. In contrast, an *online installer* will download some or all components from
  253. a remote server.
  254. The ``DOWNLOADED`` option in the :command:`cpack_add_component` command
  255. specifies that a component is to be downloaded. Alternatively, the ``ALL``
  256. option in the :command:`cpack_configure_downloads` command specifies that
  257. `all` components are to be be downloaded.
  258. The :command:`cpack_ifw_add_repository` command and the
  259. :variable:`CPACK_IFW_DOWNLOAD_ALL` variable allow for more specific
  260. configuration.
  261. When there are online components, CPack will write them to archive files.
  262. The help page of the :module:`CPackComponent` module, especially the section
  263. on the :command:`cpack_configure_downloads` function, explains how to make
  264. these files accessible from a download URL.
  265. Internationalization
  266. """"""""""""""""""""
  267. .. versionadded:: 3.9
  268. Some variables and command arguments support internationalization via
  269. CMake script. This is an optional feature.
  270. Installers created by QtIFW tools have built-in support for
  271. internationalization and many phrases are localized to many languages,
  272. but this does not apply to the description of the your components and groups
  273. that will be distributed.
  274. Localization of the description of your components and groups is useful for
  275. users of your installers.
  276. A localized variable or argument can contain a single default value, and a
  277. set of pairs the name of the locale and the localized value.
  278. For example:
  279. .. code-block:: cmake
  280. set(LOCALIZABLE_VARIABLE "Default value"
  281. en "English value"
  282. en_US "American value"
  283. en_GB "Great Britain value"
  284. )
  285. See Also
  286. ^^^^^^^^
  287. Qt Installer Framework Manual:
  288. * Index page:
  289. http://doc.qt.io/qtinstallerframework/index.html
  290. * Component Scripting:
  291. http://doc.qt.io/qtinstallerframework/scripting.html
  292. * Predefined Variables:
  293. http://doc.qt.io/qtinstallerframework/scripting.html#predefined-variables
  294. * Promoting Updates:
  295. http://doc.qt.io/qtinstallerframework/ifw-updates.html
  296. Download Qt Installer Framework for your platform from Qt site:
  297. http://download.qt.io/official_releases/qt-installer-framework