mirror of
https://github.com/reactos/CMake.git
synced 2024-12-05 10:16:50 +00:00
CPackWiX: Extend CPACK_WIX_ACL to support directories
This commit is contained in:
parent
58dc05de9e
commit
d48c781fc2
@ -1,7 +1,8 @@
|
||||
CPACK_WIX_ACL
|
||||
-------------
|
||||
|
||||
Specifies access permissions for files installed by a WiX installer.
|
||||
Specifies access permissions for files or directories
|
||||
installed by a WiX installer.
|
||||
|
||||
The property can contain multiple list entries,
|
||||
each of which has to match the following format.
|
||||
|
@ -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)
|
||||
{
|
||||
createDirectory = true;
|
||||
}
|
||||
|
||||
if(directoryInstalledFile)
|
||||
{
|
||||
if(directoryInstalledFile->HasProperty("CPACK_WIX_ACL"))
|
||||
{
|
||||
createDirectory = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(createDirectory)
|
||||
{
|
||||
std::string componentId = fileDefinitions.EmitComponentCreateFolder(
|
||||
directoryId, GenerateGUID());
|
||||
|
||||
directoryId, GenerateGUID(), directoryInstalledFile);
|
||||
featureDefinitions.EmitComponentRef(componentId);
|
||||
}
|
||||
|
||||
if(emptyDirectory)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -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");
|
||||
|
@ -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,
|
||||
|
@ -76,6 +76,13 @@ void cmInstalledFile::AppendProperty(cmMakefile const* mf,
|
||||
property.ValueExpressions.push_back(ge.Parse(value).release());
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool cmInstalledFile::HasProperty(
|
||||
const std::string& prop) const
|
||||
{
|
||||
return this->Properties.find(prop) != this->Properties.end();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool cmInstalledFile::GetProperty(
|
||||
const std::string& prop, std::string& value) const
|
||||
|
@ -62,6 +62,8 @@ public:
|
||||
void AppendProperty(cmMakefile const* mf,
|
||||
const std::string& prop, const char* value,bool asString=false);
|
||||
|
||||
bool HasProperty(const std::string& prop) const;
|
||||
|
||||
bool GetProperty(const std::string& prop, std::string& value) const;
|
||||
|
||||
bool GetPropertyAsBool(const std::string& prop) const;
|
||||
|
Loading…
Reference in New Issue
Block a user