Hi, I'm trying to find some elegant method to access registry keys added during one WINE session, i.e. without restarting WINE.
Test case description: 1. Open WINE session wineconsole --backend=user cmd 2. During session, insert some new registry key regedit new-entry.reg 3. Try to access the new registry entry from bash cat ~/.wine/system.reg |grep AutoHotkey (fails) 4. Close WINE session
I've found there was at times an option to save registry periodically, but this can't help me here.
This problem can be solved in two ways, both of them can be helpful:
a) Create small program to force sync of registry in memory with registry files - 'wineflushregistry'.
b) Enhance regedit to be able to output to STDOUT. By default registry search output is done to a specified file. It can be redirected to STDERR, though. (tested on 0.9.29, 0.9.33)
Enhancing regedit -----------------
regedit /es "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths\AutoHotkey.exe"
which will be similar to (non-functional)
regedit /e /dev/stdout "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths\AutoHotkey.exe"
Regards Vit Hrachovy
On 3/19/07, Vit Hrachovy vit.hrachovy@sandbox.cz wrote:
Hi, I'm trying to find some elegant method to access registry keys added during one WINE session, i.e. without restarting WINE.
Test case description: 1. Open WINE session wineconsole --backend=user cmd 2. During session, insert some new registry key regedit new-entry.reg 3. Try to access the new registry entry from bash cat ~/.wine/system.reg |grep AutoHotkey (fails)
Accessing the Wine registry directly is probably not the right way to do it, you should go through the Windows registry API calls, i.e. RegQueryValue.
4. Close WINE session
I've found there was at times an option to save registry periodically, but this can't help me here.
This problem can be solved in two ways, both of them can be helpful:
a) Create small program to force sync of registry in memory with registry files - 'wineflushregistry'.
b) Enhance regedit to be able to output to STDOUT. By default registry search output is done to a specified file. It can be redirected to STDERR, though. (tested on 0.9.29, 0.9.33)
If you can get it to go to stderr, why not just use shell redirection to redirect stderr to stdout?
Enhancing regedit
regedit /es "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths\AutoHotkey.exe"
which will be similar to (non-functional)
regedit /e /dev/stdout "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths\AutoHotkey.exe"
Regards Vit Hrachovy
On Mon, Mar 19, 2007 at 09:27:09AM -0700, Lei Zhang wrote:
On 3/19/07, Vit Hrachovy vit.hrachovy@sandbox.cz wrote:
Hi, I'm trying to find some elegant method to access registry keys added during one WINE session, i.e. without restarting WINE.
Test case description: 1. Open WINE session wineconsole --backend=user cmd 2. During session, insert some new registry key regedit new-entry.reg 3. Try to access the new registry entry from bash cat ~/.wine/system.reg |grep AutoHotkey (fails)
Accessing the Wine registry directly is probably not the right way to do it, you should go through the Windows registry API calls, i.e. RegQueryValue.
I'm aware of that it's not the best way. According to the documentation at http://winehq.org/site/docs/wineusr-guide/using-regedit there are two ways to access the registry - using file access and using regedit.
AFAIK what You mention these are C API calls. I'm trying to access the registry from PERL. If registry access should be done only via API calls, then there is Regedit tool which uses the API calls. That leads to the second point, enhancing regedit.
4. Close WINE session
I've found there was at times an option to save registry periodically, but this can't help me here.
This problem can be solved in two ways, both of them can be helpful:
a) Create small program to force sync of registry in memory with registry files - 'wineflushregistry'.
b) Enhance regedit to be able to output to STDOUT. By default registry search output is done to a specified file. It can be redirected to STDERR, though. (tested on 0.9.29, 0.9.33)
If you can get it to go to stderr, why not just use shell redirection to redirect stderr to stdout?
Believe it or not, there are UNIXes without /dev/stderr and /dev/stdout. Having regedit option to flush its output to STDOUT (and to get its input from STDIN) would be very helpful - and in case of STDOUT output very easy to implement.
Regards Vit Hrachovy
On 3/19/07, Vit Hrachovy vit.hrachovy@sandbox.cz wrote:
On Mon, Mar 19, 2007 at 09:27:09AM -0700, Lei Zhang wrote:
On 3/19/07, Vit Hrachovy vit.hrachovy@sandbox.cz wrote:
Hi, I'm trying to find some elegant method to access registry keys added during one WINE session, i.e. without restarting WINE.
Test case description: 1. Open WINE session wineconsole --backend=user cmd 2. During session, insert some new registry key regedit new-entry.reg 3. Try to access the new registry entry from bash cat ~/.wine/system.reg |grep AutoHotkey (fails)
Accessing the Wine registry directly is probably not the right way to do it, you should go through the Windows registry API calls, i.e. RegQueryValue.
I'm aware of that it's not the best way. According to the documentation at http://winehq.org/site/docs/wineusr-guide/using-regedit there are two ways to access the registry - using file access and using regedit.
AFAIK what You mention these are C API calls. I'm trying to access the registry from PERL. If registry access should be done only via API calls, then there is Regedit tool which uses the API calls. That leads to the second point, enhancing regedit.
Yes, but the documentation specifically says only to access the file when Wine is not running.
4. Close WINE session
I've found there was at times an option to save registry periodically, but this can't help me here.
This problem can be solved in two ways, both of them can be helpful:
a) Create small program to force sync of registry in memory with registry files - 'wineflushregistry'.
b) Enhance regedit to be able to output to STDOUT. By default registry search output is done to a specified file. It can be redirected to STDERR, though. (tested on 0.9.29, 0.9.33)
If you can get it to go to stderr, why not just use shell redirection to redirect stderr to stdout?
Believe it or not, there are UNIXes without /dev/stderr and /dev/stdout. Having regedit option to flush its output to STDOUT (and to get its input from STDIN) would be very helpful - and in case of STDOUT output very easy to implement.
Regards Vit Hrachovy
Sure, but Unices that run Wine have /dev/stderr.
A better reason for not modifying regedit is that is breaks compatibility with Windows' regedit. Yes, it can is helpful to have a tool that can retrieve registry keys from the command line, but we should not overload that functionality into regedit.
Lei Zhang wrote:
Believe it or not, there are UNIXes without /dev/stderr and /dev/stdout. Having regedit option to flush its output to STDOUT (and to get its input from STDIN) would be very helpful - and in case of STDOUT output very easy to implement.
Regards Vit Hrachovy
Sure, but Unices that run Wine have /dev/stderr.
A better reason for not modifying regedit is that is breaks compatibility with Windows' regedit. Yes, it can is helpful to have a tool that can retrieve registry keys from the command line, but we should not overload that functionality into regedit.
Hi, thanks for recommendation, I'll send a patch with the new tool for review soon. Regards Vit
On Mon, 2007-19-03 at 12:14 +0100, Vit Hrachovy wrote:
Hi, I'm trying to find some elegant method to access registry keys added during one WINE session, i.e. without restarting WINE.
Test case description:
- Open WINE session wineconsole --backend=user cmd
- During session, insert some new registry key regedit new-entry.reg
- Try to access the new registry entry from bash cat ~/.wine/system.reg |grep AutoHotkey (fails)
- Close WINE session
I've found there was at times an option to save registry periodically, but this can't help me here.
This problem can be solved in two ways, both of them can be helpful:
a) Create small program to force sync of registry in memory with registry files - 'wineflushregistry'.
b) Enhance regedit to be able to output to STDOUT. By default registry search output is done to a specified file. It can be redirected to STDERR, though. (tested on 0.9.29, 0.9.33)
c) Use the shell wine regedit -e /tmp/$$.reg <branch> && cat /tmp/$$.reg && rm -f /tmp/$ $.reg
Regards Vit Hrachovy
Bill Medland wrote:
b) Enhance regedit to be able to output to STDOUT. By default registry search output is done to a specified file. It can be redirected to STDERR, though. (tested on 0.9.29, 0.9.33)
c) Use the shell wine regedit -e /tmp/$$.reg <branch> && cat /tmp/$$.reg && rm -f /tmp/$ $.reg
Hi Bill, that's not the case I'm searching for. I'm aware that regedit can export into files. I simply want registry export to STDOUT nothing else.
As Lei Zhang mentioned such an application would be useful for more people than me, I'm going to submit a patch with some sort of new application [not to break 1 to 1 regedit compatibility] able to output registry entries to STDOUT.
Regards Vit
On Tue, 2007-20-03 at 21:12 +0100, Vit Hrachovy wrote:
Bill Medland wrote:
b) Enhance regedit to be able to output to STDOUT. By default registry search output is done to a specified file. It can be redirected to STDERR, though. (tested on 0.9.29, 0.9.33)
c) Use the shell wine regedit -e /tmp/$$.reg <branch> && cat /tmp/$$.reg && rm -f /tmp/$ $.reg
Hi Bill, that's not the case I'm searching for. I'm aware that regedit can export into files. I simply want registry export to STDOUT nothing else.
in which case I did not get my point across. I understand that you are aware that you can export to a file; that was clear.
My point is that the great thing (to me) about unix-like systems is the ability to join commands together, which it is why I can write a simple statement that will use the existing regedit and two standard unix programs (cat and rm) to generate the output on stdout.
As Lei Zhang mentioned such an application would be useful for more people than me, I'm going to submit a patch with some sort of new application [not to break 1 to 1 regedit compatibility] able to output registry entries to STDOUT.
You seem to accept the point that we should not add functionality to the existing regedit, so that we retain 1-1 compatibility with the Windows version.
However in creating yet another application I suggest you are reinventing the wheel. Either it will use regedit to do the hard work (in which case it is equivalent to what I suggested) or else it will access the registry itself (in which case it is going to have a lot in common with regedit and so you are duplicating functionality and accepting the maintenance cost).
(Can I also suggest that going back to your original idea we could accept a filename of - as meaning stdin/stdout, so that we can use
regedit -e - "HKEY_LOCAL_MACHINE....."
Then we still have the same arguments as Windows; it's just that we are a little more free in what we accept as a filename. After all, we already accept Unix filenames as well as Windows filenames.)
Regards Vit
Bill Medland wrote:
On Tue, 2007-20-03 at 21:12 +0100, Vit Hrachovy wrote:
Bill Medland wrote:
b) Enhance regedit to be able to output to STDOUT. By default registry search output is done to a specified file. It can be redirected to STDERR, though. (tested on 0.9.29, 0.9.33)
c) Use the shell wine regedit -e /tmp/$$.reg <branch> && cat /tmp/$$.reg && rm -f /tmp/$ $.reg
Hi Bill, that's not the case I'm searching for. I'm aware that regedit can export into files. I simply want registry export to STDOUT nothing else.
My point is that the great thing (to me) about unix-like systems is the ability to join commands together, which it is why I can write a simple statement that will use the existing regedit and two standard unix programs (cat and rm) to generate the output on stdout.
Yes, I understand. I simply don't like an idea of generating unnecessary file access. I'd prefer data streams and pipes where possible - another great unix thing :-)
As Lei Zhang mentioned such an application would be useful for more people than me, I'm going to submit a patch with some sort of new application [not to break 1 to 1 regedit compatibility] able to output registry entries to STDOUT.
You seem to accept the point that we should not add functionality to the existing regedit, so that we retain 1-1 compatibility with the Windows version.
However in creating yet another application I suggest you are reinventing the wheel. Either it will use regedit to do the hard work (in which case it is equivalent to what I suggested) or else it will access the registry itself (in which case it is going to have a lot in common with regedit and so you are duplicating functionality and accepting the maintenance cost).
(Can I also suggest that going back to your original idea we could accept a filename of - as meaning stdin/stdout, so that we can use
regedit -e - "HKEY_LOCAL_MACHINE....."
Then we still have the same arguments as Windows; it's just that we are a little more free in what we accept as a filename. After all, we already accept Unix filenames as well as Windows filenames.)
Yes, simple - as a STDOUT would be sufficient. Currently it doesn't work in regedit.
That was the main reason I'm asking here on list - I don't want to reinvent the wheel and I'd prefer not to support another application to do the same job as regedit. I'm trying to find an elegant solution. Support for - as STDOUT file name in regedit is an elegant solution and will be sufficient to fullfill my desires.
The question to be answered by the dedicated people is whether it is acceptable for regedit compatibility issues.
Regards Vit
On 3/20/07, Vit Hrachovy vit.hrachovy@sandbox.cz wrote:
Bill Medland wrote:
On Tue, 2007-20-03 at 21:12 +0100, Vit Hrachovy wrote:
Bill Medland wrote:
b) Enhance regedit to be able to output to STDOUT. By default registry search output is done to a specified file. It can be redirected to STDERR, though. (tested on 0.9.29, 0.9.33)
c) Use the shell wine regedit -e /tmp/$$.reg <branch> && cat /tmp/$$.reg && rm -f /tmp/$ $.reg
Hi Bill, that's not the case I'm searching for. I'm aware that regedit can export into files. I simply want registry export to STDOUT nothing else.
My point is that the great thing (to me) about unix-like systems is the ability to join commands together, which it is why I can write a simple statement that will use the existing regedit and two standard unix programs (cat and rm) to generate the output on stdout.
Yes, I understand. I simply don't like an idea of generating unnecessary file access. I'd prefer data streams and pipes where possible - another great unix thing :-)
As Lei Zhang mentioned such an application would be useful for more people than me, I'm going to submit a patch with some sort of new application [not to break 1 to 1 regedit compatibility] able to output registry entries to STDOUT.
You seem to accept the point that we should not add functionality to the existing regedit, so that we retain 1-1 compatibility with the Windows version.
However in creating yet another application I suggest you are reinventing the wheel. Either it will use regedit to do the hard work (in which case it is equivalent to what I suggested) or else it will access the registry itself (in which case it is going to have a lot in common with regedit and so you are duplicating functionality and accepting the maintenance cost).
(Can I also suggest that going back to your original idea we could accept a filename of - as meaning stdin/stdout, so that we can use
regedit -e - "HKEY_LOCAL_MACHINE....."
Then we still have the same arguments as Windows; it's just that we are a little more free in what we accept as a filename. After all, we already accept Unix filenames as well as Windows filenames.)
Yes, simple - as a STDOUT would be sufficient. Currently it doesn't work in regedit.
That was the main reason I'm asking here on list - I don't want to reinvent the wheel and I'd prefer not to support another application to do the same job as regedit. I'm trying to find an elegant solution. Support for - as STDOUT file name in regedit is an elegant solution and will be sufficient to fullfill my desires.
The question to be answered by the dedicated people is whether it is acceptable for regedit compatibility issues.
Regards Vit
I guess regedit /E - is "unixy" and at the same time non-intrusive. Right now it creates a file named '-', but that can be easily fixed. (On Windows XP it gives an error even though '-' is a valid filename)
On Di, 2007-03-20 at 21:12 +0100, Vit Hrachovy wrote:
Hi Bill, that's not the case I'm searching for. I'm aware that regedit can export into files. I simply want registry export to STDOUT nothing else.
Did you test reg.exe / regini.exe ?
I'm going to submit a patch with some sort of new application
Please try the above first. Both are from Microsoft.
Example: $ wine reg.exe query "HKCU\Software\wine\MSHTML"
! REG.EXE VERSION 3.0
HKEY_CURRENT_USER\Software\wine\MSHTML GeckoUrl REG_SZ http://source.winehq.org/winegecko.php
On Wed, Mar 21, 2007 at 11:38:03PM +0100, Detlef Riekenberg wrote:
On Di, 2007-03-20 at 21:12 +0100, Vit Hrachovy wrote:
Hi Bill, that's not the case I'm searching for. I'm aware that regedit can export into files. I simply want registry export to STDOUT nothing else.
Did you test reg.exe / regini.exe ?
I'm going to submit a patch with some sort of new application
Please try the above first. Both are from Microsoft.
Example: $ wine reg.exe query "HKCU\Software\wine\MSHTML"
! REG.EXE VERSION 3.0
HKEY_CURRENT_USER\Software\wine\MSHTML GeckoUrl REG_SZ http://source.winehq.org/winegecko.php
Hi Detlef, reg.exe is very close to fulfill my requirements.
However, it's not implemented in WINE yet.
As there is a need for such tool, I propose to implement reg.exe in future WINE versions. I'll write a prototype.
Thanks a lot for Your help.
Regards Vit Hrachovy