1. How to read from the Windows registry
- Posted by penpal0andrew Apr 15, 2009
- 1200 views
I would like to know if a particular software package is installed on my computer, and if so, what is the path to it. My idea is to search and read the windows registry. I would appreciate any ideas of how to do this in Euphoria. Thank you.
2. Re: How to read from the Windows registry
- Posted by jimcbrown (admin) Apr 15, 2009
- 1230 views
I would like to know if a particular software package is installed on my computer, and if so, what is the path to it. My idea is to search and read the windows registry. I would appreciate any ideas of how to do this in Euphoria. Thank you.
There is probably a library in the archives for this, though I don't know of one offhand. Possibly win32lib already has this builtin.
If you want to do it the hard way, use dll.e to wrap http://msdn.microsoft.com/en-us/library/ms724897(VS.85).aspx, http://msdn.microsoft.com/en-us/library/ms724845(VS.85).aspx, etc (see http://msdn.microsoft.com/en-us/library/ms725488(VS.85).aspx for more examples).
3. Re: How to read from the Windows registry
- Posted by jeremy (admin) Apr 15, 2009
- 1206 views
I would like to know if a particular software package is installed on my computer, and if so, what is the path to it. My idea is to search and read the windows registry. I would appreciate any ideas of how to do this in Euphoria. Thank you.
There is probably a library in the archives for this, though I don't know of one offhand. Possibly win32lib already has this builtin.
If you want to do it the hard way, use dll.e to wrap http://msdn.microsoft.com/en-us/library/ms724897(VS.85).aspx, http://msdn.microsoft.com/en-us/library/ms724845(VS.85).aspx, etc (see http://msdn.microsoft.com/en-us/library/ms725488(VS.85).aspx for more examples).
I was thinking that the standard library needs a configuration file (config.e) that would write cross-platform configuration files using native backends. For instance, registry on Windows and a simple $HOME/.dotfile on Unix.
Jeremy
4. Re: How to read from the Windows registry
- Posted by LarryMiller Apr 15, 2009
- 1195 views
The following file in the archive will allow access to the registry:
http://www.rapideuphoria.com/reg.zip
It does not require Win32lib.
The archive also shows an updated version by Shawn Pringle but the link was broken.
If you know the registry locations the application uses it should be easy to do what you want. There are conventions for this but no firm standards. Searching the registry is more complex.
5. Re: How to read from the Windows registry
- Posted by jimcbrown (admin) Apr 15, 2009
- 1172 views
I was thinking that the standard library needs a configuration file (config.e) that would write cross-platform configuration files using native backends. For instance, registry on Windows and a simple $HOME/.dotfile on Unix.
Jeremy
This is just my personal preference, but I'd support a library that allows for cross-platform configuration files (such that the files can be copied from OS to another and still work).
On the other hand, a library that supports using backends such as w32 registry, gconf-2, etc would be more useful, but would also be a larger undertaking.
6. Re: How to read from the Windows registry
- Posted by jeremy (admin) Apr 15, 2009
- 1197 views
I was thinking that the standard library needs a configuration file (config.e) that would write cross-platform configuration files using native backends. For instance, registry on Windows and a simple $HOME/.dotfile on Unix.
This is just my personal preference, but I'd support a library that allows for cross-platform configuration files (such that the files can be copied from OS to another and still work).
On the other hand, a library that supports using backends such as w32 registry, gconf-2, etc would be more useful, but would also be a larger undertaking.
I was thinking that you could force using a particular backend, dot files for instance on any platform.
Jeremy
7. Re: How to read from the Windows registry
- Posted by jimcbrown (admin) Apr 15, 2009
- 1242 views
I was thinking that you could force using a particular backend, dot files for instance on any platform.
Jeremy
I second this.
Off topic, I am suprised to see that you can create dot files on Windows 98. I was under the impression that this was impossible to do on a VFAT.
8. Re: How to read from the Windows registry
- Posted by euphoric (admin) Apr 15, 2009
- 1166 views
I was thinking that the standard library needs a configuration file (config.e) that would write cross-platform configuration files using native backends. For instance, registry on Windows and a simple $HOME/.dotfile on Unix.
That would be very cool, though it should have an option to allow the programmer to bypass the native backend and use a simple text file if so desired.
9. Re: How to read from the Windows registry
- Posted by ghaberek (admin) Apr 15, 2009
- 1182 views
I was thinking that the standard library needs a configuration file (config.e) that would write cross-platform configuration files using native backends. For instance, registry on Windows and a simple $HOME/.dotfile on Unix.
Jeremy
wxEuphoria does this with wxConfig.
wxConfig allows you to write the same code regardless of whether you're working with the registry under Win32 or text-based config files under Unix. To make writing the portable code even easier, wxEuphoria automatically maps to the native wxConfig implementation on the given platform: i.e. wxRegConfig under Win32 and wxFileConfig otherwise.
-Greg
10. Re: How to read from the Windows registry
- Posted by jeremy (admin) Apr 15, 2009
- 1192 views
I was thinking that the standard library needs a configuration file (config.e) that would write cross-platform configuration files using native backends. For instance, registry on Windows and a simple $HOME/.dotfile on Unix.
Jeremy
wxEuphoria does this with wxConfig.
Yes, but wxWidgets is a huge library if you just need a way to store configuration details.
Jeremy
11. Re: How to read from the Windows registry
- Posted by mattlewis (admin) Apr 15, 2009
- 1167 views
I was thinking that the standard library needs a configuration file (config.e) that would write cross-platform configuration files using native backends. For instance, registry on Windows and a simple $HOME/.dotfile on Unix.
Jeremy
This is just my personal preference, but I'd support a library that allows for cross-platform configuration files (such that the files can be copied from OS to another and still work).
On the other hand, a library that supports using backends such as w32 registry, gconf-2, etc would be more useful, but would also be a larger undertaking.
wxWidgets has some classes (unwrapped by wxEuphoria, unless Greg has done it while I wasn't looking) that handles configuration files. I think that it writes to the registry on Windows, and writes text files (possibly xml, but I'm not sure) on unix-like operating systems.
Matt
12. Re: How to read from the Windows registry
- Posted by doncole2009 Apr 15, 2009
- 1151 views
- Last edited Apr 16, 2009
I find regedit in windows very useful to find things in the registry.
Go start/run/cmd/regedit.
Not euphoria though.
I suppose you know be very careful (back-up) before making changes in the registry.
Don Cole A Bug is an un-documentedfeature. A Feature is a documented Bug.
13. Re: How to read from the Windows registry
- Posted by ghaberek (admin) Apr 16, 2009
- 1246 views
wxWidgets has some classes (unwrapped by wxEuphoria, unless Greg has done it while I wasn't looking) that handles configuration files. I think that it writes to the registry on Windows, and writes text files (possibly xml, but I'm not sure) on unix-like operating systems.
Matt
I think you missed my response...
wxEuphoria does this with wxConfig.
wxConfig allows you to write the same code regardless of whether you're working with the registry under Win32 or text-based config files under Unix. To make writing the portable code even easier, wxEuphoria automatically maps to the native wxConfig implementation on the given platform: i.e. wxRegConfig under Win32 and wxFileConfig otherwise.
I snuck it into the 0.12.2 release.
-Greg
14. Re: How to read from the Windows registry
- Posted by penpal0andrew Apr 16, 2009
- 1152 views
The following file in the archive will allow access to the registry:
http://www.rapideuphoria.com/reg.zip
It does not require Win32lib.
The archive also shows an updated version by Shawn Pringle but the link was broken.
If you know the registry locations the application uses it should be easy to do what you want. There are conventions for this but no firm standards. Searching the registry is more complex.
This was very helpful. Thank you.