Archive: Escape Char


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?


What is the !insertmacro line you are using? You have probably forgotten to quote a parameter.


!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


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.


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


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

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]


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

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