8

こんにちは、テキストファイル内のテキストを Inno Setup (Delphi ベース) に置き換えることに問題があります。

私のコード:

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;

代わりに を使用する必要があることがわかりましたがStringChange()、自分のコードでそれを使用する方法がわかりません。Delphi や Inno Setup についてはよくわかりません。あなたが私を助けてくれることを願っています。

4

1 に答える 1