diff options
author | Nils Gladitz <nilsgladitz@gmail.com> | 2014-05-16 20:43:56 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-05-28 16:30:44 (GMT) |
commit | d0b1d2a65be658663ce7314961e13036974f62e7 (patch) | |
tree | 7323abad2bea4da8e21ba2bee5601da30ed8ca74 /Source/CPack | |
parent | 15a8af21e8bd8354dfff2063e01f695f85efdeb8 (diff) | |
download | CMake-d0b1d2a65be658663ce7314961e13036974f62e7.zip CMake-d0b1d2a65be658663ce7314961e13036974f62e7.tar.gz CMake-d0b1d2a65be658663ce7314961e13036974f62e7.tar.bz2 |
CPackWiX: Implement CPACK_NEVER_OVERWRITE and CPACK_PERMANENT properties
Diffstat (limited to 'Source/CPack')
-rw-r--r-- | Source/CPack/WiX/cmCPackWIXGenerator.cxx | 6 | ||||
-rw-r--r-- | Source/CPack/WiX/cmWIXFilesSourceWriter.cxx | 17 | ||||
-rw-r--r-- | Source/CPack/WiX/cmWIXFilesSourceWriter.h | 3 |
3 files changed, 23 insertions, 3 deletions
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx index ec59715..a2995d1 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx +++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx @@ -15,6 +15,7 @@ #include <cmSystemTools.h> #include <cmGeneratedFileStream.h> #include <cmCryptoHash.h> +#include <cmInstalledFile.h> #include <CPack/cmCPackLog.h> #include <CPack/cmCPackComponentGroup.h> @@ -871,8 +872,11 @@ void cmCPackWIXGenerator::AddDirectoryAndFileDefinitons( } else { + cmInstalledFile const* installedFile = + this->GetInstalledFile(relativePath); + std::string componentId = fileDefinitions.EmitComponentFile( - directoryId, id, fullPath, *(this->Patch)); + directoryId, id, fullPath, *(this->Patch), installedFile); featureDefinitions.EmitComponentRef(componentId); diff --git a/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx b/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx index 3fd959e..451188e 100644 --- a/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx +++ b/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx @@ -12,6 +12,8 @@ #include "cmWIXFilesSourceWriter.h" +#include <cmInstalledFile.h> + #include <sys/types.h> #include <sys/stat.h> @@ -135,7 +137,8 @@ std::string cmWIXFilesSourceWriter::EmitComponentFile( std::string const& directoryId, std::string const& id, std::string const& filePath, - cmWIXPatch &patch) + cmWIXPatch &patch, + cmInstalledFile const* installedFile) { std::string componentId = std::string("CM_C") + id; std::string fileId = std::string("CM_F") + id; @@ -147,6 +150,18 @@ std::string cmWIXFilesSourceWriter::EmitComponentFile( AddAttribute("Id", componentId); AddAttribute("Guid", "*"); + if(installedFile) + { + if(installedFile->GetPropertyAsBool("CPACK_NEVER_OVERWRITE")) + { + AddAttribute("NeverOverwrite", "yes"); + } + if(installedFile->GetPropertyAsBool("CPACK_PERMANENT")) + { + AddAttribute("Permanent", "yes"); + } + } + BeginElement("File"); AddAttribute("Id", fileId); AddAttribute("Source", filePath); diff --git a/Source/CPack/WiX/cmWIXFilesSourceWriter.h b/Source/CPack/WiX/cmWIXFilesSourceWriter.h index 13122c2..23ef561 100644 --- a/Source/CPack/WiX/cmWIXFilesSourceWriter.h +++ b/Source/CPack/WiX/cmWIXFilesSourceWriter.h @@ -53,7 +53,8 @@ public: std::string const& directoryId, std::string const& id, std::string const& filePath, - cmWIXPatch &patch); + cmWIXPatch &patch, + cmInstalledFile const* installedFile); private: void EmitInstallRegistryValue( |