Archive: createShortCut does not work


createShortCut does not work
I have the following Problem in NSIS 2.0b:

I must create a shortcut with command-line

"c:\program files\sybase\sql 8.01\dbsrv8.exe" @d:\config.ini

The problem is the commandline-parameter: @d:\config.ini

It works without the @-symbol.
But with @-symbol the createShortCut does not work properly.

Is it possible to change the code for
the new release of NSIS 2.0 ?

Thanks in advance
Peter.Stojkovic@sms-eumuco.de


I don't know if it makes any difference, and I can't test it right now, but you could try quoting it (e.g. "@d:\config.ini"). (maybe you have already done that or you know that it doesn't work eighter way, then just ignore my comment;))

If the parameter of the CreateShortcut is processed by NSIS, you could try to use the ASCII-code for the caracter '@'. Decimal: 64, Hexadecimal: 40, Octal: 100. I tought I saw a variable which inserts an ASCII caracter in a string, but I can't find it anymore in the documentation :weird:.


From 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"


Just a question related to my earlier post: Is there a variable that will be converted from an ASCII code to a caracter? Like $\c40 makes the @.


IntFmt "%c" should do it.


I am using two seperate strings.
Everything is OK if I do NOT use the @-symbol.

With the @-Symbol it does not work !!
Peter


So, my idea doesn't work. I'd like something like:
"This string is located $\c064 my own server, Dani$\c137l's server." which will show like:
"This string is located @ my own server, Daniƫl's server."
Like in PHP.


OK... So what exactly doesn't work? Does the shortcut fail to create? Do you see any error in the log? Is it makensis that fails? Does it crash the installer? I will need some more details...


How can I use the intFmt together whith CreateShortCut ???

<<< intFmt "%c" should do it >>>>

Peter


If I use the @-symbol,
than NO Command-Paramter is created for the shortcut


I really doubt that's the problem... NSIS doesn't touch @ ever.

First tell me what exactly doesn't work properly.


Doesn't work here either. Only when @ is the first charcter though... If you put a space before it (" @...") it works. You can use that for now until I find what's wrong.


I try to use the following:

CreateShortCut "$SMPROGRAMS\PICOS3\DBSRV8.exe.lnk" "$PROGRAMFILES\Sybase\SQL Anywhere 8\win32\dbsrv8.exe" "@d:\database\ALUP\midissrv.ini"


But the commandline ("@d:\database\ALUP\midissrv.ini"
)is ignored with version 2.0b.

You can try it .
Than you have the same problem.
The shortcut is NOT created WITH the commandline-Parameter

Peter


You see, another bug. The 2nd in one week! KiCHiK, NSIS propably touches the first caracter of a string and does something with it, I don't know.


That helps.

Thank you very much for your help !!!

Peter


NSIS doesn't touch @'s. You can search the source code if you want. No @ anywhere but emails in the comments.


OK, some more news. This is definitely a Windows bug. I have tried creating a shortcut with an argument list that starts with the charcter @ and it just removed them all. I also tried editing a shortcut and adding it, same result. Maybe MSDN has something to say about it... I'll let you know when I have more news about it.


Why, stp, do you need an @ in the parameters. If it's a Windows bug, no program will ever use it, I think. (I don't know anything about SQL databases).


From STP

My program needs a @ in the command-line.
So some people need it.

But the workaround ( a space before @ ) helps

Thanks again
Peter

(STP)