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, 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, 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.conf</filename> or
85 <filename>.winerc</filename>), then Wine is able to load
86 registry data from it. However, Wine will not save anything to
87 the real Windows registry, but rather to its own registry
88 files (see below). Of course, if a particular registry value
89 exists in both the Windows registry and in the Wine registry,
90 then Wine will use the latter.
93 Occasionally, Wine may have trouble loading the Windows
94 registry. Usually, this is because the registry is
95 inconsistent or damaged in some way. If that becomes a
96 problem, you may want to download the
97 <filename>regclean.exe</filename> from the MS website and use
98 it to clean up the registry. Alternatively, you can always use
99 <filename>regedit.exe</filename> to export the registry data
100 you want into a text file, and then import it in Wine.
105 <title>Wine registry data filesr</title>
108 In the user's home directory, there is a subdirectory named
109 <filename>.wine</filename>, where Wine will try to save its
110 registry by default. It saves into four files, which are:
115 <term><filename>system.reg</filename></term>
118 This file contains HKEY_LOCAL_MACHINE.
123 <term><filename>user.reg</filename></term>
126 This file contains HKEY_CURRENT_USER.
131 <term><filename>userdef.reg</filename></term>
134 This file contains HKEY_USERS\.Default (i.e. the default
140 <term><filename>wine.userreg</filename></term>
143 Wine saves HKEY_USERS to this file (both current and
144 default user), but does not load from it, unless
145 <filename>userdef.reg</filename> is missing.
151 All of these files are human-readable text files, so unlike
152 Windows, you can actually use an ordinary text editor on them
156 In addition to these files, Wine can also optionally load from
157 global registry files residing in the same directory as the
158 global <filename>wine.conf</filename> (i.e.
159 <filename>/usr/local/etc</filename> if you compiled from
165 <term><filename>wine.systemreg</filename></term>
167 <para>Contains HKEY_LOCAL_MACHINE.</para>
171 <term><filename>wine.userreg</filename></term>
173 <para>Contains HKEY_USERS.</para>
180 <title>System administration</title>
183 With the above file structure, it is possible for a system
184 administrator to configure the system so that a system Wine
185 installation (and applications) can be shared by all the
186 users, and still let the users all have their own personalized
187 configuration. An administrator can, after having installed
188 Wine and any Windows application software he wants the users
189 to have access to, copy the resulting
190 <filename>system.reg</filename> and
191 <filename>wine.userreg</filename> over to the global registry
192 files (which we assume will reside in
193 <filename>/usr/local/etc</filename> here), with:
197 cp system.reg /usr/local/etc/wine.systemreg
198 cp wine.userreg /usr/local/etc/wine.userreg
201 and perhaps even symlink these back to the administrator's
202 account, to make it easier to install apps system-wide later:
205 ln -sf /usr/local/etc/wine.systemreg system.reg
206 ln -sf /usr/local/etc/wine.userreg wine.userreg
209 Note that the <filename>tools/wineinstall</filename> script
210 already does all of this for you, if you install Wine as root.
211 If you then install Windows applications while logged in as
212 root, all your users will automatically be able to use them.
213 While the application setup will be taken from the global
214 registry, the users' personalized configurations will be saved
215 in their own home directories.
218 But be careful with what you do with the administrator account
219 - if you do copy or link the administrator's registry to the
220 global registry, any user might be able to read the
221 administrator's preferences, which might not be good if
222 sensitive information (passwords, personal information, etc)
223 is stored there. Only use the administrator account to install
224 software, not for daily work; use an ordinary user account for
230 <title>The default registry</title>
233 A Windows registry contains many keys by default, and some of
234 them are necessary for even installers to operate correctly.
235 The keys that the Wine developers have found necessary to
236 install applications are distributed in a file called
237 <filename>winedefault.reg</filename>. It is automatically
238 installed for you if you use the
239 <filename>tools/wineinstall</filename> script, but if you want
240 to install it manually, you can do so by using the
241 <command>regapi</command> tool. You can find more information
243 <filename>documentation/no-windows</filename> document in the
249 <title>The [registry] section</title>
252 With the above information fresh in mind, let's look at the
253 <filename>wine.conf</filename>/<filename>.winerc</filename>
254 options for handling the registry.
259 <term>LoadGlobalRegistryFiles</term>
262 Controls whether to try to load the global registry
263 files, if they exist.
268 <term>LoadHomeRegistryFiles</term>
271 Controls whether to try to load the user's registry
272 files (in the <filename>.wine</filename> subdirectory of
273 the user's home directory).
278 <term>LoadWindowsRegistryFiles</term>
281 Controls whether Wine will attempt to load registry data
282 from a real Windows registry in an existing MS Windows
288 <term>WritetoHomeRegistryFiles</term>
291 Controls whether registry data will be written to the
292 user's registry files. (Currently, there is no
293 alternative, so if you turn this off, Wine cannot save
294 the registry on disk at all; after you exit Wine, your
295 changes will be lost.)
300 <term>UseNewFormat</term>
303 This option is obsolete. Wine now always use the new
304 format; support for the old format was removed a while
310 <term>PeriodicSave</term>
313 If this option is set to a nonzero value, it specifies
314 that you want the registry to be saved to disk at the
315 given interval. If it is not set, the registry will only
316 be saved to disk when the wineserver terminates.
321 <term>SaveOnlyUpdatedKeys</term>
324 Controls whether the entire registry is saved to the
325 user's registry files, or only subkeys the user have
326 actually changed. Considering that the user's registry
327 will override any global registry files and Windows
328 registry files, it usually makes sense to only save
329 user-modified subkeys; that way, changes to the rest of
330 the global or Windows registries will still affect the
339 <!-- Keep this comment at the end of the file
342 sgml-parent-document:("configuring.sgml" "chapter" "sect1" "")