#!/bin/bash
GAMENAME=
"FlatOut 2"
PREFIX=
"flatout2"
NEEDEDWINEVERSION=
"1.1.31"
MENU_ACTION_INSTALL=
"Install the game"
MENU_ACTION_PATCH=
"Patch the game"
GAME_SETUP=
"setup.exe"
PATCHMIME=
"application/zip"
PROGRAMFILES=
"Program Files"
POL_LoadVar_PROGRAMFILES
[
"$PLAYONLINUX"
=
""
] &&
exit
0
source
"$PLAYONLINUX/lib/sources"
wget http:
//upload
.wikimedia.org
/wikipedia/en/4/40/Flatout2pc
.jpg --output-document=
"$REPERTOIRE/tmp/flatout2.cover.jpeg"
convert
"$REPERTOIRE/tmp/flatout2.cover.jpeg"
-scale 150x356\!
"$REPERTOIRE/tmp/left.flatout.2.jpeg"
POL_SetupWindow_Init
""
"$REPERTOIRE/tmp/left.flatout.2.jpeg"
select_prefix
"$REPERTOIRE/wineprefix/$PREFIX"
patch_game()
{
POL_SetupWindow_browse
"Select the patch file for $GAMENAME (Should be like flatout_2_patch_*.zip)"
"Patching $GAMENAME"
""
if
[
"$APP_ANSWER"
!=
""
] ;
then
if
[ `
file
-bi
"$APP_ANSWER"
` ==
"$PATCHMIME"
] ;
then
cd
"$REPERTOIRE/wineprefix/$PREFIX/drive_c/$PROGRAMFILES/Empire Interactive/FlatOut2"
echo
"Unziping patch into `pwd`"
unzip -o
"$APP_ANSWER"
fi
POL_SetupWindow_message
"$GAMENAME patched successfully"
"$TYTUL"
POL_SetupWindow_Close
exit
fi
}
POL_SetupWindow_prefixcreate
POL_SetupWindow_menu
"What do you want to do?"
"Actions"
"$MENU_ACTION_INSTALL~$MENU_ACTION_PATCH"
"~"
if
[
"$APP_ANSWER"
==
"$MENU_ACTION_PATCH"
];
then
patch_game
POL_SetupWindow_Close
fi
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom
"$GAME_SETUP"
cd
"$WINEPREFIX/dosdevices"
ln
-s
"$CDROM"
d:
cd
"$WINEPREFIX/drive_c/windows/temp/"
echo
"[HKEY_LOCAL_MACHINE\\Software\\Wine\\Drives]"
> cdrom.reg
echo
"\"d:\"=\"cdrom\""
>> cdrom.reg
regedit cdrom.reg
POL_SetupWindow_wait_next_signal
"Installing $GAMENAME..."
"$GAMENAME"
cd
"$CDROM"
wine
"$GAME_SETUP"
POL_SetupWindow_install_wine
"$NEEDEDWINEVERSION"
Set_WineVersion_Assign
"$NEEDEDWINEVERSION"
"$GAMENAME"
POL_SetupWindow_make_shortcut
"$PREFIX"
"$PROGRAMFILES/Empire Interactive/FlatOut2"
"FlatOut2.exe"
""
"$GAMENAME"
""
POL_SetupWindow_make_shortcut
"$PREFIX"
"$PROGRAMFILES/Empire Interactive/FlatOut2"
"FlatOut2.exe"
""
"$GAMENAME Setup"
""
"-setup"
POL_SetupWindow_message
"$GAMENAME has been installed successfully"
"$GAMENAME"
POL_SetupWindow_Close
exit