Commit ecdc77f1 authored by Nils Gladitz's avatar Nils Gladitz
Browse files

CPackWIX: Fix installed file property lookups when using components

The WIX generator incorrectly looked for installed file properties
by relative paths that included the component specific staging
directory prefix.

Remove that prefix in installed file property lookups when
generating packages with components.
parent fc6c5074
......@@ -911,8 +911,9 @@ void cmCPackWIXGenerator::AddDirectoryAndFileDefinitons(
relativeDirectoryPath = ".";
}
cmInstalledFile const* directoryInstalledFile =
this->GetInstalledFile(relativeDirectoryPath);
cmInstalledFile const* directoryInstalledFile = this->GetInstalledFile(
this->RelativePathWithoutComponentPrefix(relativeDirectoryPath)
);
bool emptyDirectory = dir.GetNumberOfFiles() == 2;
bool createDirectory = false;
......@@ -980,8 +981,9 @@ void cmCPackWIXGenerator::AddDirectoryAndFileDefinitons(
}
else
{
cmInstalledFile const* installedFile =
this->GetInstalledFile(relativePath);
cmInstalledFile const* installedFile = this->GetInstalledFile(
this->RelativePathWithoutComponentPrefix(relativePath)
);
if(installedFile)
{
......@@ -1230,3 +1232,16 @@ void cmCPackWIXGenerator::AddCustomFlags(
stream << " " << QuotePath(*i);
}
}
std::string cmCPackWIXGenerator::RelativePathWithoutComponentPrefix(
std::string const& path)
{
if(this->Components.empty())
{
return path;
}
std::string::size_type pos = path.find('/');
return path.substr(pos + 1);
}
......@@ -168,6 +168,9 @@ private:
void AddCustomFlags(
std::string const& variableName, std::ostream& stream);
std::string RelativePathWithoutComponentPrefix(
std::string const& path);
std::vector<std::string> WixSources;
id_map_t PathToIdMap;
ambiguity_map_t IdAmbiguityCounter;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment