summaryrefslogtreecommitdiffstats
path: root/Source/CPack/WiX/cmWIXDirectoriesSourceWriter.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/CPack/WiX/cmWIXDirectoriesSourceWriter.cxx')
-rw-r--r--Source/CPack/WiX/cmWIXDirectoriesSourceWriter.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/Source/CPack/WiX/cmWIXDirectoriesSourceWriter.cxx b/Source/CPack/WiX/cmWIXDirectoriesSourceWriter.cxx
index de64059..97e3a51 100644
--- a/Source/CPack/WiX/cmWIXDirectoriesSourceWriter.cxx
+++ b/Source/CPack/WiX/cmWIXDirectoriesSourceWriter.cxx
@@ -52,8 +52,12 @@ size_t cmWIXDirectoriesSourceWriter::BeginInstallationPrefixDirectory(
std::string const& programFilesFolderId,
std::string const& installRootString)
{
- BeginElement("Directory");
- AddAttribute("Id", programFilesFolderId);
+ size_t offset = 1;
+ if (!programFilesFolderId.empty()) {
+ BeginElement("Directory");
+ AddAttribute("Id", programFilesFolderId);
+ offset = 0;
+ }
std::vector<std::string> installRoot;
@@ -77,7 +81,7 @@ size_t cmWIXDirectoriesSourceWriter::BeginInstallationPrefixDirectory(
AddAttribute("Name", installRoot[i]);
}
- return installRoot.size();
+ return installRoot.size() - offset;
}
void cmWIXDirectoriesSourceWriter::EndInstallationPrefixDirectory(size_t size)