Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 5th June 2001, 05:18   #1
django
Junior Member
 
Join Date: Jun 2001
Posts: 2
Hi:

Have a look at this scripts which setup start menu links:
...
SetOutPath $SMPROGRAMS\MyApp
CreateShortCut "$SMPROGRAMS\MyApp\MyApp.lnk" "$INSTDIR\MyApp.exe"
...

After installation, MyApp.exe may not work from the Start menu, since the working directory is pointing to $SMPROGRAMS, that was the $OUTDIR, not the $INSTDIR.

IMHO this is a not healthy logic, because most app will not be happy to work in $SMPROGRAMS.

So it maybe helpful to set a $WORKDIR for CreateShortCut instruction to do it right.

P.S. Interestingly, this instruction do things right when creating desktop shortcuts, the working directory was set to $INSTDIR...
django is offline   Reply With Quote
Old 5th June 2001, 08:38   #2
yazno
Member
 
Join Date: Oct 2000
Posts: 92
Send a message via ICQ to yazno
hi

If you use SetOutPath in adiition with CreateShortCut then SetOutPath sets the workingdirectory, nothing else.

Simply set it to $INSTDIR and everything should work fine.

try it like this

code:

SetOutPath - ;($INSTDIR)
CreateShortCut "$SMPROGRAMS\MyApp\MyApp.lnk" "$INSTDIR\MyApp.exe"



cu yzo
yazno is offline   Reply With Quote
Old 6th June 2001, 06:48   #3
django
Junior Member
 
Join Date: Jun 2001
Posts: 2
thanks yazno,

but I'm afraid that the CreateShortCut behaves not as what you described, I tried your suggested code, but the installer just outputs alotof error msg like this:
--------------------------------------------------------------------------------
Error creating shortcut: C:\Windows\Start Menu\Programs\MyApp\MyApp.lnk
--------------------------------------------------------------------------------

I found if without issue this line first:
SetOutPath $SMPROGRAMS
all the following $SMPROGRAMS\*.lnk shortcuts always failed,
but with this line, MyApp.exe shortcut's working directory will also be the $SMPROGRAMS.
do we have a dilemma here?

Pardon me for mentioning this again, the following desktop shortcut script works:
--------------------------------------------------------------------------------
SetOutPath $INSTDIR
CreateShortCut "$DESKTOP\MyApp.lnk" "$INSTDIR\MyApp\MyApp.exe"
--------------------------------------------------------------------------------
the exe working directory was set to $INSTDIR accurately, but the same logic above won't apply to $SMPROGRAMS shortcut setting.

maybe it's the time to re-think why the CreateShortCut instruction behave this way...
django is offline   Reply With Quote
Old 6th June 2001, 07:33   #4
yazno
Member
 
Join Date: Oct 2000
Posts: 92
Send a message via ICQ to yazno
hi,

no need to re-think this.

you have to create the MyApp directory in the $SMPROGRAMS folder _before_ creating the Shortcut!

sorry, i thought you knew that.

so this should work:
code:

SetOutPath -
CreateDirectory $SMPROGRAMS\MyApp
CreateShortCut "$SMPROGRAMS\MyApp\MyApp.lnk" "$INSTDIR\MyApp.exe"



cu yzo
yazno is offline   Reply With Quote
Old 7th June 2001, 08:15   #5
petersa
Senior Member
 
petersa's Avatar
 
Join Date: Apr 2001
Location: Melbourne, Australia
Posts: 207
My point, exactly.

For some reason, on certain systems, the directory needs to be created. I think this is a bug, most definitely, since on some systems this isn't required.
petersa is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

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