#!/bin/bash
[
"$PLAYONLINUX"
=
""
] &&
exit
0
source
"$PLAYONLINUX/lib/sources"
PROGRAMFILES=`wine cmd
/c
echo
"%ProgramFiles%"
`
PROGRAMFILES=${PROGRAMFILES:3}
TYTUL=
"Prototype"
PREFIX=
"Prototype"
POL_SetupWindow_Init
POL_SetupWindow_presentation
"$TYTUL"
"Radical Entertainment"
"www.prototypegame.com"
"NSLW"
"$PREFIX"
select_prefix
"$REPERTOIRE/wineprefix/$PREFIX"
if
[ -e
"$REPERTOIRE/configurations/installed/$TYTUL"
];
then
POL_SetupWindow_menu
"What do you want to do?"
"Actions"
"Patch game"
"~"
if
[
"$APP_ANSWER"
==
"Patch game"
];
then
patch_prototype
fi
POL_SetupWindow_Close
exit
fi
cd
"$REPERTOIRE/ressources/"
wget http:
//mulx
.playonlinux.com
/wine/linux-i386/LIST
--output-document=LIST
cat
LIST |
sed
-e
's/\\.//g'
|
cut
-d
';'
-f2 |
sort
-n |
tail
-n1 >& LatestVersion.txt
x=`
cat
LatestVersion.txt |
cut
-c1-1`
y=`
cat
LatestVersion.txt |
cut
-c2-2`
z=`
cat
LatestVersion.txt |
cut
-c3-4`
LATESTVERSION=$x.$y.$z
CHOSENWINEVERSION=$LATESTVERSION
POL_SetupWindow_install_wine
"$CHOSENWINEVERSION"
Use_WineVersion
"$CHOSENWINEVERSION"
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom
"setup.exe"
POL_SetupWindow_message_image
"Please install icoutils\\nif you wan't to have nice icon for the game in PlayOnLinux main menu"
"Note about icon"
"/usr/share/playonlinux/themes/tango/info.png"
POL_SetupWindow_prefixcreate
cd
"$REPERTOIRE/ressources"
if
[
"`sha1sum < winetricks | sed 's/ .*//'`"
!=
"bf24bc6d84a40a836d7ce6de41ff04f910b34434"
];
then
wget http:
//winezeug
.googlecode.com
/svn/trunk/winetricks
--output-document=winetricks
fi
WINETRICKSDX=`
cat
winetricks |
grep
\\
/directx
|
cut
-d
'_'
-f2`
WINETRICKSDXLINK=`
cat
winetricks |
grep
\\
/directx
|
cut
-d
'/'
-f5,6,7,8`
if
[ ! -e
"$HOME/.winetrickscache/directx_${WINETRICKSDX}_redist.exe"
];
then
mkdir
"$HOME/.winetrickscache"
cd
"$HOME/.winetrickscache"
fi
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
sleep
5
POL_SetupWindow_wait_next_signal
"Installation in progress..."
"$TYTUL"
cd
$CDROM
wine
"setup.exe"
POL_SetupWindow_detect_exit
cd
"$WINEPREFIX/drive_c/windows/temp"
cat
"$REPERTOIRE/ressources/winetricks"
|
sed
-e
's/set_winver\\ win2k/set_winver\\ winxp/'
> winetricks
POL_SetupWindow_wait_next_signal
"Installing DirectX 9.0c libraries..."
"$TYTUL"
bash
winetricks -q directx9 xact
POL_SetupWindow_detect_exit
cd
"$WINEPREFIX/drive_c/windows/temp/"
echo
"[HKEY_CURRENT_USER\\\\Software\\\\Wine\\\\Direct3D]"
> fbo.reg
echo
"\\"
OffscreenRenderingMode\\
"=\\"
fbo\\
""
>> fbo.reg
regedit fbo.reg
POL_SetupWindow_menu_list
"How much memory do your graphic card have got?"
"$TYTUL"
"32-64-128-256-384-512-768-1024-2048"
"-"
"256"
VMS=
"$APP_ANSWER"
echo
"[HKEY_CURRENT_USER\\\\Software\\\\Wine\\\\Direct3D]"
> vms.reg
echo
"\\"
VideoMemorySize\\
"=\\"
$VMS\\
""
>> vms.reg
regedit vms.reg
cd
"$WINEPREFIX/drive_c/windows/temp/"
cd
"$WINEPREFIX/drive_c/$PROGRAMFILES/Activision/Prototype"
mv
movies.rcf movies.rcf.bak
wrestool -x -t14
"prototypef.exe"
>
"$WINEPREFIX/drive_c/windows/temp/prototypef.ico"
icotool -x --index=11
"$WINEPREFIX/drive_c/windows/temp/prototypef.ico"
-o
"$REPERTOIRE/icones/32/$TYTUL"
cd
"$WINEPREFIX/drive_c/windows/temp"
rm
-rf *
POL_SetupWindow_make_shortcut
"$PREFIX"
"$PROGRAMFILES/Activision/Prototype"
"prototypef.exe"
""
"$TYTUL"
""
""
Set_WineVersion_Assign
"$CHOSENWINEVERSION"
"$TYTUL"
POL_SetupWindow_message
"$TYTUL has been installed successfully"
"$TYTUL"
POL_SetupWindow_question
"Do you want to patch your game?"
"$TYTUL"
if
[
"$APP_ANSWER"
==
"TRUE"
] ;
then
patch_prototype
fi
POL_SetupWindow_message_image
"Please note that this game has a copy protection system\\nand sadly, it prevents Wine from running the game.\\n\\nPlayOnLinux will not provide any help concerning any illegal\\nstuff."
"Note about copy protection"
"/usr/share/playonlinux/themes/tango/warning.png"
POL_SetupWindow_Close
exit