Skip to content
⌘ NSIS Forum Archive

FileWrite a '$' not parsed as variable

3 posts

Mosestycoon#

FileWrite a '$' not parsed as variable

My Dears -

I need to write the following line to a file using the search and replace function:
$file_path = "file://c:/path/to/xsltest/"; 
At the moment I parse the file where I have written "@@FILE_PATH@@" and substitute this string. The line looks like that:
   StrCmp $2 "@@FILE_PATH@@$\r$\n" 0 +3
      FileWrite $1 "$\$file_path = $\"file://$INSTDIR/Apache2/htdocs/xsltest/$\";$\r$\n"
      Goto loop 
But this gives back an error, because of the $file_path string.How can I exclude the $from been read as variable rather than as plain text?

Thx Chris
Sunjammer#
Quick hack: (depends how NSIS handles $\x where x is any character.. hopefully unrecognised values of x are just passed thru unmodified)
FileWrite $1 "$\$$\file_path ....