bigfooot
18th June 2003 20:02 UTC
Escape Char
im trying to replace :\ with :\\
with StrReplace
and i keep getting
!insertmacro: StrReplace
!insertmacro: macro "StrReplace" requires 3 parameter(s), passed 7!
Error in script "Z:\webserv\extra\dev\nsis\WebServ.nsi" on line 1178 -- aborting creation process
>Exit code: 1
what Escape Char should i use to get this to work?
kichik
18th June 2003 20:13 UTC
What is the !insertmacro line you are using? You have probably forgotten to quote a parameter.
bigfooot
18th June 2003 20:22 UTC
!macro StrReplace SOURCE_FILE SEARCH_TEXT REPLACEMENT
Push "${SOURCE_FILE}"
Push "${SEARCH_TEXT}"
Push "${REPLACEMENT}"
Call RIF
!macroend
works fine on all the others, just not this one
kichik
18th June 2003 20:25 UTC
The insertmacro line, not the macro line.
If it tells you there are too many parameters it's probably a missing quote. For example: "C:\Program Files\My Program" would
qualify as 3 parameters if not quoted.
bigfooot
18th June 2003 20:34 UTC
sorry about that
!insertmacro StrReplace $INSTDIR\php\pear\PEAR_ENV.reg :\ :\\
ive also tried using
!insertmacro StrReplace $INSTDIR\php\pear\PEAR_ENV.reg ":\" ":\\"
didnt work
bigfooot
18th June 2003 20:40 UTC
Originally posted by kichik
The insertmacro line, not the macro line.
If it tells you there are too many parameters it's probably a missing quote. For example: "C:\Program Files\My Program" would
qualify as 3 parameters if not quoted.
this makes a lot of sense
i tried
!insertmacro StrReplace $INSTDIR\php\pear\PEAR_ENV.reg :\ ":\\"
and it worked, thanks a lot
kichik
18th June 2003 20:41 UTC
A back slash at the end of the line means the next line is an extension of the current line. Once you quote it, it should work. I have copied the second line from your message and it worked. Are you sure the second one doesn't work? There is no reason it'll treat the next line as an extension if the last char is a quote.
[edit]ok, nm :)[/edit]
bigfooot
18th June 2003 21:00 UTC
Originally posted by kichik
A back slash at the end of the line means the next line is an extension of the current line. Once you quote it, it should work. I have copied the second line from your message and it worked. Are you sure the second one doesn't work? There is no reason it'll treat the next line as an extension if the last char is a quote.
[edit]ok, nm :)[/edit]
i hear yea, it should have worked, i have no idea why it didnt
but if a take the quites of of the find variable and leave them on the replace variable, it works
bigfooot
19th June 2003 20:15 UTC
Originally posted by kichik
A back slash at the end of the line means the next line is an extension of the current line. Once you quote it, it should work. I have copied the second line from your message and it worked. Are you sure the second one doesn't work? There is no reason it'll treat the next line as an extension if the last char is a quote.
[edit]ok, nm :)[/edit]
i tried the second one again today and it worked
i must have had a type-o somewhere and couldnt see it yesterday