1 <chapter id=
"packaging">
2 <title>Packaging Wine
</title>
4 <sect1 id=
"distributing">
5 <title>A Small WINE Distribution Guide
</title>
8 written by Marcus Meissner
<Marcus.Meissner@caldera.de
>
11 (Extracted from
<filename>wine/documentation/distributors
</filename>)
15 While packaging WINE for one of the Linux distributions I came
16 across several points which have not been clarified yet.
17 Particularly a how-to for WINE packaging distributors is
18 missing. This document tries to give a brief overview over the
19 rationales I thought up and how I tried to implement it.
20 (While the examples use
<command>rpm
</command> most of this
21 stuff can be applied to other packagers too.)
26 YOU SHOULD RECHECK THIS FILE EVERY TWO MONTHS OR SO
27 (
<command>diff -uN
</command> comes to my mind here...).
28 We'll be adding stuff constantly here in order to improve
29 the Wine environment !
36 <para>Rationales
</para>
38 A WINE install should:
42 <para>Not have a world writeable directory (-tree).
</para>
46 Require only as much user input as needed. It would be
47 very good if it would not require any at all. Just let
48 the system administrator do
<command>rpm -i
49 wine.rpm
</command> and let any user be able to run
50 <command>wine sol.exe
</command> instantly.
55 Give the user as much flexibility as possible to
56 install his own applications, do his own configuring
62 Come as preconfigured as possible, so the user does
63 not need to change any configuration files.
67 <para>Use only as much diskspace as needed per user.
</para>
78 A writeable
<filename>C:\
</filename> directory
79 structure on a per user basis. Applications do dump
80 <filename>.ini
</filename> files into
81 <filename>c:\windows
</filename>, installers dump
82 <filename>.exe
</filename>,
<filename>.dll
</filename>
83 and more into
<filename>c:\windows\
</filename> and
84 subdirectories or into
<filename>C:\Program
90 The
<filename>.exe
</filename> and
91 <filename>.dll
</filename> from a global read-only
92 Windows installation to be found by applications.
97 Some special
<filename>.dll
</filename> and
98 <filename>.exe
</filename> files in the
99 <filename>windows\system
</filename> directory, since
100 applications directly check for their presence.
104 <para>Some special program environment.
</para>
110 <para>Implementation
</para>
112 <orderedlist inheritnum=
"inherit">
114 <para>Building the package
</para>
116 WINE is configured the usual way (depending on your
117 build environment). The
"prefix" is chosen using your
118 application placement policy
119 (
<filename>/usr/
</filename>,
120 <filename>/usr/X11R6/
</filename>,
121 <filename>/opt/wine/
</filename> or similar). The
122 configuration files (
<filename>wine.conf
</filename>,
123 <filename>wine.userreg
</filename>,
124 <filename>wine.systemreg
</filename>) are targeted for
125 <filename>/etc/wine/
</filename> (rationale: FHS
2.0,
126 multiple readonly configuration files of a package).
129 Example (split this into
<literal>%build
</literal> and
130 <literal>%install
</literal> section for
131 <command>rpm
</command>):
134 CFLAGS=$RPM_OPT_FLAGS \
135 ./configure --prefix=/usr/X11R6 --sysconfdir=/etc/wine/ --enable-dll
138 make install prefix=$BR/usr/X11R6/ sysconfdir=$BR/etc/wine/
139 install -d $BR/etc/wine/
140 install -m
644 wine.ini $BR/etc/wine/wine.conf
142 # Put all our dlls in a seperate directory. (this works only if
143 # you have a buildroot)
144 install -d $BR/usr/X11R6/lib/wine
145 mv $BR/usr/X11R6/lib/lib* $BR/usr/X11R6/lib/wine/
147 # the clipboard server is started on demand.
148 install -m
755 windows/x11drv/wineclipsrv $BR/usr/X11R6/bin/
150 # The WINE server is needed.
151 install -m
755 server/wineserver $BR/usr/X11R6/bin/
154 Here we unfortunately do need to create
155 <filename>wineuser.reg
</filename> and
156 <filename>winesystem.reg
</filename> from the WINE
157 distributed
<filename>winedefault.reg
</filename>. This
158 can be done using
<command>./regapi
</command> once for
159 one example user and then reusing his
160 <filename>.wine/user.reg
</filename> and
161 <filename>.wine/system.reg
</filename> files.
164 <para>this needs to be done better
</para>
168 install -m
644 wine.sytemreg $BR/etc/wine/
169 install -m
644 wine.userreg $BR/etc/wine/
172 There are now a lot of libraries generated by the
173 build process, so a seperate library directory should
177 install -d
755 $BR/usr/X11R6/lib/
181 You will need to package the files:
184 $prefix/bin/wine, $prefix/bin/dosmod, $prefix/lib/wine/*
185 $prefix/man/man1/wine
.1, $prefix/include/wine/*,
186 $prefix/bin/wineserver, $prefix/bin/wineclipsrv
189 %doc ... choose from the toplevel directory and documentation/
192 The post-install script:
195 if ! grep -q /usr/X11R6/lib/wine /etc/ld.so.conf; then
196 echo
"/usr/X11R6/lib/wine" >> /etc/ld.so.conf
201 The post-uninstall script:
204 if [
"$1" =
0 ]; then
205 perl -ni -e 'print unless m:/usr/X11R6/lib/wine:;' /etc/ld.so.conf
211 <para>Creating a good default configuration file
</para>
213 For the rationales of needing as less input from the
214 user as possible arises the need for a very good
215 configuration file. The one supplied with WINE is
216 currently lacking. We need:
226 A for the floppy. Specify your distributions
227 default floppy mountpoint here.
235 C for the
<filename>C:\
</filename> directory.
236 Here we use the users homedirectory, for most
237 applications do see
<filename>C:\
</filename>
238 as root-writeable directory of every windows
239 installation and this basically is it in the
248 R for the CD-Rom drive. Specify your
249 distributions default CD-ROM drives mountpoint
258 T for temporary storage. We do use
259 <filename>/tmp/
</filename> (rationale: between
260 process temporary data belongs to
261 <filename>/tmp/
</filename>, FHS
2.0)
266 W for the original Windows installation. This
268 <filename>windows\
</filename> subdirectory of
269 the original windows installation. This avoids
270 problems with renamed
271 <filename>windows
</filename> directories (as
272 for instance
<filename>lose95
</filename>,
273 <filename>win
</filename> or
274 <filename>sys\win95
</filename>). During
275 compile/package/install we leave this to be
276 <filename>/
</filename>, it has to be
277 configured after the package install.
282 Z for the UNIX Root directory. This avoids any
283 problems with
"could not find drive for
284 current directory" users occasionaly complain
285 about in the newsgroup and the ircchannel. It
286 also makes the whole directory structure
287 browseable. The type of Z should be network,
288 so applications expect it to be readonly.
301 Windows=c:\windows\ (the windows/ subdirectory in the users
303 System=c:\windows\system\ (the windows/system subdirectory in the users
305 Path=c:\windows;c:\windows\system;c:\windows\system32;w:\;w:\system;w:\system32;
306 ; Using this trick we have in fact two windows installations in one, we
307 ; get the stuff from the readonly installation and can write to our own.
308 Temp=t:\ (the TEMP directory)
312 <para>[Tweak.Layout]
</para>
314 WineLook=win95 (just the coolest look ;)
319 Possibly modify the [spooler], [serialports] and
320 [parallelports] sections.
324 <para>possibly more, including printer stuff.
</para>
329 <para>Add this prepared configuration file to the package.
</para>
332 <para>Installing WINE for the system administrator
</para>
334 Install the package using the usual packager
335 <command>rpm -i wine.rpm
</command>. You may edit
336 <filename>/etc/wine/wine.conf
</filename>, [Drive W],
337 to point to a possible windows installation right
338 after the install. That's it.
341 Note that on Linux you should somehow try to add the
342 <option>unhide
</option> mount option (see
<command>man
343 mount
</command>) to the CD-ROM entry in
344 <filename>/etc/fstab
</filename> during package
345 install, as several stupid Windows programs mark some
346 setup (!) files as hidden (ISO9660) on CD-ROMs, which
347 will greatly confuse users as they won't find their
348 setup files on the CD-ROMs as they were used on
349 Windows systems when
<option>unhide
</option> is not
350 set ;-\ And of course the setup program will complain
351 that
<filename>setup.ins
</filename> or some other mess
352 is missing... If you choose to do so, then please make
353 this change verbose to the admin.
357 <para>Installing WINE for the user
</para>
359 The user will need to run a setup script before the
360 first invocation of WINE. This script should:
365 Copy
<filename>/etc/wine/wine.conf
</filename> for
371 Allow specification of the original windows
372 installation to use (which modifies the copied
373 <filename>wine.conf
</filename> file).
378 Create the windows directory structure
379 (
<filename>c:\windows
</filename>,
380 <filename>c:\windows\system
</filename>,
381 <filename>c:\windows\Start Menu\Programs
</filename>,
382 <filename>c:\Program Files
</filename>,
383 <filename>c:\Desktop
</filename>, etc.)
388 Symlink all
<filename>.dll
</filename> and
389 <filename>.exe
</filename> files from the original
390 windows installation to the
391 <filename>windows
</filename> directory. Why? Some
392 programs reference
"%windowsdir%/file.dll" or
393 "%systemdir%/file.dll" directly and fail if they
397 This will give a huge number of symlinks, yes.
398 However, if an installer later overwrites on of
399 those files, it will overwrite the symlink (so
400 that the file now lies in the
401 <filename>windows/
</filename> subdirectory).
405 <para>Not sure this is needed for all files.
</para>
410 On later invocation the script might want to
411 compare regular files in the users windows
412 directories and in the global windows directories
413 and replace same files by symlinks (to avoid
426 This procedure requires:
431 <para>Much thought and work from the packager (
1x)
</para>
435 No work for the sysadmin. Well except one
<command>rpm
436 -i
</command> and possible one edit of the configuration
442 Some or no work from the user, except running the per-user
447 <para>It scales well and suffices most of the rationales.
</para>
452 <bridgehead>Sample
<filename>wine.ini
</filename> for OpenLinux
2.x:
</bridgehead>
456 ;; MS-DOS drives configuration
458 ;; Each section has the following format:
460 ;; Path=xxx (Unix path for drive root)
461 ;; Type=xxx (supported types are 'floppy', 'hd', 'cdrom' and 'network')
462 ;; Label=xxx (drive label, at most
11 characters)
463 ;; Serial=xxx (serial number,
8 characters hexadecimal number)
464 ;; Filesystem=xxx (supported types are 'msdos'/'dos'/'fat', 'win95'/'vfat', 'unix')
465 ;; This is the FS Wine is supposed to emulate on a certain
466 ;; directory structure.
468 ;; -
"win95" for ext2fs, VFAT and FAT32
469 ;; -
"msdos" for FAT16 (ugly, upgrading to VFAT driver strongly recommended)
470 ;; DON'T use
"unix" unless you intend to port programs using Winelib !
471 ;; Device=/dev/xx (only if you want to allow raw device access)
478 ; OpenLinux uses an automounter under /auto/, so we use that too.
489 ; Comment in ONLY if you have a second floppy or the automounter hangs
502 ; Drive 'C' links to the users homedirectory.
504 ; This must point to a writeable directory structure (not your readonly
505 ; mounted DOS partitions!) since programs want to dump stuff into
506 ;
"Program Files/" "Programme/",
"windows/",
"windows/system/" etc.
508 ; The basic structure is set up using the config script.
519 ; The temp drive (and directory) points to /tmp/. Windows programs fill it
520 ; with junk, so it is approbiate.
529 ; 'U'ser homedirectory
531 ; Just in case you want C:\ elsewhere.
540 ; CD-'R'OM drive (automounted)
542 ; The default cdrom drive.
544 ; If an application (or game) wants a specific CD-ROM you might have to
545 ; temporary change the Label to the one of the CD itself.
547 ; How to read them is described in /usr/doc/wine-cvs-xxxxx/cdrom-labels.
556 ; The drive where the old windows installation resides (it points to the
557 ; windows/ subdirectory).
559 ; The Path is modified by the winesetup script.
567 ; The UNIX Root directory, so all other programs and directories are reachable.
569 ; type network is used to tell programs to not write here.
578 ; Standard Windows path entries. WINE will not work if they are incorrect.
582 ; The windows/ directory. It must be writeable, for programs write into it.
586 ; The windows/system/ directory. It must be writeable, for especially setup
587 ; programs install dlls in there.
589 System=c:\windows\system
591 ; The temp directory. Should be cleaned regulary, since install programs leave
592 ; junk without end in there.
596 ; The dll search path. It should contain at least:
597 ; - the windows and the windows/system directory of the user.
598 ; - the global windows and windows/system directory (from a possible readonly
599 ; windows installation either on msdos filesystems or somewhere in the UNIX
601 ; - any other windows style directories you want to add.
603 Path=c:\windows;c:\windows\system;c:\windows\system32;t:\;w:\;w:\system;w:\system32
605 ; Outdated and no longer used. (but needs to be present).
607 SymbolTableFile=./wine.sym
612 ; Dll loadorder defaults. No need to modify.
615 EXTRA_LD_LIBRARY_PATH=${HOME}/wine/cvs/lib
616 DefaultLoadOrder = native, elfdll, so, builtin
619 ; What
32/
16 dlls belong to each other (context wise). No need to modify.
635 ; What type of dll to use in their respective loadorder.
638 kernel32, gdi32, user32 = builtin
639 kernel, gdi, user = builtin
641 comdlg32, commdlg = elfdll, builtin, native
642 version, ver = elfdll, builtin, native
643 shell32, shell = builtin, native
644 lz32, lzexpand = builtin, native
645 commctrl, comctl32 = builtin, native
646 wsock32, winsock = builtin
647 advapi32, crtdll, ntdll = builtin, native
648 mpr, winspool = builtin, native
649 ddraw, dinput, dsound = builtin, native
650 winmm, mmsystem = builtin
651 msvideo, msvfw32 = builtin, native
652 mcicda.drv, mciseq.drv = builtin, native
653 mciwave.drv = builtin, native
654 mciavi.drv, mcianim.drv = native, builtin
656 wnaspi32, wow32 = builtin
657 system, display, wprocs = builtin
661 ; Options section. Does not need to be edited.
664 ; allocate how much system colors on startup. No need to modify.
665 AllocSystemColors=
100
668 ; Font specification. You usually do not need to edit this section.
670 ; Read documentation/fonts before adding aliases
673 ; The resolution defines what fonts to use (usually either
75 or
100 dpi fonts,
677 Default = -adobe-times-
680 ; serial ports used by
"COM1" "COM2" "COM3" "COM4". Useful for applications
681 ; that try to access serial ports.
686 Com3=/dev/modem,
38400
690 ; parallel port(s) used by
"LPT1" etc. Useful for applications that try to
691 ; access these ports.
697 ; What spooling program to use on printing.
698 ; Use
"|program" or
"filename", where the output will be dumped into.
702 LPT2:=|gs -sDEVICE=bj200 -sOutputFile=/tmp/fred -q -
706 ; Allow port access to WINE started by the root user. Useful for some
707 ; supported devices, but it can make the system unstable.
708 ; Read /usr/doc/wine-cvs-xxxxx/ioport-trace-hints.
711 ;read=
0x779,
0x379,
0x280-
0x2a0
712 ;write=
0x779,
0x379,
0x280-
0x2a0
714 ; debugging, not need to be modified.
716 Exclude=WM_SIZE;WM_TIMER;
719 ; What names for the registry datafiles, no need to modify.
722 ; Paths must be given in /dir/dir/file.reg format.
723 ; Wine will not understand dos file names here...
724 ;UserFileName=xxx ; alternate registry file name (user.reg)
725 ;LocalMachineFileName=xxx ; (system.reg)
728 ; Layout/Look modifications. Here you can switch with a single line between
729 ; windows
3.1 and windows
95 style.
730 ; This does not change WINE behaviour or reported versions, just the look!
733 ;; WineLook=xxx (supported styles are 'Win31'(default), 'Win95', 'Win98')
737 ; What programs to start on WINE startup. (you should probably leave it empty)
755 <!-- Keep this comment at the end of the file
758 sgml-parent-document:("wine-doc.sgml" "book" "part" "chapter" "")