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?
WriteIniStr without section
8 posts
Please note that without the section headings you will not be able to easily read the values again if you wish to do so.Push $R0
FileOpen $R0 "file.txt" w
FileWrite $R0 "key1=value1$\r$\nkey2=value2$\r$\nkey3=value3$\r$\n"
FileClose $R0
Pop $R0
-Stu
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.
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
-Stu
Thank you very much
I have realised that I have already written a function to do this!
You want to do something like this:
-Stu
You want to do something like this:
Be warned that it will replace all instances in the file of "key=" with the "key=newvalue".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
-Stu
Also if you need to read a value, you can use this function:
-Stu
-Stu
Thank you very much