Archive: SetOutPath stops CreateShortCut working


SetOutPath stops CreateShortCut working
Hi, I am a newbie but I promise I have searched the forums and read the docs :)

I built my setup script with the EclipseNSIS wizard and it created my shortcuts as follows:

SetOutPath $SMPROGRAMS\$StartMenuGroup
CreateShortCut $SMPROGRAMS\$StartMenuGroup\WEBSmith.lnk $INSTDIR\WEBSmith.exe
Which worked fine. But I need to set the working folder to the installation folder so after reading the forums and docs I modified the code:

SetOutPath $INSTDIR
CreateShortCut $SMPROGRAMS\$StartMenuGroup\WEBSmith.lnk $INSTDIR\WEBSmith.exe
This stops the shortcut from being created (even though there are no compiler errors or warnings). When the installer runs the details view says "Error creating shortcut: ..."

So I guess I missed or misunderstood something. If anyone can help I would very much appreciate it. I am using NSIS 2.11.

NSIS is so cool by the way - I'm so glad to get away from that awful InstallSh**ld <- censored to avoid swearing on my first post ;)

Try to create the directory in the startmenu first.


Which is easily done with this code:

SetOutPath $SMPROGRAMS\$StartMenuGroup
SetOutPath $INSTDIR
CreateShortCut $SMPROGRAMS\$StartMenuGroup\WEBSmith.lnk $INSTDIR\WEBSmith.exe

Thanks glory_man, you are a star!

That got it working, I appreciate your help.