Old 10th January 2012, 15:49   #1
Zenopus
Junior Member
 
Join Date: Jan 2012
Posts: 2
Question 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?
Zenopus is offline   Reply With Quote
Old 10th January 2012, 15:52   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,361
Please post/attach some code.

Stu
Afrow UK is offline   Reply With Quote
Old 10th January 2012, 18:10   #3
Zenopus
Junior Member
 
Join Date: Jan 2012
Posts: 2
Thumbs up 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;
code:

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
code:

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

Zenopus is offline   Reply With Quote
Old 10th January 2012, 19:16   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,361
Why are you using the ShellLink plug-in at all? You don't need to.
code:
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
Afrow UK is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

Tags
setshortcutargs, shelllink, smprograms

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump