title: Replace a text in a file with Inno Setup
body: <p>Hi I have a problem with replacing a text in a textfile with Inno Setup (Delphi based).</p>
  
  <p>My Code:</p>
  
  <pre class="lang-pascal prettyprint-override"><code>procedure  FileReplaceString(const  FileName,  searchstring,  replacestring:  string);
  var
      fs:  TFileStream;
      S:  string;
  begin
      fs  :=  TFileStream.Create(FileName,  fmOpenread  or  fmShareDenyNone);
      try
          SetLength(S,  fs.Size);
          fs.ReadBuffer(S[1],  fs.Size);
      finally
          fs.Free;
      end;
      { the compiler stops here with: unknown identifier 'StringReplace' }
      S := StringReplace(S,  SearchString,  replaceString,  [rfReplaceAll,  rfIgnoreCase]); 
      fs  :=  TFileStream.Create(FileName,  fmCreate);
      try
          fs.WriteBuffer(S[1],  Length(S));
      finally
          fs.Free;
      end;
  end;
  </code></pre>
  
  <p>I found out that I have to use <code>StringChange()</code>, instead but I don't know how to use it with my code. I don't know too much about Delphi or Inno Setup.
  I hope you can help me.</p>