2 # WINE Installation script
4 # Mar 31 1999 - Ove Kåven
6 # Dec 9 1999 - Ove Kåven
8 # Feb 25 2000 - Ove Kåven
9 # auto-add /usr/local/lib to /etc/ld.so.conf
10 # Mar 2 2000 - Ove Kåven
11 # source rather than grep config.cache
12 # use sourced config.cache to start ldconfig
13 # reconfigure if config.cache doesn't exist
14 # Mar 30 2000 - Ove Kåven
15 # autoconfigure no-windows installs
16 # do not install registry on real-windows installs
17 # some support for binary package installs
18 # set and tell user about LD_LIBRARY_PATH if necessary
19 # set EXTRA_LD_LIBRARY_PATH in wine.conf
21 # defaults (change these if you are a packager)
22 CONFARGS
= # configure args, e.g. --prefix=/usr --sysconfdir=/etc
23 prefix
=/usr
/local # installation prefix
24 sysconfdir
=$prefix/etc
# where wine.conf is supposed to be
25 libdir
=$prefix/lib
# where libwine.so will be installed
26 CONF
=$sysconfdir/wine.conf
# default path of the wine.conf
27 BINDIST
=no
# whether called from a binary package config script
28 DOCONF
=auto
# whether to autogenerate wine.conf
29 DOWCHK
=auto
# whether to autoconfigure existing-windows installation
30 DOWINE
=auto
# whether to autoconfigure no-windows installation
31 DOREG
=auto
# whether to install default registry
32 # elfdlls are not implemented yet, so this has no effect yet
33 DLLPATH
=$libdir/wine
# default path of the elfdll .so files
34 # only for existing-windows installs
35 WINECONF
=tools
/wineconf
# the path of wineconf perl script (for existing-windows)
36 # only for no-windows installs
37 WINEINI
=wine.ini
# the path of default wine.ini (also used by wineconf)
38 WININI
=/dev
/null
# the path of default win.ini
39 SYSTEMINI
=documentation
/samples
/system.ini
# the path of default system.ini
40 REGAPI
=programs
/regapi
/regapi
# the path of regapi winelib application
41 DEFREG
=winedefault.reg
# the path of the registry file to be fed to regapi
42 # CROOT=/var/wine # the path of the fake Drive C (for no-windows)
46 echo "WINE Installer v0.3"
49 if [ "$BINDIST" = 'no' ]
54 echo "You're running this from the wrong directory."
55 echo "Change to the Wine directory and try again."
60 # run the configure script, if necessary
62 if [ -f config.cache
] && [ -f Makefile
] && [ Makefile
-nt configure
]
64 echo "I see that WINE has already been configured, so I'll skip that."
65 # load configure results
69 echo "Running configure..."
71 if ! .
/configure
$CONFARGS
74 echo "Configure failed, aborting install."
79 # load configure results
81 # make sure X was found
83 if [ "$have_x" != "yes" ]
85 echo "Install the X development headers and try again."
89 elif [ "$ac_cv_header_X11_xpm_h" != "yes" ]
91 echo "Install the Xpm development headers and try again."
99 # now do the compilation
101 if [ -f wine
] && [ wine
-nt Makefile
]
103 echo "Hmm, looks like WINE is already compiled. I'll skip that too, I guess."
106 echo "Compiling WINE. Grab a lunch or two, rent a video, or whatever, in the meantime..."
108 if ! { make depend
&& make; }
111 echo "Compilation failed, aborting install."
119 # and installation, if root
121 if [ `whoami` != 'root' ]
123 echo "You aren't root, so I'll skip the make install."
124 # setup to run from current directory
126 if [ -z "$LD_LIBRARY_PATH" ]
127 then LD_LIBRARY_PATH
="$PWD:$DLLPATH"
128 else LD_LIBRARY_PATH
="$LD_LIBRARY_PATH:$PWD:$DLLPATH"
130 export LD_LIBRARY_PATH
132 echo "NOTE! To run Wine without installing, you must set the environment variable"
133 echo "LD_LIBRARY_PATH to $PWD:$DLLPATH"
134 echo "in your logon scripts."
137 echo "Now installing binaries onto the system..."
142 echo "Installation failed, aborting."
146 if [ -f /etc
/ld.so.conf
] && ! grep -qs "$libdir" /etc
/ld.so.conf
149 echo "$libdir didn't exist in your /etc/ld.so.conf, adding it now..."
150 echo "$libdir" >>/etc
/ld.so.conf
151 echo "Re-running ldconfig..."
152 eval "$ac_cv_path_LDCONFIG"
162 # now check whether we should generate wine.conf
167 if [ "$DOCONF" = 'auto' ]
169 # see if we already have a system wine.conf
176 if [ "$DOCONF" != 'no' ]
178 if [ `whoami` != 'root' ]
183 if [ "$DOCONF" != 'yes' ]
185 echo "Since you aren't root, and there's no system wine.conf, I assume"
186 echo "you want a user-specific .winerc. Am I correct? (yes/no)"
187 while [ "$DOCONF" != 'yes' ] && [ "$DOCONF" != 'no' ]
192 if [ "$DOCONF" = 'no' ]
194 echo "Aborting install. Try again as root to generate a system wine.conf."
210 # generate wine.conf from existing windows install, if any
211 if [ "$DOCONF" = 'yes' ]
213 if [ "$DOWCHK" = 'yes' ] ||
[ "$DOWCHK" = 'auto' ]
215 echo "Searching for an existing Windows installation..."
216 if ! $WINECONF > $CONF 2>/dev
/null
220 echo "Windows was not found on your system, so I assume you want a Wine-only installation."
221 echo "Am I correct? (yes/no)"
222 while [ "$DOWINE" != 'yes' ] && [ "$DOWINE" != 'no' ]
225 if [ "$DOWINE" = 'no' ]
227 echo "Aborting install. Make sure your Windows partition is mounted and try again,"
228 echo "or create $CONF manually by copying from $WINEINI and adapting the drive paths."
235 echo "Created $CONF using your existing Windows installation."
236 echo "You probably want to review the file, though."
242 elif [ "$DOWINE" = 'auto' ]
246 elif [ "$DOWINE" = 'auto' ]
250 # generate wine.conf for no-windows install, if necessary
251 if [ "$DOWINE" = 'yes' ]
253 if [ `whoami` != 'root' ]
257 echo "Configuring Wine without Windows. Some fake Windows directories must be created, to"
258 echo "hold any .ini files, DLLs, and start menu entries your applications may need to install."
259 while [ -z "$CROOT" ]
261 echo "Where would you like your fake C drive to be placed? (default is $DCROOT)"
268 if ! mkdir
-p "$CROOT"
275 echo "Configuring Wine for a no-windows install in $CROOT..."
276 for tdir
in "$CROOT/windows" "$CROOT/windows/system" "$CROOT/windows/Start Menu" "$CROOT/windows/Start Menu/Programs"
277 do [ -d "$tdir" ] || mkdir
"$tdir"
279 [ -f "$CROOT/windows/win.ini" ] ||
cp "$WININI" "$CROOT/windows/win.ini"
280 [ -f "$CROOT/windows/system.ini" ] ||
cp "$SYSTEMINI" "$CROOT/windows/system.ini"
281 if [ "$DOCONF" = 'yes' ]
283 sed "s/Path=\/c$/Path=${CROOT//\//\\/}/" $WINEINI > $CONF
284 echo "Created $CONF using default Wine configuration."
285 echo "You probably want to review the file, though."
288 # now we really need to install the registry
293 echo "Reading current Wine configuration from $CONF..."
294 CROOT
=`sed -n '/^\[Drive C\]$/,/^\[.*\]$/ s/^Path=\(.*\)/\1/p' $CONF`
295 echo "Drive C is configured at $CROOT."
300 # fixup EXTRA_LD_LIBRARY_PATH
301 if [ "$DOCONF" = 'yes' ]
303 echo "Setting EXTRA_LD_LIBRARY_PATH in .winerc to $DLLPATH..."
304 sed "s/EXTRA_LD_LIBRARY_PATH=.*/EXTRA_LD_LIBRARY_PATH=${DLLPATH//\//\\/}/" $CONF > $CONF.new
305 mv -f $CONF.new
$CONF
310 # check whether we need to install default registry
311 # (not to be done if windows registry exists)
312 if [ "$DOREG" = 'auto' ]
314 echo "Checking for real Windows registry..."
315 if [ -f "$CROOT/windows/system.dat" ]
317 elif [ -f "$CROOT/windows/system32/config/system" ]
321 if [ "$DOREG" = 'yes' ]
322 then echo "Not found, default Wine registry will be installed."
323 else echo "Windows registry found, will not install default Wine registry."
329 # install default registry entries
330 if [ "$DOREG" = 'yes' ]
332 if [ "$BINDIST" = 'no' ]
334 echo "Compiling regapi..."
336 (cd programs
/regapi
; make)
340 echo "Installing default Wine registry entries..."
342 if ! $REGAPI setValue
< $DEFREG > /dev
/null
345 echo "Registry install failed. Perhaps you weren't running X."
348 else echo "Registry successfully installed."
350 # FIXME: perhaps install registry to $sysconfdir/winesystem.reg and $sysconfdir/wineuser.reg?
354 echo "Installation complete for now. Good luck (this is still alpha software)."
355 echo "If you have problems with WINE, please read the documentation first,"
356 echo "as many kinds of potential problems are explained there."