Registry plugin with variables

Got a good idea? You can suggest new features here.
Post Reply
Owel
Posts: 41
Joined: Thu May 31, 2012 5:51 am

Registry plugin with variables

Post by Owel » Tue Feb 19, 2013 11:58 am

Hi!

I had the problem, that the registry plugin is not able to evaluate variables. So you can just change registry values to hard coded values. But in my environment I need some kind of dynamical way.
To go into detail: an eg.result has to be written to an registry key.
I've done some research, and now I have a solution, that the registry plugin is able to handle variables (eg.ParseString did it)

I've added following code (~line 739) in the Registry.py

Code: Select all

newValue = eg.ParseString(newValue)
So this section will look like this:

Code: Select all

        #set or delete key
        try:
            if (action == 0) or (action == 1):
                newValue = eg.ParseString(newValue)
                if keyType == _winreg.REG_DWORD:
                   newValue = int(newValue)
                #change key
                _winreg.SetValueEx(regHandle, valueName, 0, keyType, newValue)
This will make the plugin able to handle {eg.result} or any other variable the correct way.

I hope this is helpfull to others, and might be merged.

Regards
Owel

User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Registry plugin with variables

Post by Pako » Wed Feb 20, 2013 7:17 am

Yes, I think it is the lack of this plugin.
And it is quite easy to fix it.
So be patient, I'll do it in the foreseeable future.
But if someone will faster than me, so of course it can do!
EventGhost is not my program. I have no monopoly on it.

Pako

Post Reply