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
12 A WINE install should:
13 a. Not have a world writeable directory (-tree).
14 b. Require only as much user input as possible. It would be very good if it
15 would not require any at all. Just let the system administrator do "rpm
16 -i wine.rpm" and let any user be able to run "wine sol.exe" instantly.
17 c. Give the user as much flexibility to install his own applications, do
18 his own configuring etc.
19 d. Come as preconfigured as possible, so the user does not need to change
20 any configuration files.
21 e. Use only as much diskspace as needed per user.
24 f. A writeable C:\ directory structure on a per user basis. Applications do
25 dump .ini files into c:\windows, installers dump .exe, .dll and more into
26 c:\windows\ and subdirectories or into C:\Program Files\.
27 g. The .exe and .dll from a global read-only Windows installation to be
28 found by applications.
29 h. Some special .dll and .exe files in the windows\system directory, since
30 applications directly check for their presence.
35 2.1 Building the package
37 WINE is configured the usual way (depending on your buildenvironment).
38 The "prefix" is chosen using your application placement policy
39 (/usr/,/usr/X11R6/, /opt/wine/ or similar). The configuration files
40 (wine.conf, wine.userreg, wine.systemreg) are targeted for /etc/wine/
41 (rationale: FHS 2.0, multiple readonly configuration files of a package).
43 Example (split this into %build and %install section for rpm):
44 CFLAGS=$RPM_OPT_FLAGS \
45 ./configure --prefix=/usr/X11R6 --sysconfdir=/etc/wine/ --enable-dll
48 make install prefix=$BR/usr/X11R6/ sysconfdir=$BR/etc/wine/
49 install -d $BR/etc/wine/
50 install -m 644 wine.ini $BR/etc/wine/wine.conf
52 # Put all our dlls in a seperate directory. (this works only if
53 # you have a buildroot)
54 install -d $BR/usr/X11R6/lib/wine
55 mv $BR/usr/X11R6/lib/lib* $BR/usr/X11R6/lib/wine/
57 # the clipboard server is started on demand.
58 install -m 755 windows/x11drv/wineclipsrv $BR/usr/X11R6/bin/
60 # The WINE server is needed.
61 install -m 755 server/wineserver $BR/usr/X11R6/bin/
63 Here we unfortunately do need to create wineuser.reg and winesystem.reg
64 from the WINE distributed winedefault.reg. This can be done using
65 ./regapi once for one example user and the reusing his .wine/user.reg
66 and .wine/system.reg files. [FIXME: this needs to be done better]
68 install -m 644 wine.sytemreg $BR/etc/wine/
69 install -m 644 wine.userreg $BR/etc/wine/
71 There are now a lot of libraries generated by the build process, so a
72 seperate library directory should be used.
74 install -d 755 $BR/usr/X11R6/lib/
77 You will need to package the files:
78 $prefix/bin/wine, $prefix/bin/dosmod, $prefix/lib/wine/*
79 $prefix/man/man1/wine.1, $prefix/include/wine/*,
80 $prefix/bin/wineserver, $prefix/bin/wineclipsrv
83 %doc ... choose from the toplevel directory and documentation/
85 The Post install script:
86 if ! grep -q /usr/X11R6/lib/wine /etc/ld.so.conf; then
87 echo "/usr/X11R6/lib/wine" >> /etc/ld.so.conf
91 The post uninstall script:
93 perl -ni -e 'print unless m:/usr/X11R6/lib/wine:;' /etc/ld.so.conf
98 2.2 Creating a good default configuration file
100 For the rationales of needing as less input from the user as possible
101 arises the need for a very good configuration file. The one supplied
102 with WINE is currently lacking. We need:
105 + A for the floppy. Specify your distributions default floppy mountpoint
106 here. (Path=/auto/floppy)
107 + C for the C:\ directory. Here we use the users homedirectory, for most
108 applications do see C:\ as root-writeable directory of every windows
109 installation and this basically is it in the UNIX-user context.
111 + R for the CD-Rom drive. Specify your distributions default CD-ROM drives
112 mountpoint here. (Path=/auto/cdrom)
113 + T for temporary storage. We do use /tmp/ (rationale: between process
114 temporary data belongs to /tmp/, FHS 2.0)
115 + W for the original Windows installation. This drive points to the
116 windows\ subdirectory of the original windows installation. This avoids
117 problems with renamed 'windows' directories (as for instance 'lose95',
118 'win' or 'sys\win95'). During compile/package/install we leave this
119 to be '/', it has to be configured after the package install.
120 + Z for the UNIX Root directory (Path=/). This avoids any problems with
121 "could not find drive for current directory" users occasionaly complain
122 about in the newsgroup and the ircchannel. It also makes the whole
123 directory structure browseable. The type of Z should be network, so
124 applications expect it to be readonly.
127 Windows=c:\windows\ (the windows/ subdirectory in the users
129 System=c:\windows\system\ (the windows/system subdirectory in the users
131 Path=c:\windows;c:\windows\system;c:\windows\system32;w:\;w:\system;w:\system32;
132 ; Using this trick we have in fact two windows installations in one, we
133 ; get the stuff from the readonly installation and can write to our own.
134 Temp=t:\ (the TEMP directory)
136 WineLook=win95 (just the coolest look ;)
137 - Possibly modify the [spooler], [serialports] and [parallelports] sections.
138 (FIXME: possibly more, including printer stuff)
140 Add this prepared configuration file to the package.
142 2.3 Installing WINE for the system administrator
144 Install the package using the usual packager "rpm -i wine.rpm".
145 You may edit /etc/wine/wine.conf, [Drive W], to point to a possible windows
146 installation right after the install. Thats it.
148 2.4 Installing WINE for the user
150 The user will need to run a setup script before the first invocation of
151 WINE. This script should:
152 - Copy /etc/wine/wine.conf for user modification.
153 - Allow specification of the original windows installation to use (which
154 modifies the copied wine.conf file).
155 - Create the windows directory structure (c:\windows,c:\windows\system,
156 c:\windows\Start Menu\Programs,c:\Program Files,c:\Desktop,...)
158 (FIXME: Not sure this is needed for all files:)
160 - Symlink all .dll and .exe files from the original windows installation to
161 the windows directory. Why? Some program reference "%windowsdir%/file.dll"
162 or "%systemdir%/file.dll" directly and fail if there are not present.
164 This will give a huge number of symlinks, yes. However, if an installer
165 later overwrites on of those files, it will overwrite the symlink (so
166 that the file now lies in the windows/ subdirectory).
168 - On later invocation the script might want to compare regular files in
169 the users windows directories and in the global windows directories and
170 replace same files by symlinks (to avoid diskspace problems).
174 This procedure requires:
175 - Much thought and work from the packager (1x)
176 - No work for the sysadmin. Well except one "rpm -i" and possible one edit
177 of the configuration file.
178 - Some or no work from the user, except running the per-user setup script
180 => It scales well and suffices most of the rationales.
182 Marcus Meissner <Marcus.Meissner@caldera.de>
184 ----------------------------------------------------------------
185 Sample wine.ini for OpenLinux 2.x:
188 ;; MS-DOS drives configuration
190 ;; Each section has the following format:
192 ;; Path=xxx (Unix path for drive root)
193 ;; Type=xxx (supported types are 'floppy', 'hd', 'cdrom' and 'network')
194 ;; Label=xxx (drive label, at most 11 characters)
195 ;; Serial=xxx (serial number, 8 characters hexadecimal number)
196 ;; Filesystem=xxx (supported types are 'msdos'/'dos'/'fat', 'win95'/'vfat', 'unix')
197 ;; This is the FS Wine is supposed to emulate on a certain
198 ;; directory structure.
200 ;; - "win95" for ext2fs, VFAT and FAT32
201 ;; - "msdos" for FAT16 (ugly, upgrading to VFAT driver strongly recommended)
202 ;; DON'T use "unix" unless you intend to port programs using Winelib !
203 ;; Device=/dev/xx (only if you want to allow raw device access)
210 ; OpenLinux uses an automounter under /auto/, so we use that too.
221 ; Comment in ONLY if you have a second floppy or the automounter hangs
234 ; Drive 'C' links to the users homedirectory.
236 ; This must point to a writeable directory structure (not your readonly
237 ; mounted DOS partitions!) since programs want to dump stuff into
238 ; "Program Files/" "Programme/", "windows/", "windows/system/" etc.
240 ; The basic structure is set up using the config script.
251 ; The temp drive (and directory) points to /tmp/. Windows programs fill it
252 ; with junk, so it is approbiate.
261 ; 'U'ser homedirectory
263 ; Just in case you want C:\ elsewhere.
272 ; CD-'R'OM drive (automounted)
274 ; The default cdrom drive.
276 ; If an application (or game) wants a specific CD-ROM you might have to
277 ; temporary change the Label to the one of the CD itself.
279 ; How to read them is described in /usr/doc/wine-cvs-xxxxx/cdrom-labels.
288 ; The drive where the old windows installation resides (it points to the
289 ; windows/ subdirectory).
291 ; The Path is modified by the winesetup script.
299 ; The UNIX Root directory, so all other programs and directories are reachable.
301 ; type network is used to tell programs to not write here.
310 ; Standard Windows path entries. WINE will not work if they are incorrect.
314 ; The windows/ directory. It must be writeable, for programs write into it.
318 ; The windows/system/ directory. It must be writeable, for especially setup
319 ; programs install dlls in there.
321 System=c:\windows\system
323 ; The temp directory. Should be cleaned regulary, since install programs leave
324 ; junk without end in there.
328 ; The dll search path. It should contain at least:
329 ; - the windows and the windows/system directory of the user.
330 ; - the global windows and windows/system directory (from a possible readonly
331 ; windows installation either on msdos filesystems or somewhere in the UNIX
333 ; - any other windows style directories you want to add.
335 Path=c:\windows;c:\windows\system;c:\windows\system32;t:\;w:\;w:\system;w:\system32
337 ; Outdated and no longer used. (but needs to be present).
339 SymbolTableFile=./wine.sym
344 ; Dll loadorder defaults. No need to modify.
347 EXTRA_LD_LIBRARY_PATH=${HOME}/wine/cvs/lib
348 DefaultLoadOrder = native, elfdll, so, builtin
351 ; What 32/16 dlls belong to each other (context wise). No need to modify.
367 ; What type of dll to use in their respective loadorder.
370 kernel32, gdi32, user32 = builtin
371 kernel, gdi, user = builtin
373 comdlg32, commdlg = elfdll, builtin, native
374 version, ver = elfdll, builtin, native
375 shell32, shell = builtin, native
376 lz32, lzexpand = builtin, native
377 commctrl, comctl32 = builtin, native
378 wsock32, winsock = builtin
379 advapi32, crtdll, ntdll = builtin, native
380 mpr, winspool = builtin, native
381 ddraw, dinput, dsound = builtin, native
382 winmm, mmsystem = builtin
383 msvideo, msvfw32 = builtin, native
384 mcicda.drv, mciseq.drv = builtin, native
385 mciwave.drv = builtin, native
386 mciavi.drv, mcianim.drv = native, builtin
388 wnaspi32, wow32 = builtin
389 system, display, wprocs = builtin
393 ; Options section. Does not need to be edited.
396 ; allocate how much system colors on startup. No need to modify.
397 AllocSystemColors=100
400 ; Font specification. You usually do not need to edit this section.
402 ; Read documentation/fonts before adding aliases
405 ; The resolution defines what fonts to use (usually either 75 or 100 dpi fonts,
409 Default = -adobe-times-
412 ; serial ports used by "COM1" "COM2" "COM3" "COM4". Useful for applications
413 ; that try to access serial ports.
418 Com3=/dev/modem,38400
422 ; parallel port(s) used by "LPT1" etc. Useful for applications that try to
423 ; access these ports.
429 ; What spooling program to use on printing.
430 ; Use "|program" or "filename", where the output will be dumped into.
434 LPT2:=|gs -sDEVICE=bj200 -sOutputFile=/tmp/fred -q -
438 ; Allow port access to WINE started by the root user. Useful for some
439 ; supported devices, but it can make the system unstable.
440 ; Read /usr/doc/wine-cvs-xxxxx/ioport-trace-hints.
443 ;read=0x779,0x379,0x280-0x2a0
444 ;write=0x779,0x379,0x280-0x2a0
446 ; debugging, not need to be modified.
448 Exclude=WM_SIZE;WM_TIMER;
451 ; What names for the registry datafiles, no need to modify.
454 ; Paths must be given in /dir/dir/file.reg format.
455 ; Wine will not understand dos file names here...
456 ;UserFileName=xxx ; alternate registry file name (user.reg)
457 ;LocalMachineFileName=xxx ; (system.reg)
460 ; Layout/Look modifications. Here you can switch with a single line between
461 ; windows 3.1 and windows 95 style.
462 ; This does not change WINE behaviour or reported versions, just the look!
465 ;; WineLook=xxx (supported styles are 'Win31'(default), 'Win95', 'Win98')
469 ; What programs to start on WINE startup. (you should probably leave it empty)