ifw.rst 9.8 KB

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