diff options
author | Richard Ulrich <richi@paraeasy.ch> | 2013-05-08 14:39:32 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-07-19 18:50:42 (GMT) |
commit | 6e51ea9870658ca39e9b3050caada121519da673 (patch) | |
tree | e710093479df5b768f6c2cad33763f4bd405f6b2 /Source/CPack/WiX/cmCPackWIXGenerator.cxx | |
parent | 6d77e1ab3f6cfe5e2019a418da7c18cc3515ab54 (diff) | |
download | CMake-6e51ea9870658ca39e9b3050caada121519da673.zip CMake-6e51ea9870658ca39e9b3050caada121519da673.tar.gz CMake-6e51ea9870658ca39e9b3050caada121519da673.tar.bz2 |
CPackWIX: Handle multiple shortcuts in the start menu
Diffstat (limited to 'Source/CPack/WiX/cmCPackWIXGenerator.cxx')
-rw-r--r-- | Source/CPack/WiX/cmCPackWIXGenerator.cxx | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx index f443905..cfb655b 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx +++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx @@ -380,7 +380,14 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles() directoryDefinitions.EndElement(); directoryDefinitions.EndElement(); - if (dirIdExecutables.size() > 0 && dirIdExecutables.size() % 3 == 0) { + if (dirIdExecutables.size() > 0 && dirIdExecutables.size() % 3 == 0) + { + fileDefinitions.BeginElement("DirectoryRef"); + fileDefinitions.AddAttribute("Id", "PROGRAM_MENU_FOLDER"); + fileDefinitions.BeginElement("Component"); + fileDefinitions.AddAttribute("Id", "SHORTCUT"); + fileDefinitions.AddAttribute("Guid", "*"); + std::vector<std::string>::iterator it; for ( it = dirIdExecutables.begin() ; it != dirIdExecutables.end(); @@ -390,13 +397,12 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles() std::string iconName = *it++; std::string directoryId = *it; - fileDefinitions.BeginElement("DirectoryRef"); - fileDefinitions.AddAttribute("Id", "PROGRAM_MENU_FOLDER"); - fileDefinitions.BeginElement("Component"); - fileDefinitions.AddAttribute("Id", "SHORTCUT"); - fileDefinitions.AddAttribute("Guid", "*"); fileDefinitions.BeginElement("Shortcut"); - fileDefinitions.AddAttribute("Id", "SHORTCUT_"); + std::string shortcutName = fileName; // the iconName is mor likely to contain blanks early on + std::string::size_type const dotPos = shortcutName.find('.'); + if(std::string::npos == dotPos) + { shortcutName = shortcutName.substr(0, dotPos); } + fileDefinitions.AddAttribute("Id", "SHORTCUT_" + shortcutName); fileDefinitions.AddAttribute("Name", iconName); std::string target = "[" + directoryId + "]" + fileName; fileDefinitions.AddAttribute("Target", target); |