When I perform this call with an empty entry it removes the INI entry from the file.
my.ini:
[section]
my_item=""
another_item="abc"
WriteINIStr $INSTDIR\my.ini section my_item ""
Now my.ini looks like this:
[section]
another_item="abc"
This is a very unwanted behavior. Is this a bug?
Brent
WriteINIStr removes INI entries
4 posts
This might be a bug, but it is easily overcome: replace the empty string "" by " " (a space). Now the entry doesn't get deleted!
-Hendri.
-Hendri.
I believe this is happening because of the way the windows API call to add the ini entry works. I don't think this is a problem of NSIS's doing.
Originally posted by rainwater[edit]
I believe this is happening because of the way the windows API call to add the ini entry works. I don't think this is a problem of NSIS's doing.
That's right.
The Win32 API deletes the entry when a null string is given as value.