Search code examples
inno-setuppascalscript

Set values to ini File (Inno Setup)


I need to set values to an ini File, I try to search how to do it but I can't find an answer, the ini File is like:

[mysqld]

port=${one.port}

I wan to tho similar to:

[mysqld]

port=EditPort.text

Solution

  • Use SetIniString Function

    From Inno Setup Help,

    SetIniString writes a string to an INI file.

    You can use it like

    SetIniString('mysqld', 'port', EditPort.Text, ExpandConstant('<< PATH TO YOUR .INI FILE >>'))