Skip to content
⌘ NSIS Forum Archive

createShortCut does not work

19 posts

stp#

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
virtlink#
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 🤪.
kichik#
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" 
virtlink#
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 @.
stp#
I am using two seperate strings.
Everything is OK if I do NOT use the @-symbol.

With the @-Symbol it does not work !!
Peter
virtlink#
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.
kichik#
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...
stp#
How can I use the intFmt together whith CreateShortCut ???

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

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

First tell me what exactly doesn't work properly.
kichik#
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.
stp#
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
virtlink#
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.
kichik#
NSIS doesn't touch @'s. You can search the source code if you want. No @ anywhere but emails in the comments.
kichik#
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.
virtlink#
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).
stp#
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)