Archive: Shortcut with arguments on windows 7


Shortcut with arguments on windows 7
I am having some issues
creating start menu shortcuts with arguments
on vista and windows 7.

The installer
installs all files correctly on w2k, xp, vista, windows 7
desktop shortcuts including arguments are correct on w2k, xp, vista, windows 7
start menu shortcuts including arguments are correct on w2k, xp
but on vista and windows 7 start menu shortcut do not have arguments set.

I upgraded to NSIS 2.46 and upgraded ShellLink to v1.2
but this did not make any difference.

As desktop shortcut arguments are in place
and start menu shortcut arguments are in place on w2k and xp
presumably the syntax is ok.

Any ideas?
Is there a need to do something subtly different to make start menu shortcuts
with arguments install right on vista and windows 7?


Please post/attach some code.

Stu


Diagnosed
While putting together an SSCCE based on a random sample I found http://nsis.sourceforge.net/A_simple...nd_uninstaller I found that

the issue surfaces in this scenario;


CreateShortCut link.lnk target.file
ShellLink::SetShortCutIconLocation link.lnk "$INSTDIR/logo.ico"
Pop $0
ShellLink::SetShortCutWorkingDirectory link.lnk "$INSTDIR"
Pop $0
ShellLink::SetShortCutShowMode link.lnk SW_SHOWMAXIMIZED
Pop $0
ShellLink::SetShortCutArgs link.lnk '-arg "This is applied on w2k and xp, but not vista or windows 7"'
Pop $0

and I solved it by doing

CreateShortCut link.lnk target.file '-arg "This is applied on w2k and xp, and on vista and windows 7"' "$INSTDIR/logo.ico"
ShellLink::SetShortCutWorkingDirectory link.lnk "$INSTDIR"
Pop $0
ShellLink::SetShortCutShowMode link.lnk SW_SHOWMAXIMIZED
Pop $0

Why are you using the ShellLink plug-in at all? You don't need to.

CreateShortCut link.lnk target.file '-arg "value"' "$INSTDIR/logo.ico" 0 SW_SHOWMAXIMIZED
The working (start in) directory is set to whatever $OUTDIR is when creating the shortcut (i.e. SetOutPath).

Stu