wix.rst 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  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. .. variable:: CPACK_WIX_CULTURES
  59. Language(s) of the installer
  60. Languages are compiled into the WixUI extension library. To use them,
  61. simply provide the name of the culture. If you specify more than one
  62. culture identifier in a comma or semicolon delimited list, the first one
  63. that is found will be used. You can find a list of supported languages at:
  64. http://wix.sourceforge.net/manual-wix3/WixUI_localization.htm
  65. .. variable:: CPACK_WIX_TEMPLATE
  66. Template file for WiX generation
  67. If this variable is set, the specified template will be used to generate
  68. the WiX wxs file. This should be used if further customization of the
  69. output is required.
  70. If this variable is not set, the default MSI template included with CMake
  71. will be used.
  72. .. variable:: CPACK_WIX_PATCH_FILE
  73. Optional list of XML files with fragments to be inserted into
  74. generated WiX sources
  75. This optional variable can be used to specify an XML file that the
  76. WiX generator will use to inject fragments into its generated
  77. source files.
  78. Patch files understood by the CPack WiX generator
  79. roughly follow this RELAX NG compact schema:
  80. .. code-block:: none
  81. start = CPackWiXPatch
  82. CPackWiXPatch = element CPackWiXPatch { CPackWiXFragment* }
  83. CPackWiXFragment = element CPackWiXFragment
  84. {
  85. attribute Id { string },
  86. fragmentContent*
  87. }
  88. fragmentContent = element * - CPackWiXFragment
  89. {
  90. (attribute * { text } | text | fragmentContent)*
  91. }
  92. Currently fragments can be injected into most
  93. Component, File, Directory and Feature elements.
  94. The following additional special Ids can be used:
  95. * ``#PRODUCT`` for the ``<Product>`` element.
  96. * ``#PRODUCTFEATURE`` for the root ``<Feature>`` element.
  97. The following example illustrates how this works.
  98. Given that the WiX generator creates the following XML element:
  99. .. code-block:: xml
  100. <Component Id="CM_CP_applications.bin.my_libapp.exe" Guid="*"/>
  101. The following XML patch file may be used to inject an Environment element
  102. into it:
  103. .. code-block:: xml
  104. <CPackWiXPatch>
  105. <CPackWiXFragment Id="CM_CP_applications.bin.my_libapp.exe">
  106. <Environment Id="MyEnvironment" Action="set"
  107. Name="MyVariableName" Value="MyVariableValue"/>
  108. </CPackWiXFragment>
  109. </CPackWiXPatch>
  110. .. variable:: CPACK_WIX_EXTRA_SOURCES
  111. Extra WiX source files
  112. This variable provides an optional list of extra WiX source files (.wxs)
  113. that should be compiled and linked. The full path to source files is
  114. required.
  115. .. variable:: CPACK_WIX_EXTRA_OBJECTS
  116. Extra WiX object files or libraries
  117. This variable provides an optional list of extra WiX object (.wixobj)
  118. and/or WiX library (.wixlib) files. The full path to objects and libraries
  119. is required.
  120. .. variable:: CPACK_WIX_EXTENSIONS
  121. This variable provides a list of additional extensions for the WiX
  122. tools light and candle.
  123. .. variable:: CPACK_WIX_<TOOL>_EXTENSIONS
  124. This is the tool specific version of CPACK_WIX_EXTENSIONS.
  125. ``<TOOL>`` can be either LIGHT or CANDLE.
  126. .. variable:: CPACK_WIX_<TOOL>_EXTRA_FLAGS
  127. This list variable allows you to pass additional
  128. flags to the WiX tool ``<TOOL>``.
  129. Use it at your own risk.
  130. Future versions of CPack may generate flags which may be in conflict
  131. with your own flags.
  132. ``<TOOL>`` can be either LIGHT or CANDLE.
  133. .. variable:: CPACK_WIX_CMAKE_PACKAGE_REGISTRY
  134. If this variable is set the generated installer will create
  135. an entry in the windows registry key
  136. ``HKEY_LOCAL_MACHINE\Software\Kitware\CMake\Packages\<package>``
  137. The value for ``<package>`` is provided by this variable.
  138. Assuming you also install a CMake configuration file this will
  139. allow other CMake projects to find your package with
  140. the :command:`find_package` command.
  141. .. variable:: CPACK_WIX_PROPERTY_<PROPERTY>
  142. This variable can be used to provide a value for
  143. the Windows Installer property ``<PROPERTY>``
  144. The following list contains some example properties that can be used to
  145. customize information under
  146. "Programs and Features" (also known as "Add or Remove Programs")
  147. * ARPCOMMENTS - Comments
  148. * ARPHELPLINK - Help and support information URL
  149. * ARPURLINFOABOUT - General information URL
  150. * ARPURLUPDATEINFO - Update information URL
  151. * ARPHELPTELEPHONE - Help and support telephone number
  152. * ARPSIZE - Size (in kilobytes) of the application
  153. .. variable:: CPACK_WIX_ROOT_FEATURE_TITLE
  154. Sets the name of the root install feature in the WIX installer. Same as
  155. CPACK_COMPONENT_<compName>_DISPLAY_NAME for components.
  156. .. variable:: CPACK_WIX_ROOT_FEATURE_DESCRIPTION
  157. Sets the description of the root install feature in the WIX installer. Same as
  158. CPACK_COMPONENT_<compName>_DESCRIPTION for components.
  159. .. variable:: CPACK_WIX_SKIP_PROGRAM_FOLDER
  160. If this variable is set to true, the default install location
  161. of the generated package will be CPACK_PACKAGE_INSTALL_DIRECTORY directly.
  162. The install location will not be located relatively below
  163. ProgramFiles or ProgramFiles64.
  164. .. note::
  165. Installers created with this feature do not take differences
  166. between the system on which the installer is created
  167. and the system on which the installer might be used into account.
  168. It is therefore possible that the installer e.g. might try to install
  169. onto a drive that is unavailable or unintended or a path that does not
  170. follow the localization or convention of the system on which the
  171. installation is performed.
  172. .. variable:: CPACK_WIX_ROOT_FOLDER_ID
  173. This variable allows specification of a custom root folder ID.
  174. The generator specific ``<64>`` token can be used for
  175. folder IDs that come in 32-bit and 64-bit variants.
  176. In 32-bit builds the token will expand empty while in 64-bit builds
  177. it will expand to ``64``.
  178. When unset generated installers will default installing to
  179. ``ProgramFiles<64>Folder``.
  180. .. variable:: CPACK_WIX_ROOT
  181. This variable can optionally be set to the root directory
  182. of a custom WiX Toolset installation.
  183. When unspecified CPack will try to locate a WiX Toolset
  184. installation via the ``WIX`` environment variable instead.