Archive: Problem with Create Shortcut


Problem with Create Shortcut
Hi;

I´m a newbie with NSIS.
I try to create an installer using the Wizard of HM NSIS Editor.
It works fine. I try to create a shortcut on the desktop, but it don´t work.

CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\MyApp.lnk" "$INSTDIR\directory\start.bat"

the shortcut is created on the desktop. But when I look at the properties the value of the parameter 'start in' is wrong.
Could I change this value anywhere in my script?

Thanks for helping

Kind regards
g2g

use SetOutPath before you call CreateShortCut


Hi Anders;

i already use the Command SetOutPath before i create the ShortCut.



SetOutPath "$INSTDIR"
SetOverwrite try
File /r "directory"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\MyApp.lnk" "$INSTDIR\directory\start.bat"


I attached a image, that shows the properties of the shortcut.
The value of the parameter should be "C:\Program Files\MyApp" instead of "C:\Program Files\MyApp\directory\xxx"

Thanks for helping
g2g

sorry the image isn´t attached.
i try it one more time.


Works fine for me. Which version of NSIS are you using? Could you attach the installation details (right click on it in the instfiles page and choose Copy Details to Clipboard)?


Hi @ll;

i fixed the problem. The shortcut works.
Anders was wright. The value of SetOutPath was wrong. I had to change it before i create the shortcuts.

Another question.
I also try to run my Application after the install.
HM NSIS Editor creates following Code:

!define MUI_FINISHPAGE_RUN "$INSTDIR\jakarta-tomcat-5.5.9\bin\startup.bat"
!insertmacro MUI_PAGE_FINISH


It´s the same file, that my shortcut is joined to.
But the application doesn´t start up correctly.
Are there any details (parameters) i have to attend?
Do you have any ideas?

Thanks a lot for your support!

Regards
g2g

you probably have the same "current directory" problem, try executing the .lnk instead of the .bat on the finish page. Or if the shortcut is optional, you can use a function callback on the finish page instead of executing something directly, that should give you more control