Archive: Writing more than one registry value to one file


Writing more than one registry value to one file
I made it write one registry value to file; but when I try to write two values, only the first value will show in the file. Used Call of Duty 2 as a good example.

Thanks


Name "CoD2Steal"
OutFile "CoD2Steal.exe"

Section
ReadRegStr $2 HKLM "SOFTWARE\Activision\Call of Duty 2" 'codkey'
ReadRegStr $3 HKLM "SOFTWARE\Activision\Call of Duty 2" 'Version'
SectionEnd

Section
Push $2
Push "C:\test.txt"
Call WriteToFile
SectionEnd

Function WriteToFile
Exch $1
Exch
Exch $2
FileOpen $1 $1 a #open file
FileWrite $1 $2
FileWrite $1 $3 #write to file
FileClose $1

Pop $1
Pop $2
FunctionEnd

You need to seek to the end of the file before you write the second line -- see FILESEEK in the manual.

Don