Automate wine configuration (drives and registry)

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
phual
Level 1
Level 1
Posts: 6
Joined: Mon Apr 07, 2008 3:59 pm

Automate wine configuration (drives and registry)

Post by phual »

One of my apps requires a clean .wine directory after each (wine) version upgrade and I'm starting to get fed up of making all of the set-up required - specifically:

- creating a DVD drive in winecfg
- making small changes to a number of registry values (simple but tedious)

Both seem ideal things to be solved by a small script, but I have no idea where to start. Can anyone point me in the right direction?

Stuart
Martin Gregorie

Automate wine configuration (drives and registry)

Post by Martin Gregorie »

On Sat, 2009-07-25 at 01:38 -0500, phual wrote:
One of my apps requires a clean .wine directory after each (wine) version upgrade and I'm starting to get fed up of making all of the set-up required - specifically:

- creating a DVD drive in winecfg
Should be straight forward once you understand shell scripting. Consider
getting one of the Nutshell books (Unix in a nutshell / Linux in a
nutshell).
- making small changes to a number of registry values (simple but tedious)
Probably a job for sed or gawk - the registries are text files, so a
scriptable text editor (sed) or a general purpose text manipulator
(gawk) can do it. Probably the best way of seeing exactly what to do is
to use diff to compare a fresh set of registries with ones you've
modified and then use it to check that your script is actually doing
what is needed.

There's an O'Reilly book, "sed & awk", that may be useful.
Both seem ideal things to be solved by a small script, but I have no idea where to start. Can anyone point me in the right direction?
Of course, rather than using bash plus sed or awk to do the job, you
could do it entirely in Perl...


Martin
phual
Level 1
Level 1
Posts: 6
Joined: Mon Apr 07, 2008 3:59 pm

Post by phual »

That got me where I wanted to be. Thanks

Stuart
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: Automate wine configuration (drives and registry)

Post by vitamin »

phual wrote:- creating a DVD drive in winecfg
Wine should detect all attached drives automatically. If you adding a loop device (mounted ISO image) just make a simlink to it under $WINEPREFIX/dosdevices ex:

Code: Select all

ln -s /media/my_iso $WINEPREFIX/dosdevices/d:
If WINEPREFIX is not set, it's defaults to $HOME/.wine
Martin Gregorie wrote:Probably a job for sed or gawk - the registries are text files, so a scriptable text editor (sed) or a general purpose text manipulator (gawk) can do it.
Do NOT even think about it!!! DO NOT EVER touch Wine's registry with text editor, unless you fine with totally corrupting it and/or loosing all your changes.

If you need to add / modify registry, use ... registry files. This part works the same as windows. Make a .reg file, then import it with 'regedit file.reg'.
Lisa Denia

Automate wine configuration (drives and registry)

Post by Lisa Denia »

Do NOT even think about it!!! DO NOT EVER touch Wine's registry with text
editor, unless you fine with totally corrupting it and/or loosing all your
changes.
Uhm, why? Should be fine as long as Wine isn't running. This includes
wineserver of course.
austin987
Wine Developer
Wine Developer
Posts: 2383
Joined: Fri Feb 22, 2008 8:19 pm

Automate wine configuration (drives and registry)

Post by austin987 »

On Sat, Jul 25, 2009 at 6:34 PM, Lisa Denia<[email protected]> wrote:
Do NOT even think about it!!! DO NOT EVER touch Wine's registry with text
editor, unless you fine with totally corrupting it and/or loosing all your
changes.
Uhm, why? Should be fine as long as Wine isn't running. This includes
wineserver of course.
The .reg files aren't plain text, and have to updated a certain way.

Sure, it may 'usually' work, but be safe and use regedit foo.reg.


--
-Austin
Locked