diff options
Diffstat (limited to 'Source/CPack/WiX/cmCPackWIXGenerator.cxx')
-rw-r--r-- | Source/CPack/WiX/cmCPackWIXGenerator.cxx | 30 |
1 files changed, 27 insertions, 3 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; } |