2 <title>The Registry</title>
5 Originally written by Ove Kåven
9 After Win3.x, the registry became a fundamental part of Windows.
10 It is the place where both Windows itself, and all
11 Win95/98/NT/2000/whatever-compliant applications, store
12 configuration and state data. While most sane system
13 administrators (and Wine developers) curse badly at the twisted
14 nature of the Windows registry, it is still necessary for Wine
15 to support it somehow.
19 <title>The default registry</title>
22 A Windows registry contains many keys by default, and some of
23 them are necessary for even installers to operate correctly.
24 The keys that the Wine developers have found necessary to
25 install applications are distributed in a file called
26 <filename>winedefault.reg</filename>. It is automatically
27 installed for you if you use the
28 <filename>tools/wineinstall</filename> script in the Wine source,
29 but if you want to install it manually, you can do so by using the
30 <command>regedit</command> tool to be found in the
31 <filename>programs/regedit/</filename>
32 directory in Wine source.
33 <filename>winedefault.reg</filename> should even be applied if
34 you plan to use a native Windows registry, since Wine needs some
35 specific registry settings in its registry (for special
36 workarounds for certain programs etc.).
37 In the main Wine source code directory in a <glossterm>terminal</glossterm>, run:
40 <prompt>$ </><userinput>cd programs/regedit</>
41 <prompt>$ </><userinput>./regedit ../../winedefault.reg</>
46 <title>Using a Windows registry</title>
49 If you point Wine at an existing Windows installation (by
50 setting the appropriate directories in
51 <filename>~/.wine/config</filename>, then Wine is able to load
52 registry data from it. However, Wine will not save anything to
53 the real Windows registry, but rather to its own registry
54 files (see below). Of course, if a particular registry value
55 exists in both the Windows registry and in the Wine registry,
56 then Wine will use the latter. In the Wine config file, there
57 are a number of configuration settings in the [registry] section
58 (see below) specific to the handling of Windows registry content by Wine.
61 Occasionally, Wine may have trouble loading the Windows
62 registry. Usually, this is because the registry is
63 inconsistent or damaged in some way. If that becomes a
64 problem, you may want to download the
65 <filename>regclean.exe</filename> from the MS website and use
66 it to clean up the registry. Alternatively, you can always use
67 <filename>regedit.exe</filename> to export the registry data
68 you want into a text file, and then import it in Wine.
73 <title>The Registry</title>
75 The initial default registry content to be used by the Wine
76 registry files is in the file
77 <filename>winedefault.reg</filename>. It contains directory
78 paths, class IDs, and more; it must be installed before most
79 <filename>INSTALL.EXE</filename> or
80 <filename>SETUP.EXE</filename> applications will work.
85 <title>Registry structure</title>
88 The Windows registry is an elaborate tree structure, and not
89 even most Windows programmers are fully aware of how the
90 registry is laid out, with its different "hives" and numerous
91 links between them; a full coverage is out of the scope of
92 this document. But here are the basic registry keys you might
93 need to know about for now.
99 <term>HKEY_LOCAL_MACHINE</term>
102 This fundamental root key (in win9x it's stored in the
103 hidden file <filename>system.dat</filename>) contains
104 everything pertaining to the current Windows
110 <term>HKEY_USERS</term>
113 This fundamental root key (in win9x it's stored in the
114 hidden file <filename>user.dat</filename>) contains
115 configuration data for every user of the installation.
120 <term>HKEY_CLASSES_ROOT</term>
123 This is a link to HKEY_LOCAL_MACHINE\Software\Classes.
124 It contains data describing things like file
125 associations, OLE document handlers, and COM classes.
130 <term>HKEY_CURRENT_USER</term>
133 This is a link to HKEY_USERS\your_username, i.e., your
134 personal configuration.
142 <title>Wine registry data files</title>
145 In the user's home directory, there is a subdirectory named
146 <filename>.wine</filename>, where Wine will try to save its
147 registry by default. It saves into four files, which are:
152 <term><filename>system.reg</filename></term>
155 This file contains HKEY_LOCAL_MACHINE.
160 <term><filename>user.reg</filename></term>
163 This file contains HKEY_CURRENT_USER.
168 <term><filename>userdef.reg</filename></term>
171 This file contains HKEY_USERS\.Default (i.e. the default
177 <term><filename>wine.userreg</filename></term>
180 Wine saves HKEY_USERS to this file (both current and
181 default user), but does not load from it, unless
182 <filename>userdef.reg</filename> is missing.
188 All of these files are human-readable text files, so unlike
189 Windows, you can actually use an ordinary text editor on them
190 if you want (make sure you don't have Wine running when modifying
191 them, otherwise your changes will be discarded).
194 FIXME: global configuration currently not implemented.
196 In addition to these files, Wine can also optionally load from
197 global registry files residing in the same directory as the
198 global <filename>wine.conf</filename> (i.e.
199 <filename>/usr/local/etc</filename> if you compiled from
205 <term><filename>wine.systemreg</filename></term>
208 Contains HKEY_LOCAL_MACHINE.
213 <term><filename>wine.userreg</filename></term>
224 <title>System administration</title>
227 With the above file structure, it is possible for a system
228 administrator to configure the system so that a system Wine
229 installation (and applications) can be shared by all the
230 users, and still let the users all have their own personalized
231 configuration. An administrator can, after having installed
232 Wine and any Windows application software he wants the users
233 to have access to, copy the resulting
234 <filename>system.reg</filename> and
235 <filename>wine.userreg</filename> over to the global registry
236 files (which we assume will reside in
237 <filename>/usr/local/etc</filename> here), with:
241 cp system.reg /usr/local/etc/wine.systemreg
242 cp wine.userreg /usr/local/etc/wine.userreg
245 and perhaps even symlink these back to the administrator's
246 account, to make it easier to install apps system-wide later:
249 ln -sf /usr/local/etc/wine.systemreg system.reg
250 ln -sf /usr/local/etc/wine.userreg wine.userreg
253 Note that the <filename>tools/wineinstall</filename> script
254 already does all of this for you, if you install Wine source as root.
255 If you then install Windows applications while logged in as
256 root, all your users will automatically be able to use them.
257 While the application setup will be taken from the global
258 registry, the users' personalized configurations will be saved
259 in their own home directories.
262 But be careful with what you do with the administrator account
263 - if you do copy or link the administrator's registry to the
264 global registry, any user might be able to read the
265 administrator's preferences, which might not be good if
266 sensitive information (passwords, personal information, etc)
267 is stored there. Only use the administrator account to install
268 software, not for daily work; use an ordinary user account for
274 <title>The [registry] section</title>
277 Now let's look at the <link linkend="config-file">Wine
278 configuration file</link> options for handling the registry.
283 <term>GlobalRegistryDir</term>
286 Optional. Sets the path to look for the Global
292 <term>LoadGlobalRegistryFiles</term>
295 Controls whether to try to load the global registry
296 files, if they exist.
301 <term>LoadHomeRegistryFiles</term>
304 Controls whether to try to load the user's registry
305 files (in the <filename>.wine</filename> subdirectory of
306 the user's home directory).
311 <term>LoadWindowsRegistryFiles</term>
314 Controls whether Wine will attempt to load registry data
315 from a real Windows registry in an existing MS Windows
321 <term>WritetoHomeRegistryFiles</term>
324 Controls whether registry data will be written to the
325 user's registry files. (Currently, there is no
326 alternative, so if you turn this off, Wine cannot save
327 the registry on disk at all; after you exit Wine, your
328 changes will be lost.)
333 <term>SaveOnlyUpdatedKeys</term>
336 Controls whether the entire registry is saved to the
337 user's registry files, or only subkeys the user have
338 actually changed. Considering that the user's registry
339 will override any global registry files and Windows
340 registry files, it usually makes sense to only save
341 user-modified subkeys; that way, changes to the rest of
342 the global or Windows registries will still affect the
348 <term>PeriodicSave</term>
351 If this option is set to a nonzero value, it specifies
352 that you want the registry to be saved to disk at the
353 given interval. If it is not set, the registry will only
354 be saved to disk when the wineserver terminates.
359 <term>UseNewFormat</term>
362 This option is obsolete. Wine now always uses the new
363 format; support for the old format was removed a while
372 <!-- Keep this comment at the end of the file
375 sgml-parent-document:("configuring.sgml" "chapter" "sect1" "")