Old 5th November 2012, 05:30   #1
vuser
Junior Member
 
Join Date: Oct 2012
Posts: 6
Using Plugins

I am trying to use the Registry Plugin

The helps says to use the syntax ${registry::Read}.
However, this gives me the error.
Invalid command: ${registry::Read}

I looked up the plugins found which are printed at the start of the compiler output & saw that all the functions look like this

- Registry::_Read
- Registry::_ReadExtra

etc.


So I next tried (note leading underscores)

Registry::_Read "HKEY_LOCAL_MACHINE\Software\Microsoft\NET Framework Setup\NDP\v3.0\" "Install" $R0 $R1
MessageBox MB_OK $R0
MessageBox MB_OK $R1

The command compiled, but both the messageboxes gave blank output.

The key does exist & has a value in my registry.

What am I doing wrong here?


UPDATE: I got the issue. I hadn't included registry.nsh!!!!
First time I am using a plugin - didn't realize I had to do this.
vuser is offline   Reply With Quote
Old 11th November 2012, 02:25   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Not all plug-ins require you to include a header. But some of them do have some of the functionality implemented in a header file. Sometimes it's just a wrapper around the raw plug-in calls to make your life easier and sometimes it's a bit more.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 12th December 2012, 10:48   #3
jiake
Senior Member
 
jiake's Avatar
 
Join Date: Oct 2007
Location: Shanghai, China
Posts: 207
code:
!define registry::Read `!insertmacro registry::Read`
!macro registry::Read _PATH _VALUE _STRING _TYPE
registry::_Read /NOUNLOAD `${_PATH}` `${_VALUE}`
Pop ${_STRING}
Pop ${_TYPE}
!macroend


code:
${registry::Read} "HKEY_LOCAL_MACHINE\Software\Microsoft\NET Framework Setup\NDP\v3.0\" "Install" $R0 $R1

Expanding the macro it exactly equals to:
code:
Registry::_Read "HKEY_LOCAL_MACHINE\Software\Microsoft\NET Framework Setup\NDP\v3.0\" "Install"
Pop $R0
Pop $R1


Contact me: 137729898@qq.com
jiake is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump