Squirrel.Windows icon indicating copy to clipboard operation
Squirrel.Windows copied to clipboard

Rename a shortcut

Open ChaseFlorell opened this issue 11 years ago • 10 comments

I'm looking at the CreateShortcutsForExecutable and it doesn't have an option to name the shortcut. I notice that the Shortcut name is the same as the exe name, but I'm hoping to be able to change it per environment.

MyApp.exe

  • (dev shortcut) MyApp - Dev
  • (qual shortcut) MyApp - Qual
  • (prod shortcut) MyApp

Is there an easy way to do this with the stuff built into Squirrel now? Since I'm super lazy, what's the preferred approach to achieving this?

ChaseFlorell avatar Jul 28 '15 19:07 ChaseFlorell

Same problem here, what about a new parameter in UpdateManager:CreateShortcutsForExecutable()?

agostinocinelli avatar Aug 06 '15 07:08 agostinocinelli

I think you probably want to do this by-hand yourself, it should be pretty easy to call CreateShortcutsForExecutable then rename it

anaisbetts avatar Aug 25 '15 03:08 anaisbetts

@paulcbetts does Squirrel have hooks into the shortcut locations, or do I have to try and figure those out manually?

ChaseFlorell avatar Aug 25 '15 03:08 ChaseFlorell

@ChaseFlorell Gotta figure them out yourself though if you look at the Squirrel source it's not so bad

Update: actually it might be That Bad, maybe we should have an API for this

anaisbetts avatar Aug 25 '15 03:08 anaisbetts

Yeah, I was thinking it would be nice to have an overload on CreateShortcutsForExecutable

ChaseFlorell avatar Aug 25 '15 03:08 ChaseFlorell

@paulcbetts would you be willing to re-open this and give a little guidance on how you envision it being implemented? I'd be interested on working on it and submitting a PR. This is definitely a need in our Continuous Delivery pipeline.

ChaseFlorell avatar Aug 26 '15 14:08 ChaseFlorell

@ChaseFlorell I would instead have a new method GetShortcutsForExecutable that has an identical signature but instead of doing something, returns the ShellLink object that it would create, which means you can edit it and commit it yourself

anaisbetts avatar Aug 26 '15 18:08 anaisbetts

Any updates on this? I could use it as well.

StillLearnin avatar Jan 28 '16 16:01 StillLearnin

Ah sorry, this has been shipped for awhile now, check out https://github.com/Squirrel/Squirrel.Windows/blob/aea7552c392e6fa8f49fa2a0733060e6c8342bc0/src/Squirrel/UpdateManager.ApplyReleases.cs#L153

anaisbetts avatar Jan 28 '16 19:01 anaisbetts

Why not use the title as specified in the NuGet package to name the shortcut? EDIT: What I was looking is explained there. Squirrel rocks!

Slion avatar Apr 29 '17 18:04 Slion