Skip to content

Commit

Permalink
Merge pull request #569 from ezzarghili/wip/issue_21_multiple_config_…
Browse files Browse the repository at this point in the history
…files_shortcuts

Wip/issue 21 multiple config files shortcuts
  • Loading branch information
muuki88 committed May 1, 2015
2 parents bf58c76 + 00fd9e2 commit d091090
Showing 1 changed file with 4 additions and 3 deletions.
Expand Up @@ -130,16 +130,17 @@ object WixHelper {
// Also, we need some mechanism to ensure the start menu folder is removed in the event
// that we remove all menu items.
case AddShortCuts(targets, workingDir) =>
val id = cleanStringForId("shortcut_" + makeGUID).takeRight(67) // Room for "_SC"
val targetSize = targets.size.toString.size
val id = cleanStringForId("shortcut_" + makeGUID).takeRight(67 - targetSize) // Room for "_SC"+incremental number
val xml =
<DirectoryRef Id="ApplicationProgramsFolder">
<Component Id={ id } Guid={ makeGUID }>
{
for (target <- targets) yield {
for ((target, i) <- targets.zipWithIndex) yield {
val name = simpleName(target)
val desc = "Edit configuration file: " + name
val cleanName = name.replaceAll("[\\.-\\\\//]+", "_")
<Shortcut Id={ id + "_SC" } Name={ cleanName } Description={ desc } Target={ "[INSTALLDIR]\\" + target.replaceAll("\\/", "\\\\") } WorkingDirectory="INSTALLDIR"/>
<Shortcut Id={ id + "_SC" + (s"%0${targetSize}d").format(i+1) } Name={ cleanName } Description={ desc } Target={ "[INSTALLDIR]\\" + target.replaceAll("\\/", "\\\\") } WorkingDirectory="INSTALLDIR"/>
}
}
<RemoveFolder Id="ApplicationProgramsFolderRemove" Directory="ApplicationProgramsFolder" On="uninstall"/>
Expand Down

0 comments on commit d091090

Please sign in to comment.