2004-04-01 07:03:27 +02:00
|
|
|
|
#!/bin/sh
|
|
|
|
|
#
|
|
|
|
|
# Script to create the initial WINEPREFIX directory
|
|
|
|
|
#
|
|
|
|
|
# Copyright 1999 Ove K<>ven
|
|
|
|
|
# Copyright 2004 Chris Morgan
|
|
|
|
|
# Copyright 2004 Alexandre Julliard
|
|
|
|
|
#
|
|
|
|
|
# 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
|
|
|
|
|
#
|
|
|
|
|
|
2004-05-06 00:09:09 +02:00
|
|
|
|
usage()
|
|
|
|
|
{
|
|
|
|
|
echo "Usage: $0 [options]"
|
|
|
|
|
echo ""
|
|
|
|
|
echo "Options:"
|
2004-05-11 06:29:18 +02:00
|
|
|
|
echo " -h, --help Display this message"
|
|
|
|
|
echo " --prefix <dir> Directory to create (default: \$WINEPREFIX or ~/.wine)"
|
|
|
|
|
echo " -q, --quiet Don't print status messages"
|
|
|
|
|
echo " -u, --update Update the prefix directory if it already exists"
|
|
|
|
|
echo " --use-wine-tree <dir> Run from the Wine source tree <dir>"
|
2004-05-06 00:09:09 +02:00
|
|
|
|
echo ""
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
|
|
dlldir="@dlldir@"
|
|
|
|
|
datadir="@datadir@/wine"
|
|
|
|
|
|
|
|
|
|
do_update=0
|
2004-05-11 06:29:18 +02:00
|
|
|
|
quiet=0
|
2004-05-06 00:09:09 +02:00
|
|
|
|
|
|
|
|
|
while [ $# -gt 0 ]
|
|
|
|
|
do
|
|
|
|
|
case "$1" in
|
2004-05-11 06:29:18 +02:00
|
|
|
|
-h|--help)
|
2004-05-06 00:09:09 +02:00
|
|
|
|
usage
|
|
|
|
|
exit 0
|
|
|
|
|
;;
|
|
|
|
|
--prefix)
|
|
|
|
|
WINEPREFIX="$2"
|
|
|
|
|
shift 2
|
|
|
|
|
;;
|
2004-05-11 06:29:18 +02:00
|
|
|
|
-u|--update)
|
2004-05-06 00:09:09 +02:00
|
|
|
|
do_update=1
|
|
|
|
|
shift
|
|
|
|
|
;;
|
2004-05-11 06:29:18 +02:00
|
|
|
|
-q|--quiet)
|
|
|
|
|
quiet=1
|
|
|
|
|
shift
|
|
|
|
|
;;
|
2004-05-06 00:09:09 +02:00
|
|
|
|
--use-wine-tree)
|
|
|
|
|
topdir=`cd "$2" && pwd`
|
|
|
|
|
if [ -x "$topdir/server/wineserver" ]
|
|
|
|
|
then
|
|
|
|
|
WINELOADER="$topdir/wine"
|
|
|
|
|
dlldir="$topdir/programs"
|
|
|
|
|
datadir="$topdir/tools"
|
|
|
|
|
else
|
|
|
|
|
echo "$2 is not a valid Wine source tree"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
shift 2
|
|
|
|
|
;;
|
|
|
|
|
*)
|
2004-05-11 06:29:18 +02:00
|
|
|
|
echo "Unknown option $1"
|
2004-05-06 00:09:09 +02:00
|
|
|
|
usage
|
|
|
|
|
exit 1
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
done
|
2004-04-01 07:03:27 +02:00
|
|
|
|
|
|
|
|
|
WINEPREFIX="${WINEPREFIX:-$HOME/.wine}"
|
|
|
|
|
|
2004-05-11 06:29:18 +02:00
|
|
|
|
if [ -d "$WINEPREFIX" ] || mkdir "$WINEPREFIX"; then :
|
2004-04-01 07:03:27 +02:00
|
|
|
|
else
|
2004-05-11 06:29:18 +02:00
|
|
|
|
echo "Could not create $WINEPREFIX, aborting"
|
|
|
|
|
exit 1
|
2004-04-01 07:03:27 +02:00
|
|
|
|
fi
|
|
|
|
|
|
2004-05-06 00:09:09 +02:00
|
|
|
|
WINEPREFIX=`cd "$WINEPREFIX" && pwd`
|
2004-05-14 02:43:50 +02:00
|
|
|
|
|
|
|
|
|
# Create the drive symlinks
|
|
|
|
|
|
|
|
|
|
if [ ! -d "$WINEPREFIX/dosdevices" ]
|
|
|
|
|
then
|
|
|
|
|
mkdir "$WINEPREFIX/dosdevices"
|
|
|
|
|
[ -d "$WINEPREFIX/drive_c" ] || mkdir "$WINEPREFIX/drive_c"
|
|
|
|
|
ln -s "../drive_c" "$WINEPREFIX/dosdevices/c:"
|
|
|
|
|
ln -s "/" "$WINEPREFIX/dosdevices/z:"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
CROOT="$WINEPREFIX/dosdevices/c:"
|
2004-04-01 07:03:27 +02:00
|
|
|
|
|
|
|
|
|
# Create the directory tree
|
|
|
|
|
|
|
|
|
|
for i in \
|
2004-08-11 20:51:58 +02:00
|
|
|
|
"$CROOT/Program Files" \
|
|
|
|
|
"$CROOT/Program Files/Common Files" \
|
2004-04-01 07:03:27 +02:00
|
|
|
|
"$CROOT/windows" \
|
|
|
|
|
"$CROOT/windows/command" \
|
|
|
|
|
"$CROOT/windows/fonts" \
|
|
|
|
|
"$CROOT/windows/inf" \
|
|
|
|
|
"$CROOT/windows/profiles" \
|
|
|
|
|
"$CROOT/windows/profiles/Administrator" \
|
|
|
|
|
"$CROOT/windows/Start Menu" \
|
|
|
|
|
"$CROOT/windows/Start Menu/Programs" \
|
|
|
|
|
"$CROOT/windows/Start Menu/Programs/Startup" \
|
|
|
|
|
"$CROOT/windows/system" \
|
|
|
|
|
"$CROOT/windows/temp"
|
|
|
|
|
do
|
2004-05-06 00:09:09 +02:00
|
|
|
|
[ -d "$i" ] || mkdir "$i"
|
2004-04-01 07:03:27 +02:00
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
# Create the application symlinks
|
|
|
|
|
|
|
|
|
|
link_app()
|
|
|
|
|
{
|
2004-05-06 00:09:09 +02:00
|
|
|
|
rm -f "$2" && ln -s "$dlldir/$1.exe.so" "$2" || echo "Warning: failed to create $2"
|
2004-04-01 07:03:27 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
link_app start "$CROOT/windows/command/start.exe"
|
|
|
|
|
link_app notepad "$CROOT/windows/notepad.exe"
|
|
|
|
|
link_app regedit "$CROOT/windows/regedit.exe"
|
|
|
|
|
link_app rundll32 "$CROOT/windows/rundll32.exe"
|
|
|
|
|
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"
|
|
|
|
|
link_app uninstaller "$CROOT/windows/uninstall.exe"
|
|
|
|
|
link_app winhelp "$CROOT/windows/winhelp.exe"
|
|
|
|
|
link_app winhelp "$CROOT/windows/winhlp32.exe"
|
|
|
|
|
link_app winebrowser "$CROOT/windows/winebrowser.exe"
|
|
|
|
|
|
|
|
|
|
# Copy the .inf script and run it
|
|
|
|
|
|
2004-05-06 00:09:09 +02:00
|
|
|
|
cp "$datadir/wine.inf" "$CROOT/windows/inf/wine.inf"
|
2004-04-01 07:03:27 +02:00
|
|
|
|
export WINEPREFIX
|
|
|
|
|
${WINELOADER:-wine} rundll32.exe setupapi.dll,InstallHinfSection DefaultInstall 128 wine.inf
|
|
|
|
|
|
|
|
|
|
# Wait for the wineserver to finish
|
|
|
|
|
|
2004-05-06 00:09:09 +02:00
|
|
|
|
if [ $do_update = 0 ]
|
|
|
|
|
then
|
|
|
|
|
${WINESERVER:-wineserver} -w
|
2004-05-11 06:29:18 +02:00
|
|
|
|
if [ $quiet = 0 ]
|
|
|
|
|
then
|
|
|
|
|
echo "$WINEPREFIX created successfully."
|
|
|
|
|
fi
|
2004-05-06 00:09:09 +02:00
|
|
|
|
else
|
2004-05-11 06:29:18 +02:00
|
|
|
|
if [ $quiet = 0 ]
|
|
|
|
|
then
|
|
|
|
|
echo "$WINEPREFIX updated successfully."
|
|
|
|
|
fi
|
2004-05-06 00:09:09 +02:00
|
|
|
|
fi
|