wix.rst 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. CPack WIX Generator
  2. -------------------
  3. CPack WIX generator specific options
  4. Variables specific to CPack WIX generator
  5. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  6. The following variables are specific to the installers built on
  7. Windows using WiX.
  8. .. variable:: CPACK_WIX_UPGRADE_GUID
  9. Upgrade GUID (``Product/@UpgradeCode``)
  10. Will be automatically generated unless explicitly provided.
  11. It should be explicitly set to a constant generated globally unique
  12. identifier (GUID) to allow your installers to replace existing
  13. installations that use the same GUID.
  14. You may for example explicitly set this variable in your
  15. CMakeLists.txt to the value that has been generated per default. You
  16. should not use GUIDs that you did not generate yourself or which may
  17. belong to other projects.
  18. A GUID shall have the following fixed length syntax::
  19. XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  20. (each X represents an uppercase hexadecimal digit)
  21. .. variable:: CPACK_WIX_PRODUCT_GUID
  22. Product GUID (``Product/@Id``)
  23. Will be automatically generated unless explicitly provided.
  24. If explicitly provided this will set the Product Id of your installer.
  25. The installer will abort if it detects a pre-existing installation that
  26. uses the same GUID.
  27. The GUID shall use the syntax described for CPACK_WIX_UPGRADE_GUID.
  28. .. variable:: CPACK_WIX_LICENSE_RTF
  29. RTF License File
  30. If CPACK_RESOURCE_FILE_LICENSE has an .rtf extension it is used as-is.
  31. If CPACK_RESOURCE_FILE_LICENSE has an .txt extension it is implicitly
  32. converted to RTF by the WIX Generator.
  33. The expected encoding of the .txt file is UTF-8.
  34. With CPACK_WIX_LICENSE_RTF you can override the license file used by the
  35. WIX Generator in case CPACK_RESOURCE_FILE_LICENSE is in an unsupported
  36. format or the .txt -> .rtf conversion does not work as expected.
  37. .. variable:: CPACK_WIX_PRODUCT_ICON
  38. The Icon shown next to the program name in Add/Remove programs.
  39. If set, this icon is used in place of the default icon.
  40. .. variable:: CPACK_WIX_UI_REF
  41. This variable allows you to override the Id of the ``<UIRef>`` element
  42. in the WiX template.
  43. The default is ``WixUI_InstallDir`` in case no CPack components have
  44. been defined and ``WixUI_FeatureTree`` otherwise.
  45. .. variable:: CPACK_WIX_UI_BANNER
  46. The bitmap will appear at the top of all installer pages other than the
  47. welcome and completion dialogs.
  48. If set, this image will replace the default banner image.
  49. This image must be 493 by 58 pixels.
  50. .. variable:: CPACK_WIX_UI_DIALOG
  51. Background bitmap used on the welcome and completion dialogs.
  52. If this variable is set, the installer will replace the default dialog
  53. image.
  54. This image must be 493 by 312 pixels.
  55. .. variable:: CPACK_WIX_PROGRAM_MENU_FOLDER
  56. Start menu folder name for launcher.
  57. If this variable is not set, it will be initialized with CPACK_PACKAGE_NAME
  58. If this variable is set to ``.``, then application shortcuts will be
  59. created directly in the start menu and the uninstaller shortcut will be
  60. omitted.
  61. .. variable:: CPACK_WIX_CULTURES
  62. Language(s) of the installer
  63. Languages are compiled into the WixUI extension library. To use them,
  64. simply provide the name of the culture. If you specify more than one
  65. culture identifier in a comma or semicolon delimited list, the first one
  66. that is found will be used. You can find a list of supported languages at:
  67. http://wix.sourceforge.net/manual-wix3/WixUI_localization.htm
  68. .. variable:: CPACK_WIX_TEMPLATE
  69. Template file for WiX generation
  70. If this variable is set, the specified template will be used to generate
  71. the WiX wxs file. This should be used if further customization of the
  72. output is required.
  73. If this variable is not set, the default MSI template included with CMake
  74. will be used.
  75. .. variable:: CPACK_WIX_PATCH_FILE
  76. Optional list of XML files with fragments to be inserted into
  77. generated WiX sources
  78. This optional variable can be used to specify an XML file that the
  79. WIX generator will use to inject fragments into its generated
  80. source files.
  81. Patch files understood by the CPack WIX generator
  82. roughly follow this RELAX NG compact schema:
  83. .. code-block:: none
  84. start = CPackWiXPatch
  85. CPackWiXPatch = element CPackWiXPatch { CPackWiXFragment* }
  86. CPackWiXFragment = element CPackWiXFragment
  87. {
  88. attribute Id { string },
  89. fragmentContent*
  90. }
  91. fragmentContent = element * - CPackWiXFragment
  92. {
  93. (attribute * { text } | text | fragmentContent)*
  94. }
  95. Currently fragments can be injected into most
  96. Component, File, Directory and Feature elements.
  97. The following additional special Ids can be used:
  98. * ``#PRODUCT`` for the ``<Product>`` element.
  99. * ``#PRODUCTFEATURE`` for the root ``<Feature>`` element.
  100. The following example illustrates how this works.
  101. Given that the WIX generator creates the following XML element:
  102. .. code-block:: xml
  103. <Component Id="CM_CP_applications.bin.my_libapp.exe" Guid="*"/>
  104. The following XML patch file may be used to inject an Environment element
  105. into it:
  106. .. code-block:: xml
  107. <CPackWiXPatch>
  108. <CPackWiXFragment Id="CM_CP_applications.bin.my_libapp.exe">
  109. <Environment Id="MyEnvironment" Action="set"
  110. Name="MyVariableName" Value="MyVariableValue"/>
  111. </CPackWiXFragment>
  112. </CPackWiXPatch>
  113. .. variable:: CPACK_WIX_EXTRA_SOURCES
  114. Extra WiX source files
  115. This variable provides an optional list of extra WiX source files (.wxs)
  116. that should be compiled and linked. The full path to source files is
  117. required.
  118. .. variable:: CPACK_WIX_EXTRA_OBJECTS
  119. Extra WiX object files or libraries
  120. This variable provides an optional list of extra WiX object (.wixobj)
  121. and/or WiX library (.wixlib) files. The full path to objects and libraries
  122. is required.
  123. .. variable:: CPACK_WIX_EXTENSIONS
  124. This variable provides a list of additional extensions for the WiX
  125. tools light and candle.
  126. .. variable:: CPACK_WIX_<TOOL>_EXTENSIONS
  127. This is the tool specific version of CPACK_WIX_EXTENSIONS.
  128. ``<TOOL>`` can be either LIGHT or CANDLE.
  129. .. variable:: CPACK_WIX_<TOOL>_EXTRA_FLAGS
  130. This list variable allows you to pass additional
  131. flags to the WiX tool ``<TOOL>``.
  132. Use it at your own risk.
  133. Future versions of CPack may generate flags which may be in conflict
  134. with your own flags.
  135. ``<TOOL>`` can be either LIGHT or CANDLE.
  136. .. variable:: CPACK_WIX_CMAKE_PACKAGE_REGISTRY
  137. If this variable is set the generated installer will create
  138. an entry in the windows registry key
  139. ``HKEY_LOCAL_MACHINE\Software\Kitware\CMake\Packages\<PackageName>``
  140. The value for ``<PackageName>`` is provided by this variable.
  141. Assuming you also install a CMake configuration file this will
  142. allow other CMake projects to find your package with
  143. the :command:`find_package` command.
  144. .. variable:: CPACK_WIX_PROPERTY_<PROPERTY>
  145. This variable can be used to provide a value for
  146. the Windows Installer property ``<PROPERTY>``
  147. The following list contains some example properties that can be used to
  148. customize information under
  149. "Programs and Features" (also known as "Add or Remove Programs")
  150. * ARPCOMMENTS - Comments
  151. * ARPHELPLINK - Help and support information URL
  152. * ARPURLINFOABOUT - General information URL
  153. * ARPURLUPDATEINFO - Update information URL
  154. * ARPHELPTELEPHONE - Help and support telephone number
  155. * ARPSIZE - Size (in kilobytes) of the application
  156. .. variable:: CPACK_WIX_ROOT_FEATURE_TITLE
  157. Sets the name of the root install feature in the WIX installer. Same as
  158. CPACK_COMPONENT_<compName>_DISPLAY_NAME for components.
  159. .. variable:: CPACK_WIX_ROOT_FEATURE_DESCRIPTION
  160. Sets the description of the root install feature in the WIX installer. Same as
  161. CPACK_COMPONENT_<compName>_DESCRIPTION for components.
  162. .. variable:: CPACK_WIX_SKIP_PROGRAM_FOLDER
  163. If this variable is set to true, the default install location
  164. of the generated package will be CPACK_PACKAGE_INSTALL_DIRECTORY directly.
  165. The install location will not be located relatively below
  166. ProgramFiles or ProgramFiles64.
  167. .. note::
  168. Installers created with this feature do not take differences
  169. between the system on which the installer is created
  170. and the system on which the installer might be used into account.
  171. It is therefore possible that the installer e.g. might try to install
  172. onto a drive that is unavailable or unintended or a path that does not
  173. follow the localization or convention of the system on which the
  174. installation is performed.
  175. .. variable:: CPACK_WIX_ROOT_FOLDER_ID
  176. This variable allows specification of a custom root folder ID.
  177. The generator specific ``<64>`` token can be used for
  178. folder IDs that come in 32-bit and 64-bit variants.
  179. In 32-bit builds the token will expand empty while in 64-bit builds
  180. it will expand to ``64``.
  181. When unset generated installers will default installing to
  182. ``ProgramFiles<64>Folder``.
  183. .. variable:: CPACK_WIX_ROOT
  184. This variable can optionally be set to the root directory
  185. of a custom WiX Toolset installation.
  186. When unspecified CPack will try to locate a WiX Toolset
  187. installation via the ``WIX`` environment variable instead.