PortableLinuxGames/AppRun_wine

65 lines
1.6 KiB
Bash
Executable File

#!/bin/sh
# Author : Ismael Barros² <ismael@barros2.org>
# License : BSD http://en.wikipedia.org/wiki/BSD_license
APPDIR=$(dirname "$(readlink -f "$0")")
LOGFILE=$(mktemp --suffix=_AppRun )
BINARY=_BINARY_
BINARY_ARGS=
WINETRICKS=
cd "${APPDIR}"
. ./qutil.sh
export LD_LIBRARY_PATH=$PWD/usr/lib/:${LD_LIBRARY_PATH}
export PATH=$PWD/usr/bin/:${PATH}
[ -z "$*" ] && show_usage "usage.txt"
$APPDIR/usr/bin/wineserver -k
setup_keepResolution
export WINEPREFIX=_WINEPREFIX_
export WINEARCH="win32"
export WINEDEBUG="-all"
export WINEDLLOVERRIDES="mshtml,mscoree=,winemenubuilder.exe=n"
if [ ! -d "$WINEPREFIX" ]; then
mkdir -p ~/.cache/winetricks/
if [ "$WINETRICKS" ]; then
for i in $APPDIR/winetricks/*; do
ln -sf "$i" ~/.cache/winetricks/
done
$APPDIR/usr/bin/winetricks -q $WINETRICKS
fi
mkdir -p "$WINEPREFIX"
find "$WINEPREFIX" -type d -exec chmod 775 "{}" \;
find "$WINEPREFIX" -type f -exec chmod 664 "{}" \;
# chown -R "${USER}" "${WINEPREFIX}"
# mkdir -p "${WINEPREFIX}/dosdevices"
# mkdir -p "${WINEPREFIX}/drive_c"
# mkdir -p "${WINEPREFIX}/drive_c/StarCraft"
# ln -nfs "${WINEPREFIX}/drive_c" "${WINEPREFIX}/dosdevices/c:"
# ln -nfs "${HOME}" "${WINEPREFIX}/dosdevices/y:"
# ln -nfs "/" "${WINEPREFIX}/dosdevices/z:"
# cp "${APPDIR}/"*.reg "${WINEPREFIX}"
fi
CONF=
for i in $@; do
case $i in
@conf) CONF=1; shift ;;
esac
done
cd "$WINEPREFIX"
if [ $CONF ]; then
$APPDIR/usr/bin/winecfg $@
else
$APPDIR/usr/bin/wine "$APPDIR/$BINARY" $BINARY_ARGS $@
fi