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...
|
2002-03-10 00:29:33 +01:00
|
|
|
|
#
|
|
|
|
|
# Copyright 1999 Ove K<>ven
|
|
|
|
|
#
|
|
|
|
|
# This library is free software; you can redistribute it and/or
|
|
|
|
|
# modify it under the terms of the GNU Lesser General Public
|
|
|
|
|
# License as published by the Free Software Foundation; either
|
|
|
|
|
# version 2.1 of the License, or (at your option) any later version.
|
|
|
|
|
#
|
|
|
|
|
# This library is distributed in the hope that it will be useful,
|
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
# Lesser General Public License for more details.
|
|
|
|
|
#
|
|
|
|
|
# You should have received a copy of the GNU Lesser General Public
|
|
|
|
|
# License along with this library; if not, write to the Free Software
|
|
|
|
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
|
#
|
1999-04-18 15:16:29 +02:00
|
|
|
|
|
2000-05-10 00:32:42 +02:00
|
|
|
|
#--- defaults (change these if you are a packager)
|
2002-11-22 00:46:06 +01:00
|
|
|
|
CONFARGS="" # configure args, e.g. --prefix=/usr --sysconfdir=/etc
|
2000-04-08 22:20:21 +02:00
|
|
|
|
prefix=/usr/local # installation prefix
|
2002-09-06 21:46:27 +02:00
|
|
|
|
sysconfdir=$prefix/etc # where wine.conf and the global registry are supposed to be
|
|
|
|
|
bindir=$prefix/bin # where winelib apps will be (or are) installed
|
2000-04-15 22:37:14 +02:00
|
|
|
|
libdir=$prefix/lib # where libwine.so will be (or is) installed
|
2002-09-06 21:46:27 +02:00
|
|
|
|
exdir=documentation/samples # where the sample 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
|
2002-05-04 20:31:24 +02:00
|
|
|
|
DOAPP=auto # whether to install applications, distributed with Wine
|
2000-04-15 22:37:14 +02:00
|
|
|
|
SYSREG=yes # whether to make root's registry global (system-default)
|
2000-05-10 00:32:42 +02:00
|
|
|
|
|
|
|
|
|
# this is only for existing-windows installs
|
2002-09-06 21:46:27 +02:00
|
|
|
|
WINECONF=tools/wineconf # path to the wineconf perl script
|
2000-05-10 00:32:42 +02:00
|
|
|
|
|
|
|
|
|
# this is only for no-windows installs
|
2002-09-06 21:46:27 +02:00
|
|
|
|
WINEINI=$exdir/config # path to the default wine config file (also used by wineconf)
|
2004-02-28 00:34:18 +01:00
|
|
|
|
RUNDLL32=programs/rundll32/rundll32 # path to the rundll32 winelib application
|
|
|
|
|
INFSCRIPT=tools/wine.inf # path to the default .inf script
|
2002-09-06 21:46:27 +02:00
|
|
|
|
# CROOT=/var/wine # path of the fake Drive C (asks user if not set)
|
2000-05-10 00:32:42 +02:00
|
|
|
|
#--- end of defaults
|
|
|
|
|
|
|
|
|
|
# temporary files used by the installer
|
|
|
|
|
TMPCONF=/tmp/wineinstall.conf
|
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 {
|
2002-12-05 20:05:44 +01:00
|
|
|
|
for tdir in "$CROOT/windows" "$CROOT/windows/system" \
|
2003-01-21 21:14:36 +01:00
|
|
|
|
"$CROOT/windows/command" \
|
2001-01-18 21:29:21 +01:00
|
|
|
|
"$CROOT/windows/Start Menu" "$CROOT/windows/Start Menu/Programs" \
|
2002-05-16 22:27:27 +02:00
|
|
|
|
"$CROOT/Program Files" "$CROOT/Program Files/Common Files" \
|
2002-05-23 18:30:42 +02:00
|
|
|
|
"$CROOT/windows/Profiles" "$CROOT/windows/Profiles/Administrator" \
|
|
|
|
|
"$CROOT/windows/Fonts" "$CROOT/windows/Start Menu/Programs/Startup"
|
2001-01-18 21:29:21 +01:00
|
|
|
|
do [ -d "$tdir" ] || mkdir "$tdir"
|
|
|
|
|
done
|
2004-02-28 00:34:18 +01:00
|
|
|
|
cp $INFSCRIPT "$CROOT/windows/system/wine.inf"
|
2001-01-18 21:29:21 +01:00
|
|
|
|
}
|
|
|
|
|
|
2002-05-04 20:31:24 +02:00
|
|
|
|
#creates symbolic link in windows directory to installed winelib application
|
|
|
|
|
#parameters:
|
|
|
|
|
# - name of the installed winelib application
|
|
|
|
|
# - full path to application in the winelib directory
|
|
|
|
|
function link_app {
|
2002-11-21 01:03:14 +01:00
|
|
|
|
if [ "$WINEINSTALLED" = 'no' ]
|
|
|
|
|
then {
|
|
|
|
|
ln -sf $PWD/programs/$1/$1.exe.so $2
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
ln -sf $libdir/wine/$1.exe.so $2
|
|
|
|
|
}
|
|
|
|
|
fi
|
2002-05-04 20:31:24 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#puts windows applications replacements to windows directories,
|
|
|
|
|
#configures them
|
|
|
|
|
function configure_wine_applications {
|
2003-01-21 21:14:36 +01:00
|
|
|
|
link_app start "$CROOT/windows/command/start.exe"
|
2002-09-23 21:55:12 +02:00
|
|
|
|
link_app notepad "$CROOT/windows/notepad.exe"
|
2002-05-04 20:31:24 +02:00
|
|
|
|
link_app regedit "$CROOT/windows/regedit.exe"
|
2002-11-18 20:42:34 +01:00
|
|
|
|
link_app rundll32 "$CROOT/windows/rundll32.exe"
|
2002-12-05 20:05:44 +01:00
|
|
|
|
link_app wcmd "$CROOT/windows/system/wcmd.exe"
|
|
|
|
|
link_app control "$CROOT/windows/system/control.exe"
|
|
|
|
|
link_app winhelp "$CROOT/windows/system/help.exe"
|
|
|
|
|
link_app notepad "$CROOT/windows/system/notepad.exe"
|
|
|
|
|
link_app progman "$CROOT/windows/system/progman.exe"
|
|
|
|
|
link_app regsvr32 "$CROOT/windows/system/regsvr32.exe"
|
|
|
|
|
link_app winemine "$CROOT/windows/system/winmine.exe"
|
|
|
|
|
link_app winver "$CROOT/windows/system/winver.exe"
|
2002-09-23 21:55:12 +02:00
|
|
|
|
link_app uninstaller "$CROOT/windows/uninstall.exe"
|
2002-09-05 01:30:44 +02:00
|
|
|
|
link_app winhelp "$CROOT/windows/winhelp.exe"
|
|
|
|
|
link_app winhelp "$CROOT/windows/winhlp32.exe"
|
2004-01-06 21:49:58 +01:00
|
|
|
|
link_app winebrowser "$CROOT/windows/winebrowser.exe"
|
2002-05-04 20:31:24 +02:00
|
|
|
|
}
|
|
|
|
|
|
1999-04-18 15:16:29 +02:00
|
|
|
|
# startup...
|
|
|
|
|
|
2002-11-21 01:03:14 +01:00
|
|
|
|
echo "WINE Installer v0.74"
|
1999-04-18 15:16:29 +02:00
|
|
|
|
echo
|
2000-04-08 22:20:21 +02:00
|
|
|
|
|
|
|
|
|
if [ "$BINDIST" = 'no' ]
|
|
|
|
|
then {
|
|
|
|
|
|
2002-05-23 18:30:42 +02:00
|
|
|
|
if ! [ -f configure ]
|
|
|
|
|
then {
|
2002-10-13 19:53:47 +02:00
|
|
|
|
if [ -f ../configure ]
|
|
|
|
|
then {
|
|
|
|
|
pushd ..
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo "You're running this from the wrong directory."
|
|
|
|
|
echo "Change to the Wine source's main directory and try again."
|
|
|
|
|
exit 1
|
|
|
|
|
}
|
|
|
|
|
fi
|
2002-05-23 18:30:42 +02:00
|
|
|
|
}
|
|
|
|
|
fi
|
1999-04-18 15:16:29 +02:00
|
|
|
|
|
2004-03-02 21:53:05 +01:00
|
|
|
|
if [ `whoami` = 'root' ]
|
2002-05-23 18:30:42 +02:00
|
|
|
|
then {
|
|
|
|
|
echo "You are running wineinstall as root, this is not advisable. Please rerun as a user."
|
|
|
|
|
echo "Aborting."
|
|
|
|
|
exit 1
|
|
|
|
|
}
|
|
|
|
|
fi
|
2002-04-01 22:56:51 +02:00
|
|
|
|
|
2003-09-29 22:25:47 +02:00
|
|
|
|
if [ ! -w . ]
|
|
|
|
|
then {
|
|
|
|
|
echo "The source directory is not writable. You probably extracted the sources as root."
|
|
|
|
|
echo "You should remove the source tree and extract it again as a normal user."
|
|
|
|
|
exit 1
|
|
|
|
|
}
|
|
|
|
|
fi
|
|
|
|
|
|
2002-05-23 18:30:42 +02:00
|
|
|
|
# check whether RPM installed, and if it is, remove any old wine rpm.
|
|
|
|
|
hash rpm &>/dev/null
|
|
|
|
|
RET=$?
|
|
|
|
|
if [ $RET -eq 0 ]; then
|
|
|
|
|
if [ -n "`rpm -qi wine 2>/dev/null|grep "^Name"`" ]; then
|
|
|
|
|
echo "Warning: Old Wine RPM install detected. Do you want to remove it first?"
|
|
|
|
|
conf_yesno_answer "(yes/no) "
|
|
|
|
|
if [ "$ANSWER" = 'yes' ]; then
|
|
|
|
|
echo "We need to remove the rpm as root, please enter your root password"
|
|
|
|
|
echo
|
|
|
|
|
echo Starting wine rpm removal...
|
|
|
|
|
su -c "rpm -e wine; RET=$?"
|
|
|
|
|
if [ $RET -eq 0 ]; then
|
|
|
|
|
echo Done.
|
|
|
|
|
else
|
|
|
|
|
echo "FAILED. Probably you aren't installing as root."
|
|
|
|
|
echo "Expect problems (library conflicts with existing install etc.)."
|
|
|
|
|
fi
|
2000-08-28 23:32:08 +02:00
|
|
|
|
else
|
2002-05-23 18:30:42 +02:00
|
|
|
|
echo "Sorry, I won't install Wine when an rpm version is still installed."
|
|
|
|
|
echo "(Wine support suffered from way too many conflicts between RPM"
|
|
|
|
|
echo "and source installs)"
|
|
|
|
|
echo "Have a nice day !"
|
|
|
|
|
exit 1
|
2000-08-28 23:32:08 +02:00
|
|
|
|
fi
|
2002-05-23 18:30:42 +02:00
|
|
|
|
fi
|
2000-08-28 23:32:08 +02:00
|
|
|
|
fi
|
|
|
|
|
|
2002-05-23 18:30:42 +02:00
|
|
|
|
# check whether wine binary still available
|
|
|
|
|
if [ -n "`which wine 2>/dev/null|grep '/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
|
2001-04-09 20:32:16 +02:00
|
|
|
|
|
2002-05-23 18:30:42 +02:00
|
|
|
|
# run the configure script, if necessary
|
1999-04-18 15:16:29 +02:00
|
|
|
|
|
2002-05-23 18:30:42 +02:00
|
|
|
|
if [ -f config.cache ] && [ -f Makefile ] && [ Makefile -nt configure ]
|
1999-04-18 15:16:29 +02:00
|
|
|
|
then {
|
|
|
|
|
echo
|
2002-05-23 18:30:42 +02:00
|
|
|
|
echo "I see that WINE has already been configured, so I'll skip that."
|
|
|
|
|
std_sleep
|
|
|
|
|
# load configure results
|
|
|
|
|
. ./config.cache
|
1999-04-18 15:16:29 +02:00
|
|
|
|
}
|
2002-05-23 18:30:42 +02:00
|
|
|
|
else {
|
|
|
|
|
echo "Running configure..."
|
|
|
|
|
echo
|
2003-05-14 01:37:09 +02:00
|
|
|
|
if ! ./configure -C $CONFARGS --prefix=$prefix
|
2002-05-23 18:30:42 +02:00
|
|
|
|
then {
|
|
|
|
|
echo
|
|
|
|
|
echo "Configure failed, aborting install."
|
|
|
|
|
rm -f config.cache
|
|
|
|
|
exit 1
|
|
|
|
|
}
|
|
|
|
|
fi
|
|
|
|
|
# load configure results
|
|
|
|
|
. ./config.cache
|
|
|
|
|
# make sure X was found
|
|
|
|
|
eval "$ac_cv_have_x"
|
|
|
|
|
if [ "$have_x" != "yes" ]
|
|
|
|
|
then {
|
|
|
|
|
echo "Install the X development headers and try again."
|
|
|
|
|
rm -f config.cache
|
|
|
|
|
exit 1
|
|
|
|
|
}
|
|
|
|
|
fi
|
1999-04-18 15:16:29 +02:00
|
|
|
|
}
|
|
|
|
|
fi
|
2002-04-01 22:56:51 +02:00
|
|
|
|
|
2002-05-23 18:30:42 +02:00
|
|
|
|
# now do the compilation and install, we need to always do this because we
|
|
|
|
|
# don't want the 'make install' command we might run to run 'make' as root
|
|
|
|
|
if [ `whoami` != 'root' ]
|
1999-04-18 15:16:29 +02:00
|
|
|
|
then {
|
2002-05-23 18:30:42 +02:00
|
|
|
|
# ask the user if they want to build and install wine
|
|
|
|
|
echo
|
|
|
|
|
echo "We need to install wine as root user, do you want us to build wine,"
|
|
|
|
|
echo "'su root' and install Wine? Enter 'no' to continue without installing"
|
|
|
|
|
conf_yesno_answer "(yes/no) "
|
2002-10-15 03:19:46 +02:00
|
|
|
|
ROOTINSTALL="$ANSWER"
|
1999-04-18 15:16:29 +02:00
|
|
|
|
|
2002-10-15 03:19:46 +02:00
|
|
|
|
if [ "$ROOTINSTALL" = "yes" ]
|
2002-05-23 18:30:42 +02:00
|
|
|
|
then {
|
|
|
|
|
# start out with the basic command
|
|
|
|
|
sucommand="make install"
|
|
|
|
|
|
|
|
|
|
# if the user doesn't have $libdir in their ld.so.conf add this
|
|
|
|
|
# to our sucommand string
|
|
|
|
|
if [ -f /etc/ld.so.conf ]
|
|
|
|
|
then
|
2003-07-30 05:43:55 +02:00
|
|
|
|
if ! grep -s "$libdir" /etc/ld.so.conf >/dev/null 2>&1
|
2002-05-23 18:30:42 +02:00
|
|
|
|
then {
|
|
|
|
|
echo
|
|
|
|
|
echo "$libdir doesn't exist in your /etc/ld.so.conf, it will be added"
|
|
|
|
|
echo "when we perform the install..."
|
|
|
|
|
sucommand="$sucommand;echo $libdir>>/etc/ld.so.conf"
|
|
|
|
|
}
|
|
|
|
|
fi
|
2004-01-06 23:08:33 +01:00
|
|
|
|
# run ldconfig always just in case some updated files don't get linked
|
2002-05-23 18:30:42 +02:00
|
|
|
|
sucommand="$sucommand;$ac_cv_path_LDCONFIG"
|
|
|
|
|
fi
|
2002-10-15 03:19:46 +02:00
|
|
|
|
}
|
|
|
|
|
fi # [ "$ROOTINSTALL" = "yes" ]
|
2002-05-23 18:30:42 +02:00
|
|
|
|
|
2002-10-15 03:19:46 +02:00
|
|
|
|
echo
|
2002-05-23 18:30:42 +02:00
|
|
|
|
|
2002-10-15 03:19:46 +02:00
|
|
|
|
echo "Compiling WINE. Grab a lunch or two, rent a video, or whatever,"
|
|
|
|
|
echo "in the meantime..."
|
|
|
|
|
echo
|
|
|
|
|
std_sleep
|
2002-05-23 18:30:42 +02:00
|
|
|
|
|
2002-10-15 03:19:46 +02:00
|
|
|
|
# try to just make wine, if this fails 'make depend' and try to remake
|
|
|
|
|
if ! { make; }
|
|
|
|
|
then {
|
|
|
|
|
if ! { make depend && make; }
|
2002-04-27 02:15:12 +02:00
|
|
|
|
then {
|
2002-10-15 03:19:46 +02:00
|
|
|
|
echo
|
|
|
|
|
echo "Compilation failed, aborting install."
|
|
|
|
|
exit 1
|
2002-04-27 02:15:12 +02:00
|
|
|
|
}
|
|
|
|
|
fi
|
2002-10-15 03:19:46 +02:00
|
|
|
|
}
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ "$ROOTINSTALL" = "yes" ]
|
|
|
|
|
then {
|
2002-05-23 18:30:42 +02:00
|
|
|
|
echo
|
1999-04-18 15:16:29 +02:00
|
|
|
|
|
2002-05-23 18:30:42 +02:00
|
|
|
|
echo "Performing 'make install' as root to install binaries, enter root password"
|
2001-01-18 21:29:21 +01:00
|
|
|
|
|
2002-05-23 18:30:42 +02:00
|
|
|
|
std_sleep
|
2001-01-18 21:29:21 +01:00
|
|
|
|
|
2002-05-23 18:30:42 +02:00
|
|
|
|
if ! su root -c "$sucommand"
|
2002-04-01 22:56:51 +02:00
|
|
|
|
then {
|
2003-03-24 20:29:38 +01:00
|
|
|
|
if ! su root -c "$sucommand"
|
|
|
|
|
then {
|
|
|
|
|
echo
|
|
|
|
|
echo "Either you entered an incorrect password or we failed to"
|
|
|
|
|
echo "run '$sucommand' correctly."
|
|
|
|
|
echo "If you didn't enter an incorrect password then please"
|
|
|
|
|
echo "report this error and any steps to possibly reproduce it to"
|
2003-11-26 04:55:01 +01:00
|
|
|
|
echo "http://bugs.winehq.org/"
|
2003-03-24 20:29:38 +01:00
|
|
|
|
echo
|
|
|
|
|
echo "Installation failed, aborting."
|
|
|
|
|
exit 1
|
|
|
|
|
}
|
|
|
|
|
fi
|
|
|
|
|
}
|
2002-04-01 22:56:51 +02:00
|
|
|
|
fi
|
|
|
|
|
|
2002-05-23 18:30:42 +02:00
|
|
|
|
echo
|
2002-04-01 22:56:51 +02:00
|
|
|
|
|
2002-05-23 18:30:42 +02:00
|
|
|
|
# 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
|
2002-11-21 01:03:14 +01:00
|
|
|
|
|
|
|
|
|
WINEINSTALLED=yes
|
2002-05-23 18:30:42 +02:00
|
|
|
|
}
|
|
|
|
|
else {
|
2002-11-21 01:03:14 +01:00
|
|
|
|
WINEINSTALLED=no
|
2002-04-01 22:56:51 +02:00
|
|
|
|
}
|
2002-10-15 03:19:46 +02:00
|
|
|
|
fi # [ "$ROOTINSTALL" = "yes" ]
|
2000-02-25 21:51:09 +01:00
|
|
|
|
}
|
2002-05-23 18:30:42 +02:00
|
|
|
|
fi # [ `whoami` != 'root' ]
|
1999-04-18 15:16:29 +02:00
|
|
|
|
|
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" ]
|
2002-02-19 19:30:54 +01:00
|
|
|
|
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
|
2002-04-01 22:56:51 +02:00
|
|
|
|
# if the user has an existing config file ask them if they want us to
|
|
|
|
|
# overwrite it, otherwise just ask them if they want to create one
|
|
|
|
|
if [ -f "$LCONF" ]
|
2001-01-18 21:29:21 +01:00
|
|
|
|
then
|
2002-04-01 22:56:51 +02:00
|
|
|
|
echo "Found existing $LCONF, do you want to overwrite this"
|
|
|
|
|
echo "existing Wine configuration file?"
|
|
|
|
|
conf_yesno_answer "(yes/no) "
|
|
|
|
|
DOLOCALCONF="$ANSWER"
|
|
|
|
|
echo
|
2002-05-23 18:30:42 +02:00
|
|
|
|
if [ "$ANSWER" = "yes" ]
|
|
|
|
|
then
|
|
|
|
|
{
|
|
|
|
|
echo "Would you like to make a backup of this old config file?"
|
|
|
|
|
conf_yesno_answer "(yes/no) "
|
|
|
|
|
echo
|
|
|
|
|
if [ "$ANSWER" = "yes" ]
|
|
|
|
|
then
|
|
|
|
|
{
|
|
|
|
|
echo "Renaming $LCONF to $LCONF.old"
|
|
|
|
|
mv -f "$LCONF" "$LCONF.old"
|
|
|
|
|
echo
|
|
|
|
|
}
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
fi
|
|
|
|
|
else
|
|
|
|
|
{
|
2002-04-01 22:56:51 +02:00
|
|
|
|
echo "Create local config file ~/.wine/config?"
|
|
|
|
|
conf_yesno_answer "(yes/no) "
|
|
|
|
|
DOLOCALCONF="$ANSWER"
|
|
|
|
|
echo
|
|
|
|
|
if [ "$ANSWER" = 'no' ]
|
|
|
|
|
then
|
|
|
|
|
conf_question high need_root \
|
|
|
|
|
"Aborting install. Try again as root to generate a system wine.conf."
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
}
|
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 {
|
2002-10-30 00:27:37 +01:00
|
|
|
|
rm -f $TMPCONF > /dev/null
|
2001-01-18 21:29:21 +01:00
|
|
|
|
|
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
|
|
|
|
|
2002-11-21 01:03:14 +01:00
|
|
|
|
conf_question low do_without_windows \
|
|
|
|
|
"Windows was found on your system, and so we can use the Windows" \
|
|
|
|
|
"Drive as our Wine drive. You may, however, wish to create a clean" \
|
|
|
|
|
"Wine install anyways."
|
|
|
|
|
conf_yesno_answer "Should I use the Windows drive for the Wine install? (yes/no) "
|
|
|
|
|
if [ "$ANSWER" = 'yes' ]
|
|
|
|
|
then {
|
|
|
|
|
conf_reset_question windows_found
|
|
|
|
|
conf_question low windows_found \
|
|
|
|
|
"Created $LCONF using your existing Windows installation." \
|
|
|
|
|
"You probably want to review the file, though."
|
|
|
|
|
DOWINE=no
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
DOWINE=yes
|
|
|
|
|
}
|
|
|
|
|
fi
|
2000-04-08 22:20:21 +02:00
|
|
|
|
}
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
elif [ "$DOWINE" = 'auto' ]
|
|
|
|
|
then DOWINE=yes
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
elif [ "$DOWINE" = 'auto' ]
|
2002-06-01 04:55:48 +02:00
|
|
|
|
then
|
2001-01-18 21:29:21 +01:00
|
|
|
|
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
|
|
|
|
|
2002-11-22 21:44:13 +01:00
|
|
|
|
conf_question low drivec_path \
|
2001-01-18 21:29:21 +01:00
|
|
|
|
"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?"
|
2002-11-22 21:44:13 +01:00
|
|
|
|
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
|
2001-01-18 21:29:21 +01:00
|
|
|
|
echo "Directory $ANSWER can't be created !"
|
|
|
|
|
conf_reset_question drivec_path
|
|
|
|
|
fi
|
|
|
|
|
}
|
2002-11-22 21:44:13 +01:00
|
|
|
|
else CROOT="$ANSWER"
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
done
|
|
|
|
|
echo "Configuring Wine for a no-windows install in $CROOT..."
|
2002-06-01 04:55:48 +02:00
|
|
|
|
|
2001-01-18 21:29:21 +01:00
|
|
|
|
create_windows_directories
|
2002-05-04 20:31:24 +02:00
|
|
|
|
configure_wine_applications
|
2001-01-11 21:18:06 +01:00
|
|
|
|
|
2002-06-01 04:55:48 +02:00
|
|
|
|
# create $LCONF using the default config file $WINEINI
|
2002-11-22 21:44:13 +01:00
|
|
|
|
if [ "$DOLOCALCONF" = 'yes' ]
|
2001-01-11 21:18:06 +01:00
|
|
|
|
then {
|
2004-04-13 00:05:00 +02:00
|
|
|
|
cp $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
|
2002-11-22 21:44:13 +01:00
|
|
|
|
cp $TMPCONF $LCONF > /dev/null
|
2001-01-18 21:29:21 +01:00
|
|
|
|
else
|
|
|
|
|
DOREG=no
|
2002-06-01 04:55:48 +02:00
|
|
|
|
fi
|
2001-01-18 21:29:21 +01:00
|
|
|
|
|
|
|
|
|
#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 {
|
2002-04-23 21:29:55 +02:00
|
|
|
|
CROOT=`sed -n '/^\[Drive C\]$/,/^\[.*\]$/ s/^\"Path\" = \"\(.*\)\"/\1/p' $LCONF`
|
2000-04-08 22:20:21 +02:00
|
|
|
|
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
|
2002-04-23 21:29:55 +02:00
|
|
|
|
elif [ -f "$CROOT/WINNT/system32/config/system" ]
|
2002-06-01 04:55:48 +02:00
|
|
|
|
then DOREG=no
|
2000-04-08 22:20:21 +02:00
|
|
|
|
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 {
|
2004-02-28 00:34:18 +01:00
|
|
|
|
echo "Compiling rundll32..."
|
|
|
|
|
(cd programs/rundll32; make)
|
2000-04-08 22:20:21 +02:00
|
|
|
|
echo
|
|
|
|
|
}
|
|
|
|
|
fi
|
2000-05-10 00:32:42 +02:00
|
|
|
|
echo "Preparing to install default Wine registry entries..."
|
|
|
|
|
|
2004-04-15 02:04:32 +02:00
|
|
|
|
# Check if dosdevices exists and create it if necessary
|
|
|
|
|
if [ ! -d ~/.wine/dosdevices ]
|
|
|
|
|
then
|
|
|
|
|
mkdir ~/.wine/dosdevices
|
|
|
|
|
ln -s /mnt/fd0 ~/.wine/dosdevices/a:
|
|
|
|
|
ln -s $CROOT ~/.wine/dosdevices/c:
|
|
|
|
|
ln -s /cdrom ~/.wine/dosdevices/d:
|
|
|
|
|
ln -s /tmp ~/.wine/dosdevices/e:
|
|
|
|
|
ln -s ~ ~/.wine/dosdevices/f:
|
|
|
|
|
ln -s / ~/.wine/dosdevices/z:
|
|
|
|
|
fi
|
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
|
2004-02-28 00:34:18 +01:00
|
|
|
|
if ! $RUNDLL32 setupapi.dll,InstallHinfSection DefaultInstall 128 $INFSCRIPT > /dev/null
|
1999-04-18 15:16:29 +02:00
|
|
|
|
then {
|
2000-05-10 00:32:42 +02:00
|
|
|
|
echo "Registry install failed."
|
2002-05-04 20:31:24 +02:00
|
|
|
|
conf_reset_question regedit_error
|
|
|
|
|
conf_question high regedit_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 {
|
2002-11-22 21:44:13 +01:00
|
|
|
|
echo
|
|
|
|
|
echo "Registry entries successfully installed."
|
2001-01-11 21:18:06 +01:00
|
|
|
|
}
|
2000-04-15 22:37:14 +02:00
|
|
|
|
fi
|
|
|
|
|
if [ "$SYSREG" = 'auto' ]
|
|
|
|
|
then SYSREG=yes
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
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
|