forked from mattcaron/playonlinux
-
Notifications
You must be signed in to change notification settings - Fork 10
/
_template
87 lines (61 loc) · 2.2 KB
/
_template
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
#!/usr/bin/env playonlinux-bash
# Date : (2015-XX-XX XX-XX)
# Last revision : (2015-XX-XX XX-XX)
# Wine version used : 1.6.2
# Distribution used to test : Debian Sid (Unstable)
# Author : Pierre Etchemaite [email protected]
# Script licence : GPL v.2
# Program licence : Retail
# Depend :
# Tested with install archives:
# setup_game_name.exe size "md5"
[ -z "$PLAYONLINUX" ] && exit 0
source "$PLAYONLINUX/lib/sources"
PREFIX="GameName"
WORKING_WINE_VERSION="1.6.2"
INSTALLBIN="setup_game_name.exe"
TITLE="Script Name"
URL="http://"
SHORTCUT_NAME="Shortcut Game Name"
POL_GetSetupImages "http://files.playonlinux.com/resources/setups/$PREFIX/top.jpg" "http://files.playonlinux.com/resources/setups/$PREFIX/left.jpg" "$TITLE"
POL_SetupWindow_Init
#POL_SetupWindow_SetID ScriptIDNumber
POL_Debug_Init
POL_SetupWindow_presentation "$TITLE" "Studio / Publisher" "$URL" "Pierre Etchemaite" "$PREFIX"
if [ -z "$POL_SELECTED_FILE" -a -n "$URL" ]; then
POL_SetupWindow_question "$(eval_gettext 'Do you want to download $TITLE?')" "$TITLE"
[ "$APP_ANSWER" = "TRUE" ] && POL_Browser "$URL"
fi
if [ -n "$POL_SELECTED_FILE" ]; then
ARCHIVE="$POL_SELECTED_FILE"
else
cd $HOME
POL_SetupWindow_browse "$(eval_gettext 'Please select the setup file to run.')" "$TITLE" ""
ARCHIVE="$APP_ANSWER"
fi
POL_Wine_SelectPrefix "$PREFIX"
POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"
POL_Wine_WaitBefore "$TITLE"
POL_Wine "$ARCHIVE" || POL_Debug_Fatal "$(eval_gettext 'Error while installing archive')"
Set_OS winxp
POL_SetupWindow_VMS "32"
# Doesn't hurt ;)
POL_Wine_reboot
POL_Shortcut "main.exe" "$SHORTCUT_NAME" "$SHORTCUT_NAME.png" "" "Categories"
POL_Shortcut_Document "$SHORTCUT_NAME" "$WINEPREFIX/drive_c/$PROGRAMFILES/Game Install Directory/Manual.pdf"
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="-all"
POL_LoadVar_PROGRAMFILES
cd "\$WINEPREFIX/drive_c/\$PROGRAMFILES/Game Install Directory/" || exit 1
TITLE="$TITLE"
POL_SetupWindow_Init
# ...
POL_SetupWindow_Close
exit 0
_EOF_
exit 0