73 lines
1.9 KiB
Bash
Executable File
73 lines
1.9 KiB
Bash
Executable File
#!/bin/bash
|
|
# Author : Ismael Barros² <ismael@barros2.org>
|
|
# License : BSD http://en.wikipedia.org/wiki/BSD_license
|
|
|
|
export APPDIR="$(dirname "$(readlink -f "$0")")"
|
|
export APPPKG="$(basename "$APPIMAGE")"
|
|
LOGFILE=$(mktemp "/tmp/AppRun-log-${APPPKG}.XXXXXXXXXX")
|
|
|
|
BINARY="_BINARY_"
|
|
BINARY_ARGS=
|
|
WINETRICKS=
|
|
|
|
. "$APPDIR/util.sh"
|
|
|
|
# Uncomment this if the app needs relative paths specified on the command line
|
|
#eval arguments="$(patch_relative_paths "$@")"
|
|
#set -- "${arguments[@]}"
|
|
|
|
export PATH="$APPDIR/usr/bin/:${PATH}"
|
|
|
|
[ -z "$*" ] && show_usage "$APPDIR/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"
|
|
|
|
|
|
CONF=
|
|
for i in $@; do
|
|
case $i in
|
|
@conf) CONF=1; shift ;;
|
|
@reset) rm -rfv "$WINEPREFIX"; shift ;;
|
|
esac
|
|
done
|
|
|
|
|
|
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:"
|
|
|
|
for i in "${APPDIR}/"*.reg; do
|
|
[ -f "$i" ] && cp -v "$i" "${WINEPREFIX}"
|
|
done
|
|
fi
|
|
|
|
|
|
cd "$WINEPREFIX"
|
|
if [ $CONF ]; then
|
|
run_withLocalLibs "$APPDIR/usr/bin/winecfg" $@
|
|
else
|
|
run_withLocalLibs "$APPDIR/usr/bin/wine" "$APPDIR/$BINARY" $BINARY_ARGS "$@"
|
|
fi
|