1999-04-18 15:16:29 +02:00
|
|
|
|
#!/bin/bash
|
|
|
|
|
# WINE Installation script
|
2000-10-29 19:02:53 +01:00
|
|
|
|
# Can do almost everything from compiling to configuring...
|
1999-04-18 15:16:29 +02:00
|
|
|
|
|
|
|
|
|
# Mar 31 1999 - Ove K<>ven
|
|
|
|
|
# First version
|
2000-02-25 21:51:09 +01:00
|
|
|
|
# Dec 9 1999 - Ove K<>ven
|
|
|
|
|
# require Xpm
|
|
|
|
|
# Feb 25 2000 - Ove K<>ven
|
|
|
|
|
# auto-add /usr/local/lib to /etc/ld.so.conf
|
2000-03-04 20:13:52 +01:00
|
|
|
|
# Mar 2 2000 - Ove K<>ven
|
|
|
|
|
# source rather than grep config.cache
|
|
|
|
|
# use sourced config.cache to start ldconfig
|
|
|
|
|
# reconfigure if config.cache doesn't exist
|
2000-04-08 22:20:21 +02:00
|
|
|
|
# Mar 30 2000 - Ove K<>ven
|
|
|
|
|
# autoconfigure no-windows installs
|
|
|
|
|
# do not install registry on real-windows installs
|
|
|
|
|
# some support for binary package installs
|
|
|
|
|
# set and tell user about LD_LIBRARY_PATH if necessary
|
|
|
|
|
# set EXTRA_LD_LIBRARY_PATH in wine.conf
|
2000-04-15 22:37:14 +02:00
|
|
|
|
# Apr 9 2000 - Ove K<>ven
|
|
|
|
|
# make root's registry global (system-default)
|
2000-05-10 00:32:42 +02:00
|
|
|
|
# May 9 2000 - Ove K<>ven
|
|
|
|
|
# use ttydrv when running regapi, so we don't have to run from X
|
|
|
|
|
# change debugger path in registry
|
2000-10-29 19:02:53 +01:00
|
|
|
|
# Oct 29 2000 - Ove K<>ven
|
|
|
|
|
# added --enable-opengl to default confargs
|
|
|
|
|
# added conf_question, conf_yesno_answer, and conf_string_answer functions
|
|
|
|
|
# added DEFCAT variable
|
2000-10-31 01:59:01 +01:00
|
|
|
|
# (later that day...)
|
|
|
|
|
# added conf_reset_question function
|
|
|
|
|
# added file existence checks to the registry copying
|
|
|
|
|
# fixed problem with no-windows directory creation
|
|
|
|
|
# some text reformatting from Eric Maryniak
|
2001-01-11 21:18:06 +01:00
|
|
|
|
# Jan 5 2000 - Chris Morgan
|
|
|
|
|
# use default config file in /documentation/samples/config
|
|
|
|
|
# replace .winerc with ~/.wine/config in printed text
|
|
|
|
|
# added user question to convert .winerc file(if exists) or use the default
|
|
|
|
|
# config file
|
|
|
|
|
# add conf_question to allow root to install a local config file and
|
|
|
|
|
# registry
|
2001-01-18 21:29:21 +01:00
|
|
|
|
# Jan 12 2000 - Chris Morgan
|
|
|
|
|
# distinguish between creating local and global config files
|
|
|
|
|
# display a message about the status of global config files
|
|
|
|
|
# misc cleanups and reordering of questions
|
|
|
|
|
# added check to see if wine is installed when we are running as a normal
|
|
|
|
|
# user and print a message if wine cannot be found
|
1999-04-18 15:16:29 +02:00
|
|
|
|
|
2000-05-10 00:32:42 +02:00
|
|
|
|
#--- defaults (change these if you are a packager)
|
2001-02-12 19:10:43 +01:00
|
|
|
|
CONFARGS="--enable-opengl" # configure args, e.g. --prefix=/usr --sysconfdir=/etc
|
2000-04-08 22:20:21 +02:00
|
|
|
|
prefix=/usr/local # installation prefix
|
2000-04-15 22:37:14 +02:00
|
|
|
|
sysconfdir=$prefix/etc # where wine.conf and global registry is supposed to be
|
2000-05-10 00:32:42 +02:00
|
|
|
|
bindir=$prefix/bin # where winelib apps will be (or is) installed
|
2000-04-15 22:37:14 +02:00
|
|
|
|
libdir=$prefix/lib # where libwine.so will be (or is) installed
|
|
|
|
|
exdir=documentation/samples # where the example system.ini resides
|
2001-01-18 21:29:21 +01:00
|
|
|
|
GCONF=$sysconfdir/wine.conf # default path of the wine.conf global config file
|
|
|
|
|
LCONF=~/.wine/config # default path of the local config file
|
2000-04-08 22:20:21 +02:00
|
|
|
|
BINDIST=no # whether called from a binary package config script
|
2001-01-18 21:29:21 +01:00
|
|
|
|
DOGLOBALCONF=auto # whether to autogenerate wine.conf
|
|
|
|
|
DOLOCALCONF=auto # whether to autogenerate localconf
|
2000-04-08 22:20:21 +02:00
|
|
|
|
DOWCHK=auto # whether to autoconfigure existing-windows installation
|
|
|
|
|
DOWINE=auto # whether to autoconfigure no-windows installation
|
|
|
|
|
DOREG=auto # whether to install default registry
|
2000-04-15 22:37:14 +02:00
|
|
|
|
SYSREG=yes # whether to make root's registry global (system-default)
|
2001-01-11 21:18:06 +01:00
|
|
|
|
CONVCONF=no # whether we are converting an existing .winerc or not
|
2000-05-10 00:32:42 +02:00
|
|
|
|
|
|
|
|
|
# "make install" still installs the dlls into $libdir, but this may change in the future
|
|
|
|
|
# (DLLPATH should point to them if/when they are not in standard ld.so paths)
|
|
|
|
|
DLLPATH=$libdir/wine # default path of the dll .so files (except libwine.so)
|
|
|
|
|
|
|
|
|
|
# having the Wine debugger launched automatically will be a plus for us
|
|
|
|
|
DEBUGGER=$bindir/winedbg # the (installed) path of winedbg
|
|
|
|
|
HDEBUGGER=debugger/winedbg # the (non-installed) path of winedbg
|
|
|
|
|
|
|
|
|
|
# this is only for existing-windows installs
|
2000-04-15 22:37:14 +02:00
|
|
|
|
WINECONF=tools/wineconf # the path of wineconf perl script
|
2000-05-10 00:32:42 +02:00
|
|
|
|
|
|
|
|
|
# this is only for no-windows installs
|
2001-01-11 21:18:06 +01:00
|
|
|
|
WINEINI=$exdir/config # the path of default wine config file (also used by wineconf)
|
2000-04-08 22:20:21 +02:00
|
|
|
|
WININI=/dev/null # the path of default win.ini
|
2000-04-15 22:37:14 +02:00
|
|
|
|
SYSTEMINI=$exdir/system.ini # the path of default system.ini
|
2000-04-08 22:20:21 +02:00
|
|
|
|
REGAPI=programs/regapi/regapi # the path of regapi winelib application
|
|
|
|
|
DEFREG=winedefault.reg # the path of the registry file to be fed to regapi
|
2000-04-15 22:37:14 +02:00
|
|
|
|
# CROOT=/var/wine # the path of the fake Drive C (asks user if not set)
|
2000-10-29 19:02:53 +01:00
|
|
|
|
DEFCAT=cat # program to cat $DEFREG with (some packages need zcat)
|
2000-05-10 00:32:42 +02:00
|
|
|
|
#--- end of defaults
|
|
|
|
|
|
|
|
|
|
# temporary files used by the installer
|
|
|
|
|
TMPCONF=/tmp/wineinstall.conf
|
|
|
|
|
TMPREG=/tmp/wineinstall.reg
|
1999-04-18 15:16:29 +02:00
|
|
|
|
|
2000-10-29 19:02:53 +01:00
|
|
|
|
# functions
|
|
|
|
|
|
2000-12-05 04:53:51 +01:00
|
|
|
|
function std_sleep {
|
|
|
|
|
sleep 1
|
|
|
|
|
}
|
|
|
|
|
|
2000-10-29 19:02:53 +01:00
|
|
|
|
function conf_question {
|
|
|
|
|
# parameters: $1 = importance, $2 = question-id, $3+ = message lines
|
|
|
|
|
# the first two parameters can be used by e.g. debconf in debian packages
|
|
|
|
|
# but here we just print the message
|
|
|
|
|
shift 2
|
|
|
|
|
echo
|
|
|
|
|
local LINE="$1"
|
|
|
|
|
while shift
|
|
|
|
|
do {
|
|
|
|
|
echo "$LINE"
|
|
|
|
|
LINE="$1"
|
|
|
|
|
}
|
|
|
|
|
done
|
|
|
|
|
}
|
|
|
|
|
|
2000-10-31 01:59:01 +01:00
|
|
|
|
function conf_reset_question {
|
|
|
|
|
# parameters: $1 = question-id
|
|
|
|
|
# this is used to flush any cached answers and "already-displayed" flags
|
|
|
|
|
shift # dummy command
|
|
|
|
|
}
|
|
|
|
|
|
2000-10-29 19:02:53 +01:00
|
|
|
|
function conf_yesno_answer {
|
|
|
|
|
unset ANSWER
|
|
|
|
|
while [ "$ANSWER" != 'yes' ] && [ "$ANSWER" != 'no' ]
|
|
|
|
|
do {
|
|
|
|
|
echo -n "$1"
|
|
|
|
|
read ANSWER
|
|
|
|
|
}
|
|
|
|
|
done
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function conf_string_answer {
|
|
|
|
|
echo -n "$1"
|
|
|
|
|
read ANSWER
|
|
|
|
|
}
|
|
|
|
|
|
2001-01-18 21:29:21 +01:00
|
|
|
|
function create_windows_directories {
|
|
|
|
|
for tdir in "$CROOT/windows" "$CROOT/windows/system" \
|
|
|
|
|
"$CROOT/windows/Start Menu" "$CROOT/windows/Start Menu/Programs" \
|
|
|
|
|
"$CROOT/Common Files" "$CROOT/Program Files" \
|
|
|
|
|
"$CROOT/windows/Profiles" "$CROOT/windows/Profiles/Administrator"
|
|
|
|
|
do [ -d "$tdir" ] || mkdir "$tdir"
|
|
|
|
|
done
|
|
|
|
|
[ -f "$CROOT/windows/win.ini" ] || cp "$WININI" "$CROOT/windows/win.ini"
|
|
|
|
|
[ -f "$CROOT/windows/system.ini" ] || cp "$SYSTEMINI" "$CROOT/windows/system.ini"
|
|
|
|
|
}
|
|
|
|
|
|
1999-04-18 15:16:29 +02:00
|
|
|
|
# startup...
|
|
|
|
|
|
2001-01-18 21:29:21 +01:00
|
|
|
|
echo "WINE Installer v0.7"
|
1999-04-18 15:16:29 +02:00
|
|
|
|
echo
|
2000-04-08 22:20:21 +02:00
|
|
|
|
|
|
|
|
|
if [ "$BINDIST" = 'no' ]
|
|
|
|
|
then {
|
|
|
|
|
|
1999-04-18 15:16:29 +02:00
|
|
|
|
if ! [ -f configure ]
|
|
|
|
|
then {
|
|
|
|
|
echo "You're running this from the wrong directory."
|
2000-11-25 02:23:32 +01:00
|
|
|
|
echo "Change to the Wine source's main directory and try again."
|
1999-04-18 15:16:29 +02:00
|
|
|
|
exit 1
|
|
|
|
|
}
|
|
|
|
|
fi
|
|
|
|
|
|
2000-08-28 23:32:08 +02:00
|
|
|
|
# check whether RPM installed, and if it is, remove any old wine rpm.
|
2000-10-29 19:02:53 +01:00
|
|
|
|
hash rpm &>/dev/null
|
|
|
|
|
RET=$?
|
2000-08-28 23:32:08 +02:00
|
|
|
|
if [ $RET -eq 0 ]; then
|
|
|
|
|
if [ -n "`rpm -qi wine 2>/dev/null|grep "^Name"`" ]; then
|
2000-10-29 19:02:53 +01:00
|
|
|
|
echo "Warning: Old Wine RPM install detected. Do you want to remove it first?"
|
|
|
|
|
conf_yesno_answer "(yes/no) "
|
|
|
|
|
if [ "$ANSWER" = 'yes' ]; then
|
2000-08-28 23:32:08 +02:00
|
|
|
|
echo Starting wine rpm removal...
|
|
|
|
|
rpm -e wine; RET=$?
|
|
|
|
|
if [ $RET -eq 0 ]; then
|
|
|
|
|
echo Done.
|
|
|
|
|
else
|
2000-08-31 04:07:07 +02:00
|
|
|
|
echo "FAILED. Probably you aren't installing as root."
|
2000-11-25 02:23:32 +01:00
|
|
|
|
echo "Expect problems (library conflicts with existing install etc.)."
|
2000-08-28 23:32:08 +02:00
|
|
|
|
fi
|
|
|
|
|
else
|
|
|
|
|
echo "Sorry, I won't install Wine when an rpm version is still installed."
|
|
|
|
|
echo "(Wine support suffered from way too many conflicts)"
|
|
|
|
|
echo "Have a nice day !"
|
2000-10-31 01:59:01 +01:00
|
|
|
|
exit 1
|
2000-08-28 23:32:08 +02:00
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
2001-04-09 20:32:16 +02:00
|
|
|
|
# check whether wine binary still available
|
|
|
|
|
if [ -n "`which wine`" ]; then
|
|
|
|
|
echo "Warning !! wine binary (still) found, which may indicate"
|
|
|
|
|
echo "a (conflicting) previous installation."
|
|
|
|
|
echo "You might want to abort and uninstall Wine first."
|
|
|
|
|
std_sleep
|
|
|
|
|
fi
|
|
|
|
|
|
1999-04-18 15:16:29 +02:00
|
|
|
|
# run the configure script, if necessary
|
|
|
|
|
|
2000-03-04 20:13:52 +01:00
|
|
|
|
if [ -f config.cache ] && [ -f Makefile ] && [ Makefile -nt configure ]
|
1999-04-18 15:16:29 +02:00
|
|
|
|
then {
|
|
|
|
|
echo "I see that WINE has already been configured, so I'll skip that."
|
2000-12-05 04:53:51 +01:00
|
|
|
|
std_sleep
|
2000-03-04 20:13:52 +01:00
|
|
|
|
# load configure results
|
|
|
|
|
. ./config.cache
|
1999-04-18 15:16:29 +02:00
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo "Running configure..."
|
|
|
|
|
echo
|
2000-04-08 22:20:21 +02:00
|
|
|
|
if ! ./configure $CONFARGS
|
1999-04-18 15:16:29 +02:00
|
|
|
|
then {
|
|
|
|
|
echo
|
|
|
|
|
echo "Configure failed, aborting install."
|
|
|
|
|
rm -f config.cache
|
|
|
|
|
exit 1
|
|
|
|
|
}
|
|
|
|
|
fi
|
2000-03-04 20:13:52 +01:00
|
|
|
|
# load configure results
|
|
|
|
|
. ./config.cache
|
1999-04-18 15:16:29 +02:00
|
|
|
|
# make sure X was found
|
2000-03-04 20:13:52 +01:00
|
|
|
|
eval "$ac_cv_have_x"
|
|
|
|
|
if [ "$have_x" != "yes" ]
|
1999-04-18 15:16:29 +02:00
|
|
|
|
then {
|
|
|
|
|
echo "Install the X development headers and try again."
|
|
|
|
|
rm -f config.cache
|
|
|
|
|
exit 1
|
|
|
|
|
}
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# now do the compilation
|
|
|
|
|
|
|
|
|
|
if [ -f wine ] && [ wine -nt Makefile ]
|
|
|
|
|
then {
|
|
|
|
|
echo "Hmm, looks like WINE is already compiled. I'll skip that too, I guess."
|
2000-12-05 04:53:51 +01:00
|
|
|
|
std_sleep
|
1999-04-18 15:16:29 +02:00
|
|
|
|
}
|
|
|
|
|
else {
|
2000-10-31 01:59:01 +01:00
|
|
|
|
echo "Compiling WINE. Grab a lunch or two, rent a video, or whatever,"
|
|
|
|
|
echo "in the meantime..."
|
1999-04-18 15:16:29 +02:00
|
|
|
|
echo
|
2000-12-05 04:53:51 +01:00
|
|
|
|
std_sleep
|
1999-04-18 15:16:29 +02:00
|
|
|
|
if ! { make depend && make; }
|
|
|
|
|
then {
|
|
|
|
|
echo
|
|
|
|
|
echo "Compilation failed, aborting install."
|
|
|
|
|
exit 1
|
|
|
|
|
}
|
|
|
|
|
fi
|
|
|
|
|
echo
|
|
|
|
|
}
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# and installation, if root
|
|
|
|
|
|
|
|
|
|
if [ `whoami` != 'root' ]
|
|
|
|
|
then {
|
|
|
|
|
echo "You aren't root, so I'll skip the make install."
|
2001-01-18 21:29:21 +01:00
|
|
|
|
|
2000-04-08 22:20:21 +02:00
|
|
|
|
# setup to run from current directory
|
|
|
|
|
DLLPATH="$PWD/dlls"
|
|
|
|
|
if [ -z "$LD_LIBRARY_PATH" ]
|
|
|
|
|
then LD_LIBRARY_PATH="$PWD:$DLLPATH"
|
|
|
|
|
else LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PWD:$DLLPATH"
|
|
|
|
|
fi
|
|
|
|
|
export LD_LIBRARY_PATH
|
2000-07-23 15:32:04 +02:00
|
|
|
|
DEBUGGER="$PWD/$HDEBUGGER"
|
2000-04-08 22:20:21 +02:00
|
|
|
|
echo
|
|
|
|
|
echo "NOTE! To run Wine without installing, you must set the environment variable"
|
|
|
|
|
echo "LD_LIBRARY_PATH to $PWD:$DLLPATH"
|
|
|
|
|
echo "in your logon scripts."
|
2001-01-18 21:29:21 +01:00
|
|
|
|
echo
|
|
|
|
|
|
|
|
|
|
# see if wine is installed on the users system, if not prompt them
|
|
|
|
|
# and then exit
|
|
|
|
|
if [ ! `which wine` ]
|
|
|
|
|
then
|
|
|
|
|
echo "Could not find wine on your system. Run wineinstall as root to install wine"
|
|
|
|
|
echo "before re-running wineinstall as a user."
|
|
|
|
|
echo
|
|
|
|
|
echo "Exiting wineinstall"
|
|
|
|
|
exit 1;
|
|
|
|
|
fi
|
1999-04-18 15:16:29 +02:00
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo "Now installing binaries onto the system..."
|
|
|
|
|
echo
|
2000-12-05 04:53:51 +01:00
|
|
|
|
std_sleep
|
1999-04-18 15:16:29 +02:00
|
|
|
|
if ! make install
|
|
|
|
|
then {
|
|
|
|
|
echo
|
|
|
|
|
echo "Installation failed, aborting."
|
|
|
|
|
exit 1
|
|
|
|
|
}
|
|
|
|
|
fi
|
2000-04-08 22:20:21 +02:00
|
|
|
|
if [ -f /etc/ld.so.conf ] && ! grep -qs "$libdir" /etc/ld.so.conf
|
2000-02-25 21:51:09 +01:00
|
|
|
|
then {
|
|
|
|
|
echo
|
2000-04-08 22:20:21 +02:00
|
|
|
|
echo "$libdir didn't exist in your /etc/ld.so.conf, adding it now..."
|
|
|
|
|
echo "$libdir" >>/etc/ld.so.conf
|
2000-02-25 21:51:09 +01:00
|
|
|
|
echo "Re-running ldconfig..."
|
2000-03-04 20:13:52 +01:00
|
|
|
|
eval "$ac_cv_path_LDCONFIG"
|
2000-02-25 21:51:09 +01:00
|
|
|
|
}
|
|
|
|
|
fi
|
1999-04-18 15:16:29 +02:00
|
|
|
|
}
|
|
|
|
|
fi
|
|
|
|
|
|
2000-04-08 22:20:21 +02:00
|
|
|
|
}
|
|
|
|
|
fi # BINDIST
|
|
|
|
|
|
2001-01-18 21:29:21 +01:00
|
|
|
|
# now check whether we should generate wine.conf
|
|
|
|
|
if [ -z "$DOGLOBALCONF" ]
|
|
|
|
|
then DOGLOBALCONF=auto
|
1999-04-18 15:16:29 +02:00
|
|
|
|
fi
|
|
|
|
|
|
2001-01-18 21:29:21 +01:00
|
|
|
|
if [ "$DOGLOBALCONF" = 'auto' ]
|
1999-04-18 15:16:29 +02:00
|
|
|
|
then {
|
2001-01-18 21:29:21 +01:00
|
|
|
|
# see if we already have a system wine.conf
|
|
|
|
|
if [ ! -f $GCONF ] && [ `whoami` = 'root' ]
|
|
|
|
|
then
|
|
|
|
|
DOGLOBALCONF=no
|
|
|
|
|
echo "Creation of a global config file is not supported in wineinstall at this"
|
|
|
|
|
echo "time. When the configuration architecture is cleaned up this functionality"
|
|
|
|
|
echo "will be restored to wineinstall."
|
|
|
|
|
echo
|
1999-04-18 15:16:29 +02:00
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
fi
|
|
|
|
|
|
2001-01-18 21:29:21 +01:00
|
|
|
|
if [ "$DOLOCALCONF" = 'auto' ]
|
1999-04-18 15:16:29 +02:00
|
|
|
|
then {
|
2001-01-18 21:29:21 +01:00
|
|
|
|
# see if the user is root, if so, explicitly ask them if they want a
|
|
|
|
|
# local config file
|
|
|
|
|
if [ `whoami` = 'root' ]
|
|
|
|
|
then
|
|
|
|
|
echo "You are running as root. Do you want a local config file,"
|
|
|
|
|
echo "file, ~/.wine/config, created?"
|
|
|
|
|
conf_yesno_answer "(yes/no) "
|
|
|
|
|
DOLOCALCONF="$ANSWER"
|
|
|
|
|
else
|
|
|
|
|
echo "Create local config file ~/.wine/config?"
|
|
|
|
|
conf_yesno_answer "(yes/no) "
|
|
|
|
|
echo
|
|
|
|
|
DOLOCALCONF="$ANSWER"
|
|
|
|
|
if [ "$ANSWER" = 'no' ]
|
|
|
|
|
then
|
|
|
|
|
conf_question high need_root \
|
|
|
|
|
"Aborting install. Try again as root to generate a system wine.conf."
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ -f "$LCONF" ]
|
|
|
|
|
then
|
|
|
|
|
echo "Found existing $LCONF, if you continue this file will be"
|
|
|
|
|
echo "overwritten. Continue running wineinstall?"
|
|
|
|
|
conf_yesno_answer "(yes/no) "
|
|
|
|
|
echo
|
|
|
|
|
if [ "$ANSWER" = 'no' ]
|
|
|
|
|
then
|
|
|
|
|
echo "Exiting wineinstall"
|
|
|
|
|
exit 1
|
1999-04-18 15:16:29 +02:00
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
fi
|
|
|
|
|
|
2001-01-18 21:29:21 +01:00
|
|
|
|
# generate $TMPCONF from existing windows install, if any
|
|
|
|
|
if [ "$DOLOCALCONF" = 'yes' ]
|
2000-04-08 22:20:21 +02:00
|
|
|
|
then {
|
|
|
|
|
if [ "$DOWCHK" = 'yes' ] || [ "$DOWCHK" = 'auto' ]
|
|
|
|
|
then {
|
2000-10-29 19:02:53 +01:00
|
|
|
|
echo -n "Searching for an existing Windows installation..."
|
2001-01-18 21:29:21 +01:00
|
|
|
|
if ! $WINECONF -inifile "$WINEINI" > $TMPCONF 2>/dev/null
|
2000-04-08 22:20:21 +02:00
|
|
|
|
then {
|
2001-01-18 21:29:21 +01:00
|
|
|
|
rm -f $TMPCONF $TMPREG > /dev/null
|
|
|
|
|
|
2001-11-19 03:30:01 +01:00
|
|
|
|
echo " not found. (no matching /etc/fstab mount entry found)"
|
2000-10-29 19:02:53 +01:00
|
|
|
|
conf_question low do_without_windows \
|
2000-10-31 01:59:01 +01:00
|
|
|
|
"Windows was not found on your system, so I assume you want" \
|
|
|
|
|
"a Wine-only installation. Am I correct?"
|
2000-10-29 19:02:53 +01:00
|
|
|
|
conf_yesno_answer "(yes/no) "
|
|
|
|
|
if [ "$ANSWER" = 'no' ]
|
2000-04-08 22:20:21 +02:00
|
|
|
|
then {
|
2000-10-29 19:02:53 +01:00
|
|
|
|
conf_question high windows_not_found \
|
|
|
|
|
"Aborting install. Make sure your Windows partition is mounted and try again," \
|
2001-01-18 21:29:21 +01:00
|
|
|
|
"or create $LCONF manually by copying from $WINEINI and adapting the drive paths."
|
2000-04-08 22:20:21 +02:00
|
|
|
|
exit 1
|
|
|
|
|
}
|
|
|
|
|
fi
|
2000-10-29 19:02:53 +01:00
|
|
|
|
DOWINE=yes
|
2000-04-08 22:20:21 +02:00
|
|
|
|
}
|
|
|
|
|
else {
|
2000-10-29 19:02:53 +01:00
|
|
|
|
echo " found."
|
2001-01-18 21:29:21 +01:00
|
|
|
|
|
2000-10-31 01:59:01 +01:00
|
|
|
|
conf_reset_question windows_found
|
2000-10-29 19:02:53 +01:00
|
|
|
|
conf_question low windows_found \
|
2001-01-18 21:29:21 +01:00
|
|
|
|
"Created $LCONF using your existing Windows installation." \
|
2000-10-29 19:02:53 +01:00
|
|
|
|
"You probably want to review the file, though."
|
2000-04-08 22:20:21 +02:00
|
|
|
|
DOWINE=no
|
|
|
|
|
}
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
elif [ "$DOWINE" = 'auto' ]
|
|
|
|
|
then DOWINE=yes
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
elif [ "$DOWINE" = 'auto' ]
|
2001-01-18 21:29:21 +01:00
|
|
|
|
then
|
|
|
|
|
DOWINE=no
|
2000-04-08 22:20:21 +02:00
|
|
|
|
fi
|
|
|
|
|
|
2000-04-15 22:37:14 +02:00
|
|
|
|
# setup a no-windows installation, if necessary
|
2000-04-08 22:20:21 +02:00
|
|
|
|
if [ "$DOWINE" = 'yes' ]
|
|
|
|
|
then {
|
2001-01-18 21:29:21 +01:00
|
|
|
|
# set an appropriate DCROOT
|
2000-04-08 22:20:21 +02:00
|
|
|
|
if [ `whoami` != 'root' ]
|
|
|
|
|
then DCROOT=~/c
|
|
|
|
|
else DCROOT=/c
|
|
|
|
|
fi
|
2001-01-18 21:29:21 +01:00
|
|
|
|
|
2001-01-11 21:18:06 +01:00
|
|
|
|
if [ -f ~/.winerc ]
|
2000-04-08 22:20:21 +02:00
|
|
|
|
then {
|
2001-01-11 21:18:06 +01:00
|
|
|
|
conf_question medium convert_config \
|
2001-01-18 21:29:21 +01:00
|
|
|
|
"I found the old version Wine config file, .winerc, in your " \
|
2001-01-11 21:18:06 +01:00
|
|
|
|
"home directory. I can convert this to the new format or use the" \
|
|
|
|
|
"new default Wine config file. Convert?"
|
|
|
|
|
conf_yesno_answer "(yes/no) "
|
|
|
|
|
if [ "$ANSWER" = 'yes' ]
|
|
|
|
|
then {
|
|
|
|
|
WINEINI=~/.winerc
|
|
|
|
|
CONVCONF=yes
|
|
|
|
|
}
|
|
|
|
|
fi
|
|
|
|
|
}
|
2001-01-18 21:29:21 +01:00
|
|
|
|
else {
|
|
|
|
|
|
|
|
|
|
conf_question low drivec_path \
|
|
|
|
|
"Configuring Wine without Windows." \
|
|
|
|
|
"Some fake Windows directories must be created, to hold any .ini files, DLLs," \
|
|
|
|
|
"start menu entries, and other things your applications may need to install." \
|
|
|
|
|
"Where would you like your fake C drive to be placed?"
|
|
|
|
|
while [ -z "$CROOT" ]
|
|
|
|
|
do {
|
|
|
|
|
conf_string_answer "(default is $DCROOT) "
|
|
|
|
|
[ -z "$ANSWER" ] && ANSWER="$DCROOT"
|
|
|
|
|
if ! [ -d "$ANSWER" ]
|
|
|
|
|
then {
|
|
|
|
|
if mkdir -p "$ANSWER"
|
|
|
|
|
then CROOT="$ANSWER"
|
|
|
|
|
else
|
|
|
|
|
echo "Directory $ANSWER can't be created !"
|
|
|
|
|
conf_reset_question drivec_path
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
else CROOT="$ANSWER"
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
done
|
|
|
|
|
echo "Configuring Wine for a no-windows install in $CROOT..."
|
|
|
|
|
|
|
|
|
|
create_windows_directories
|
|
|
|
|
}
|
2001-01-11 21:18:06 +01:00
|
|
|
|
fi
|
|
|
|
|
|
2001-01-18 21:29:21 +01:00
|
|
|
|
# create $LCONF using the default config file $WINEINI
|
|
|
|
|
if [ "$DOLOCALCONF" = 'yes' ] && [ "$CONVCONF" = 'no' ]
|
2001-01-11 21:18:06 +01:00
|
|
|
|
then {
|
2001-01-18 21:29:21 +01:00
|
|
|
|
sed "s|\"Path\" = \"/c\"\$|\"Path\" = \"${CROOT}\"|" $WINEINI > $TMPCONF
|
2000-10-31 01:59:01 +01:00
|
|
|
|
conf_reset_question default_config
|
2000-10-29 19:02:53 +01:00
|
|
|
|
conf_question low default_config \
|
2001-01-18 21:29:21 +01:00
|
|
|
|
"Created $LCONF using default Wine configuration." \
|
2000-10-29 19:02:53 +01:00
|
|
|
|
"You probably want to review the file, though."
|
2000-04-08 22:20:21 +02:00
|
|
|
|
}
|
|
|
|
|
fi
|
2001-01-11 21:18:06 +01:00
|
|
|
|
|
2000-07-23 15:32:04 +02:00
|
|
|
|
# now we really should install the registry
|
|
|
|
|
if [ "$DOREG" = 'auto' ]
|
|
|
|
|
then DOREG=yes
|
|
|
|
|
fi
|
2000-04-08 22:20:21 +02:00
|
|
|
|
}
|
|
|
|
|
fi
|
|
|
|
|
echo
|
|
|
|
|
|
2001-01-18 21:29:21 +01:00
|
|
|
|
#install the local config file $LCONF
|
|
|
|
|
if [ "$DOLOCALCONF" = 'yes' ]
|
|
|
|
|
then
|
|
|
|
|
if [ ! -w ~/.wine ]
|
|
|
|
|
then
|
|
|
|
|
mkdir ~/.wine
|
2001-01-11 21:18:06 +01:00
|
|
|
|
fi
|
2001-01-18 21:29:21 +01:00
|
|
|
|
|
|
|
|
|
if [ "$CONVCONF" = 'no' ]
|
|
|
|
|
then
|
|
|
|
|
cp $TMPCONF $LCONF > /dev/null
|
|
|
|
|
fi
|
|
|
|
|
else
|
|
|
|
|
DOREG=no
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
#install the global config file $GCONF
|
|
|
|
|
if [ "$DOGLOBALCONF" = 'yes' ]
|
|
|
|
|
then
|
|
|
|
|
if [ ! -f $sysconfdir ]
|
|
|
|
|
then
|
|
|
|
|
mkdir -p $sysconfdir
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
cp $TMPCONF $GCONF > /dev/null
|
2000-04-08 22:20:21 +02:00
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# check whether we need to install default registry
|
|
|
|
|
# (not to be done if windows registry exists)
|
|
|
|
|
if [ "$DOREG" = 'auto' ]
|
|
|
|
|
then {
|
|
|
|
|
echo "Checking for real Windows registry..."
|
|
|
|
|
if [ -f "$CROOT/windows/system.dat" ]
|
|
|
|
|
then DOREG=no
|
|
|
|
|
elif [ -f "$CROOT/windows/system32/config/system" ]
|
|
|
|
|
then DOREG=no
|
|
|
|
|
else DOREG=yes
|
|
|
|
|
fi
|
|
|
|
|
if [ "$DOREG" = 'yes' ]
|
|
|
|
|
then echo "Not found, default Wine registry will be installed."
|
|
|
|
|
else echo "Windows registry found, will not install default Wine registry."
|
|
|
|
|
fi
|
1999-04-18 15:16:29 +02:00
|
|
|
|
echo
|
|
|
|
|
}
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# install default registry entries
|
|
|
|
|
if [ "$DOREG" = 'yes' ]
|
|
|
|
|
then {
|
2000-04-08 22:20:21 +02:00
|
|
|
|
if [ "$BINDIST" = 'no' ]
|
|
|
|
|
then {
|
|
|
|
|
echo "Compiling regapi..."
|
|
|
|
|
(cd programs/regapi; make)
|
|
|
|
|
echo
|
|
|
|
|
}
|
|
|
|
|
fi
|
2000-05-10 00:32:42 +02:00
|
|
|
|
echo "Preparing to install default Wine registry entries..."
|
|
|
|
|
|
2001-01-18 21:29:21 +01:00
|
|
|
|
# edit config files so we don't have to run regapi under X
|
2001-01-11 21:18:06 +01:00
|
|
|
|
if [ "$CONVCONF" = 'yes' ]
|
|
|
|
|
then
|
2001-01-18 21:29:21 +01:00
|
|
|
|
mv $WINEINI $WINEINI.new
|
|
|
|
|
sed "s/GraphicsDriver=.*/GraphicsDriver=ttydrv/" $WINEINI.new > $WINEINI
|
2001-01-11 21:18:06 +01:00
|
|
|
|
else
|
2001-01-18 21:29:21 +01:00
|
|
|
|
mv $LCONF $LCONF.new
|
|
|
|
|
sed "s/\"GraphicsDriver\" = .*/\"GraphicsDriver\" = \"ttydrv\"/" $LCONF.new > $LCONF
|
2001-01-11 21:18:06 +01:00
|
|
|
|
fi
|
2000-05-10 00:32:42 +02:00
|
|
|
|
|
|
|
|
|
# create a temporary wineinstall.reg with fixed debugger path
|
2000-10-29 19:02:53 +01:00
|
|
|
|
$DEFCAT $DEFREG | sed "s|debugger/winedbg|${DEBUGGER}|" > $TMPREG
|
2000-05-10 00:32:42 +02:00
|
|
|
|
|
2000-04-08 22:20:21 +02:00
|
|
|
|
echo "Installing default Wine registry entries..."
|
1999-04-18 15:16:29 +02:00
|
|
|
|
echo
|
2001-01-18 21:29:21 +01:00
|
|
|
|
if ! $REGAPI setValue < $TMPREG > /dev/null
|
1999-04-18 15:16:29 +02:00
|
|
|
|
then {
|
2001-01-18 21:29:21 +01:00
|
|
|
|
rm -f $TMPREG
|
2000-05-10 00:32:42 +02:00
|
|
|
|
echo "Registry install failed."
|
2000-10-31 01:59:01 +01:00
|
|
|
|
conf_reset_question regapi_error
|
2000-10-29 19:02:53 +01:00
|
|
|
|
conf_question high regapi_error
|
2000-02-25 21:51:09 +01:00
|
|
|
|
exit 1
|
1999-04-18 15:16:29 +02:00
|
|
|
|
}
|
2001-01-11 21:18:06 +01:00
|
|
|
|
else {
|
2001-01-18 21:29:21 +01:00
|
|
|
|
# if we are converting from a .winerc file, running regapi once
|
|
|
|
|
# will ONLY convert .winerc -> ~/.wine/config, it will not import the
|
|
|
|
|
# registry data. so if we are converting we need to run regapi twice
|
|
|
|
|
if [ "$CONVCONF" = 'yes' ]
|
|
|
|
|
then
|
|
|
|
|
if ! $REGAPI setValue < $TMPREG > /dev/null
|
|
|
|
|
then
|
|
|
|
|
rm -f $TMPREG
|
|
|
|
|
echo "Registry install failed."
|
|
|
|
|
conf_reset_question regapi_error
|
|
|
|
|
conf_question high regapi_error
|
|
|
|
|
exit 1
|
|
|
|
|
else
|
|
|
|
|
echo
|
|
|
|
|
echo "Registry entries successfully installed."
|
|
|
|
|
fi
|
|
|
|
|
else
|
|
|
|
|
echo
|
|
|
|
|
echo "Registry entries successfully installed."
|
|
|
|
|
fi
|
2001-01-11 21:18:06 +01:00
|
|
|
|
}
|
2000-04-15 22:37:14 +02:00
|
|
|
|
fi
|
2001-01-18 21:29:21 +01:00
|
|
|
|
rm -f $TMPREG
|
2000-04-15 22:37:14 +02:00
|
|
|
|
if [ "$SYSREG" = 'auto' ]
|
|
|
|
|
then SYSREG=yes
|
|
|
|
|
fi
|
2001-01-11 21:18:06 +01:00
|
|
|
|
|
2001-01-18 21:29:21 +01:00
|
|
|
|
# if we converted we need to change the graphics driver back and
|
|
|
|
|
# restore the original .winerc file
|
2001-01-11 21:18:06 +01:00
|
|
|
|
if [ "$CONVCONF" = 'yes' ]
|
|
|
|
|
then
|
2001-01-18 21:29:21 +01:00
|
|
|
|
mv $WINEINI.new $WINEINI
|
2001-01-11 21:18:06 +01:00
|
|
|
|
fi
|
2001-01-18 21:29:21 +01:00
|
|
|
|
|
|
|
|
|
sed "s/\"GraphicsDriver\" = .*/\"GraphicsDriver\" = \"x11drv\"/" $LCONF > $LCONF.new
|
|
|
|
|
mv $LCONF.new $LCONF
|
2000-04-15 22:37:14 +02:00
|
|
|
|
}
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# make root's registry global, if desired
|
2001-01-11 21:18:06 +01:00
|
|
|
|
if [ `whoami` = 'root' ] && [ "$DOREG" = 'yes' ] && [ "$SYSREG" = 'yes' ]
|
2000-04-15 22:37:14 +02:00
|
|
|
|
then {
|
2000-07-23 15:32:04 +02:00
|
|
|
|
[ -d ~/.wine ] || mkdir ~/.wine
|
2000-04-15 22:37:14 +02:00
|
|
|
|
if ! [ -f $sysconfdir/wine.userreg ]
|
|
|
|
|
then {
|
|
|
|
|
echo "Linking root's user registry hive to the global registry..."
|
2000-10-31 01:59:01 +01:00
|
|
|
|
[ -f ~/.wine/wine.userreg ] && cp ~/.wine/wine.userreg $sysconfdir/wine.userreg
|
2000-04-15 22:37:14 +02:00
|
|
|
|
ln -sf $sysconfdir/wine.userreg ~/.wine/wine.userreg
|
|
|
|
|
}
|
|
|
|
|
fi
|
|
|
|
|
if ! [ -f $sysconfdir/wine.systemreg ]
|
|
|
|
|
then {
|
|
|
|
|
echo "Linking root's system registry hive to the global registry..."
|
2000-10-31 01:59:01 +01:00
|
|
|
|
[ -f ~/.wine/system.reg ] && cp ~/.wine/system.reg $sysconfdir/wine.systemreg
|
2000-04-15 22:37:14 +02:00
|
|
|
|
ln -sf $sysconfdir/wine.systemreg ~/.wine/system.reg
|
|
|
|
|
}
|
1999-04-18 15:16:29 +02:00
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
fi
|
2000-04-15 22:37:14 +02:00
|
|
|
|
|
2001-01-18 21:29:21 +01:00
|
|
|
|
# cleanup any temporary files that may remain
|
|
|
|
|
if [ -f $TMPCONF ]
|
|
|
|
|
then rm -f $TMPCONF
|
|
|
|
|
fi
|
|
|
|
|
if [ -f $TMPREG ]
|
|
|
|
|
then rm -f $TMPREG
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
2000-04-15 22:37:14 +02:00
|
|
|
|
# it's a wrap
|
1999-04-18 15:16:29 +02:00
|
|
|
|
echo
|
|
|
|
|
echo "Installation complete for now. Good luck (this is still alpha software)."
|
2000-04-08 22:20:21 +02:00
|
|
|
|
echo "If you have problems with WINE, please read the documentation first,"
|
|
|
|
|
echo "as many kinds of potential problems are explained there."
|
2000-10-31 01:59:01 +01:00
|
|
|
|
|
|
|
|
|
exit 0
|