1 <chapter id="installing">
2 <title>Installing/compiling Wine</title>
3 <para>How to install Wine...</para>
5 <sect1 id="replace-windows" xreflabel="--Installing Section--">
6 <title>WWN #52 Feature: Replacing Windows</title>
9 Written by &name-ove-kaaven; <email>&email-ove-kaaven;</email>
14 <title>Installation Overview</title>
17 A Windows installation consists of many different parts.
23 Registry. Many keys are supposed to exist and contain
24 meaningful data, even in a newly-installed Windows.
29 Directory structure. Applications expect to find and/or
30 install things in specific predetermined locations. Most
31 of these directories are expected to exist. But unlike
32 Unix directory structures, most of these locations are
33 not hardcoded, and can be queried via the Windows API
34 and the registry. This places additional requirements on
40 System DLLs. In Windows, these usually reside in the
41 <filename>system</filename> (or
42 <filename>system32</filename>) directories. Some Windows
43 applications check for their existence in these
44 directories before attempting to load them. While Wine
45 is able to load its own internal DLLs
46 (<filename>.so</filename> files) when the application
47 asks for a DLL, Wine does not simulate the existence of
54 While the users are of course free to set up everything
55 themselves, the Wine team will make the automated Wine source
56 installation script, <filename>tools/wineinstall</filename>,
57 do everything we find necessary to do; running the
58 conventional <userinput>configure && make depend && make && make
59 install</userinput> cycle is thus not recommended, unless
60 you know what you're doing. At the moment,
61 <filename>tools/wineinstall</filename> is able to create a
62 configuration file, install the registry, and create the
63 directory structure itself.
68 <title>The Registry</title>
70 The default registry is in the file
71 <filename>winedefault.reg</filename>. It contains directory
72 paths, class IDs, and more; it must be installed before most
73 <filename>INSTALL.EXE</filename> or
74 <filename>SETUP.EXE</filename> applications will work. The
75 registry is covered in more detail <link
76 linkend="registry">here</link>.
81 <title>Directory Structure</title>
83 Here's the fundamental layout that Windows applications and
84 installers expect. Without it, they seldom operate
89 C:\ Root directory of primary disk drive
90 Windows\ Windows directory, containing .INI files,
92 System\ Win3.x/95/98/ME directory for common DLLs
93 WinNT/2000 directory for common 16-bit DLLs
94 System32\ WinNT/2000 directory for common 32-bit DLLs
95 Start Menu\ Program launcher directory structure
96 Programs\ Program launcher links (.LNK files) to applications
97 Program Files\ Application binaries (.EXE and .DLL files)
101 Wine emulates drives by placing their virtual drive roots to
102 user-configurable points in the Unix filesystem, so it's
103 your choice where <medialabel>C:</medialabel>'s root should
104 be (<filename>tools/wineinstall</filename> will even ask
105 you). If you choose, say, <filename>/var/wine</filename>, as
106 the root of your virtual drive <medialabel>C</medialabel>,
107 then you'd put this in your <filename>~/.wine/config</filename>:
115 "Filesystem" = "win95"
119 With this configuration, what windows apps think of as
120 "c:\windows\system" would map to
121 <filename>/var/wine/windows/system</filename> in the UNIX
122 filesystem. Note that you need to specify
123 <literal>"Filesystem" = "win95"</literal>, NOT
124 <literal>"Filesystem" = "unix"</literal>, to make Wine simulate a
125 Windows-compatible (case-insensitive) filesystem, otherwise
126 most apps won't work.
131 <title>System DLLs</title>
133 The Wine team has determined that it is necessary to create
134 fake DLL files to trick many applications that check for
135 file existence to determine whether a particular feature
136 (such as Winsock and its TCP/IP networking) is available. If
137 this is a problem for you, you can create empty files in the
138 configured <filename>c:\windows\system</filename> directory
139 to make the application think it's there, and Wine's built-in DLL
140 will be loaded when the application actually asks for it.
141 (Unfortunately, <filename>tools/wineinstall</filename> does
142 not create such empty files itself.)
145 Applications sometimes also try to inspect the version
146 resources from the physical files (for example, to determine
147 the DirectX version). Empty files will not do in this case,
148 it is rather necessary to install files with complete
149 version resources. This problem is currently being worked
150 on. In the meantime, you may still need to grab some real
151 DLL files to fool these apps with.
154 And there are of course DLLs that wine does not currently
155 implement very well (or at all). If you do not have a real
156 Windows you can steal necessary DLLs from, you can always
157 get some from one of the Windows DLL archive sites
158 that can be found via internet search engine.
159 Please make sure to obey any licenses on the DLLs you fetch...
160 (some are redistributable, some aren't).
165 <sect1 id="no-windows">
166 <title>Installing Wine Without Windows</title>
168 Written by &name-james-juran; <email>&email-james-juran;</email>
171 (Extracted from <filename>wine/documentation/no-windows</filename>)
175 A major goal of Wine is to allow users to run Windows programs
176 without having to install Windows on their machine. Wine
177 implements the functionality of the main DLLs usually
178 provided with Windows. Therefore, once Wine is finished, you
179 will not need to have windows installed to use Wine.
182 Wine has already made enough progress that it may be possible
183 to run your target applications without Windows installed. If
184 you want to try it, follow these steps:
190 Create empty <filename>C:\windows</filename>,
191 <filename>C:\windows\system</filename>,
192 <filename>C:\windows\Start Menu</filename>, and
193 <filename>C:\windows\Start Menu\Programs</filename>
194 directories. Do not point Wine to a
195 <filename>Windows</filename> directory full of old
196 installations and a messy registry. (Wine creates a
197 special registry in your <filename >home</filename>
198 directory, in <filename>$HOME/.wine/*.reg</filename>.
199 Perhaps you have to remove these files).
204 Point <medialabel>[Drive C]</medialabel> in
205 <filename>~/.wine/config</filename> to where you want
206 <filename>C:</filename> to be. Refer to the Wine man page
207 for more information. Remember to use
208 <userinput>"Filesystem" = "win95"</userinput>!
213 Use <filename>tools/wineinstall</filename> to compile Wine
214 and install the default registry. Or if you prefer to do
215 it yourself, compile <filename>programs/regapi</filename>,
219 <userinput>programs/regapi/regapi setValue < winedefault.reg</userinput>
224 Run and/or install your applications.
230 Because Wine is not yet complete, some programs will work
231 better with native Windows DLLs than with Wine's
232 replacements. Wine has been designed to make this possible.
233 Here are some tips by Juergen Schmied (and others) on how to
234 proceed. This assumes that your
235 <filename>C:\windows</filename> directory in the configuration
236 file does not point to a native Windows installation but is in
237 a separate Unix file system. (For instance, <quote>C:\windows</quote> is
238 really subdirectory <quote>windows</quote> located in
239 <quote>/home/ego/wine/drives/c</quote>).
245 Run the application with <parameter>--debugmsg
246 +loaddll</parameter> to find out which files are
247 needed. Copy the required DLLs one by one to the
248 <filename>C:\windows\system</filename> directory. Do not
249 copy KERNEL/KERNEL32, GDI/GDI32, USER/USER32 or NTDLL. These
250 implement the core functionality of the Windows API, and
251 the Wine internal versions must be used.
256 Edit the <quote>[DllOverrides]</quote> section of
257 <filename>~/.wine/config</filename> to specify
258 <quote>native</quote> before <quote>builtin</quote> for
259 the Windows DLLs you want to use. For more information
260 about this, see the Wine manpage.
265 Note that some network DLLs are not needed even though
266 Wine is looking for them. The Windows
267 <filename>MPR.DLL</filename> currently does not work; you
268 must use the internal implementation.
273 Copy SHELL/SHELL32 and COMDLG/COMDLG32 COMMCTRL/COMCTL32
274 only as pairs to your Wine directory (these DLLs are
275 <quote>clean</quote> to use). Make sure you have these
276 specified in the <quote>[DllPairs]</quote> section of
277 <filename>~/.wine/config</filename>.
282 Be consistent: Use only DLLs from the same Windows version
288 Put <filename>regedit.exe</filename> in the
289 <filename>C:\windows</filename> directory.
290 (<application>Office 95</application> imports a
291 <filename>*.reg</filename> file when it runs with an empty
292 registry, don't know about
293 <application>Office 97</application>).
298 Also add <filename>winhelp.exe</filename> and
299 <filename>winhlp32.exe</filename> if you want to be able
300 to browse through your programs' help function.
307 <title>Dealing With FAT/VFAT Partitions</title>
309 Written by &name-steven-elliott; <email>&email-steven-elliott;</email>
312 (Extracted from <filename>wine/documentation/linux-fat-permissions</filename>)
315 This document describes how FAT and
316 VFAT file system permissions work in Linux
317 with a focus on configuring them for Wine.
321 <title>Introduction</title>
323 Linux is able to access DOS and Windows file systems using
324 either the FAT (older 8.3 DOS filesystems) or VFAT (newer
325 Windows 95 or later long filename filesystems) modules.
326 Mounted FAT or VFAT filesystems provide the primary means
327 for which existing applications and their data are accessed
328 through Wine for dual boot (Linux + Windows) systems.
331 Wine maps mounted FAT filesystems, such as
332 <filename>/c</filename>, to driver letters, such as
333 <quote>c:</quote>, as indicated by the
334 <filename>~/.wine/config</filename> file. The following excerpt
335 from a <filename>~/.wine/config</filename> file does this:
343 Although VFAT filesystems are preferable to FAT filesystems
344 for their long filename support the term <quote>FAT</quote>
345 will be used throughout the remainder of this document to
346 refer to FAT filesystems and their derivatives. Also,
347 <quote>/c</quote> will be used as the FAT mount point in
348 examples throughout this document.
351 Most modern Linux distributions either detect or allow
352 existing FAT file systems to be configured so that they can be
353 mounted, in a location such as <filename>/c</filename>,
354 either persistently (on bootup) or on an as needed basis. In
355 either case, by default, the permissions will probably be
356 configured so that they look like:
359 <prompt>~></prompt><userinput>cd /c</userinput>
360 <prompt>/c></prompt><userinput>ls -l</userinput>
361 <computeroutput>-rwxr-xr-x 1 root root 91 Oct 10 17:58 autoexec.bat
362 -rwxr-xr-x 1 root root 245 Oct 10 17:58 config.sys
363 drwxr-xr-x 41 root root 16384 Dec 30 1998 windows</computeroutput>
366 where all the files are owned by "root", are in the "root"
367 group and are only writable by "root"
368 (<literal>755</literal> permissions). This is restrictive in
369 that it requires that Wine be run as root in order for
370 applications to be able to write to any part of the
374 There are three major approaches to overcoming the restrictive
375 permissions mentioned in the previous paragraph:
380 Run <application>Wine</application> as root
385 Mount the FAT filesystem with less restrictive
391 Shadow the FAT filesystem by completely or partially
397 Each approach will be discussed in the following sections.
402 <title>Running Wine as root</title>
404 Running Wine as root is the easiest and most thorough way of giving
405 applications that Wine runs unrestricted access to FAT files systems.
406 Running wine as root also allows applications to do things unrelated
407 to FAT filesystems, such as listening to ports that are less than
408 1024. Running Wine as root is dangerous since there is no limit to
409 what the application can do to the system.
414 <title>Mounting FAT filesystems</title>
416 The FAT filesystem can be mounted with permissions less restrictive
417 than the default. This can be done by either changing the user that
418 mounts the FAT filesystem or by explicitly changing the permissions
419 that the FAT filesystem is mounted with. The permissions are
420 inherited from the process that mounts the FAT filesystem. Since the
421 process that mounts the FAT filesystem is usually a startup script
422 running as root the FAT filesystem inherits root's permissions. This
423 results in the files on the FAT filesystem having permissions similar
424 to files created by root. For example:
427 <prompt>~></prompt><userinput>whoami</userinput>
428 <computeroutput>root</computeroutput>
429 <prompt>~></prompt><userinput>touch root_file</userinput>
430 <prompt>~></prompt><userinput>ls -l root_file</userinput>
431 <computeroutput></computeroutput>-rw-r--r-- 1 root root 0 Dec 10 00:20 root_file
434 which matches the owner, group and permissions of files seen
435 on the FAT filesystem except for the missing 'x's. The
436 permissions on the FAT filesystem can be changed by changing
437 root's umask (unset permissions bits). For example:
440 <prompt>~></prompt><userinput>umount /c</userinput>
441 <prompt>~></prompt><userinput>umask</userinput>
442 <computeroutput>022</computeroutput>
443 <prompt>~></prompt><userinput>umask 073</userinput>
444 <prompt>~></prompt><userinput>mount /c</userinput>
445 <prompt>~></prompt><userinput>cd /c</userinput>
446 <prompt>/c></prompt><userinput>ls -l</userinput>
447 <computeroutput>-rwx---r-- 1 root root 91 Oct 10 17:58 autoexec.bat
448 -rwx---r-- 1 root root 245 Oct 10 17:58 config.sys
449 drwx---r-- 41 root root 16384 Dec 30 1998 windows</computeroutput>
452 Mounting the FAT filesystem with a umask of
453 <literal>000</literal> gives all users complete control over
454 it. Explicitly specifying the permissions of the FAT
455 filesystem when it is mounted provides additional control.
456 There are three mount options that are relevant to FAT
457 permissions: <literal>uid</literal>, <literal>gid</literal>
458 and <literal>umask</literal>. They can each be specified
459 when the filesystem is manually mounted. For example:
462 <prompt>~></prompt><userinput>umount /c</userinput>
463 <prompt>~></prompt><userinput>mount -o uid=500 -o gid=500 -o umask=002 /c</userinput>
464 <prompt>~></prompt><userinput>cd /c</userinput>
465 <prompt>/c></prompt><userinput>ls -l</userinput>
466 <computeroutput>-rwxrwxr-x 1 sle sle 91 Oct 10 17:58 autoexec.bat
467 -rwxrwxr-x 1 sle sle 245 Oct 10 17:58 config.sys
468 drwxrwxr-x 41 sle sle 16384 Dec 30 1998 windows</computeroutput>
471 which gives "sle" complete control over
472 <filename>/c</filename>. The options listed above can be
473 made permanent by adding them to the
474 <filename>/etc/fstab</filename> file:
477 <prompt>~></prompt><userinput>grep /c /etc/fstab</userinput>
478 <computeroutput>/dev/hda1 /c vfat uid=500,gid=500,umask=002,exec,dev,suid,rw 1 1</computeroutput>
481 Note that the umask of <literal>002</literal> is common in
482 the user private group file permission scheme. On FAT file
483 systems this umask assures that all files are fully
484 accessible by all users in the specified group
485 (<literal>gid</literal>).
490 <title>Shadowing FAT filesystems</title>
492 Shadowing provides a finer granularity of control. Parts of
493 the original FAT filesystem can be copied so that the
494 application can safely work with those copied parts while
495 the application continues to directly read the remaining
496 parts. This is done with symbolic links. For example,
497 consider a system where an application named
498 <application>AnApp</application> must be able to read and
499 write to the <filename>c:\windows</filename> and
500 <filename>c:\AnApp</filename> directories as well as have
501 read access to the entire FAT filesystem. On this system
502 the FAT filesystem has default permissions which should not
503 be changed for security reasons or can not be changed due to
504 lack of root access. On this system a shadow directory
505 might be set up in the following manner:
508 <prompt>~></prompt><userinput>cd /</userinput>
509 <prompt>/></prompt><userinput>mkdir c_shadow</userinput>
510 <prompt>/></prompt><userinput>cd c_shadow</userinput>
511 <prompt>/c_shadow></prompt><userinput>ln -s /c_/* .</userinput>
512 <prompt>/c_shadow></prompt><userinput>rm windows AnApp</userinput>
513 <prompt>/c_shadow></prompt><userinput>cp -R /c_/{windows,AnApp} .</userinput>
514 <prompt>/c_shadow></prompt><userinput>chmod -R 777 windows AnApp</userinput>
515 <prompt>/c_shadow></prompt><userinput>perl -p -i -e 's|/c$|/c_shadow|g' /usr/local/etc/wine.conf</userinput>
518 The above gives everyone complete read and write access to
519 the <filename>windows</filename> and
520 <filename>AnApp</filename> directories while only root has
521 write access to all other directories.
526 <sect1 id="scsi-support">
527 <title>SCSI Support</title>
529 Written by &name-bruce-milner; <email>&email-bruce-milner;</email>;
530 Additions by &name-andreas-mohr; <email>&email-andreas-mohr;</email>
533 (Extracted from <filename>wine/documentation/aspi</filename>)
537 This file describes setting up the Windows ASPI interface.
541 <warning><title>Warning/Warning/Warning!!!!!!</title>
542 <para>This may trash your system if used incorrectly. It may
543 even trash your system when used <emphasis>correctly</>!
549 Now that I have said that. ASPI is a direct link to SCSI devices from
550 windows programs. ASPI just forwards the SCSI commands that programs send
551 to it to the SCSI bus.
554 If you use the wrong SCSI device in your setup file, you can send
555 completely bogus commands to the wrong device - An example would be
556 formatting your hard drives (assuming the device gave you permission -
557 if you're running as root, all bets are off).
560 So please make sure that <emphasis>all</emphasis> SCSI devices not needed by the program
561 have their permissions set as restricted as possible !
565 Cookbook for setting up scanner: (At least how mine is to work)
566 (well, for other devices such as CD burners, MO drives, ..., too)
570 <title>Windows requirements</title>
574 The scanner software needs to use the "Adaptec"
575 compatible drivers (ASPI). At least with Mustek, they
576 allow you the choice of using the builtin card or the
577 "Adaptec (AHA)" compatible drivers. This will not work
578 any other way. Software that accesses the scanner via a
579 DOS ASPI driver (e.g. ASPI2DOS) is supported, too. [AM]
584 You probably need a real windows install of the software
585 to set the LUN's/SCSI id's up correctly. I'm not exactly
593 <title>LINUX requirements:</title>
597 Your SCSI card must be supported under Linux. This will
598 not work with an unknown SCSI card. Even for cheap'n
599 crappy "scanner only" controllers some special Linux
600 drivers exist on the net.
601 If you intend to use your IDE device, you need to use the
604 <ulink url="http://www.linuxdoc.org/HOWTO/CD-Writing-HOWTO.html">
605 http://www.linuxdoc.org/HOWTO/CD-Writing-HOWTO.html</ulink>
606 for ide-scsi setup instructions.
611 Compile generic SCSI drivers into your kernel.
616 This seems to be not required any more for newer (2.2.x) kernels:
617 Linux by default uses smaller SCSI buffers than Windows.
618 There is a kernel build define <literal>SG_BIG_BUFF</literal> (in
619 <filename>sg.h</filename>) that is by default set too
620 low. The SANE project recommends
621 <literal>130560</literal> and this seems to work just
622 fine. This does require a kernel rebuild.
627 Make the devices for the scanner (generic SCSI devices)
628 - look at the SCSI programming HOWTO at
629 <ulink url="http://www.linuxdoc.org/HOWTO/SCSI-Programming-HOWTO.html">
630 http://www.linuxdoc.org/HOWTO/SCSI-Programming-HOWTO.html</ulink>
631 for device numbering.
636 I would recommend making the scanner device writable by
637 a group. I made a group called
638 <literal>scanner</literal> and added myself to it.
639 Running as root increases your risk of sending bad SCSI
640 commands to the wrong device. With a regular user, you
641 are better protected.
646 For Win32 software (WNASPI32), Wine has auto-detection in place.
647 For Win16 software (WINASPI), you need to add a SCSI device entry
648 for your particular scanner to ~/.wine/config. The format is
649 <literal>[scsi cCtTdD]</literal> where
650 <literal>"C" = "controller"</literal>,
651 <literal>"T" = "target"</literal>, <literal>D=LUN</literal>
654 For example, I set mine up as controller <literal>0</literal>,
655 Target <literal>6</literal>, LUN <literal>0</literal>.
658 "Device" = "/dev/sgi"
660 Yours will vary with your particular SCSI setup.
667 <title>General Information</title>
669 The mustek scanner I have was shipped with a package
670 "ipplus". This program uses the TWAIN driver specification
678 ipplus.exe <-> (TWAIN INTERFACE) <-> (TWAIN DATA SOURCE.ASPI) -> WINASPI
684 <title>NOTES/BUGS</title>
686 The biggest is that it only works under Linux at the moment.
689 The ASPI code has only been tested with:
694 a Mustek 800SP with a Buslogic controller under Linux [BM]
699 a Siemens Nixdorf 9036 with Adaptec AVA-1505 under Linux
700 accessed via DOSASPI. Note that I had color problems,
701 though (barely readable result) [AM]
706 a Fujitsu M2513A MO drive (640MB) using generic SCSI
707 drivers. Formatting and ejecting worked perfectly.
708 Thanks to Uwe Bonnes for access to the hardware ! [AM]
713 I make no warranty to the ASPI code. It makes my scanner
714 work. Your devices may explode. I have no way of determining
715 this. I take zero responsibility!
722 <!-- Keep this comment at the end of the file
725 sgml-parent-document:("wine-doc.sgml" "set" "book" "chapter" "")