2 <title>The Registry</title>
8 (Extracted from <filename>wine/documentation/registry</filename>)
12 After Win3.x, the registry became a fundamental part of Windows.
13 It is the place where both Windows itself, and all
14 Win95/98/NT/2000/whatever-compliant applications, store
15 configuration and state data. While most sane system
16 administrators (and Wine developers) curse badly at the twisted
17 nature of the Windows registry, it is still necessary for Wine
18 to support it somehow.
22 <title>Registry structure</title>
25 The Windows registry is an elaborate tree structure, and not
26 even most Windows programmers are fully aware of how the
27 registry is laid out, with its different "hives" and numerous
28 links between them; a full coverage is out of the scope of
29 this document. But here are the basic registry keys you might
30 need to know about for now.
36 <term>HKEY_LOCAL_MACHINE</term>
39 This fundamental root key (in win9x it's stored in the
40 hidden file <filename>system.dat</filename>) contains
41 everything pertaining to the current Windows
47 <term>HKEY_USERS</term>
50 This fundamental root key (in win9x it's stored in the
51 hidden file <filename>user.dat</filename>) contains
52 configuration data for every user of the installation.
57 <term>HKEY_CLASSES_ROOT</term>
60 This is a link to HKEY_LOCAL_MACHINE\Software\Classes.
61 It contains data describing things like file
62 associations, OLE document handlers, and COM classes.
67 <term>HKEY_CURRENT_USER</term>
70 This is a link to HKEY_USERS\your_username, i.e., your
71 personal configuration.
79 <title>Using a Windows registry</title>
82 If you point Wine at an existing MS Windows installation (by
83 setting the appropriate directories in
84 <filename>~/.wine/config</filename>, then Wine is able to load
85 registry data from it. However, Wine will not save anything to
86 the real Windows registry, but rather to its own registry
87 files (see below). Of course, if a particular registry value
88 exists in both the Windows registry and in the Wine registry,
89 then Wine will use the latter.
92 Occasionally, Wine may have trouble loading the Windows
93 registry. Usually, this is because the registry is
94 inconsistent or damaged in some way. If that becomes a
95 problem, you may want to download the
96 <filename>regclean.exe</filename> from the MS website and use
97 it to clean up the registry. Alternatively, you can always use
98 <filename>regedit.exe</filename> to export the registry data
99 you want into a text file, and then import it in Wine.
104 <title>Wine registry data files</title>
107 In the user's home directory, there is a subdirectory named
108 <filename>.wine</filename>, where Wine will try to save its
109 registry by default. It saves into four files, which are:
114 <term><filename>system.reg</filename></term>
117 This file contains HKEY_LOCAL_MACHINE.
122 <term><filename>user.reg</filename></term>
125 This file contains HKEY_CURRENT_USER.
130 <term><filename>userdef.reg</filename></term>
133 This file contains HKEY_USERS\.Default (i.e. the default
139 <term><filename>wine.userreg</filename></term>
142 Wine saves HKEY_USERS to this file (both current and
143 default user), but does not load from it, unless
144 <filename>userdef.reg</filename> is missing.
150 All of these files are human-readable text files, so unlike
151 Windows, you can actually use an ordinary text editor on them
152 if you want (make sure you don't have Wine running when modifying
153 them, otherwise your changes will be discarded).
156 FIXME: global config currently not implemented.
158 In addition to these files, Wine can also optionally load from
159 global registry files residing in the same directory as the
160 global <filename>wine.conf</filename> (i.e.
161 <filename>/usr/local/etc</filename> if you compiled from
167 <term><filename>wine.systemreg</filename></term>
169 <para>Contains HKEY_LOCAL_MACHINE.</para>
173 <term><filename>wine.userreg</filename></term>
175 <para>Contains HKEY_USERS.</para>
182 <title>System administration</title>
185 With the above file structure, it is possible for a system
186 administrator to configure the system so that a system Wine
187 installation (and applications) can be shared by all the
188 users, and still let the users all have their own personalized
189 configuration. An administrator can, after having installed
190 Wine and any Windows application software he wants the users
191 to have access to, copy the resulting
192 <filename>system.reg</filename> and
193 <filename>wine.userreg</filename> over to the global registry
194 files (which we assume will reside in
195 <filename>/usr/local/etc</filename> here), with:
199 cp system.reg /usr/local/etc/wine.systemreg
200 cp wine.userreg /usr/local/etc/wine.userreg
203 and perhaps even symlink these back to the administrator's
204 account, to make it easier to install apps system-wide later:
207 ln -sf /usr/local/etc/wine.systemreg system.reg
208 ln -sf /usr/local/etc/wine.userreg wine.userreg
211 Note that the <filename>tools/wineinstall</filename> script
212 already does all of this for you, if you install Wine source as root.
213 If you then install Windows applications while logged in as
214 root, all your users will automatically be able to use them.
215 While the application setup will be taken from the global
216 registry, the users' personalized configurations will be saved
217 in their own home directories.
220 But be careful with what you do with the administrator account
221 - if you do copy or link the administrator's registry to the
222 global registry, any user might be able to read the
223 administrator's preferences, which might not be good if
224 sensitive information (passwords, personal information, etc)
225 is stored there. Only use the administrator account to install
226 software, not for daily work; use an ordinary user account for
232 <title>The default registry</title>
235 A Windows registry contains many keys by default, and some of
236 them are necessary for even installers to operate correctly.
237 The keys that the Wine developers have found necessary to
238 install applications are distributed in a file called
239 <filename>winedefault.reg</filename>. It is automatically
240 installed for you if you use the
241 <filename>tools/wineinstall</filename> script in the Wine source,
242 but if you want to install it manually, you can do so by using the
243 <command>regapi</command> tool to be found in the
244 <filename>programs/regapi/</filename>
245 directory in Wine source.
250 <title>The [registry] section</title>
253 With the above information fresh in mind, let's look at the
254 <filename>wine.conf</filename> / <filename>~/.wine/config</filename>
255 options for handling the registry.
260 <term>LoadGlobalRegistryFiles</term>
263 Controls whether to try to load the global registry
264 files, if they exist.
269 <term>LoadHomeRegistryFiles</term>
272 Controls whether to try to load the user's registry
273 files (in the <filename>.wine</filename> subdirectory of
274 the user's home directory).
279 <term>LoadWindowsRegistryFiles</term>
282 Controls whether Wine will attempt to load registry data
283 from a real Windows registry in an existing MS Windows
289 <term>WritetoHomeRegistryFiles</term>
292 Controls whether registry data will be written to the
293 user's registry files. (Currently, there is no
294 alternative, so if you turn this off, Wine cannot save
295 the registry on disk at all; after you exit Wine, your
296 changes will be lost.)
301 <term>SaveOnlyUpdatedKeys</term>
304 Controls whether the entire registry is saved to the
305 user's registry files, or only subkeys the user have
306 actually changed. Considering that the user's registry
307 will override any global registry files and Windows
308 registry files, it usually makes sense to only save
309 user-modified subkeys; that way, changes to the rest of
310 the global or Windows registries will still affect the
316 <term>PeriodicSave</term>
319 If this option is set to a nonzero value, it specifies
320 that you want the registry to be saved to disk at the
321 given interval. If it is not set, the registry will only
322 be saved to disk when the wineserver terminates.
327 <term>UseNewFormat</term>
330 This option is obsolete. Wine now always uses the new
331 format; support for the old format was removed a while
340 <!-- Keep this comment at the end of the file
343 sgml-parent-document:("configuring.sgml" "chapter" "sect1" "")