Regedit output to STDOUT / force registry files sync

Lei Zhang thestig at google.com
Mon Mar 19 13:06:32 CDT 2007


On 3/19/07, Vit Hrachovy <vit.hrachovy at sandbox.cz> wrote:
> On Mon, Mar 19, 2007 at 09:27:09AM -0700, Lei Zhang wrote:
> > On 3/19/07, Vit Hrachovy <vit.hrachovy at 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.



More information about the wine-devel mailing list