Skip to content

Commit

Permalink
fix #21
Browse files Browse the repository at this point in the history
  • Loading branch information
ezzarghili committed May 1, 2015
1 parent bf58c76 commit a0e9a5f
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,18 @@ 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 id = cleanStringForId("shortcut_" + makeGUID).takeRight(70 - targets.size.toString().size - 3) // Room for "_SC"+incremental number
val xml =
<DirectoryRef Id="ApplicationProgramsFolder">
<Component Id={ id } Guid={ makeGUID }>
{
var i = 0
for (target <- targets) yield {
i = i + 1
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" + ("%0" + targets.size.toString().size + "d").format(i) } Name={ cleanName } Description={ desc } Target={ "[INSTALLDIR]\\" + target.replaceAll("\\/", "\\\\") } WorkingDirectory="INSTALLDIR"/>
}
}
<RemoveFolder Id="ApplicationProgramsFolderRemove" Directory="ApplicationProgramsFolder" On="uninstall"/>
Expand Down

0 comments on commit a0e9a5f

Please sign in to comment.