diff options
author | Nils Gladitz <nilsgladitz@gmail.com> | 2013-12-25 23:14:44 (GMT) |
---|---|---|
committer | Nils Gladitz <nilsgladitz@gmail.com> | 2013-12-25 23:14:44 (GMT) |
commit | 44a7543c530cad64c429e85c679c481ee587f929 (patch) | |
tree | cc1d78e1add93124dc5b991b520ddea4a9126845 /Source/CPack/WiX/cmCPackWIXGenerator.cxx | |
parent | b87ce492ab4600091262593499095ea5db1ae0ca (diff) | |
download | CMake-44a7543c530cad64c429e85c679c481ee587f929.zip CMake-44a7543c530cad64c429e85c679c481ee587f929.tar.gz CMake-44a7543c530cad64c429e85c679c481ee587f929.tar.bz2 |
CPackWiX: transfer file read only flag during installation
Diffstat (limited to 'Source/CPack/WiX/cmCPackWIXGenerator.cxx')
-rw-r--r-- | Source/CPack/WiX/cmCPackWIXGenerator.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx index c1749ac..78e7339 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx +++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx @@ -27,6 +27,9 @@ #include <rpc.h> // for GUID generation +#include <sys/types.h> +#include <sys/stat.h> + int cmCPackWIXGenerator::InitializeInternal() { componentPackageMethod = ONE_PACKAGE; @@ -920,6 +923,14 @@ void cmCPackWIXGenerator::AddDirectoryAndFileDefinitons( fileDefinitions.AddAttribute("Source", fullPath); fileDefinitions.AddAttribute("KeyPath", "yes"); + mode_t fileMode = 0; + cmSystemTools::GetPermissions(fullPath.c_str(), fileMode); + + if(!(fileMode & S_IWRITE)) + { + fileDefinitions.AddAttribute("ReadOnly", "yes"); + } + ApplyPatchFragment(fileId, fileDefinitions); fileDefinitions.EndElement("File"); |