diff options
author | Michael Stürmer <michael.stuermer@schaeffler.com> | 2016-09-06 10:11:00 (GMT) |
---|---|---|
committer | Nils Gladitz <nilsgladitz@gmail.com> | 2016-09-06 15:44:48 (GMT) |
commit | 1bc33257d48bb4b54333b755951967c6c3fa1df6 (patch) | |
tree | 9279d779c344357821f3a5e199e8ca0410cec39d /Source/CPack/WiX/cmCPackWIXGenerator.cxx | |
parent | 8317ea01aa3cf9319ef907e127fa6dbf9666cc53 (diff) | |
download | CMake-1bc33257d48bb4b54333b755951967c6c3fa1df6.zip CMake-1bc33257d48bb4b54333b755951967c6c3fa1df6.tar.gz CMake-1bc33257d48bb4b54333b755951967c6c3fa1df6.tar.bz2 |
CPackWIX: Fix incomplete CPACK_WIX_SKIP_PROGRAM_FOLDER implementation
Commit 17bbf6af (CPackWIX: Implement new CPACK_WIX_SKIP_PROGRAM_FOLDER
feature) generates GUIDs for most but not all components
when the feature is active.
Generate the remaining GUIDs as well.
Co-Author: Nils Gladitz <nilsgladitz@gmail.com>
Diffstat (limited to 'Source/CPack/WiX/cmCPackWIXGenerator.cxx')
-rw-r--r-- | Source/CPack/WiX/cmCPackWIXGenerator.cxx | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx index d7f69a1..85e0ae3 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx +++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx @@ -35,6 +35,7 @@ cmCPackWIXGenerator::cmCPackWIXGenerator() : Patch(0) + , ComponentGuidType(cmWIXSourceWriter::WIX_GENERATED_GUID) { } @@ -234,6 +235,12 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration() } } + // if install folder is supposed to be set absolutely, the default + // component guid "*" cannot be used + if (cmSystemTools::IsOn(GetOption("CPACK_WIX_SKIP_PROGRAM_FOLDER"))) { + this->ComponentGuidType = cmWIXSourceWriter::CMAKE_GENERATED_GUID; + } + return true; } @@ -317,7 +324,9 @@ void cmCPackWIXGenerator::CreateWiXVariablesIncludeFile() { std::string includeFilename = this->CPackTopLevel + "/cpack_variables.wxi"; - cmWIXSourceWriter includeFile(this->Logger, includeFilename, true); + cmWIXSourceWriter includeFile(this->Logger, includeFilename, + this->ComponentGuidType, + cmWIXSourceWriter::INCLUDE_ELEMENT_ROOT); CopyDefinition(includeFile, "CPACK_WIX_PRODUCT_GUID"); CopyDefinition(includeFile, "CPACK_WIX_UPGRADE_GUID"); @@ -338,7 +347,9 @@ void cmCPackWIXGenerator::CreateWiXPropertiesIncludeFile() { std::string includeFilename = this->CPackTopLevel + "/properties.wxi"; - cmWIXSourceWriter includeFile(this->Logger, includeFilename, true); + cmWIXSourceWriter includeFile(this->Logger, includeFilename, + this->ComponentGuidType, + cmWIXSourceWriter::INCLUDE_ELEMENT_ROOT); std::string prefix = "CPACK_WIX_PROPERTY_"; std::vector<std::string> options = GetOptions(); @@ -386,7 +397,9 @@ void cmCPackWIXGenerator::CreateWiXProductFragmentIncludeFile() { std::string includeFilename = this->CPackTopLevel + "/product_fragment.wxi"; - cmWIXSourceWriter includeFile(this->Logger, includeFilename, true); + cmWIXSourceWriter includeFile(this->Logger, includeFilename, + this->ComponentGuidType, + cmWIXSourceWriter::INCLUDE_ELEMENT_ROOT); this->Patch->ApplyFragment("#PRODUCT", includeFile); } @@ -413,13 +426,15 @@ void cmCPackWIXGenerator::AddDefinition(cmWIXSourceWriter& source, bool cmCPackWIXGenerator::CreateWiXSourceFiles() { + // if install folder is supposed to be set absolutely, the default + // component guid "*" cannot be used std::string directoryDefinitionsFilename = this->CPackTopLevel + "/directories.wxs"; this->WixSources.push_back(directoryDefinitionsFilename); cmWIXDirectoriesSourceWriter directoryDefinitions( - this->Logger, directoryDefinitionsFilename); + this->Logger, directoryDefinitionsFilename, this->ComponentGuidType); directoryDefinitions.BeginElement("Fragment"); std::string installRoot; @@ -439,13 +454,8 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles() this->WixSources.push_back(fileDefinitionsFilename); - cmWIXFilesSourceWriter fileDefinitions(this->Logger, - fileDefinitionsFilename); - - // if install folder is supposed to be set absolutely, the default - // component guid "*" cannot be used - fileDefinitions.GenerateComponentGuids = - cmSystemTools::IsOn(GetOption("CPACK_WIX_SKIP_PROGRAM_FOLDER")); + cmWIXFilesSourceWriter fileDefinitions(this->Logger, fileDefinitionsFilename, + this->ComponentGuidType); fileDefinitions.BeginElement("Fragment"); @@ -454,8 +464,8 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles() this->WixSources.push_back(featureDefinitionsFilename); - cmWIXFeaturesSourceWriter featureDefinitions(this->Logger, - featureDefinitionsFilename); + cmWIXFeaturesSourceWriter featureDefinitions( + this->Logger, featureDefinitionsFilename, this->ComponentGuidType); featureDefinitions.BeginElement("Fragment"); @@ -764,7 +774,8 @@ bool cmCPackWIXGenerator::CreateShortcutsOfSpecificType( fileDefinitions.BeginElement("Component"); fileDefinitions.AddAttribute("Id", componentId); - fileDefinitions.AddAttribute("Guid", "*"); + fileDefinitions.AddAttribute( + "Guid", fileDefinitions.CreateGuidFromComponentId(componentId)); this->Patch->ApplyFragment(componentId, fileDefinitions); |