Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wip/issue 21 multiple config files shortcuts #569

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
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