Archive: Remove Program Files ShortCut


Remove Program Files ShortCut
I'm having problems removing my Program Files shortcut. Here's the add, and then the remove (add in the install section and remove in the uninstall section):

<!--Add Routine-->
; put the app in the program files menu
CreateDirectory "$SMPROGRAMS\myApp" ;Put a folder in the program files menu
CreateShortCut "$SMPROGRAMS\myApp\myApp.lnk" "$INSTDIR\myApp.exe" "$INSTDIR\myApp.ICO"


<!--Remove Routine-->
;Delete from program files menu
Delete "$SMPROGRAMS\myApp\myApp.lnk" ;Remove shortcut
RMDIR "$SMPROGRAMS\myApp" ;Remove folder in the program files menu

<!--End Code Snippets-->

Also, my icon doesn't show up. Is there a icon size restriction (mine is 48x48px)?

Thanks Much!
Eric


During remove, are you using the right shell variable context?

Try using SetShellVarContext just before you delete. (I'm not sure if you need to be in the user's start menu or the 'all users' start menu. Whichever it is, you can set appropriately for what you need.)

As far as the icon, are you talking about the install icon, uninstall icon, or both? from the help files:

...Note that if you use an uninstaller, each icon in the icon file must have the same size and color depth as its matching icon in the uninstaller icon file...

Thanks Comperio, I'll give that a shot.

The icon I'm talking about is the icon for the shortcut. If I use the icon for the shortcut on the desktop, it works fine, but not in the program files group. It just ends up being an empty box looking thing. I'm guessing the big icon (48x48) is too big for the menu.


hmm... Could be right. That or you just need to refresh explorer.

See if you can assign the same icon manually in explorer. If that works, then it's probably the latter.


That seems to have been the trick Comperio, thanks!!! One last question.

In the doc for CreateShortcut, it just says "some command line parameters". I'm looking to set the "Comment" for the shortcut (this is displayed when the mouse is over the icon). Any help?

Thanks,
Eric


command line parameters are for command line switches on the EXE. (not what you're looking for.)

What you need is the 'description' parameter (last parameter).

example:
CreateShortCut "shortcut.lnk" "C:\windows\notepad" "" "" "" SW_SHOWNORMAL "" "Comment here"


Thanks Comperio, All Good!!!