#!/bin/bash
GAMENAME=
"Max Payne"
PUBLISHER=
"RockstarGame"
PREFIX=
"maxpayne"
GAMEPATHFROMPROGRAMFILES=
"/Max Payne"
GAMEEXECUTABLENAME=
"MaxPayne.exe"
NEEDEDWINEVERSION=
"1.1.31"
GAME_SETUP=
"Disk1/Setup.exe"
MENU_ACTION_INSTALL=
"Install the game"
MENU_ACTION_PATCH=
"Patch the game"
PATCH_SOURCE_LOCAL=
"From my computer"
PATCH_SOURCE_REMOTE=
"From Internet"
PATCHMIME=
"application/x-dosexec"
PROGRAMFILES=`wine cmd
/c
echo
"%ProgramFiles%"
`
PROGRAMFILES=${PROGRAMFILES:3}
[
"$PLAYONLINUX"
=
""
] &&
exit
0
source
"$PLAYONLINUX/lib/sources"
wget $COVERURL --output-document=
"$REPERTOIRE/tmp/$PREFIX.cover.jpeg"
convert
"$REPERTOIRE/tmp/$PREFIX.cover.jpeg"
-scale 150x356\\!
"$REPERTOIRE/tmp/left.$PREFIX.jpeg"
POL_SetupWindow_Init
""
"$REPERTOIRE/tmp/left.$PREFIX.jpeg"
POL_SetupWindow_presentation
"$GAMENAME"
"$PUBLISHER"
"$URL"
"zedtux"
"$PREFIX"
select_prefix
"$REPERTOIRE/wineprefix/$PREFIX"
patch_game()
{
POL_SetupWindow_menu
"Select the source to patch the game"
"Sources"
"$PATCH_SOURCE_LOCAL~$PATCH_SOURCE_REMOTE"
"~"
if
[
"$APP_ANSWER"
==
"$PATCH_SOURCE_LOCAL"
];
then
POL_SetupWindow_browse
"Select the patch file for $GAMENAME"
"Patching $GAMENAME"
""
if
[
"$APP_ANSWER"
!=
""
] ;
then
if
[ `
file
-bi
"$APP_ANSWER"
` ==
"$PATCHMIME"
] ;
then
POL_SetupWindow_wait_next_signal
"Patching $GAMENAME..."
"$GAMENAME"
wine
"$APP_ANSWER"
POL_SetupWindow_message
"$GAMENAME patched successfully"
"$GAMENAME"
POL_SetupWindow_Close
exit
else
POL_SetupWindow_message_image
"The file that you've selected is not a Microsoft executable."
"Wrong Mime Type"
"/usr/share/playonlinux/themes/tango/warning.png"
fi
else
POL_SetupWindow_Close
exit
fi
else
cd
"$HOME/.PlayOnLinux/tmp"
POL_SetupWindow_wait_next_signal
"Patching $GAMENAME..."
"$GAMENAME"
wine
"./maxpayne1-05patch.exe"
rm
-f
"./maxpayne1-05patch.exe"
POL_SetupWindow_message
"$GAMENAME patched successfully"
"$GAMENAME"
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"
POL_SetupWindow_message_image
"Please, ignore error messages, the game will work =)"
""
"/usr/share/playonlinux/themes/tango/info.png"
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$GAMEPATHFROMPROGRAMFILES"
"$GAMEEXECUTABLENAME"
""
"$GAMENAME"
""
POL_SetupWindow_question
"Do you want to patch the game now ?"
"Max Payne Patch 1.05"
if
[
"$APP_ANSWER"
==
"TRUE"
] ;
then
patch_game
fi
POL_SetupWindow_message
"$GAMENAME has been installed successfully"
"$GAMENAME"
POL_SetupWindow_Close
exit