Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: bc01102dfb
Fetching contributors…

Cannot retrieve contributors at this time

97 lines (67 sloc) 2.949 kB
#!/bin/bash
# Date : (2012-01-20 23-25)
# Last revision : (2012-09-23 18-42)
# Wine version used : 1.3.37
# Distribution used to test : Debian Sid (Unstable)
# Author : Pierre Etchemaite pe-pol@concept-micro.com
# Script licence : GPL v.2
# Program licence : Retail
# Depend :
[ -z "$PLAYONLINUX" ] && exit 0
source "$PLAYONLINUX/lib/sources"
GOGID="enclave"
PREFIX="Enclave_gog"
WORKING_WINE_VERSION="1.3.37"
TITLE="Enclave (GoG release)"
SHORTCUT_NAME="Enclave"
POL_SetupWindow_Init
POL_SetupWindow_SetID 1042
# 4.0.15 needed for complex POL_Shortcut_InsertBeforeWine
POL_RequiredVersion "4.0.15" || POL_Debug_Fatal "$APPLICATION_TITLE 4.0.15 is required to install $TITLE"
POL_Debug_Init
POL_SetupWindow_presentation "$TITLE" "Starbreeze Studios / TopWare Interactive" "http://www.gog.com/en/gamecard/$GOGID" "Pierre Etchemaite" "$PREFIX"
POL_System_SetArch "auto"
POL_Call POL_GoG_setup "$GOGID" "0fd0daa0f8b8e8a642e05a0cdc4f15ad"
POL_Wine_SelectPrefix "$PREFIX"
POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"
# Prevent GoG installer from installing Acrobat Reader or Foxit in each prefix
POL_Call POL_Function_SetNativeExtension "pdf"
POL_Wine_WaitBefore "$TITLE"
POL_Wine "$POL_GoG_location" || POL_Debug_Fatal "$(eval_gettext 'Error while installing archive')"
# GoG work!
Set_OS winxp
POL_SetupWindow_VMS "16"
# Doesn't hurt ;)
POL_Wine_reboot
POL_Shortcut "Enclave.exe" "$SHORTCUT_NAME" "$SHORTCUT_NAME.png" ""
# Fixes a problem with CPU management on modern computers (specially laptops):
# Enclave doesn't handle variable frequency, so make sure they stay at top frequency
# with a background busy loop (other means are less portable and/or require root privileges)
POL_Shortcut_InsertBeforeWine "$SHORTCUT_NAME" 'taskset -pc 0 $$'
POL_Shortcut_InsertBeforeWine "$SHORTCUT_NAME" 'nice -19 bash -c "while true; do let i=1; done" &'
POL_Shortcut_InsertBeforeWine "$SHORTCUT_NAME" 'BUSYLOOP_PID=$!'
echo 'kill $BUSYLOOP_PID' >> "$POL_USER_ROOT/shortcuts/$SHORTCUT_NAME"
POL_Shortcut_Document "$SHORTCUT_NAME" "$WINEPREFIX/drive_c/$PROGRAMFILES/GOG.com/Enclave/Manual.pdf"
# C:/$PROGRAMFILES/GOG.com/Enclave/readme.txt
POL_SetupWindow_Close
cat <<_EOF_ > "$POL_USER_ROOT/configurations/configurators/$SHORTCUT_NAME"
#!/bin/bash
[ -z "\$PLAYONLINUX" ] && exit 0
source "\$PLAYONLINUX/lib/sources"
export WINEPREFIX="\$POL_USER_ROOT/wineprefix/$PREFIX"
export WINEDEBUG=""
POL_LoadVar_PROGRAMFILES
cd "\$WINEPREFIX/drive_c/\$PROGRAMFILES/GOG.com/Enclave/" || exit 1
TITLE="$TITLE"
POL_SetupWindow_Init
POL_Debug_Init
DRIVER="\$(sed -e 's/^VID_RENDER=\([A-Za-z0-9]*\).*/\1/p; d' environment.cfg)"
POL_SetupWindow_menu_list "\$(eval_gettext 'Pick video renderer to use:')" "\$TITLE" "Direct3D8~OpenGL" "~" "\$DRIVER"
NEW_DRIVER="\$APP_ANSWER"
if [ "\$NEW_DRIVER" != "\$DRIVER" ]; then
sed -i.bak -e 's/^VID_RENDER=[A-Za-z0-9]*/VID_RENDER='"\$NEW_DRIVER"'/' environment.cfg
fi
POL_SetupWindow_Close
exit
_EOF_
exit
Jump to Line
Something went wrong with that request. Please try again.