2000-08-08 03:24:00 +02:00
|
|
|
|
<sect1 id="registry">
|
|
|
|
|
<title>The Registry</title>
|
|
|
|
|
|
2003-04-01 05:26:13 +02:00
|
|
|
|
<para>
|
|
|
|
|
Originally written by Ove K<>ven
|
|
|
|
|
</para>
|
2000-08-08 03:24:00 +02:00
|
|
|
|
|
|
|
|
|
<para>
|
|
|
|
|
After Win3.x, the registry became a fundamental part of Windows.
|
|
|
|
|
It is the place where both Windows itself, and all
|
|
|
|
|
Win95/98/NT/2000/whatever-compliant applications, store
|
|
|
|
|
configuration and state data. While most sane system
|
|
|
|
|
administrators (and Wine developers) curse badly at the twisted
|
|
|
|
|
nature of the Windows registry, it is still necessary for Wine
|
|
|
|
|
to support it somehow.
|
|
|
|
|
</para>
|
|
|
|
|
|
2003-04-01 05:26:13 +02:00
|
|
|
|
<sect2>
|
|
|
|
|
<title>The default registry</title>
|
|
|
|
|
|
|
|
|
|
<para>
|
|
|
|
|
A Windows registry contains many keys by default, and some of
|
|
|
|
|
them are necessary for even installers to operate correctly.
|
|
|
|
|
The keys that the Wine developers have found necessary to
|
|
|
|
|
install applications are distributed in a file called
|
|
|
|
|
<filename>winedefault.reg</filename>. It is automatically
|
|
|
|
|
installed for you if you use the
|
|
|
|
|
<filename>tools/wineinstall</filename> script in the Wine source,
|
|
|
|
|
but if you want to install it manually, you can do so by using the
|
|
|
|
|
<command>regedit</command> tool to be found in the
|
|
|
|
|
<filename>programs/regedit/</filename>
|
|
|
|
|
directory in Wine source.
|
|
|
|
|
<filename>winedefault.reg</filename> should even be applied if
|
|
|
|
|
you plan to use a native Windows registry, since Wine needs some
|
|
|
|
|
specific registry settings in its registry (for special
|
|
|
|
|
workarounds for certain programs etc.).
|
|
|
|
|
In the main Wine source code directory in a <glossterm>terminal</glossterm>, run:
|
|
|
|
|
</para>
|
|
|
|
|
<screen>
|
|
|
|
|
<prompt>$ </><userinput>cd programs/regedit</>
|
|
|
|
|
<prompt>$ </><userinput>./regedit ../../winedefault.reg</>
|
|
|
|
|
</screen>
|
|
|
|
|
</sect2>
|
|
|
|
|
|
|
|
|
|
<sect2>
|
|
|
|
|
<title>Using a Windows registry</title>
|
|
|
|
|
|
|
|
|
|
<para>
|
|
|
|
|
If you point Wine at an existing Windows installation (by
|
|
|
|
|
setting the appropriate directories in
|
|
|
|
|
<filename>~/.wine/config</filename>, then Wine is able to load
|
|
|
|
|
registry data from it. However, Wine will not save anything to
|
|
|
|
|
the real Windows registry, but rather to its own registry
|
|
|
|
|
files (see below). Of course, if a particular registry value
|
|
|
|
|
exists in both the Windows registry and in the Wine registry,
|
|
|
|
|
then Wine will use the latter. In the Wine config file, there
|
|
|
|
|
are a number of configuration settings in the [registry] section
|
|
|
|
|
(see below) specific to the handling of Windows registry content by Wine.
|
|
|
|
|
</para>
|
|
|
|
|
<para>
|
|
|
|
|
Occasionally, Wine may have trouble loading the Windows
|
|
|
|
|
registry. Usually, this is because the registry is
|
|
|
|
|
inconsistent or damaged in some way. If that becomes a
|
|
|
|
|
problem, you may want to download the
|
|
|
|
|
<filename>regclean.exe</filename> from the MS website and use
|
|
|
|
|
it to clean up the registry. Alternatively, you can always use
|
|
|
|
|
<filename>regedit.exe</filename> to export the registry data
|
|
|
|
|
you want into a text file, and then import it in Wine.
|
|
|
|
|
</para>
|
|
|
|
|
</sect2>
|
|
|
|
|
|
|
|
|
|
<sect2>
|
|
|
|
|
<title>The Registry</title>
|
|
|
|
|
<para>
|
|
|
|
|
The initial default registry content to be used by the Wine
|
|
|
|
|
registry files is in the file
|
|
|
|
|
<filename>winedefault.reg</filename>. It contains directory
|
|
|
|
|
paths, class IDs, and more; it must be installed before most
|
|
|
|
|
<filename>INSTALL.EXE</filename> or
|
|
|
|
|
<filename>SETUP.EXE</filename> applications will work.
|
|
|
|
|
</para>
|
|
|
|
|
</sect2>
|
|
|
|
|
|
2000-08-08 03:24:00 +02:00
|
|
|
|
<sect2>
|
|
|
|
|
<title>Registry structure</title>
|
2002-07-24 05:00:02 +02:00
|
|
|
|
|
2000-08-08 03:24:00 +02:00
|
|
|
|
<para>
|
|
|
|
|
The Windows registry is an elaborate tree structure, and not
|
|
|
|
|
even most Windows programmers are fully aware of how the
|
|
|
|
|
registry is laid out, with its different "hives" and numerous
|
|
|
|
|
links between them; a full coverage is out of the scope of
|
|
|
|
|
this document. But here are the basic registry keys you might
|
|
|
|
|
need to know about for now.
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
|
<varlistentry>
|
|
|
|
|
<term>HKEY_LOCAL_MACHINE</term>
|
|
|
|
|
<listitem>
|
|
|
|
|
<para>
|
2002-07-24 05:00:02 +02:00
|
|
|
|
This fundamental root key (in win9x it's stored in the
|
2000-08-08 03:24:00 +02:00
|
|
|
|
hidden file <filename>system.dat</filename>) contains
|
|
|
|
|
everything pertaining to the current Windows
|
|
|
|
|
installation.
|
|
|
|
|
</para>
|
|
|
|
|
</listitem>
|
2002-07-24 05:00:02 +02:00
|
|
|
|
</varlistentry>
|
2000-08-08 03:24:00 +02:00
|
|
|
|
<varlistentry>
|
|
|
|
|
<term>HKEY_USERS</term>
|
|
|
|
|
<listitem>
|
|
|
|
|
<para>
|
2002-07-24 05:00:02 +02:00
|
|
|
|
This fundamental root key (in win9x it's stored in the
|
2000-08-08 03:24:00 +02:00
|
|
|
|
hidden file <filename>user.dat</filename>) contains
|
|
|
|
|
configuration data for every user of the installation.
|
|
|
|
|
</para>
|
|
|
|
|
</listitem>
|
2002-07-24 05:00:02 +02:00
|
|
|
|
</varlistentry>
|
2000-08-08 03:24:00 +02:00
|
|
|
|
<varlistentry>
|
|
|
|
|
<term>HKEY_CLASSES_ROOT</term>
|
|
|
|
|
<listitem>
|
|
|
|
|
<para>
|
|
|
|
|
This is a link to HKEY_LOCAL_MACHINE\Software\Classes.
|
|
|
|
|
It contains data describing things like file
|
|
|
|
|
associations, OLE document handlers, and COM classes.
|
|
|
|
|
</para>
|
|
|
|
|
</listitem>
|
2002-07-24 05:00:02 +02:00
|
|
|
|
</varlistentry>
|
2000-08-08 03:24:00 +02:00
|
|
|
|
<varlistentry>
|
|
|
|
|
<term>HKEY_CURRENT_USER</term>
|
|
|
|
|
<listitem>
|
|
|
|
|
<para>
|
|
|
|
|
This is a link to HKEY_USERS\your_username, i.e., your
|
|
|
|
|
personal configuration.
|
|
|
|
|
</para>
|
|
|
|
|
</listitem>
|
|
|
|
|
</varlistentry>
|
|
|
|
|
</variablelist>
|
|
|
|
|
</sect2>
|
|
|
|
|
|
|
|
|
|
<sect2>
|
2000-12-13 22:52:37 +01:00
|
|
|
|
<title>Wine registry data files</title>
|
2002-07-24 05:00:02 +02:00
|
|
|
|
|
2000-08-08 03:24:00 +02:00
|
|
|
|
<para>
|
|
|
|
|
In the user's home directory, there is a subdirectory named
|
|
|
|
|
<filename>.wine</filename>, where Wine will try to save its
|
|
|
|
|
registry by default. It saves into four files, which are:
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
|
<varlistentry>
|
|
|
|
|
<term><filename>system.reg</filename></term>
|
|
|
|
|
<listitem>
|
|
|
|
|
<para>
|
|
|
|
|
This file contains HKEY_LOCAL_MACHINE.
|
|
|
|
|
</para>
|
|
|
|
|
</listitem>
|
2002-07-24 05:00:02 +02:00
|
|
|
|
</varlistentry>
|
2000-08-08 03:24:00 +02:00
|
|
|
|
<varlistentry>
|
|
|
|
|
<term><filename>user.reg</filename></term>
|
|
|
|
|
<listitem>
|
|
|
|
|
<para>
|
|
|
|
|
This file contains HKEY_CURRENT_USER.
|
|
|
|
|
</para>
|
|
|
|
|
</listitem>
|
2002-07-24 05:00:02 +02:00
|
|
|
|
</varlistentry>
|
2000-08-08 03:24:00 +02:00
|
|
|
|
<varlistentry>
|
|
|
|
|
<term><filename>userdef.reg</filename></term>
|
|
|
|
|
<listitem>
|
|
|
|
|
<para>
|
|
|
|
|
This file contains HKEY_USERS\.Default (i.e. the default
|
|
|
|
|
user settings).
|
|
|
|
|
</para>
|
|
|
|
|
</listitem>
|
2002-07-24 05:00:02 +02:00
|
|
|
|
</varlistentry>
|
2000-08-08 03:24:00 +02:00
|
|
|
|
<varlistentry>
|
|
|
|
|
<term><filename>wine.userreg</filename></term>
|
|
|
|
|
<listitem>
|
|
|
|
|
<para>
|
|
|
|
|
Wine saves HKEY_USERS to this file (both current and
|
|
|
|
|
default user), but does not load from it, unless
|
|
|
|
|
<filename>userdef.reg</filename> is missing.
|
|
|
|
|
</para>
|
|
|
|
|
</listitem>
|
|
|
|
|
</varlistentry>
|
|
|
|
|
</variablelist>
|
|
|
|
|
<para>
|
|
|
|
|
All of these files are human-readable text files, so unlike
|
|
|
|
|
Windows, you can actually use an ordinary text editor on them
|
2002-07-24 05:00:02 +02:00
|
|
|
|
if you want (make sure you don't have Wine running when modifying
|
|
|
|
|
them, otherwise your changes will be discarded).
|
2000-08-08 03:24:00 +02:00
|
|
|
|
</para>
|
|
|
|
|
<para>
|
2003-04-01 05:26:13 +02:00
|
|
|
|
FIXME: global configuration currently not implemented.
|
2002-07-24 05:00:02 +02:00
|
|
|
|
|
2000-08-08 03:24:00 +02:00
|
|
|
|
In addition to these files, Wine can also optionally load from
|
|
|
|
|
global registry files residing in the same directory as the
|
|
|
|
|
global <filename>wine.conf</filename> (i.e.
|
|
|
|
|
<filename>/usr/local/etc</filename> if you compiled from
|
|
|
|
|
source). These are:
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
|
<varlistentry>
|
|
|
|
|
<term><filename>wine.systemreg</filename></term>
|
|
|
|
|
<listitem>
|
|
|
|
|
<para>Contains HKEY_LOCAL_MACHINE.</para>
|
|
|
|
|
</listitem>
|
|
|
|
|
</varlistentry>
|
|
|
|
|
<varlistentry>
|
|
|
|
|
<term><filename>wine.userreg</filename></term>
|
|
|
|
|
<listitem>
|
|
|
|
|
<para>Contains HKEY_USERS.</para>
|
|
|
|
|
</listitem>
|
|
|
|
|
</varlistentry>
|
|
|
|
|
</variablelist>
|
|
|
|
|
</sect2>
|
|
|
|
|
|
|
|
|
|
<sect2>
|
|
|
|
|
<title>System administration</title>
|
2002-07-24 05:00:02 +02:00
|
|
|
|
|
2000-08-08 03:24:00 +02:00
|
|
|
|
<para>
|
|
|
|
|
With the above file structure, it is possible for a system
|
|
|
|
|
administrator to configure the system so that a system Wine
|
|
|
|
|
installation (and applications) can be shared by all the
|
|
|
|
|
users, and still let the users all have their own personalized
|
|
|
|
|
configuration. An administrator can, after having installed
|
|
|
|
|
Wine and any Windows application software he wants the users
|
|
|
|
|
to have access to, copy the resulting
|
|
|
|
|
<filename>system.reg</filename> and
|
|
|
|
|
<filename>wine.userreg</filename> over to the global registry
|
|
|
|
|
files (which we assume will reside in
|
|
|
|
|
<filename>/usr/local/etc</filename> here), with:
|
|
|
|
|
</para>
|
|
|
|
|
<screen>
|
|
|
|
|
cd ~/.wine
|
|
|
|
|
cp system.reg /usr/local/etc/wine.systemreg
|
|
|
|
|
cp wine.userreg /usr/local/etc/wine.userreg
|
|
|
|
|
</screen>
|
|
|
|
|
<para>
|
|
|
|
|
and perhaps even symlink these back to the administrator's
|
|
|
|
|
account, to make it easier to install apps system-wide later:
|
|
|
|
|
</para>
|
|
|
|
|
<screen>
|
|
|
|
|
ln -sf /usr/local/etc/wine.systemreg system.reg
|
|
|
|
|
ln -sf /usr/local/etc/wine.userreg wine.userreg
|
|
|
|
|
</screen>
|
|
|
|
|
<para>
|
|
|
|
|
Note that the <filename>tools/wineinstall</filename> script
|
2002-02-27 02:30:32 +01:00
|
|
|
|
already does all of this for you, if you install Wine source as root.
|
2000-08-08 03:24:00 +02:00
|
|
|
|
If you then install Windows applications while logged in as
|
|
|
|
|
root, all your users will automatically be able to use them.
|
|
|
|
|
While the application setup will be taken from the global
|
|
|
|
|
registry, the users' personalized configurations will be saved
|
|
|
|
|
in their own home directories.
|
|
|
|
|
</para>
|
|
|
|
|
<para>
|
|
|
|
|
But be careful with what you do with the administrator account
|
|
|
|
|
- if you do copy or link the administrator's registry to the
|
|
|
|
|
global registry, any user might be able to read the
|
|
|
|
|
administrator's preferences, which might not be good if
|
|
|
|
|
sensitive information (passwords, personal information, etc)
|
|
|
|
|
is stored there. Only use the administrator account to install
|
|
|
|
|
software, not for daily work; use an ordinary user account for
|
|
|
|
|
that.
|
|
|
|
|
</para>
|
|
|
|
|
</sect2>
|
|
|
|
|
|
|
|
|
|
<sect2>
|
|
|
|
|
<title>The [registry] section</title>
|
|
|
|
|
|
|
|
|
|
<para>
|
2003-04-01 05:26:13 +02:00
|
|
|
|
Now let's look at the <link linkend="config-file">Wine
|
|
|
|
|
configuration file</link> options for handling the registry.
|
2000-08-08 03:24:00 +02:00
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
|
<varlistentry>
|
2002-09-24 05:07:17 +02:00
|
|
|
|
<term>GlobalRegistryDir</term>
|
|
|
|
|
<listitem>
|
|
|
|
|
<para>
|
|
|
|
|
Optional. Sets the path to look for the Global
|
|
|
|
|
Registry.
|
|
|
|
|
</para>
|
|
|
|
|
</listitem>
|
|
|
|
|
</varlistentry>
|
|
|
|
|
<varlistentry>
|
2000-08-08 03:24:00 +02:00
|
|
|
|
<term>LoadGlobalRegistryFiles</term>
|
|
|
|
|
<listitem>
|
|
|
|
|
<para>
|
|
|
|
|
Controls whether to try to load the global registry
|
|
|
|
|
files, if they exist.
|
|
|
|
|
</para>
|
|
|
|
|
</listitem>
|
|
|
|
|
</varlistentry>
|
|
|
|
|
<varlistentry>
|
|
|
|
|
<term>LoadHomeRegistryFiles</term>
|
|
|
|
|
<listitem>
|
|
|
|
|
<para>
|
|
|
|
|
Controls whether to try to load the user's registry
|
|
|
|
|
files (in the <filename>.wine</filename> subdirectory of
|
|
|
|
|
the user's home directory).
|
|
|
|
|
</para>
|
|
|
|
|
</listitem>
|
|
|
|
|
</varlistentry>
|
|
|
|
|
<varlistentry>
|
|
|
|
|
<term>LoadWindowsRegistryFiles</term>
|
|
|
|
|
<listitem>
|
|
|
|
|
<para>
|
|
|
|
|
Controls whether Wine will attempt to load registry data
|
|
|
|
|
from a real Windows registry in an existing MS Windows
|
|
|
|
|
installation.
|
|
|
|
|
</para>
|
|
|
|
|
</listitem>
|
|
|
|
|
</varlistentry>
|
|
|
|
|
<varlistentry>
|
|
|
|
|
<term>WritetoHomeRegistryFiles</term>
|
|
|
|
|
<listitem>
|
|
|
|
|
<para>
|
|
|
|
|
Controls whether registry data will be written to the
|
|
|
|
|
user's registry files. (Currently, there is no
|
|
|
|
|
alternative, so if you turn this off, Wine cannot save
|
|
|
|
|
the registry on disk at all; after you exit Wine, your
|
|
|
|
|
changes will be lost.)
|
|
|
|
|
</para>
|
|
|
|
|
</listitem>
|
|
|
|
|
</varlistentry>
|
|
|
|
|
<varlistentry>
|
2002-07-24 05:00:02 +02:00
|
|
|
|
<term>SaveOnlyUpdatedKeys</term>
|
2000-08-08 03:24:00 +02:00
|
|
|
|
<listitem>
|
|
|
|
|
<para>
|
2002-07-24 05:00:02 +02:00
|
|
|
|
Controls whether the entire registry is saved to the
|
|
|
|
|
user's registry files, or only subkeys the user have
|
|
|
|
|
actually changed. Considering that the user's registry
|
|
|
|
|
will override any global registry files and Windows
|
|
|
|
|
registry files, it usually makes sense to only save
|
|
|
|
|
user-modified subkeys; that way, changes to the rest of
|
|
|
|
|
the global or Windows registries will still affect the
|
|
|
|
|
user.
|
2000-08-08 03:24:00 +02:00
|
|
|
|
</para>
|
|
|
|
|
</listitem>
|
|
|
|
|
</varlistentry>
|
|
|
|
|
<varlistentry>
|
|
|
|
|
<term>PeriodicSave</term>
|
|
|
|
|
<listitem>
|
|
|
|
|
<para>
|
|
|
|
|
If this option is set to a nonzero value, it specifies
|
|
|
|
|
that you want the registry to be saved to disk at the
|
|
|
|
|
given interval. If it is not set, the registry will only
|
|
|
|
|
be saved to disk when the wineserver terminates.
|
|
|
|
|
</para>
|
|
|
|
|
</listitem>
|
|
|
|
|
</varlistentry>
|
|
|
|
|
<varlistentry>
|
2002-07-24 05:00:02 +02:00
|
|
|
|
<term>UseNewFormat</term>
|
2000-08-08 03:24:00 +02:00
|
|
|
|
<listitem>
|
|
|
|
|
<para>
|
2002-07-24 05:00:02 +02:00
|
|
|
|
This option is obsolete. Wine now always uses the new
|
|
|
|
|
format; support for the old format was removed a while
|
|
|
|
|
ago.
|
2000-08-08 03:24:00 +02:00
|
|
|
|
</para>
|
|
|
|
|
</listitem>
|
|
|
|
|
</varlistentry>
|
|
|
|
|
</variablelist>
|
|
|
|
|
</sect2>
|
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
|
|
|
Local variables:
|
|
|
|
|
mode: sgml
|
|
|
|
|
sgml-parent-document:("configuring.sgml" "chapter" "sect1" "")
|
|
|
|
|
End:
|
|
|
|
|
-->
|