Use COMSPEC command interpreter to run .bat files.
[wine/multimedia.git] / documentation / getting.sgml
blob9113fa00bba60be089319b6c3c2d4074620ef6ef
1 <chapter id="getting-wine">
2 <title>Getting Wine</title>
4 <sect1>
5 <title>The Many Forms of Wine</title>
6 <para>
7 The standard Wine distribution includes quite a few different
8 executables, libraries, and configuration files. All of these
9 must be set up properly for Wine to work well. This chapter
10 will guide you through the necessary steps to get Wine
11 installed on your system.
12 </para>
13 <para>
14 If you are running a distribution of Linux that uses packages
15 to keep track of installed software, you may be in luck: A
16 prepackaged version of Wine may already exist for your system.
17 The first three sections will tell you how to find the latest
18 Wine packages and get them installed. You should be careful,
19 though, about mixing packages between different distributions,
20 and even from different versions of the same distribution.
21 Often a package will only work on the distribution it's
22 compiled for. We'll cover
23 <link linkend="getting-dist-debian">Debian</link>,
24 <link linkend="getting-dist-redhat">Redhat</link>, and
25 <link linkend="getting-dist-other">other</link> distributions.
26 </para>
27 <para>
28 If you're not lucky enough to have a package available for
29 your operating system, or if you'd prefer a newer version of
30 Wine than already exists as a package, you may have to
31 download the Wine source code and compile it yourself on your
32 own machine. Don't worry, it's not too hard to do this,
33 especially with the many helpful tools that come with Wine.
34 You don't need any programming experience to compile and
35 install Wine, although it might be nice to have some minor
36 UNIX administrative skills. We'll cover how to retrieve and
37 compile the official source releases from the <link
38 linkend="getting-source-ftp">FTP archives</link>, and also how
39 to get the cutting edge up-to-the-minute fresh Wine source
40 code from <link linkend="getting-source-cvs">CVS (Concurrent
41 Versions System)</link>. Both processes of source code
42 installation are similar, and once you master one, you should
43 have no trouble dealing with the other one.
44 </para>
45 <para>
46 Finally, you may someday need to know how to apply a source
47 code patch to your version of Wine. Perhaps you've uncovered
48 a bug in Wine, reported it to the <ulink
49 url="mailto:wine-devel@winehq.com">Wine mailing list</ulink>,
50 and received a patch from a developer to hopefully fix the
51 bug. The last section in this chapter will show you how to
52 <link linkend="getting-upgrading">safely apply the
53 patch</link> and revert it if the patch doesn't work.
54 </para>
55 </sect1>
57 <sect1 id="getting-dist-debian">
58 <title>Getting Wine for a Debian System</title>
60 <para>
61 In most cases on a Debian system, you can install Wine with a
62 single command, as root:
63 </para>
64 <screen>
65 # apt-get install wine
66 </screen>
67 <para>
68 <command>apt-get</command> will connect to a Debian archive
69 across the Internet (thus, you must be online), then download
70 the Wine package and install it on your system. End of story.
71 </para>
73 <para>
74 Of course, Debian's pre-packaged version of Wine may not be the
75 most recent release. If you are running the stable version of
76 Debian, you may be able to get a slightly newer version of Wine
77 by grabbing the package from the unstable distribution, although
78 this may be a little risky, depending on how far the unstable
79 distribution has diverged from the stable one. You can find a
80 list of Wine binary packages for the various Debian releases
81 using the package search engine at <ulink url="http://www.debian.org">
82 www.debian.org</ulink>.
83 </para>
85 <para>
86 To install a package that's not part of your distribution, you
87 must use <command>dpkg</command> instead of
88 <command>apt-get</command>. Since <command>dpkg</command>
89 doesn't download the file for you, you must do it yourself.
90 Follow the link on the package search engine to the desired
91 package, then click on the <guibutton>Go To Download
92 Page</guibutton> button and follow the instructions. Save the
93 file to your hard drive, then run <command>dpkg</command> on it.
94 For example, if you saved the file to your home directory, you
95 might perform the following actions to install it:
96 </para>
97 <screen>
98 $ su -
99 <emphasis>&lt;Type in root password&gt;</emphasis>
100 # cd /home/user
101 # dpkg -i wine_0.0.20021031-1.deb
102 </screen>
103 <para>
104 You may also want to install the
105 <systemitem>wine-doc</systemitem> package, and if you are
106 using Wine from the 2.3 distribution (Woody), the
107 <systemitem>wine-utils</systemitem> package as well.
108 </para>
109 </sect1>
111 <sect1 id="getting-dist-redhat">
112 <title>Getting Wine for a Redhat System</title>
114 <para>
115 Redhat/RPM users can use <ulink url="http://rpmfind.net/linux/RPM/">
116 rpmfind.net</ulink> to track down available Wine RPM binaries.
117 <ulink url="http://rpmfind.net/linux/RPM/WByName.html"> This
118 page</ulink> contains a list of all rpmfind packages that start with
119 the letter "W", including a few Wine packages.
120 </para>
122 <para>
123 Of course now that you have the RPM package, you may be wondering
124 "What in the world do I do with this thing?".
125 </para>
127 <para>
128 The easiest way to install an RPM is to make sure that you have not
129 previously installed wine (perhaps, when you installed linux)
130 and then switch to the directory you downloaded the rpm file to.
131 Once there, type this one command as root:
132 </para>
133 <screen>
134 # rpm -ivh wine-20020605-2.i386.rpm
135 </screen>
136 <para>
137 You may also want to install the
138 <systemitem>wine-devel</systemitem> package.
139 </para>
140 </sect1>
142 <sect1 id="getting-dist-other">
143 <title>Getting Wine for Other Distributions</title>
145 <para>
146 The first place you should look if your system isn't Debian or
147 Redhat is the <ulink
148 url="http://www.winehq.com/download/">WineHQ Download
149 Page</ulink>. This page lists many assorted archives of
150 binary (precompiled) Wine files.
151 </para>
153 <para>
154 <ulink url="http://ftpsearch.lycos.com/?form=medium">
155 Lycos FTPSearch</ulink> is another useful resource for
156 tracking down miscellaneous distribution packages.
157 </para>
159 <para>
160 NOTE: If you are running a Mandrake system, please see the page
161 on how to get wine for a
162 <link linkend="getting-dist-redhat">Redhat</link> system,
163 as Mandrake is based on Redhat.
164 </para>
166 <!-- *** Add other distributions, e.g., SUSE, Slackware *** -->
168 </sect1>
170 <sect1 id="getting-source-ftp">
171 <title>Getting Wine Source Code from the FTP Archive</title>
173 <para>
174 If the version of Wine you want does not exist in package form,
175 you can download the source code yourself and compile it on your
176 machine. Although this might seem a little intimidating at
177 first if you've never done it, you'll find that it'll often go
178 quite smoothly, especially on the newer Linux distributions.
179 </para>
181 <para>
182 The safest way to grab the source is from one of the official
183 FTP archives. An up to date listing is in the <ulink
184 url="http://www.winehq.com/source/ANNOUNCE">ANNOUNCE</ulink>
185 file in the Wine distribution (which you would have if you
186 already downloaded it). Here is a list
187 of FTP servers carrying Wine:
188 </para>
189 <itemizedlist>
190 <listitem>
191 <para>
192 <ulink url="ftp://ftp.ibiblio.org/pub/Linux/ALPHA/wine/development/">
193 ftp://ftp.ibiblio.org/pub/Linux/ALPHA/wine/development/
194 </ulink>
195 </para>
196 </listitem>
197 <listitem>
198 <para>
199 <ulink url="ftp://ftp.infomagic.com/pub/mirrors/linux/sunsite/ALPHA/wine/development/">
200 ftp://ftp.infomagic.com/pub/mirrors/linux/sunsite/ALPHA/wine/development/
201 </ulink>
202 </para>
203 </listitem>
204 <listitem>
205 <para>
206 <ulink url="ftp://ftp.fu-berlin.de/unix/linux/mirrors/sunsite.unc.edu/ALPHA/wine/development/">
207 ftp://ftp.fu-berlin.de/unix/linux/mirrors/sunsite.unc.edu/ALPHA/wine/development/
208 </ulink>
209 </para>
210 </listitem>
211 <listitem>
212 <para>
213 <ulink url="ftp://orcus.progsoc.uts.edu.au/pub/Wine/development/">
214 ftp://orcus.progsoc.uts.edu.au/pub/Wine/development/
215 </ulink>
216 </para>
217 </listitem>
218 </itemizedlist>
219 <para>
220 The official releases are tagged by date with the format
221 "Wine-YYYYMMDD.tar.gz". Your best bet is to grab the latest
222 one.
223 </para>
224 <para>
225 Once you have downloaded this, you must first compile wine, and then install it.
226 To do this is not very hard. First switch to the directory containing the file
227 you just downloaded. Then extract the source with (e.g.):
228 </para>
229 <screen>
230 # tar xzvf wine-20021031.tar.gz
231 </screen>
232 <para>
233 Then, switch to the directory that was created and compile it by typing (e.g.):
234 </para>
235 <screen>
236 # ./tools/wineinstall
237 </screen>
238 <para>
239 NOTE: You must make sure that you are not the superuser (root) when doing this,
240 and that you have write permission to the directory that was created by the tar
241 command as well as all of its subdirectories and files..
242 </para>
243 </sect1>
245 <sect1 id="getting-source-cvs">
246 <title>Getting Wine Source Code from CVS</title>
248 <para>
249 The official web page for Wine CVS is
250 <ulink url="http://www.winehq.com/development/">
251 http://www.winehq.com/development/</ulink>.
252 </para>
253 <para>
254 First, you need to get a copy of the latest Wine sources
255 using CVS. You can tell it where to find the source tree by
256 setting the <envar>CVSROOT</envar> environment variable. You
257 also have to log in anonymously to the wine CVS server. In
258 <command>bash</command>, it might look something like this:
259 </para>
260 <screen>
261 $ export CVSROOT=:pserver:cvs@cvs.winehq.com:/home/wine
262 $ cvs login
263 Password: cvs
264 $ cvs checkout wine
265 </screen>
266 <para>
267 That'll pull down the entire Wine source tree from
268 winehq.com and place it in the current directory (actually
269 in the 'wine' subdirectory). CVS has a million command line
270 parameters, so there are many ways to pull down files, from
271 anywhere in the revision history. Later, you can grab just
272 the updates:
273 </para>
274 <screen>
275 $ cvs -PAd update
276 </screen>
277 <para>
278 <command>cvs update</command> works from inside the source tree.
279 You don't need the <envar>CVSROOT</envar> environment variable
280 to run it either. You just have to be inside the source tree.
281 The <parameter>-P</parameter>, <parameter>-A</parameter> and <parameter>-d</parameter>
282 options make sure your local Wine tree directory structure stays
283 in sync with the remote repository.
284 </para>
285 <para>
286 After you've made changes, you can create a patch with
287 <command>cvs diff -u</command>, which sends output to stdout
288 (the <parameter>-u</parameter> controls the format of the
289 patch). So, to create an <filename>my_patch.diff</filename>
290 file, you would do this:
291 </para>
292 <screen>
293 $ cvs diff -u > my_patch.diff
294 </screen>
295 <para>
296 You can call <command>cvs diff</command> from anywhere in the
297 tree (just like <command>cvs update</command>), and it will
298 always grab recursively from that point. You can also specify
299 single files or subdirectories:
300 </para>
301 <screen>
302 $ cvs diff -u dlls/winaspi > my_aspi_patch.diff
303 </screen>
304 <para>
305 Experiment around a little. It's fairly intuitive.
306 </para>
307 </sect1>
309 <sect1 id="getting-upgrading">
310 <title>Upgrading Wine with a Patch</title>
311 <para>
312 If you have the Wine source code, as opposed to a binary
313 distribution, you have the option of applying patches to the
314 source tree to fix bugs and add experimental features.
315 Perhaps you've found a bug, reported it to the <ulink
316 url="mailto:wine-devel@winehq.com">Wine mailing list</ulink>,
317 and received a patch file to fix the bug. You can apply the
318 patch with the <command>patch</command> command, which takes a
319 streamed patch from <filename>stdin</filename>:
320 </para>
321 <screen>
322 $ cd wine
323 $ patch -p0 < ../patch_to_apply.diff
324 </screen>
325 <para>
326 To remove the patch, use the <parameter>-R</parameter> option:
327 </para>
328 <screen>
329 $ patch -p0 -R < ../patch_to_apply.diff
330 </screen>
331 <para>
332 If you want to do a test run to see if the patch will apply
333 successfully (e.g., if the patch was created from an older or
334 newer version of the tree), you can use the
335 <parameter>--dry-run</parameter> parameter to run the patch
336 without writing to any files:
337 </para>
338 <screen>
339 $ patch -p0 --dry-run < ../patch_to_apply.diff
340 </screen>
341 <para>
342 <command>patch</command> is pretty smart about extracting
343 patches from the middle of a file, so if you save an email with
344 an inlined patch to a file on your hard drive, you can invoke
345 patch on it without stripping out the email headers and other
346 text. <command>patch</command> ignores everything that doesn't
347 look like a patch.
348 </para>
349 <para>
350 The <parameter>-p0</parameter> option to <command>patch</command>
351 tells it to keep the full file name from the patch file. For example,
352 if the file name in the patch file was
353 <filename>wine/programs/clock/main.c</filename>.
354 Setting the <parameter>-p0</parameter> option would apply the patch
355 to the file of the same name i.e.
356 <filename>wine/programs/clock/main.c </filename>.
357 Setting the <parameter>-p1</parameter> option would strip off the
358 first part of the file name and apply
359 the patch instead to <filename>programs/clock/main.c </filename>.
360 The <parameter>-p1</parameter> option would be useful if you named
361 your top level wine directory differently to the person who sent you
362 the patch. For the <parameter>-p1</parameter> option
363 <command>patch</command> should be run from the top level wine directory.
365 </para>
366 </sect1>
368 </chapter>
370 <!-- Keep this comment at the end of the file
371 Local variables:
372 mode: sgml
373 sgml-parent-document:("wine-doc.sgml" "set" "book" "chapter" "")
374 End: