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, wineuser.reg, winesystem.reg) 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
47 make install prefix=$BUILDROOT/usr/X11R6/
49 install -m 644 wine.ini /etc/wine/wine.conf
51 Here we unfortunately do need to create wineuser.reg and winesystem.reg
52 from the WINE distributed winedefault.reg. This can be done using
53 ./regapi once for one example user and the reusing his .wine/user.reg
54 and .wine/system.reg files. [FIXME: this needs to be done better]
56 install -m 644 winesytem.reg /etc/wine/
57 install -m 644 wineuser.reg /etc/wine/
59 You will need to package the files:
60 $prefix/bin/wine, $prefix/bin/dosmod, $prefix/lib/libwine.so.1.0,
61 $prefix/man/man1/wine.1, $prefix/include/wine/*,
64 %doc ... choose from the toplevel directory and documentation/
66 Do not forget ldconfig for the postinstall, the postuninstall and 'rm
67 libwine.so' for the postuninstall.
69 2.2 Creating a good default configuration file
71 For the rationales of needing as less input from the user as possible
72 arises the need for a very good configuration file. The one supplied
73 with WINE is currently lacking. We need:
76 + A for the floppy. Specify your distributions default floppy mountpoint
77 here. (Path=/auto/floppy)
78 + C for the C:\ directory. Here we use the users homedirectory, for most
79 applications do see C:\ as root-writeable directory of every windows
80 installation and this basically is it in the UNIX-user context.
82 + R for the CD-Rom drive. Specify your distributions default CD-ROM drives
83 mountpoint here. (Path=/auto/cdrom)
84 + T for temporary storage. We do use /tmp/ (rationale: between process
85 temporary data belongs to /tmp/, FHS 2.0)
86 + W for the original Windows installation. This drive points to the
87 windows\ subdirectory of the original windows installation. This avoids
88 problems with renamed 'windows' directories (as for instance 'lose95',
89 'win' or 'sys\win95'). During compile/package/install we leave this
90 to be '/', it has to be configured after the package install.
91 + Z for the UNIX Root directory (Path=/). This avoids any problems with
92 "could not find drive for current directory" users occasionaly complain
93 about in the newsgroup and the ircchannel. It also makes the whole
94 directory structure browseable. The type of Z should be network, so
95 applications expect it to be readonly.
98 Windows=c:\windows\ (the windows/ subdirectory in the users
100 System=c:\windows\system\ (the windows/system subdirectory in the users
102 Path=c:\windows;c:\windows\system;c:\windows\system32;w:\;w:\system;w:\system32;
103 ; Using this trick we have in fact two windows installations in one, we
104 ; get the stuff from the readonly installation and can write to our own.
105 Temp=t:\ (the TEMP directory)
107 WineLook=win95 (just the coolest look ;)
108 - Possibly modify the [spooler], [serialports] and [parallelports] sections.
109 (FIXME: possibly more, including printer stuff)
111 Add this prepared configuration file to the package.
113 2.3 Installing WINE for the system administrator
115 Install the package using the usual packager "rpm -i wine.rpm".
116 You may edit /etc/wine/wine.conf, [Drive W], to point to a possible windows
117 installation right after the install. Thats it.
119 2.4 Installing WINE for the user
121 The user will need to run a setup script before the first invocation of
122 WINE. This script should:
123 - Copy /etc/wine/wine.conf for user modification.
124 - Allow specification of the original windows installation to use (which
125 modifies the copied wine.conf file).
126 - Create the windows directory structure (c:\windows,c:\windows\system,
127 c:\Program Files,c:\Desktop,etc...)
129 (FIXME: Not sure this is needed for all files:)
130 - Symlink all .dll and .exe files from the original windows installation to
131 the windows directory. Why? Some program reference "%windowsdir%/file.dll"
132 or "%systemdir%/file.dll" directly and fail if there are not present.
133 This will give a huge number of symlinks, yes. However, if an installer
134 later overwrites on of those files, it will overwrite the symlink (so
135 that the file now lies in the windows/ subdirectory).
137 - On later invocation the script might want to compare regular files in
138 the users windows directories and in the global windows directories and
139 replace same files by symlinks (to avoid diskspace problems).
143 This procedure requires:
144 - Much thought and work from the packager (1x)
145 - No work for the sysadmin. Well except one "rpm -i" and possible one edit
146 of the configuration file.
147 - Some or no work from the user, except running the per-user setup script
149 => It scales well and suffices most of the rationales.
151 Marcus Meissner <marcus@jet.franken.de>