Skip to content
⌘ NSIS Forum Archive

WriteINIStr with unpaired value

7 posts

dmmorris#

WriteINIStr with unpaired value

Does anyone know how to write a simple string to an ini file? I am trying to a value without the =xxxx. That may just point out that the ini file is being used improperly but in this case I don't have control over the format of the ini file. I am guessing that I could also use a file write, but in that case I would have to locate the proper section.

Thanks,

David Morris
Afrow UK#
Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.


This topic should help (read my post at the bottom)

Maybe you can use that instead.


-Stuart
kichik#
That's actually a bug. You are supposed to be able to write an empty string as a value. I will fix this ASAP.
dmmorris#
With your fix, I can write out a value as:
[somesection]
myvalue=
[nextsection]

but what I actaully need is to write out:
[somesection]
myvalue
[nextsection]...

It could be that the program I am working with uses ini files incorrectly, but I don't have any control over the program.

Thanks,

David Morris
kichik#
That's impossible with WriteINIStr, it's not how INI files are structured. If you want to do it this way you'll have to write manually with FileOpen, FileRead, FileWrite and FileClose.
dmmorris#
Thanks for your help, I was going down that path when I got your message and it looks like it will work.

David Morris