diff --git a/Modules/CPackWIX.cmake b/Modules/CPackWIX.cmake index 0a47e196f..105df96fc 100644 --- a/Modules/CPackWIX.cmake +++ b/Modules/CPackWIX.cmake @@ -148,6 +148,9 @@ # Currently fragments can be injected into most # Component, File and Directory elements. # +# The special Id ``#PRODUCT`` can be used to inject content +# into the ```` element. +# # The following example illustrates how this works. # # Given that the WiX generator creates the following XML element: @@ -233,7 +236,7 @@ # * ARPSIZE - Size (in kilobytes) of the application #============================================================================= -# Copyright 2014 Kitware, Inc. +# Copyright 2014-2015 Kitware, Inc. # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. diff --git a/Modules/WIX.template.in b/Modules/WIX.template.in index bbb7c8831..c4fc83afa 100644 --- a/Modules/WIX.template.in +++ b/Modules/WIX.template.in @@ -42,5 +42,6 @@ + diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx index 59c38e9b1..11d5437e7 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx +++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx @@ -1,6 +1,6 @@ /*============================================================================ CMake - Cross Platform Makefile Generator - Copyright 2000-2014 Kitware, Inc., Insight Software Consortium + Copyright 2012-2015 Kitware, Inc., Insight Software Consortium Distributed under the OSI-approved BSD License (the "License"); see accompanying file Copyright.txt for details. @@ -257,6 +257,7 @@ bool cmCPackWIXGenerator::PackageFilesImpl() CreateWiXVariablesIncludeFile(); CreateWiXPropertiesIncludeFile(); + CreateWiXProductFragmentIncludeFile(); if(!CreateWiXSourceFiles()) { @@ -385,6 +386,17 @@ void cmCPackWIXGenerator::CreateWiXPropertiesIncludeFile() } } +void cmCPackWIXGenerator::CreateWiXProductFragmentIncludeFile() +{ + std::string includeFilename = + this->CPackTopLevel + "/product_fragment.wxi"; + + cmWIXSourceWriter includeFile( + this->Logger, includeFilename, true); + + this->Patch->ApplyFragment("#PRODUCT", includeFile); +} + void cmCPackWIXGenerator::CopyDefinition( cmWIXSourceWriter &source, std::string const& name) { diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.h b/Source/CPack/WiX/cmCPackWIXGenerator.h index 8705d404b..703529703 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.h +++ b/Source/CPack/WiX/cmCPackWIXGenerator.h @@ -1,6 +1,6 @@ /*============================================================================ CMake - Cross Platform Makefile Generator - Copyright 2000-2012 Kitware, Inc. + Copyright 2012-2015 Kitware, Inc. Distributed under the OSI-approved BSD License (the "License"); see accompanying file Copyright.txt for details. @@ -76,6 +76,8 @@ private: void CreateWiXPropertiesIncludeFile(); + void CreateWiXProductFragmentIncludeFile(); + void CopyDefinition( cmWIXSourceWriter &source, std::string const& name);