Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 30th May 2001, 03:49   #1
petersa
Senior Member
 
petersa's Avatar
 
Join Date: Apr 2001
Location: Melbourne, Australia
Posts: 207
Hi,

Have a look at this code:

code:
CreateDirectory $SMPROGRAMS\Program
CreateShortcut $SMPROGRAMS\Program\Program.lnk $INSTDIR\PROGRAM.EXE
CreateShortcut "$SMPROGRAMS\Uninstall Program.lnk" $INSTDIR\REMOVE.EXE



Now, have a look at this code, which puts the icons in the folder containing the installer:

code:
SetOutPath $SMPROGRAMS\Program
CreateShortcut Program.lnk $INSTDIR\PROGRAM.EXE
CreateShortcut "Uninstall Program.lnk" $INSTDIR\REMOVE.EXE



Does anyone else think that this code should also work? It definitely seems more efficient and more logical, because it would then work more like the File command. You specify the OutPath, and then not have to specify an absolute path with CreateShortcut.
petersa is offline   Reply With Quote
Old 30th May 2001, 05:40   #2
yazno
Member
 
Join Date: Oct 2000
Posts: 92
Send a message via ICQ to yazno
hi,

yeah, you are right, it should, but it doesn't

that would be a lot better to understand (not only for newbies) and it would fit to the logic of the other commands like "File".

cu yzo

yazno is offline   Reply With Quote
Old 30th May 2001, 08:57   #3
saivert
Banned
 
saivert's Avatar
 
Join Date: Jan 2001
Location: Norway
Posts: 927
Not a bug only bad use of feature.

I think you guys have missed the point with SetOutPath.
SetOutPath when used together with CreateShortcut sets the Working dircetory for the shortcut since that parameter disappered some versions ago. But you ar absolutely right that It could be used with the filename for the shortcut, reimplementing the Working directory as a parameter again.
saivert is offline   Reply With Quote
Old 30th May 2001, 09:16   #4
yazno
Member
 
Join Date: Oct 2000
Posts: 92
Send a message via ICQ to yazno
hi,

yeah sure, createshortcut uses the outpath as working dir since version 1.0i, but that is IMHO the wrong logic.

it should point to the path where the Shortcut has to be created and the working dir should be set with a parameter.

well, i guess that is a question of taste.

cu yzo
yazno is offline   Reply With Quote
Old 30th May 2001, 10:07   #5
petersa
Senior Member
 
petersa's Avatar
 
Join Date: Apr 2001
Location: Melbourne, Australia
Posts: 207
I wasn't aware of SetOutPath setting the working directory for CreateShortcut.

But personally, I don't think I'll ever need the working directory to be anything other than $INSTDIR.

I think NSIS should automatically set the working directory to the folder of the file the shortcut refers to, unless otherwise advised.

Example:

CreateShortcut $INSTDIR\PROGRAM.EXE
Sets the working directory to $INSTDIR.

CreateShortcut C:\WINDOWS\NOTEPAD.EXE
Sets the working directory to C:\WINDOWS.
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