1 A small WINE distribution guide.
3 While packaging WINE for one of the Linux distributions I came across
4 several points which have been clarified yet. Particular a how-to for WINE
5 packaging distributors is missing. This document tries to give a brief
6 overview over the rationales I thought up and how I tried to implement it.
7 (While the examples use "rpm" most of this stuff can be applied to other
10 NOTE THAT YOU SHOULD RECHECK THIS FILE EVERY TWO MONTHS OR SO
11 (diff -uN comes to my mind here...).
12 We'll be adding stuff constantly here in order to improve the Wine
17 A WINE install should:
18 a. Not have a world writeable directory (-tree).
19 b. Require only as much user input as possible. It would be very good if it
20 would not require any at all. Just let the system administrator do "rpm
21 -i wine.rpm" and let any user be able to run "wine sol.exe" instantly.
22 c. Give the user as much flexibility to install his own applications, do
23 his own configuring etc.
24 d. Come as preconfigured as possible, so the user does not need to change
25 any configuration files.
26 e. Use only as much diskspace as needed per user.
29 f. A writeable C:\ directory structure on a per user basis. Applications do
30 dump .ini files into c:\windows, installers dump .exe, .dll and more into
31 c:\windows\ and subdirectories or into C:\Program Files\.
32 g. The .exe and .dll from a global read-only Windows installation to be
33 found by applications.
34 h. Some special .dll and .exe files in the windows\system directory, since
35 applications directly check for their presence.
36 i. Some special program environment.
41 2.1 Building the package
43 WINE is configured the usual way (depending on your buildenvironment).
44 The "prefix" is chosen using your application placement policy
45 (/usr/,/usr/X11R6/, /opt/wine/ or similar). The configuration files
46 (wine.conf, wine.userreg, wine.systemreg) are targeted for /etc/wine/
47 (rationale: FHS 2.0, multiple readonly configuration files of a package).
49 Example (split this into %build and %install section for rpm):
50 CFLAGS=$RPM_OPT_FLAGS \
51 ./configure --prefix=/usr/X11R6 --sysconfdir=/etc/wine/ --enable-dll
54 make install prefix=$BR/usr/X11R6/ sysconfdir=$BR/etc/wine/
55 install -d $BR/etc/wine/
56 install -m 644 wine.ini $BR/etc/wine/wine.conf
58 # Put all our dlls in a seperate directory. (this works only if
59 # you have a buildroot)
60 install -d $BR/usr/X11R6/lib/wine
61 mv $BR/usr/X11R6/lib/lib* $BR/usr/X11R6/lib/wine/
63 # the clipboard server is started on demand.
64 install -m 755 windows/x11drv/wineclipsrv $BR/usr/X11R6/bin/
66 # The WINE server is needed.
67 install -m 755 server/wineserver $BR/usr/X11R6/bin/
69 Here we unfortunately do need to create wineuser.reg and winesystem.reg
70 from the WINE distributed winedefault.reg. This can be done using
71 ./regapi once for one example user and the reusing his .wine/user.reg
72 and .wine/system.reg files. [FIXME: this needs to be done better]
74 install -m 644 wine.sytemreg $BR/etc/wine/
75 install -m 644 wine.userreg $BR/etc/wine/
77 There are now a lot of libraries generated by the build process, so a
78 seperate library directory should be used.
80 install -d 755 $BR/usr/X11R6/lib/
83 You will need to package the files:
84 $prefix/bin/wine, $prefix/bin/dosmod, $prefix/lib/wine/*
85 $prefix/man/man1/wine.1, $prefix/include/wine/*,
86 $prefix/bin/wineserver, $prefix/bin/wineclipsrv
89 %doc ... choose from the toplevel directory and documentation/
91 The Post install script:
92 if ! grep -q /usr/X11R6/lib/wine /etc/ld.so.conf; then
93 echo "/usr/X11R6/lib/wine" >> /etc/ld.so.conf
97 The post uninstall script:
99 perl -ni -e 'print unless m:/usr/X11R6/lib/wine:;' /etc/ld.so.conf
104 2.2 Creating a good default configuration file
106 For the rationales of needing as less input from the user as possible
107 arises the need for a very good configuration file. The one supplied
108 with WINE is currently lacking. We need:
111 + A for the floppy. Specify your distributions default floppy mountpoint
112 here. (Path=/auto/floppy)
113 + C for the C:\ directory. Here we use the users homedirectory, for most
114 applications do see C:\ as root-writeable directory of every windows
115 installation and this basically is it in the UNIX-user context.
117 + R for the CD-Rom drive. Specify your distributions default CD-ROM drives
118 mountpoint here. (Path=/auto/cdrom)
119 + T for temporary storage. We do use /tmp/ (rationale: between process
120 temporary data belongs to /tmp/, FHS 2.0)
121 + W for the original Windows installation. This drive points to the
122 windows\ subdirectory of the original windows installation. This avoids
123 problems with renamed 'windows' directories (as for instance 'lose95',
124 'win' or 'sys\win95'). During compile/package/install we leave this
125 to be '/', it has to be configured after the package install.
126 + Z for the UNIX Root directory (Path=/). This avoids any problems with
127 "could not find drive for current directory" users occasionaly complain
128 about in the newsgroup and the ircchannel. It also makes the whole
129 directory structure browseable. The type of Z should be network, so
130 applications expect it to be readonly.
133 Windows=c:\windows\ (the windows/ subdirectory in the users
135 System=c:\windows\system\ (the windows/system subdirectory in the users
137 Path=c:\windows;c:\windows\system;c:\windows\system32;w:\;w:\system;w:\system32;
138 ; Using this trick we have in fact two windows installations in one, we
139 ; get the stuff from the readonly installation and can write to our own.
140 Temp=t:\ (the TEMP directory)
142 WineLook=win95 (just the coolest look ;)
143 - Possibly modify the [spooler], [serialports] and [parallelports] sections.
144 (FIXME: possibly more, including printer stuff)
146 Add this prepared configuration file to the package.
148 2.3 Installing WINE for the system administrator
150 Install the package using the usual packager "rpm -i wine.rpm".
151 You may edit /etc/wine/wine.conf, [Drive W], to point to a possible windows
152 installation right after the install. Thats it.
154 Note that on Linux you should somehow try to add the "unhide" mount option
155 (-> "man mount") to the CD-ROM entry in /etc/fstab during package install,
156 as several stupid Windows programs mark some setup (!) files
157 as hidden (ISO9660) on CD-ROMs, which will greatly confuse users
158 as they won't find their setup files on the CD-ROMs as they were
159 used on Windows systems when "unhide" is not set ;-\
160 And of course the setup program will complain that "setup.ins" or some other
162 If you choose to do so, then please make this change verbose to the admin.
164 2.4 Installing WINE for the user
166 The user will need to run a setup script before the first invocation of
167 WINE. This script should:
168 - Copy /etc/wine/wine.conf for user modification.
169 - Allow specification of the original windows installation to use (which
170 modifies the copied wine.conf file).
171 - Create the windows directory structure (c:\windows,c:\windows\system,
172 c:\windows\Start Menu\Programs,c:\Program Files,c:\Desktop,...)
174 (FIXME: Not sure this is needed for all files:)
176 - Symlink all .dll and .exe files from the original windows installation to
177 the windows directory. Why? Some program reference "%windowsdir%/file.dll"
178 or "%systemdir%/file.dll" directly and fail if there are not present.
180 This will give a huge number of symlinks, yes. However, if an installer
181 later overwrites on of those files, it will overwrite the symlink (so
182 that the file now lies in the windows/ subdirectory).
184 - On later invocation the script might want to compare regular files in
185 the users windows directories and in the global windows directories and
186 replace same files by symlinks (to avoid diskspace problems).
190 This procedure requires:
191 - Much thought and work from the packager (1x)
192 - No work for the sysadmin. Well except one "rpm -i" and possible one edit
193 of the configuration file.
194 - Some or no work from the user, except running the per-user setup script
196 => It scales well and suffices most of the rationales.
198 Marcus Meissner <Marcus.Meissner@caldera.de>
200 ----------------------------------------------------------------
201 Sample wine.ini for OpenLinux 2.x:
204 ;; MS-DOS drives configuration
206 ;; Each section has the following format:
208 ;; Path=xxx (Unix path for drive root)
209 ;; Type=xxx (supported types are 'floppy', 'hd', 'cdrom' and 'network')
210 ;; Label=xxx (drive label, at most 11 characters)
211 ;; Serial=xxx (serial number, 8 characters hexadecimal number)
212 ;; Filesystem=xxx (supported types are 'msdos'/'dos'/'fat', 'win95'/'vfat', 'unix')
213 ;; This is the FS Wine is supposed to emulate on a certain
214 ;; directory structure.
216 ;; - "win95" for ext2fs, VFAT and FAT32
217 ;; - "msdos" for FAT16 (ugly, upgrading to VFAT driver strongly recommended)
218 ;; DON'T use "unix" unless you intend to port programs using Winelib !
219 ;; Device=/dev/xx (only if you want to allow raw device access)
226 ; OpenLinux uses an automounter under /auto/, so we use that too.
237 ; Comment in ONLY if you have a second floppy or the automounter hangs
250 ; Drive 'C' links to the users homedirectory.
252 ; This must point to a writeable directory structure (not your readonly
253 ; mounted DOS partitions!) since programs want to dump stuff into
254 ; "Program Files/" "Programme/", "windows/", "windows/system/" etc.
256 ; The basic structure is set up using the config script.
267 ; The temp drive (and directory) points to /tmp/. Windows programs fill it
268 ; with junk, so it is approbiate.
277 ; 'U'ser homedirectory
279 ; Just in case you want C:\ elsewhere.
288 ; CD-'R'OM drive (automounted)
290 ; The default cdrom drive.
292 ; If an application (or game) wants a specific CD-ROM you might have to
293 ; temporary change the Label to the one of the CD itself.
295 ; How to read them is described in /usr/doc/wine-cvs-xxxxx/cdrom-labels.
304 ; The drive where the old windows installation resides (it points to the
305 ; windows/ subdirectory).
307 ; The Path is modified by the winesetup script.
315 ; The UNIX Root directory, so all other programs and directories are reachable.
317 ; type network is used to tell programs to not write here.
326 ; Standard Windows path entries. WINE will not work if they are incorrect.
330 ; The windows/ directory. It must be writeable, for programs write into it.
334 ; The windows/system/ directory. It must be writeable, for especially setup
335 ; programs install dlls in there.
337 System=c:\windows\system
339 ; The temp directory. Should be cleaned regulary, since install programs leave
340 ; junk without end in there.
344 ; The dll search path. It should contain at least:
345 ; - the windows and the windows/system directory of the user.
346 ; - the global windows and windows/system directory (from a possible readonly
347 ; windows installation either on msdos filesystems or somewhere in the UNIX
349 ; - any other windows style directories you want to add.
351 Path=c:\windows;c:\windows\system;c:\windows\system32;t:\;w:\;w:\system;w:\system32
353 ; Outdated and no longer used. (but needs to be present).
355 SymbolTableFile=./wine.sym
360 ; Dll loadorder defaults. No need to modify.
363 EXTRA_LD_LIBRARY_PATH=${HOME}/wine/cvs/lib
364 DefaultLoadOrder = native, elfdll, so, builtin
367 ; What 32/16 dlls belong to each other (context wise). No need to modify.
383 ; What type of dll to use in their respective loadorder.
386 kernel32, gdi32, user32 = builtin
387 kernel, gdi, user = builtin
389 comdlg32, commdlg = elfdll, builtin, native
390 version, ver = elfdll, builtin, native
391 shell32, shell = builtin, native
392 lz32, lzexpand = builtin, native
393 commctrl, comctl32 = builtin, native
394 wsock32, winsock = builtin
395 advapi32, crtdll, ntdll = builtin, native
396 mpr, winspool = builtin, native
397 ddraw, dinput, dsound = builtin, native
398 winmm, mmsystem = builtin
399 msvideo, msvfw32 = builtin, native
400 mcicda.drv, mciseq.drv = builtin, native
401 mciwave.drv = builtin, native
402 mciavi.drv, mcianim.drv = native, builtin
404 wnaspi32, wow32 = builtin
405 system, display, wprocs = builtin
409 ; Options section. Does not need to be edited.
412 ; allocate how much system colors on startup. No need to modify.
413 AllocSystemColors=100
416 ; Font specification. You usually do not need to edit this section.
418 ; Read documentation/fonts before adding aliases
421 ; The resolution defines what fonts to use (usually either 75 or 100 dpi fonts,
425 Default = -adobe-times-
428 ; serial ports used by "COM1" "COM2" "COM3" "COM4". Useful for applications
429 ; that try to access serial ports.
434 Com3=/dev/modem,38400
438 ; parallel port(s) used by "LPT1" etc. Useful for applications that try to
439 ; access these ports.
445 ; What spooling program to use on printing.
446 ; Use "|program" or "filename", where the output will be dumped into.
450 LPT2:=|gs -sDEVICE=bj200 -sOutputFile=/tmp/fred -q -
454 ; Allow port access to WINE started by the root user. Useful for some
455 ; supported devices, but it can make the system unstable.
456 ; Read /usr/doc/wine-cvs-xxxxx/ioport-trace-hints.
459 ;read=0x779,0x379,0x280-0x2a0
460 ;write=0x779,0x379,0x280-0x2a0
462 ; debugging, not need to be modified.
464 Exclude=WM_SIZE;WM_TIMER;
467 ; What names for the registry datafiles, no need to modify.
470 ; Paths must be given in /dir/dir/file.reg format.
471 ; Wine will not understand dos file names here...
472 ;UserFileName=xxx ; alternate registry file name (user.reg)
473 ;LocalMachineFileName=xxx ; (system.reg)
476 ; Layout/Look modifications. Here you can switch with a single line between
477 ; windows 3.1 and windows 95 style.
478 ; This does not change WINE behaviour or reported versions, just the look!
481 ;; WineLook=xxx (supported styles are 'Win31'(default), 'Win95', 'Win98')
485 ; What programs to start on WINE startup. (you should probably leave it empty)