Archive: Read from file (Please Help!!!!!!)


Read from file (Please Help!!!!!!)
I am new on scripting, My thougth is this. I have a file maybe an .ini-file where i have an serialnumber and something else maybe. When the installer starts it's read the file for the serialnumber and after that it´s write the serialnumber down in the registry. Should i use "ReadINIStr" or another function? And could anyone give a code example so I see how the code is writen?

Sorry for my bad English


WriteRegStr "HKLM" "Software\%Your Software%" "Serial" "$0"

Lets say you INI file is set up like this.

[User_Info]
Name=John Doe
Company=Nullsoft
Serial=1234-1234-1234-1234

Then your code would look like this:

ReadINIStr $0 "YourFile.ini" "User_Info" "Serial"
WriteRegStr "HKLM" "Software\%Your Software%" "Serial" "$0"

Then if you want to read more lines in the INI, you would just change the 'ReadINIStr' code. You can look up ReadIUNIStr and WriteRegStr in the help manual.


Why post twice? Previous thread here.


Because i wasn't shure how if I should use an .ini file or a text-file.

Thanks for the help "Shea" :)