It is best to use the XML DOM to select and edit the required node as the proposed TLama .
Alternatively, you can install the template file with a known line in the place you want to replace. Then the file can be read as a string, modified and written back using something like:
[Code]
procedure WriteAppPath;
var
FileData: String;
begin
LoadStringFromFile(ExpandConstant('{app}\app.xml'), FileData);
StringChange(FileData, 'XXXXXMARKERXXXXX', ExpandConstant('{app}'));
SaveStringToFile(ExpandConstant('{app}\app.xml'), FileData, False);
end;
. , INI.