Dutch localisation of language group names.
[wine/multimedia.git] / documentation / registry.sgml
blobec9e5171069511efbaac3e3fb2450861d6152019
1 <sect1 id="registry">
2 <title>The Registry</title>
4 <para>
5 Originally written by Ove Kåven
6 </para>
8 <para>
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.
16 </para>
18 <sect2>
19 <title>The default registry</title>
21 <para>
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:
38 </para>
39 <screen>
40 <prompt>$ </><userinput>cd programs/regedit</>
41 <prompt>$ </><userinput>./regedit ../../winedefault.reg</>
42 </screen>
43 </sect2>
45 <sect2>
46 <title>Using a Windows registry</title>
48 <para>
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.
59 </para>
60 <para>
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.
69 </para>
70 </sect2>
72 <sect2>
73 <title>The Registry</title>
74 <para>
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.
81 </para>
82 </sect2>
84 <sect2>
85 <title>Registry structure</title>
87 <para>
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.
94 </para>
97 <variablelist>
98 <varlistentry>
99 <term>HKEY_LOCAL_MACHINE</term>
100 <listitem>
101 <para>
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
105 installation.
106 </para>
107 </listitem>
108 </varlistentry>
109 <varlistentry>
110 <term>HKEY_USERS</term>
111 <listitem>
112 <para>
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.
116 </para>
117 </listitem>
118 </varlistentry>
119 <varlistentry>
120 <term>HKEY_CLASSES_ROOT</term>
121 <listitem>
122 <para>
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.
126 </para>
127 </listitem>
128 </varlistentry>
129 <varlistentry>
130 <term>HKEY_CURRENT_USER</term>
131 <listitem>
132 <para>
133 This is a link to HKEY_USERS\your_username, i.e., your
134 personal configuration.
135 </para>
136 </listitem>
137 </varlistentry>
138 </variablelist>
139 </sect2>
141 <sect2>
142 <title>Wine registry data files</title>
144 <para>
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:
148 </para>
150 <variablelist>
151 <varlistentry>
152 <term><filename>system.reg</filename></term>
153 <listitem>
154 <para>
155 This file contains HKEY_LOCAL_MACHINE.
156 </para>
157 </listitem>
158 </varlistentry>
159 <varlistentry>
160 <term><filename>user.reg</filename></term>
161 <listitem>
162 <para>
163 This file contains HKEY_CURRENT_USER.
164 </para>
165 </listitem>
166 </varlistentry>
167 <varlistentry>
168 <term><filename>userdef.reg</filename></term>
169 <listitem>
170 <para>
171 This file contains HKEY_USERS\.Default (i.e. the default
172 user settings).
173 </para>
174 </listitem>
175 </varlistentry>
176 <varlistentry>
177 <term><filename>wine.userreg</filename></term>
178 <listitem>
179 <para>
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.
183 </para>
184 </listitem>
185 </varlistentry>
186 </variablelist>
187 <para>
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).
192 </para>
193 <para>
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
200 source). These are:
201 </para>
203 <variablelist>
204 <varlistentry>
205 <term><filename>wine.systemreg</filename></term>
206 <listitem>
207 <para>Contains HKEY_LOCAL_MACHINE.</para>
208 </listitem>
209 </varlistentry>
210 <varlistentry>
211 <term><filename>wine.userreg</filename></term>
212 <listitem>
213 <para>Contains HKEY_USERS.</para>
214 </listitem>
215 </varlistentry>
216 </variablelist>
217 </sect2>
219 <sect2>
220 <title>System administration</title>
222 <para>
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:
234 </para>
235 <screen>
236 cd ~/.wine
237 cp system.reg /usr/local/etc/wine.systemreg
238 cp wine.userreg /usr/local/etc/wine.userreg
239 </screen>
240 <para>
241 and perhaps even symlink these back to the administrator's
242 account, to make it easier to install apps system-wide later:
243 </para>
244 <screen>
245 ln -sf /usr/local/etc/wine.systemreg system.reg
246 ln -sf /usr/local/etc/wine.userreg wine.userreg
247 </screen>
248 <para>
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.
256 </para>
257 <para>
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
265 that.
266 </para>
267 </sect2>
269 <sect2>
270 <title>The [registry] section</title>
272 <para>
273 Now let's look at the <link linkend="config-file">Wine
274 configuration file</link> options for handling the registry.
275 </para>
277 <variablelist>
278 <varlistentry>
279 <term>GlobalRegistryDir</term>
280 <listitem>
281 <para>
282 Optional. Sets the path to look for the Global
283 Registry.
284 </para>
285 </listitem>
286 </varlistentry>
287 <varlistentry>
288 <term>LoadGlobalRegistryFiles</term>
289 <listitem>
290 <para>
291 Controls whether to try to load the global registry
292 files, if they exist.
293 </para>
294 </listitem>
295 </varlistentry>
296 <varlistentry>
297 <term>LoadHomeRegistryFiles</term>
298 <listitem>
299 <para>
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).
303 </para>
304 </listitem>
305 </varlistentry>
306 <varlistentry>
307 <term>LoadWindowsRegistryFiles</term>
308 <listitem>
309 <para>
310 Controls whether Wine will attempt to load registry data
311 from a real Windows registry in an existing MS Windows
312 installation.
313 </para>
314 </listitem>
315 </varlistentry>
316 <varlistentry>
317 <term>WritetoHomeRegistryFiles</term>
318 <listitem>
319 <para>
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.)
325 </para>
326 </listitem>
327 </varlistentry>
328 <varlistentry>
329 <term>SaveOnlyUpdatedKeys</term>
330 <listitem>
331 <para>
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
339 user.
340 </para>
341 </listitem>
342 </varlistentry>
343 <varlistentry>
344 <term>PeriodicSave</term>
345 <listitem>
346 <para>
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.
351 </para>
352 </listitem>
353 </varlistentry>
354 <varlistentry>
355 <term>UseNewFormat</term>
356 <listitem>
357 <para>
358 This option is obsolete. Wine now always uses the new
359 format; support for the old format was removed a while
360 ago.
361 </para>
362 </listitem>
363 </varlistentry>
364 </variablelist>
365 </sect2>
366 </sect1>
368 <!-- Keep this comment at the end of the file
369 Local variables:
370 mode: sgml
371 sgml-parent-document:("configuring.sgml" "chapter" "sect1" "")
372 End: