forked from mattcaron/playonlinux
-
Notifications
You must be signed in to change notification settings - Fork 10
/
enclave-gog
93 lines (65 loc) · 2.72 KB
/
enclave-gog
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/usr/bin/env playonlinux-bash
# Date : (2012-01-20 23-25)
# Last revision : (2013-12-09 23-10)
# Wine version used : 1.3.37, 1.4.1
# Distribution used to test : Debian Sid (Unstable)
# Author : Pierre Etchemaite [email protected]
# 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.4.1"
TITLE="GOG.com - Enclave"
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/gamecard/$GOGID" "Pierre Etchemaite" "$PREFIX"
POL_System_SetArch "auto"
POL_Call POL_GoG_setup "$GOGID" "c043fb01c784a18febe6332ac5bc08f5"
POL_Wine_SelectPrefix "$PREFIX"
POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"
# fake sdbinst.exe
POL_Call POL_Install_nop "$WINEPREFIX/drive_c/windows/sdbinst.exe"
POL_Call POL_GoG_install "/nogui"
# GoG work!
Set_OS winxp
POL_SetupWindow_VMS "16"
# Doesn't hurt ;)
POL_Wine_reboot
POL_Shortcut "Enclave.exe" "$SHORTCUT_NAME" "$SHORTCUT_NAME.png" "" "Game;ActionGame;"
# 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" "$GOGROOT/Enclave/Manual.pdf"
# C:\GOG Games\Enclave\readme.txt
POL_SetupWindow_Close
cat <<_EOF_ > "$POL_USER_ROOT/configurations/configurators/$SHORTCUT_NAME"
#!/usr/bin/env playonlinux-bash
[ -z "\$PLAYONLINUX" ] && exit 0
source "\$PLAYONLINUX/lib/sources"
export WINEPREFIX="\$POL_USER_ROOT/wineprefix/$PREFIX"
export WINEDEBUG=""
POL_LoadVar_PROGRAMFILES
cd "$GOGROOT/Enclave/" || exit 1
TITLE="$TITLE"
POL_SetupWindow_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 0
_EOF_
exit 0