CPackWIX.cmake 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. #.rst:
  2. # CPackWIX
  3. # --------
  4. #
  5. # CPack WiX generator specific options
  6. #
  7. # Variables specific to CPack WiX generator
  8. # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  9. #
  10. # The following variables are specific to the installers built on
  11. # Windows using WiX.
  12. #
  13. # .. variable:: CPACK_WIX_UPGRADE_GUID
  14. #
  15. # Upgrade GUID (``Product/@UpgradeCode``)
  16. #
  17. # Will be automatically generated unless explicitly provided.
  18. #
  19. # It should be explicitly set to a constant generated gloabally unique
  20. # identifier (GUID) to allow your installers to replace existing
  21. # installations that use the same GUID.
  22. #
  23. # You may for example explicitly set this variable in your
  24. # CMakeLists.txt to the value that has been generated per default. You
  25. # should not use GUIDs that you did not generate yourself or which may
  26. # belong to other projects.
  27. #
  28. # A GUID shall have the following fixed length syntax::
  29. #
  30. # XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  31. #
  32. # (each X represents an uppercase hexadecimal digit)
  33. #
  34. # .. variable:: CPACK_WIX_PRODUCT_GUID
  35. #
  36. # Product GUID (``Product/@Id``)
  37. #
  38. # Will be automatically generated unless explicitly provided.
  39. #
  40. # If explicitly provided this will set the Product Id of your installer.
  41. #
  42. # The installer will abort if it detects a pre-existing installation that
  43. # uses the same GUID.
  44. #
  45. # The GUID shall use the syntax described for CPACK_WIX_UPGRADE_GUID.
  46. #
  47. # .. variable:: CPACK_WIX_LICENSE_RTF
  48. #
  49. # RTF License File
  50. #
  51. # If CPACK_RESOURCE_FILE_LICENSE has an .rtf extension it is used as-is.
  52. #
  53. # If CPACK_RESOURCE_FILE_LICENSE has an .txt extension it is implicitly
  54. # converted to RTF by the WiX Generator.
  55. # The expected encoding of the .txt file is UTF-8.
  56. #
  57. # With CPACK_WIX_LICENSE_RTF you can override the license file used by the
  58. # WiX Generator in case CPACK_RESOURCE_FILE_LICENSE is in an unsupported
  59. # format or the .txt -> .rtf conversion does not work as expected.
  60. #
  61. # .. variable:: CPACK_WIX_PRODUCT_ICON
  62. #
  63. # The Icon shown next to the program name in Add/Remove programs.
  64. #
  65. # If set, this icon is used in place of the default icon.
  66. #
  67. # .. variable:: CPACK_WIX_UI_REF
  68. #
  69. # This variable allows you to override the Id of the ``<UIRef>`` element
  70. # in the WiX template.
  71. #
  72. # The default is ``WixUI_InstallDir`` in case no CPack components have
  73. # been defined and ``WixUI_FeatureTree`` otherwise.
  74. #
  75. # .. variable:: CPACK_WIX_UI_BANNER
  76. #
  77. # The bitmap will appear at the top of all installer pages other than the
  78. # welcome and completion dialogs.
  79. #
  80. # If set, this image will replace the default banner image.
  81. #
  82. # This image must be 493 by 58 pixels.
  83. #
  84. # .. variable:: CPACK_WIX_UI_DIALOG
  85. #
  86. # Background bitmap used on the welcome and completion dialogs.
  87. #
  88. # If this variable is set, the installer will replace the default dialog
  89. # image.
  90. #
  91. # This image must be 493 by 312 pixels.
  92. #
  93. # .. variable:: CPACK_WIX_PROGRAM_MENU_FOLDER
  94. #
  95. # Start menu folder name for launcher.
  96. #
  97. # If this variable is not set, it will be initialized with CPACK_PACKAGE_NAME
  98. #
  99. # .. variable:: CPACK_WIX_CULTURES
  100. #
  101. # Language(s) of the installer
  102. #
  103. # Languages are compiled into the WixUI extension library. To use them,
  104. # simply provide the name of the culture. If you specify more than one
  105. # culture identifier in a comma or semicolon delimited list, the first one
  106. # that is found will be used. You can find a list of supported languages at:
  107. # http://wix.sourceforge.net/manual-wix3/WixUI_localization.htm
  108. #
  109. # .. variable:: CPACK_WIX_TEMPLATE
  110. #
  111. # Template file for WiX generation
  112. #
  113. # If this variable is set, the specified template will be used to generate
  114. # the WiX wxs file. This should be used if further customization of the
  115. # output is required.
  116. #
  117. # If this variable is not set, the default MSI template included with CMake
  118. # will be used.
  119. #
  120. # .. variable:: CPACK_WIX_PATCH_FILE
  121. #
  122. # Optional XML file with fragments to be inserted into generated WiX sources
  123. #
  124. # This optional variable can be used to specify an XML file that the
  125. # WiX generator will use to inject fragments into its generated
  126. # source files.
  127. #
  128. # Patch files understood by the CPack WiX generator
  129. # roughly follow this RELAX NG compact schema:
  130. #
  131. # .. code-block:: none
  132. #
  133. # start = CPackWiXPatch
  134. #
  135. # CPackWiXPatch = element CPackWiXPatch { CPackWiXFragment* }
  136. #
  137. # CPackWiXFragment = element CPackWiXFragment
  138. # {
  139. # attribute Id { string },
  140. # fragmentContent*
  141. # }
  142. #
  143. # fragmentContent = element * - CPackWiXFragment
  144. # {
  145. # (attribute * { text } | text | fragmentContent)*
  146. # }
  147. #
  148. # Currently fragments can be injected into most
  149. # Component, File and Directory elements.
  150. #
  151. # The special Id ``#PRODUCT`` can be used to inject content
  152. # into the ``<Product>`` element.
  153. #
  154. # The following example illustrates how this works.
  155. #
  156. # Given that the WiX generator creates the following XML element:
  157. #
  158. # .. code-block:: xml
  159. #
  160. # <Component Id="CM_CP_applications.bin.my_libapp.exe" Guid="*"/>
  161. #
  162. # The following XML patch file may be used to inject an Environment element
  163. # into it:
  164. #
  165. # .. code-block:: xml
  166. #
  167. # <CPackWiXPatch>
  168. # <CPackWiXFragment Id="CM_CP_applications.bin.my_libapp.exe">
  169. # <Environment Id="MyEnvironment" Action="set"
  170. # Name="MyVariableName" Value="MyVariableValue"/>
  171. # </CPackWiXFragment>
  172. # </CPackWiXPatch>
  173. #
  174. # .. variable:: CPACK_WIX_EXTRA_SOURCES
  175. #
  176. # Extra WiX source files
  177. #
  178. # This variable provides an optional list of extra WiX source files (.wxs)
  179. # that should be compiled and linked. The full path to source files is
  180. # required.
  181. #
  182. # .. variable:: CPACK_WIX_EXTRA_OBJECTS
  183. #
  184. # Extra WiX object files or libraries
  185. #
  186. # This variable provides an optional list of extra WiX object (.wixobj)
  187. # and/or WiX library (.wixlib) files. The full path to objects and libraries
  188. # is required.
  189. #
  190. # .. variable:: CPACK_WIX_EXTENSIONS
  191. #
  192. # This variable provides a list of additional extensions for the WiX
  193. # tools light and candle.
  194. #
  195. # .. variable:: CPACK_WIX_<TOOL>_EXTENSIONS
  196. #
  197. # This is the tool specific version of CPACK_WIX_EXTENSIONS.
  198. # ``<TOOL>`` can be either LIGHT or CANDLE.
  199. #
  200. # .. variable:: CPACK_WIX_<TOOL>_EXTRA_FLAGS
  201. #
  202. # This list variable allows you to pass additional
  203. # flags to the WiX tool ``<TOOL>``.
  204. #
  205. # Use it at your own risk.
  206. # Future versions of CPack may generate flags which may be in conflict
  207. # with your own flags.
  208. #
  209. # ``<TOOL>`` can be either LIGHT or CANDLE.
  210. #
  211. # .. variable:: CPACK_WIX_CMAKE_PACKAGE_REGISTRY
  212. #
  213. # If this variable is set the generated installer will create
  214. # an entry in the windows registry key
  215. # ``HKEY_LOCAL_MACHINE\Software\Kitware\CMake\Packages\<package>``
  216. # The value for ``<package>`` is provided by this variable.
  217. #
  218. # Assuming you also install a CMake configuration file this will
  219. # allow other CMake projects to find your package with
  220. # the :command:`find_package` command.
  221. #
  222. # .. variable:: CPACK_WIX_PROPERTY_<PROPERTY>
  223. #
  224. # This variable can be used to provide a value for
  225. # the Windows Installer property ``<PROPERTY>``
  226. #
  227. # The follwing list contains some example properties that can be used to
  228. # customize information under
  229. # "Programs and Features" (also known as "Add or Remove Programs")
  230. #
  231. # * ARPCOMMENTS - Comments
  232. # * ARPHELPLINK - Help and support information URL
  233. # * ARPURLINFOABOUT - General information URL
  234. # * URLUPDATEINFO - Update information URL
  235. # * ARPHELPTELEPHONE - Help and support telephone number
  236. # * ARPSIZE - Size (in kilobytes) of the application
  237. #=============================================================================
  238. # Copyright 2014-2015 Kitware, Inc.
  239. #
  240. # Distributed under the OSI-approved BSD License (the "License");
  241. # see accompanying file Copyright.txt for details.
  242. #
  243. # This software is distributed WITHOUT ANY WARRANTY; without even the
  244. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  245. # See the License for more information.
  246. #=============================================================================
  247. # (To distribute this file outside of CMake, substitute the full
  248. # License text for the above reference.)
  249. if(NOT CPACK_WIX_ROOT)
  250. file(TO_CMAKE_PATH "$ENV{WIX}" CPACK_WIX_ROOT)
  251. endif()
  252. find_program(CPACK_WIX_CANDLE_EXECUTABLE candle
  253. PATHS "${CPACK_WIX_ROOT}/bin")
  254. if(NOT CPACK_WIX_CANDLE_EXECUTABLE)
  255. message(FATAL_ERROR "Could not find the WiX candle executable.")
  256. endif()
  257. find_program(CPACK_WIX_LIGHT_EXECUTABLE light
  258. PATHS "${CPACK_WIX_ROOT}/bin")
  259. if(NOT CPACK_WIX_LIGHT_EXECUTABLE)
  260. message(FATAL_ERROR "Could not find the WiX light executable.")
  261. endif()