Archive: Regarding Registry


Regarding Registry
Hi All,

While working on installer for my application, I need to add lots of registry entries in my installer. So I need to add about 200 times WriteRegStr code in my script. Instead, I want to write one menifest file, which keeps all registry entries in the form :

HKCR "RootKey" "SubKey" "Value"

Then in the main script, I want to read all the lines from this menifest file and use WriteRegStr in a loop, till all entries in menifest file are over.

Is there any code already available for such requirement ? Please help.

Thanks and best regards,
Sunil.
hi_khatri12@yahoo.com


Easy and faster without parsing extended file, but if you want (required):


Name "Output"
OutFile "Output.exe"

!include "TextFunc.nsh"
!insertmacro LineFind
!insertmacro TrimNewLines

!include "WordFunc.nsh"
!insertmacro WordFind

Section
${LineFind} "C:\input.txt" "/NUL" "1:-1" "LineFindCallback"

IfErrors 0 +2
MessageBox MB_OK "Error"
SectionEnd

Function LineFindCallback
${TrimNewLines} "$R9" $R9
${WordFind} "$R9" " " "+1{" $0
${WordFind} "$R9" '"' "+2" $1
${WordFind} "$R9" '"' "+4" $2
${WordFind} "$R9" '"' "+6" $3

registry::Write "$0\$1" "$2" "$3" "REG_SZ" .R0

Push 0
FunctionEnd