Archive: Problem with CreateShortCut


Problem with CreateShortCut
Hi!

I have a problem in the CreateShortCut function.
I write the following line:

CreateShortCut "$SMSTARTUP\Tomcat.lnk" "$WINDIR\command.com /e:4096 /c $PROGRAMFILES\Apache Group\Tomcat 4.1\bin\startup.bat" "" "" "0" "SW_SHOWMINIMIZED" "" ""

And after the run of install I get this command line in the created shortcut:

"C:\WINDOWS\command.com \e:4096 \c C:\Program Files\Apache Grou"

Where is the end of line?

Thanks.

Sanyi


Please read the FAQ:

I am having problems with CreateShortCut
Make sure you have separated the parameters from the target file.
For example, if you want to create a shortcut to notepad with $INSTDIR\Readme.txt as a parameter don't use:
CreateShortcut"myshortcut.lnk""notepad.exe$INSTDIR\\Readme.txt"

Use two separate strings:
CreateShortcut"myshortcut.lnk""notepad.exe""$INSTDIR\\Readme.txt"

BTW, it's better to read %COMSPEC% than to guess that command.com/cmd.exe is in $WINDIR.

Hi, this is not enough good for me.
I separate the CreateShortCut function:

ReadEnvStr $2 "COMSPEC"

CreateShortCut "$SMSTARTUP\Tomcat.lnk" "$2" "/e:4096 /c $PROGRAMFILES\Apache Group\Tomcat 4.1\bin\startup.bat" "" "0" "SW_SHOWMINIMIZED" "" ""

And after the run of install I get this command line in the created shortcut:

C:\WINDOWS\command.com \e:4096 \c C:\Program Files\Apache Group\Tomcat 4.1\bin\startup.bat

and this is not works: missing the quotation marks.

Thanx


Please take a look here:
http://nsis.sourceforge.net/Docs/Chapter3.html#3.1

Good luck,
-Hendri.