Archive: write to registry


write to registry
I'm just getting to grips with NSIS and so far I think its excellent.

I'm just having a bit of a problem writing to the registry using WriteRegStr.

The .reg file that i'm trying to convert into NSIS format is the following...

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\Whois]
@="c:\\test\\whois.html"
"contexts"=hex:10

Any help would be very much appreciated.

Best Regards
Martin


WriteRegStr HKEY_CURRENT_USER "Software\Microsoft\Internet Explorer\MenuExt\Whois" "" "c:\test\whois.html"
WriteRegDWORD HKEY_CURRENT_USER "Software\Microsoft\Internet Explorer\MenuExt\Whois" "contexts" 0x10

0x10 is hex 10 which is 16 in decimal base.


Use this for the hexadecimal number:

WriteRegDWORD HKCU "Software\Microsoft\Internet Explorer\MenuExt\Whois" "contexts" 0x10

The key is automatically created if it doesn't exist.
For the string, you can use the following:
WriteRegStr HKCU "Software\Microsoft\Internet Explorer\MenuExt\Whois" "" "c:\\test\\whois.html"


[edit]kichik and I typed their messages together[/edit]

A Huge thank you for such a prompt response. Your suggestions worked perfectly.

Many Thanks
Martin