4 After Win3.x, the registry became a fundamental part of Windows. It is
5 the place where both Windows itself, and all
6 Win95/98/NT/2000/whatever-compliant applications, store configuration
7 and state data. While most sane system administrators (and Wine
8 developers) curse badly at the twisted nature of the Windows registry,
9 it is still necessary for Wine to support it somehow.
13 The Windows registry is an elaborate tree structure, and not even most
14 Windows programmers are fully aware of how the registry is laid out,
15 with its different "hives" and numerous links between them; a full
16 coverage is out of the scope of this document. But here are the basic
17 registry keys you might need to know about for now.
20 This fundamental root key (in win9x, stored in the hidden file
21 system.dat) contains everything pertaining to the current
25 This fundamental root key (in win9x, stored in the hidden file
26 user.dat) contains configuration data for every user of the
30 This is a link to HKEY_LOCAL_MACHINE\Software\Classes. It
31 contains data describing things like file associations, OLE
32 document handlers, and COM classes.
35 This is a link to HKEY_USERS\your_username, i.e., your personal
38 Using a Windows registry
40 If you point Wine at an existing MS Windows installation (by setting
41 the appropriate directories in wine.conf/.winerc), then Wine is able
42 to load registry data from it. However, Wine will not save anything to
43 the real Windows registry, but rather to its own registry files (see
44 below). Of course, if a particular registry value exists in both the
45 Windows registry and in the Wine registry, then Wine will use the
48 Occasionally, Wine may have trouble loading the Windows registry.
49 Usually, this is because the registry is inconsistent or damaged in
50 some way. If that becomes a problem, you may want to download the
51 regclean.exe from the MS website and use it to clean up the registry.
52 Alternatively, you can always use regedit.exe to export the registry
53 data you want into a text file, and then import it in Wine.
55 Wine registry data files
57 In the user's home directory, there is a subdirectory named .wine,
58 where Wine will try to save its registry by default. It saves into
59 four files, which are:
62 This file contains HKEY_LOCAL_MACHINE.
65 This file contains HKEY_CURRENT_USER.
68 This file contains HKEY_USERS\.Default (i.e. the default user
72 Wine saves HKEY_USERS to this file (both current and default
73 user), but does not load from it, unless userdef.reg is
76 All of these files are human-readable text files, so unlike Windows,
77 you can actually use an ordinary text editor on them if you must.
79 In addition to these files, Wine can also optionally load from global
80 registry files residing in the same directory as the global wine.conf
81 (i.e. /usr/local/etc if you compiled from source). These are:
84 Contains HKEY_LOCAL_MACHINE.
91 With the above file structure, it is possible for a system
92 administrator to configure the system so that a system Wine
93 installation (and applications) can be shared by all the users, and
94 still let the users all have their own personalized configuration. An
95 administrator can, after having installed Wine and any Windows
96 application software he wants the users to have access to, copy the
97 resulting system.reg and wine.userreg over to the global registry
98 files (which we assume will reside in /usr/local/etc here), with:
101 cp system.reg /usr/local/etc/wine.systemreg
102 cp wine.userreg /usr/local/etc/wine.userreg
104 and perhaps even symlink these back to the administrator's account, to
105 make it easier to install apps system-wide later:
107 ln -sf /usr/local/etc/wine.systemreg system.reg
108 ln -sf /usr/local/etc/wine.userreg wine.userreg
110 Note that the tools/wineinstall script already does all of this for
111 you, if you install Wine as root. If you then install Windows
112 applications while logged in as root, all your users will
113 automatically be able to use them. While the application setup will be
114 taken from the global registry, the users' personalized configurations
115 will be saved in their own home directories.
117 But be careful with what you do with the administrator account - if
118 you do copy or link the administrator's registry to the global
119 registry, any user might be able to read the administrator's
120 preferences, which might not be good if sensitive information
121 (passwords, personal information, etc) is stored there. Only use the
122 administrator account to install software, not for daily work; use an
123 ordinary user account for that.
127 A Windows registry contains many keys by default, and some of them are
128 necessary for even installers to operate correctly. The keys that the
129 Wine developers have found necessary to install applications are
130 distributed in a file called "winedefault.reg". It is automatically
131 installed for you if you use the tools/wineinstall script, but if you
132 want to install it manually, you can do so by using the regapi tool.
133 You can find more information about this in the
134 documentation/no-windows document in the Wine distribution.
136 The [registry] section
138 With the above information fresh in mind, let's look at the
139 wine.conf/.winerc options for handling the registry.
141 LoadGlobalRegistryFiles
142 Controls whether to try to load the global registry files, if
145 LoadHomeRegistryFiles
146 Controls whether to try to load the user's registry files (in
147 the .wine subdirectory of the user's home directory).
149 LoadWindowsRegistryFiles
150 Controls whether Wine will attempt to load registry data from a
151 real Windows registry in an existing MS Windows installation.
153 WritetoHomeRegistryFiles
154 Controls whether registry data will be written to the user's
155 registry files. (Currently, there is no alternative, so if you
156 turn this off, Wine cannot save the registry on disk at all;
157 after you exit Wine, your changes will be lost.)
160 This option is obsolete. Wine now always use the new format;
161 support for the old format was removed a while ago.
164 If this option is set to a nonzero value, it specifies that you
165 want the registry to be saved to disk at the given interval. If
166 it is not set, the registry will only be saved to disk when the
167 wineserver terminates.
170 Controls whether the entire registry is saved to the user's
171 registry files, or only subkeys the user have actually changed.
172 Considering that the user's registry will override any global
173 registry files and Windows registry files, it usually makes
174 sense to only save user-modified subkeys; that way, changes to
175 the rest of the global or Windows registries will still affect