I can't figure out why the line below creates a second duplicate section frmR
in an .ini
file that already contains a section with that name.
SetIniString('frmR', 'update', 'true', 'C:\junk\test.ini');
Contents of test.ini
file after installer is run:
We thought this might be an encoding issue (we're using version 5.6.1 (u)). But the section names in a hex viewer are also identical:
Contents of test.ini
file in hex:
A before and after version of the test.ini
file is here: https://drive.google.com/open?id=1vamZxgTvYpAQcOwOnrTpGG63_Bg7i0Js
Below is the barebones .iss
file that demonstrates this problem. Put test.ini
(from the above Google Drive link) in a folder named C:\junk
before running.
[Code]
procedure DeinitializeSetup();
begin
SetIniString('frmR', 'update', 'true', 'C:\junk\test.ini');
end;
I discovered that this problem only occurs if the section is the first section in the file. In other words, the file below works fine (without any duplicate section being added):
[Test section]
Test=test
[frmR]
Top=28
Left=0
The above discovery doesn't resolve the problem, since I have no easy way of assuring that the section I'm writing to is not the first section in the file.