Archive: Error on using WriteRegDWORD


Error on using WriteRegDWORD
Hi!
i want to write some entry on registry during NSI installation, like this one.
WriteRegDWORD HKCU "Software\Microsoft\Internet Explorer\Desktop\Components\0" "CurrentState" "40000004"

When i compile my project, i've this error:
WriteRegDWORD: HKCU\Software\Microsoft\Internet Explorer\Desktop\Components\0\CurrentState=40000004
Error: Can't add entry, no section or function is open!

Someone could help me ?

Thinks


Re: Error on using WriteRegDWORD

Originally posted by cooladn
Hi!
i want to write some entry on registry during NSI installation, like this one.
WriteRegDWORD HKCU "Software\Microsoft\Internet Explorer\Desktop\Components\0" "CurrentState" "40000004"

When i compile my project, i've this error:
WriteRegDWORD: HKCU\Software\Microsoft\Internet Explorer\Desktop\Components\0\CurrentState=40000004
Error: Can't add entry, no section or function is open!

Someone could help me ?

Thinks
Just like it says, check where you are placing the command. It needs to be in a "Section" or in a function, and the function needs to be closed. I.E.

Section ""

WriteRegDWORD HKCU "Software\Microsoft\Internet Explorer\Desktop\Components\0" "CurrentState" "40000004"

EndSection

Or

Function Foo

WriteRegDWORD HKCU "Software\Microsoft\Internet Explorer\Desktop\Components\0" "CurrentState" "40000004"

FunctionEnd

Hope that helps.

Thinks for your help