From e29bfbf272dbf4ea5f6a89084ec1f503fcf0e4f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20St=C3=BCrmer?= Date: Wed, 20 Jul 2016 15:27:01 +0200 Subject: [PATCH] CPackWIX: Support custom title and description for the root feature These can now be specified through the WIX generator specific CPack variables CPACK_WIX_ROOT_FEATURE_TITLE and CPACK_WIX_ROOT_FEATURE_DESCRIPTION. --- Help/release/dev/wix-root-description.rst | 7 +++++++ Modules/CPackWIX.cmake | 11 +++++++++++ Source/CPack/WiX/cmCPackWIXGenerator.cxx | 9 ++++++++- 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 Help/release/dev/wix-root-description.rst diff --git a/Help/release/dev/wix-root-description.rst b/Help/release/dev/wix-root-description.rst new file mode 100644 index 000000000..24afed283 --- /dev/null +++ b/Help/release/dev/wix-root-description.rst @@ -0,0 +1,7 @@ +wix-root-description +-------------------- + +* The CPack WIX generator now supports + :variable:`CPACK_WIX_ROOT_FEATURE_TITLE` and + :variable:`CPACK_WIX_ROOT_FEATURE_DESCRIPTION` to allow the specification + of a custom title and description for the root feature element. diff --git a/Modules/CPackWIX.cmake b/Modules/CPackWIX.cmake index 3c9056152..10926c0f7 100644 --- a/Modules/CPackWIX.cmake +++ b/Modules/CPackWIX.cmake @@ -237,6 +237,17 @@ # * ARPURLUPDATEINFO - Update information URL # * ARPHELPTELEPHONE - Help and support telephone number # * ARPSIZE - Size (in kilobytes) of the application +# +# .. variable:: CPACK_WIX_ROOT_FEATURE_TITLE +# +# Sets the name of the root install feature in the WIX installer. Same as +# CPACK_COMPONENT__DISPLAY_NAME for components. +# +# .. variable:: CPACK_WIX_ROOT_FEATURE_DESCRIPTION +# +# Sets the description of the root install feature in the WIX installer. Same as +# CPACK_COMPONENT__DESCRIPTION for components. +# #============================================================================= # Copyright 2014-2015 Kitware, Inc. diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx index 97216c391..3ecc14d5a 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx +++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx @@ -464,7 +464,14 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles() return false; } - featureDefinitions.AddAttribute("Title", cpackPackageName); + std::string featureTitle = cpackPackageName; + if (const char* title = GetOption("CPACK_WIX_ROOT_FEATURE_TITLE")) { + featureTitle = title; + } + featureDefinitions.AddAttribute("Title", featureTitle); + if (const char* desc = GetOption("CPACK_WIX_ROOT_FEATURE_DESCRIPTION")) { + featureDefinitions.AddAttribute("Description", desc); + } featureDefinitions.AddAttribute("Level", "1"); this->Patch->ApplyFragment("#PRODUCTFEATURE", featureDefinitions);