summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/manual/cmake-properties.7.rst3
-rw-r--r--Help/prop_inst/CPACK_NEVER_OVERWRITE.rst6
-rw-r--r--Help/prop_inst/CPACK_PERMANENT.rst6
-rw-r--r--Source/CPack/WiX/cmCPackWIXGenerator.cxx6
-rw-r--r--Source/CPack/WiX/cmWIXFilesSourceWriter.cxx17
-rw-r--r--Source/CPack/WiX/cmWIXFilesSourceWriter.h3
6 files changed, 38 insertions, 3 deletions
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index f02b17f..949f190 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -308,3 +308,6 @@ Properties on Installed Files
.. toctree::
:maxdepth: 1
+
+ /prop_inst/CPACK_NEVER_OVERWRITE.rst
+ /prop_inst/CPACK_PERMANENT.rst
diff --git a/Help/prop_inst/CPACK_NEVER_OVERWRITE.rst b/Help/prop_inst/CPACK_NEVER_OVERWRITE.rst
new file mode 100644
index 0000000..11f44d0
--- /dev/null
+++ b/Help/prop_inst/CPACK_NEVER_OVERWRITE.rst
@@ -0,0 +1,6 @@
+CPACK_NEVER_OVERWRITE
+---------------------
+
+Request that this file not be overwritten on install or reinstall.
+
+The property is currently only supported by the WIX generator.
diff --git a/Help/prop_inst/CPACK_PERMANENT.rst b/Help/prop_inst/CPACK_PERMANENT.rst
new file mode 100644
index 0000000..5e191d0
--- /dev/null
+++ b/Help/prop_inst/CPACK_PERMANENT.rst
@@ -0,0 +1,6 @@
+CPACK_PERMANENT
+---------------
+
+Request that this file not be removed on uninstall.
+
+The property is currently only supported by the WIX generator.
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(