PDA

View Full Version : RegSetValue plugin...



JSMain
August 22nd, 2003, 09:09 AM
Mike,
I would like to make a recommendation for your plugin.

I have successfully set a reg value, but now need a way to retrieve it.
Could you add this capability? Perhaps get the value, and assign it to a register in girder for manipulation?

Mark F
August 22nd, 2003, 12:35 PM
I've got a LUA interface to the registry ~90% (open, create, close, read, write) added to the WinLUAEx plugin. I'll need to test a bit but expect it tomorrow.

JSMain
August 22nd, 2003, 12:44 PM
Sweet Mark!
Can't wait!

Promixis
August 22nd, 2003, 01:40 PM
Mark,

Another way, although probably not as slick as your plugin, is to use LuaCOM and the windows scripting host interface. I am currently using this as a way to read/write the registry directly from LUA.

Mike

Mark F
August 22nd, 2003, 03:27 PM
Mike,

Yeah, this can probably be done a bunch of ways. :)

A preview from the upcoming WinLUAEx readme:

--> snip <--

REGISTRY Extension Function:

WARNING: Editing the registry through this interface can have EXTREMELY harmful results. Please be careful.

REGISTRYOBJ = REGISTRY_CreateObject()
Creates a new registry object and returns it.

The REGISTRYOBJ object has 5 methods: CreateKey, OpenKey, Read, Write, CloseKey

REGISTRYOBJ.CreateKey(string ROOTNAME, string KEYNAME)
Attempts to create the key, KEYNAME, in the ROOTNAME registry branch.

REGISTRYOBJ.OpenKey(string ROOTNAME, string KEYNAME)
Attempts to open the key, KEYNAME, in the ROOTNAME registry branch.

VALUE = REGISTRYOBJ.Read(string VALUENAME)
Attempts to read from the VALUENAME and place the results in VALUE. If VALUENAME does not exist, returns nil.

REGISTRYOBJ.Write(string VALUENAME, string VALUE) or
REGISTRYOBJ.Write(string VALUENAME, int VALUE)
Attempts to write VALUE to the VALUENAME.

REGISTRYOBJ.CloseKey()
Attempts to close the registry key and free resources.

NOTE: ROOTNAME must be one of the following strings - HKLM, HKCU, HKEY_LOCAL_MACHINE, HKEY_CURRENT_USER

NOTE: Remember that LUA treats \ as a special character. Use \\ to denote items in a KEYNAME path.

EXAMPLE:
ro = REGISTRY_CreateObject()
ro.OpenKey("HKLM","HARDWARE\\DEVICEMAP\\SERIALCOMM")
print(ro.Read("Serial0"))
ro.CloseKey()

--> snip <--

Is this OK?

JSMain
August 23rd, 2003, 11:58 AM
Works for me!
:D

Mark F
August 23rd, 2003, 03:29 PM
Changing the registry (incorrectly) can cause some instability in your machine. :D I'm reloading my deveopment machine. I have a bug to find.

Mark F
August 25th, 2003, 01:49 PM
I hope to put the finishing touches on the registry support tonight. (I found the nasty bug last night) Sorry for the delay.

The interface has morphed a bit to allow more flexibility.

The readme tries to explain it and I have created some samples.

Mark F
August 25th, 2003, 01:57 PM
Nothing to see here.

JSMain
August 25th, 2003, 02:10 PM
Nothing to see here?
SHould I not be excited?

I'm awaiting tonight!

Mark F
August 25th, 2003, 07:23 PM
I double posted and was trying to be funny. :(

I have just uploaded WinLUAEx v1.0.7 which includes the new registry functions.

Please take a look at the readme.html and the RegistrySample.LUA files and let me know if they need more information.

I also added a TimeSample.LUA file.

EDIT: Download here (http://prdownloads.sourceforge.net/girderplugins/WinLUAEx.1.0.7.zip?download)

Thanks and enjoy. :)

JSMain
August 25th, 2003, 07:38 PM
Couldn't be sure Mark, but thanks!
Will look now, and start playing!
Thanks!