WriteIniStr without section
Hi,
I need to write in an ini file which contains no sections, only key=value pairs.
I tried to specify "" aas section_name but it doesn't work.
How can I do that?
Archive: WriteIniStr without section
WriteIniStr without section
Hi,
I need to write in an ini file which contains no sections, only key=value pairs.
I tried to specify "" aas section_name but it doesn't work.
How can I do that?
Push $R0
FileOpen $R0 "file.txt" w
FileWrite $R0 "key1=value1$\r$\nkey2=value2$\r$\nkey3=value3$\r$\n"
FileClose $R0
Pop $R0
The problem is that I didn't create this ini file.
I need to change an existing value but I don't know the other keys.
Ah right. I'll write a function to do this then (won't take too long)!
-Stu
Thank you very much
I have realised that I have already written a function to do this!
http://nsis.sourceforge.net/archive/...b.php?page=626
You want to do something like this:
Push "$INSTDIR\file.ini" ; file to modify
Push "key=" ; string that a line must begin with
Push "key=newvalue" ; string to replace whole line with
Call ReplaceLineStr
Also if you need to read a value, you can use this function:
http://nsis.sourceforge.net/archive/...b.php?page=636
-Stu
Thank you very much