Ron.Stordahl
18th February 2011 18:06 UTC
CreateShortCut changing a literal / to \
CreateShortCut "$SMPROGRAMS\BPQ32\Configure.lnk" "Explorer.exe e/,$INSTDIR" "" \
"${NSISDIR}\BPQ32\Icons\bpqicon.ico"
is generating:
C:\Explorer..exe e\,C:\Program Files\BPQ32
rather than the needed format:
C:\Explorer..exe e/,C:\Program Files\BPQ32
i.e., the e\ is converted to e/ which Explorer does not understand as a start parameter.
Help!
Afrow UK
18th February 2011 18:11 UTC
What if you put it in a var?
Stu
Ron.Stordahl
18th February 2011 18:42 UTC
Stu I tried:
StrCopy $ForwardSlash "/"
And substituted $ForwardSlash for the / in CreateShortCut and the generated shortcut has had the forwardslash translated to a backslash.
So good idea..but it didn't work.
There must be a way to escape the /, which clearly has a special meaning, into a literal /.
I tried $\/ which I thought might do the trick, but no.
Afrow UK
18th February 2011 19:37 UTC
I just noticed what you are doing wrong. Arguments go in a separate parameter for CreateShortCut.
Stu
Ron.Stordahl
19th February 2011 02:38 UTC
Your right....the parameters for the target file,Explorer.exe, should have been the third positional parameter.
Here is what works:
CreateShortCut "$SMPROGRAMS\BPQ32\BPQ32 Configure.lnk" \
Explorer.exe "/e,/select,$INSTDIR\BPQ32.cfg" "${NSISDIR}\BPQ32\Icons\bpqicon.ico"
This correctly generates a shortcut with the target:
C:\WINDOWS\Explorer.exe /e,/select,C:\Program Files\BPQ32\BPQ32.cfg