Inno Setup Compiler: How to edit INI file and replace a value with {app} constant

前端 未结 1 1235
温柔的废话
温柔的废话 2020-12-19 17:38

I have a INI file wich contains c:/wamp many times.

How can I replace this text with the {app} extended/chosen constant value?

I kn

相关标签:
1条回答
  • 2020-12-19 18:29

    This is risky solution as TLama says.

    You have to call this procedure at some point, e.g. on ssDone or as an AfterInstall

    [Code]
    procedure Update;
    var
    A: AnsiString;
    U: String;
    begin
        LoadStringFromFile(ExpandConstant('{app}\wampmanager.conf'), A);
        U := A;
        StringChange(U, 'c:/wamp', ExpandConstant('{app}'));
        A := U;
        SaveStringToFile(ExpandConstant('{app}\wampmanager.conf'), A, False);
    end;
    
    0 讨论(0)
提交回复
热议问题