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
20 # Apr 9 2000 - Ove Kåven
21 # make root's registry global (system-default)
22 # May 9 2000 - Ove Kåven
23 # use ttydrv when running regapi, so we don't have to run from X
24 # change debugger path in registry
26 #--- defaults (change these if you are a packager)
27 CONFARGS
= # configure args, e.g. --prefix=/usr --sysconfdir=/etc
28 prefix
=/usr
/local # installation prefix
29 sysconfdir
=$prefix/etc
# where wine.conf and global registry is supposed to be
30 bindir
=$prefix/bin
# where winelib apps will be (or is) installed
31 libdir
=$prefix/lib
# where libwine.so will be (or is) installed
32 exdir
=documentation
/samples
# where the example system.ini resides
33 CONF
=$sysconfdir/wine.conf
# default path of the wine.conf
34 BINDIST
=no
# whether called from a binary package config script
35 DOCONF
=auto
# whether to autogenerate wine.conf
36 DOWCHK
=auto
# whether to autoconfigure existing-windows installation
37 DOWINE
=auto
# whether to autoconfigure no-windows installation
38 DOREG
=auto
# whether to install default registry
39 SYSREG
=yes # whether to make root's registry global (system-default)
41 # "make install" still installs the dlls into $libdir, but this may change in the future
42 # (DLLPATH should point to them if/when they are not in standard ld.so paths)
43 DLLPATH
=$libdir/wine
# default path of the dll .so files (except libwine.so)
45 # having the Wine debugger launched automatically will be a plus for us
46 DEBUGGER
=$bindir/winedbg
# the (installed) path of winedbg
47 HDEBUGGER
=debugger
/winedbg
# the (non-installed) path of winedbg
49 # this is only for existing-windows installs
50 WINECONF
=tools
/wineconf
# the path of wineconf perl script
52 # this is only for no-windows installs
53 WINEINI
=wine.ini
# the path of default wine.ini (also used by wineconf)
54 WININI
=/dev
/null
# the path of default win.ini
55 SYSTEMINI
=$exdir/system.ini
# the path of default system.ini
56 REGAPI
=programs
/regapi
/regapi
# the path of regapi winelib application
57 DEFREG
=winedefault.reg
# the path of the registry file to be fed to regapi
58 # CROOT=/var/wine # the path of the fake Drive C (asks user if not set)
61 # temporary files used by the installer
62 TMPCONF
=/tmp
/wineinstall.conf
63 TMPREG
=/tmp
/wineinstall.reg
67 echo "WINE Installer v0.4"
70 if [ "$BINDIST" = 'no' ]
75 echo "You're running this from the wrong directory."
76 echo "Change to the Wine directory and try again."
81 # check whether RPM installed, and if it is, remove any old wine rpm.
82 hash rpm
; RET
=$?
&>/dev
/null
83 if [ $RET -eq 0 ]; then
84 if [ -n "`rpm -qi wine 2>/dev/null|grep "^Name
"`" ]; then
85 echo "Warning: Old Wine RPM install detected. We want to get rid of it first."
88 if [ "$DOWINE" != 'n' -a "$DOWINE" != 'N' ]; then
89 echo Starting wine rpm removal...
91 if [ $RET -eq 0 ]; then
94 echo "FAILED. Probably you aren't installing as root."
97 echo "Sorry, I won't install Wine when an rpm version is still installed."
98 echo "(Wine support suffered from way too many conflicts)"
99 echo "Have a nice day !"
105 # run the configure script, if necessary
107 if [ -f config.cache
] && [ -f Makefile
] && [ Makefile
-nt configure
]
109 echo "I see that WINE has already been configured, so I'll skip that."
110 # load configure results
114 echo "Running configure..."
116 if ! .
/configure
$CONFARGS
119 echo "Configure failed, aborting install."
124 # load configure results
126 # make sure X was found
128 if [ "$have_x" != "yes" ]
130 echo "Install the X development headers and try again."
134 elif [ "$ac_cv_header_X11_xpm_h" != "yes" ]
136 echo "Install the Xpm development headers and try again."
144 # now do the compilation
146 if [ -f wine
] && [ wine
-nt Makefile
]
148 echo "Hmm, looks like WINE is already compiled. I'll skip that too, I guess."
151 echo "Compiling WINE. Grab a lunch or two, rent a video, or whatever, in the meantime..."
153 if ! { make depend
&& make; }
156 echo "Compilation failed, aborting install."
164 # and installation, if root
166 if [ `whoami` != 'root' ]
168 echo "You aren't root, so I'll skip the make install."
169 # setup to run from current directory
171 if [ -z "$LD_LIBRARY_PATH" ]
172 then LD_LIBRARY_PATH
="$PWD:$DLLPATH"
173 else LD_LIBRARY_PATH
="$LD_LIBRARY_PATH:$PWD:$DLLPATH"
175 export LD_LIBRARY_PATH
176 DEBUGGER
="$PWD/$HDEBUGGER"
178 echo "NOTE! To run Wine without installing, you must set the environment variable"
179 echo "LD_LIBRARY_PATH to $PWD:$DLLPATH"
180 echo "in your logon scripts."
183 echo "Now installing binaries onto the system..."
188 echo "Installation failed, aborting."
192 if [ -f /etc
/ld.so.conf
] && ! grep -qs "$libdir" /etc
/ld.so.conf
195 echo "$libdir didn't exist in your /etc/ld.so.conf, adding it now..."
196 echo "$libdir" >>/etc
/ld.so.conf
197 echo "Re-running ldconfig..."
198 eval "$ac_cv_path_LDCONFIG"
208 # now check whether we should generate wine.conf
213 if [ "$DOCONF" = 'auto' ]
215 # see if we already have a system wine.conf
222 if [ "$DOCONF" != 'no' ]
224 if [ `whoami` != 'root' ]
229 if [ "$DOCONF" != 'yes' ]
231 echo "Since you aren't root, and there's no system wine.conf, I assume"
232 echo "you want a user-specific .winerc. Am I correct? (yes/no)"
233 while [ "$DOCONF" != 'yes' ] && [ "$DOCONF" != 'no' ]
238 if [ "$DOCONF" = 'no' ]
240 echo "Aborting install. Try again as root to generate a system wine.conf."
256 # generate wine.conf from existing windows install, if any
257 if [ "$DOCONF" = 'yes' ]
259 if [ "$DOWCHK" = 'yes' ] ||
[ "$DOWCHK" = 'auto' ]
261 echo "Searching for an existing Windows installation..."
262 if ! $WINECONF > $CONF 2>/dev
/null
266 echo "Windows was not found on your system, so I assume you want a Wine-only installation."
267 echo "Am I correct? (yes/no)"
268 while [ "$DOWINE" != 'yes' ] && [ "$DOWINE" != 'no' ]
271 if [ "$DOWINE" = 'no' ]
273 echo "Aborting install. Make sure your Windows partition is mounted and try again,"
274 echo "or create $CONF manually by copying from $WINEINI and adapting the drive paths."
281 echo "Created $CONF using your existing Windows installation."
282 echo "You probably want to review the file, though."
288 elif [ "$DOWINE" = 'auto' ]
292 elif [ "$DOWINE" = 'auto' ]
296 # setup a no-windows installation, if necessary
297 if [ "$DOWINE" = 'yes' ]
299 if [ `whoami` != 'root' ]
303 echo "Configuring Wine without Windows. Some fake Windows directories must be created, to"
304 echo "hold any .ini files, DLLs, and start menu entries your applications may need to install."
305 while [ -z "$CROOT" ]
307 echo "Where would you like your fake C drive to be placed? (default is $DCROOT)"
314 if ! mkdir
-p "$CROOT"
321 echo "Configuring Wine for a no-windows install in $CROOT..."
322 for tdir
in "$CROOT/windows" "$CROOT/windows/system" "$CROOT/windows/Start Menu" "$CROOT/windows/Start Menu/Programs" "$CROOT/Common Files" "$CROOT/windows/Profiles/Administrator" "$CROOT/Program Files"
323 do [ -d "$tdir" ] || mkdir
"$tdir"
325 [ -f "$CROOT/windows/win.ini" ] ||
cp "$WININI" "$CROOT/windows/win.ini"
326 [ -f "$CROOT/windows/system.ini" ] ||
cp "$SYSTEMINI" "$CROOT/windows/system.ini"
327 if [ "$DOCONF" = 'yes' ]
329 sed "s|Path=/c\$|Path=${CROOT}|" $WINEINI > $CONF
330 echo "Created $CONF using default Wine configuration."
331 echo "You probably want to review the file, though."
334 # now we really should install the registry
335 if [ "$DOREG" = 'auto' ]
341 echo "Reading current Wine configuration from $CONF..."
342 CROOT
=`sed -n '/^\[Drive C\]$/,/^\[.*\]$/ s/^Path=\(.*\)/\1/p' $CONF`
343 echo "Drive C is configured at $CROOT."
348 # fixup EXTRA_LD_LIBRARY_PATH
349 if [ "$DOCONF" = 'yes' ]
351 echo "Setting EXTRA_LD_LIBRARY_PATH in .winerc to $DLLPATH..."
352 sed "s|EXTRA_LD_LIBRARY_PATH=.*|EXTRA_LD_LIBRARY_PATH=${DLLPATH}|" $CONF > $CONF.new
353 mv -f $CONF.new
$CONF
358 # check whether we need to install default registry
359 # (not to be done if windows registry exists)
360 if [ "$DOREG" = 'auto' ]
362 echo "Checking for real Windows registry..."
363 if [ -f "$CROOT/windows/system.dat" ]
365 elif [ -f "$CROOT/windows/system32/config/system" ]
369 if [ "$DOREG" = 'yes' ]
370 then echo "Not found, default Wine registry will be installed."
371 else echo "Windows registry found, will not install default Wine registry."
377 # install default registry entries
378 if [ "$DOREG" = 'yes' ]
380 if [ "$BINDIST" = 'no' ]
382 echo "Compiling regapi..."
384 (cd programs
/regapi
; make)
388 echo "Preparing to install default Wine registry entries..."
390 # create a temporary wineinstall.conf file using ttydrv,
391 # so that we don't have to run regapi under X
392 sed "s/GraphicsDriver=.*/GraphicsDriver=ttydrv/" $CONF > $TMPCONF
394 # create a temporary wineinstall.reg with fixed debugger path
395 sed "s|debugger/winedbg|${DEBUGGER}|" $DEFREG > $TMPREG
397 echo "Installing default Wine registry entries..."
399 if ! $REGAPI --config $TMPCONF setValue
< $TMPREG > /dev
/null
401 rm -f $TMPCONF $TMPREG
403 echo "Registry install failed."
406 else echo "Registry entries successfully installed."
408 rm -f $TMPCONF $TMPREG
409 if [ "$SYSREG" = 'auto' ]
415 # make root's registry global, if desired
416 if [ `whoami` = 'root' ] && [ "$SYSREG" = 'yes' ]
418 [ -d ~
/.wine
] || mkdir ~
/.wine
419 if ! [ -f $sysconfdir/wine.userreg
]
421 echo "Linking root's user registry hive to the global registry..."
422 cp ~
/.wine
/wine.userreg
$sysconfdir/wine.userreg
423 ln -sf $sysconfdir/wine.userreg ~
/.wine
/wine.userreg
426 if ! [ -f $sysconfdir/wine.systemreg
]
428 echo "Linking root's system registry hive to the global registry..."
429 cp ~
/.wine
/system.reg
$sysconfdir/wine.systemreg
430 ln -sf $sysconfdir/wine.systemreg ~
/.wine
/system.reg
438 echo "Installation complete for now. Good luck (this is still alpha software)."
439 echo "If you have problems with WINE, please read the documentation first,"
440 echo "as many kinds of potential problems are explained there."