Archive: 3 parameters in WriteRegStr


3 parameters in WriteRegStr
I am making a WriteRegStr HKCR. This reg information looks like this in a normal .reg file:

[HKEY_CLASSES_ROOT\AVIfile\shell\something\command]
@="\"C:\\Progra~1\\something\\something.exe\" \"%1\""

But when I do this in NSIS:

WriteRegStr HKCR "AVIfile\shell\something\command" "" "$INSTDIR\something\something.exe" "%1"

- then it won't accept the last "%1" and says:

WriteRegStr expects 4 parameters, got 5.

What can I do here? Its really not 5 parameters I want, but 4 with the "%1" within the $INSTDIR\something\something.exe line like this:

$INSTDIR\something\something.exe "%1"

I get confused just by writting it :confused:, but hope someone can figure it out ;)


You've got an extra "" in it which makes 5 parameters instead of 4.

-Stu


Yup, I know. I am therefore asking how to get the last "%1" within the "$INSTDIR\something\something.exe" line, like this:

$INSTDIR\something\something.exe "%1"

(I can't figure out how to get the letter " within such a line.)


You can't do that.
Isn't this what you want to do?

WriteRegStr HKCR "AVIfile\shell\something\command" "" "$INSTDIR\something\something.exe $\"%1$\""

$\" inserts " characters into a string.

-Stu


hehe, great. Thanks alot for your help. Just the right thing! ;-)