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>
207 <para>Contains HKEY_LOCAL_MACHINE.</para>
211 <term><filename>wine.userreg</filename></term>
213 <para>Contains HKEY_USERS.</para>
220 <title>System administration</title>
223 With the above file structure, it is possible for a system
224 administrator to configure the system so that a system Wine
225 installation (and applications) can be shared by all the
226 users, and still let the users all have their own personalized
227 configuration. An administrator can, after having installed
228 Wine and any Windows application software he wants the users
229 to have access to, copy the resulting
230 <filename>system.reg</filename> and
231 <filename>wine.userreg</filename> over to the global registry
232 files (which we assume will reside in
233 <filename>/usr/local/etc</filename> here), with:
237 cp system.reg /usr/local/etc/wine.systemreg
238 cp wine.userreg /usr/local/etc/wine.userreg
241 and perhaps even symlink these back to the administrator's
242 account, to make it easier to install apps system-wide later:
245 ln -sf /usr/local/etc/wine.systemreg system.reg
246 ln -sf /usr/local/etc/wine.userreg wine.userreg
249 Note that the <filename>tools/wineinstall</filename> script
250 already does all of this for you, if you install Wine source as root.
251 If you then install Windows applications while logged in as
252 root, all your users will automatically be able to use them.
253 While the application setup will be taken from the global
254 registry, the users' personalized configurations will be saved
255 in their own home directories.
258 But be careful with what you do with the administrator account
259 - if you do copy or link the administrator's registry to the
260 global registry, any user might be able to read the
261 administrator's preferences, which might not be good if
262 sensitive information (passwords, personal information, etc)
263 is stored there. Only use the administrator account to install
264 software, not for daily work; use an ordinary user account for
270 <title>The [registry] section</title>
273 Now let's look at the <link linkend="config-file">Wine
274 configuration file</link> options for handling the registry.
279 <term>GlobalRegistryDir</term>
282 Optional. Sets the path to look for the Global
288 <term>LoadGlobalRegistryFiles</term>
291 Controls whether to try to load the global registry
292 files, if they exist.
297 <term>LoadHomeRegistryFiles</term>
300 Controls whether to try to load the user's registry
301 files (in the <filename>.wine</filename> subdirectory of
302 the user's home directory).
307 <term>LoadWindowsRegistryFiles</term>
310 Controls whether Wine will attempt to load registry data
311 from a real Windows registry in an existing MS Windows
317 <term>WritetoHomeRegistryFiles</term>
320 Controls whether registry data will be written to the
321 user's registry files. (Currently, there is no
322 alternative, so if you turn this off, Wine cannot save
323 the registry on disk at all; after you exit Wine, your
324 changes will be lost.)
329 <term>SaveOnlyUpdatedKeys</term>
332 Controls whether the entire registry is saved to the
333 user's registry files, or only subkeys the user have
334 actually changed. Considering that the user's registry
335 will override any global registry files and Windows
336 registry files, it usually makes sense to only save
337 user-modified subkeys; that way, changes to the rest of
338 the global or Windows registries will still affect the
344 <term>PeriodicSave</term>
347 If this option is set to a nonzero value, it specifies
348 that you want the registry to be saved to disk at the
349 given interval. If it is not set, the registry will only
350 be saved to disk when the wineserver terminates.
355 <term>UseNewFormat</term>
358 This option is obsolete. Wine now always uses the new
359 format; support for the old format was removed a while
368 <!-- Keep this comment at the end of the file
371 sgml-parent-document:("configuring.sgml" "chapter" "sect1" "")