Archive: Write an ini file


Write an ini file
Hey guys .. how can I write an ini file ???

the ini file has this in line 6

C:Hard-drive

that's becuase I installed the program to C:

but how can I let the install make it D:Hard-drive if the $instdir is on D:


thanks ^_^ ....VegetaSan


If it's an INI file you can use WriteIniStr, otherwise use the file reading/writing commands.


thank you joost. but I still got a little prob.


WriteINIStr "$INSTDIR\test.ini" "MySection" "Value1" $8


I still dont get this line. what does the $8, Value1 and MySection stand for.

I found this in the manaul. and I still dont get it :S


ini_filename section_name entry_name value

Writes entry_name=value into [section_name] of ini_filename. The error flag is set if the string could not be written to the ini file.


could you say what the $8, Value1 and MySection stand for.

The code

StrCpy $8 "some value"
WriteINIStr "$INSTDIR\test.ini" "MySection" "Value1" $8

will add the following to test.ini:

[MySection]
Value1=some value