diff options
author | Nils Gladitz <nilsgladitz@gmail.com> | 2014-09-27 15:34:39 (GMT) |
---|---|---|
committer | Nils Gladitz <nilsgladitz@gmail.com> | 2014-09-27 15:34:39 (GMT) |
commit | d48c781fc2e637fd9605775f44f4360bec6a59d9 (patch) | |
tree | 08a190d00835a9fb230fcf3dae6956b19dffabc4 /Source/CPack | |
parent | 58dc05de9e8e130b0fc188ff510826d649d62aff (diff) | |
download | CMake-d48c781fc2e637fd9605775f44f4360bec6a59d9.zip CMake-d48c781fc2e637fd9605775f44f4360bec6a59d9.tar.gz CMake-d48c781fc2e637fd9605775f44f4360bec6a59d9.tar.bz2 |
CPackWiX: Extend CPACK_WIX_ACL to support directories
Diffstat (limited to 'Source/CPack')
-rw-r--r-- | Source/CPack/WiX/cmCPackWIXGenerator.cxx | 30 | ||||
-rw-r--r-- | Source/CPack/WiX/cmWIXFilesSourceWriter.cxx | 10 | ||||
-rw-r--r-- | Source/CPack/WiX/cmWIXFilesSourceWriter.h | 3 |
3 files changed, 38 insertions, 5 deletions
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx index b221ab4..744280a 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx +++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx @@ -847,13 +847,37 @@ void cmCPackWIXGenerator::AddDirectoryAndFileDefinitons( cmsys::Directory dir; dir.Load(topdir.c_str()); - if(dir.GetNumberOfFiles() == 2) + std::string relativeDirectoryPath = + cmSystemTools::RelativePath(toplevel.c_str(), topdir.c_str()); + + cmInstalledFile const* directoryInstalledFile = + this->GetInstalledFile(relativeDirectoryPath); + + bool emptyDirectory = dir.GetNumberOfFiles() == 2; + bool createDirectory = false; + + if(emptyDirectory) { - std::string componentId = fileDefinitions.EmitComponentCreateFolder( - directoryId, GenerateGUID()); + createDirectory = true; + } + + if(directoryInstalledFile) + { + if(directoryInstalledFile->HasProperty("CPACK_WIX_ACL")) + { + createDirectory = true; + } + } + if(createDirectory) + { + std::string componentId = fileDefinitions.EmitComponentCreateFolder( + directoryId, GenerateGUID(), directoryInstalledFile); featureDefinitions.EmitComponentRef(componentId); + } + if(emptyDirectory) + { return; } diff --git a/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx b/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx index 0ad5d0c..1adb06a 100644 --- a/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx +++ b/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx @@ -113,7 +113,9 @@ void cmWIXFilesSourceWriter::EmitUninstallShortcut( } std::string cmWIXFilesSourceWriter::EmitComponentCreateFolder( - std::string const& directoryId, std::string const& guid) + std::string const& directoryId, + std::string const& guid, + cmInstalledFile const* installedFile) { std::string componentId = std::string("CM_C_EMPTY_") + directoryId; @@ -127,6 +129,12 @@ std::string cmWIXFilesSourceWriter::EmitComponentCreateFolder( BeginElement("CreateFolder"); + if(installedFile) + { + cmWIXAccessControlList acl(Logger, *installedFile, *this); + acl.Apply(); + } + EndElement("CreateFolder"); EndElement("Component"); EndElement("DirectoryRef"); diff --git a/Source/CPack/WiX/cmWIXFilesSourceWriter.h b/Source/CPack/WiX/cmWIXFilesSourceWriter.h index 23ef561..b0a4af8 100644 --- a/Source/CPack/WiX/cmWIXFilesSourceWriter.h +++ b/Source/CPack/WiX/cmWIXFilesSourceWriter.h @@ -47,7 +47,8 @@ public: std::string EmitComponentCreateFolder( std::string const& directoryId, - std::string const& guid); + std::string const& guid, + cmInstalledFile const* installedFile); std::string EmitComponentFile( std::string const& directoryId, |