#!/bin/bash
[
"$PLAYONLINUX"
=
""
] &&
exit
0
source
"$PLAYONLINUX/lib/sources"
PROGRAMFILES=`wine cmd
/c
echo
"%ProgramFiles%"
`
PROGRAMFILES=${PROGRAMFILES:3}
TYTUL=
"Test Drive Unlimited"
PREFIX=
"TDU"
patch_tdu()
{
POL_SetupWindow_browse
"Select patch file"
"$TYTUL"
""
POL_SetupWindow_wait_next_signal
"Installation in progress..."
"$TYTUL"
wine
"$APP_ANSWER"
POL_SetupWindow_detect_exit
POL_SetupWindow_message
"Patch for $TYTUL has been installed successfully"
"$TYTUL"
}
Install_megapack()
{
POL_SetupWindow_browse
"Select Megapack file"
"$TYTUL"
""
POL_SetupWindow_wait_next_signal
"Installation in progress..."
"$TYTUL"
wine
"$APP_ANSWER"
POL_SetupWindow_detect_exit
POL_SetupWindow_message
"Patch for $TYTUL has been installed successfully"
"$TYTUL"
}
Get_Latest_Wine_Version()
{
wget http:
//mulx
.playonlinux.com
/wine/linux-i386/LIST
--output-document=
"$REPERTOIRE/tmp/LIST"
xyz=`
cat
"$REPERTOIRE/tmp/LIST"
|
sed
-e
's/\\.//g'
|
cut
-d
';'
-f2 |
sort
-n |
tail
-n1`
echo
"$(echo $xyz | cut -c1-1).$(echo $xyz | cut -c2-2).$(echo $xyz | cut -c3-4)"
}
POL_SetupWindow_make_icon_for_shortcut()
{
convert
"$HOME/.local/share/icons/$2"
-geometry 32X32
"$REPERTOIRE/icones/32/$1"
}
POL_SetupWindow_Init
POL_SetupWindow_presentation
"$TYTUL"
"Atari"
"www.testdriveunlimited.com"
"NSLW"
"$PREFIX"
select_prefix
"$REPERTOIRE/wineprefix/$PREFIX"
LATESTVERSION=$(Get_Latest_Wine_Version)
CHOSENWINEVERSION=
"$LATESTVERSION"
Use_WineVersion
"$CHOSENWINEVERSION"
if
[ -e
"$REPERTOIRE/configurations/installed/$TYTUL"
];
then
POL_SetupWindow_menu
"What do you want to do?"
"Actions"
"Patch game~Install Megapack"
"~"
if
[
"$APP_ANSWER"
==
"Patch game"
];
then
patch_tdu
elif
[
"$APP_ANSWER"
==
"Install Megapack"
]
then
Install_megapack
fi
POL_SetupWindow_Close
exit
fi
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom
"setup.exe"
POL_SetupWindow_prefixcreate
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
tricks fontsmooth-
enable
POL_SetupWindow_wait_next_signal
"Installation in progress..."
"$TYTUL"
cd
"$CDROM"
msiexec
/i
ISScript11.Msi
/q
wine
"setup.exe"
POL_SetupWindow_detect_exit
cd
"$WINEPREFIX/drive_c/windows/temp/"
echo
"[HKEY_CURRENT_USER\\\\Software\\\\Wine\\\\Direct3D]"
> multisampling.reg
echo
"\\"
Multisampling\\
"=\\"
enabled\\
""
>> multisampling.reg
echo
"\\"
OffscreenRenderingMode\\
"=\\"
backbuffer\\
""
>> multisampling.reg
regedit multisampling.reg
echo
"[HKEY_CURRENT_USER\\\\Software\\\\Wine\\\\DirectInput]"
> mwo.reg
echo
"\\"
MouseWarpOverride\\
"=\\"
disable\\
""
>> mwo.reg
regedit mwo.reg
POL_SetupWindow_menu_list
"How much memory do your graphic card have got?"
"$TYTUL"
"32-64-128-256-384-512-768-890-1024-2048"
"-"
"256"
VMS=
"$APP_ANSWER"
echo
"[HKEY_CURRENT_USER\\\\Software\\\\Wine\\\\Direct3D]"
> vms.reg
echo
"\\"
VideoMemorySize\\
"=\\"
$VMS\\
""
>> vms.reg
regedit vms.reg
POL_SetupWindow_make_shortcut
"$PREFIX"
"$PROGRAMFILES/Atari/Test Drive Unlimited"
"TestDriveUnlimited.exe"
""
"$TYTUL"
""
""
Set_WineVersion_Assign
"$CHOSENWINEVERSION"
"$TYTUL"
POL_SetupWindow_make_icon_for_shortcut
"$TYTUL"
"fccb_testdriveunlimited.0.xpm"
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_tdu
fi
POL_SetupWindow_question
"Do you've got Test Drive® Unlimited Megapack?"
"$TYTUL"
if
[
"$APP_ANSWER"
==
"TRUE"
] ;
then
Install_megapack
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