summaryrefslogtreecommitdiffstats
path: root/Source/CPack/WiX/cmCPackWIXGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/CPack/WiX/cmCPackWIXGenerator.cxx')
-rw-r--r--Source/CPack/WiX/cmCPackWIXGenerator.cxx20
1 files changed, 15 insertions, 5 deletions
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
index 2bccf2e..39586de 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
@@ -437,8 +437,8 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles()
directoryDefinitions.AddAttribute("Name", "SourceDir");
size_t installRootSize =
- directoryDefinitions.BeginInstallationPrefixDirectory(
- GetProgramFilesFolderId(), installRoot);
+ directoryDefinitions.BeginInstallationPrefixDirectory(GetRootFolderId(),
+ installRoot);
std::string fileDefinitionsFilename = this->CPackTopLevel + "/files.wxs";
@@ -570,16 +570,26 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles()
return this->Patch->CheckForUnappliedFragments();
}
-std::string cmCPackWIXGenerator::GetProgramFilesFolderId() const
+std::string cmCPackWIXGenerator::GetRootFolderId() const
{
if (cmSystemTools::IsOn(GetOption("CPACK_WIX_SKIP_PROGRAM_FOLDER"))) {
return "";
}
+
+ std::string result = "ProgramFiles<64>Folder";
+
+ const char* rootFolderId = GetOption("CPACK_WIX_ROOT_FOLDER_ID");
+ if (rootFolderId) {
+ result = rootFolderId;
+ }
+
if (GetArchitecture() == "x86") {
- return "ProgramFilesFolder";
+ cmSystemTools::ReplaceString(result, "<64>", "");
} else {
- return "ProgramFiles64Folder";
+ cmSystemTools::ReplaceString(result, "<64>", "64");
}
+
+ return result;
}
bool cmCPackWIXGenerator::GenerateMainSourceFileFromTemplate()