#!/bin/bash
[
"$PLAYONLINUX"
=
""
] &&
exit
0
source
"$PLAYONLINUX/lib/sources"
VERSIONWINE=$(wine --version)
TYTUL=
"Race Driver : GRID"
PREFIX=
"GRID"
patch_grid()
{
POL_SetupWindow_browse
"Select patch file downloaded from www.codemasters.com"
"$TYTUL"
""
wine
"$APP_ANSWER"
POL_SetupWindow_message
"Patch for $TYTUL has been installed successfully"
"$TYTUL"
}
POL_SetupWindow_Init
POL_SetupWindow_presentation
"$TYTUL"
"Codemasters"
"N/A"
"NSLW"
"$PREFIX"
select_prefix
"$REPERTOIRE/wineprefix/$PREFIX"
POL_SetupWindow_menu
"What do you want to do?"
"Actions"
"install-game patch-game"
" "
if
[
"$APP_ANSWER"
==
"patch-game"
];
then
if
[ -e
"$REPERTOIRE/wineprefix/$PREFIX"
];
then
patch_grid
fi
POL_SetupWindow_Close
fi
POL_SetupWindow_prefixcreate
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom
"setup.exe"
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_message
"Wait 5 seconds then click next"
"$TYTUL"
cd
"$REPERTOIRE/ressources"
if
[ ! -e $REPERTOIRE
/ressources/openal32
.zip ];
then
fi
if
[ ! -e $REPERTOIRE
/ressources/D3DX9_XX_dll_
\\(32Bit_All\\).zip ];
then
fi
if
[ ! -e $REPERTOIRE
/ressources/X_XX_dll_
\\(32Bit_All\\).zip ];
then
fi
cd
"$WINEPREFIX/drive_c/windows/temp"
unzip $REPERTOIRE
/ressources/D3DX9_XX_dll_
\\(32Bit_All\\).zip
cabextract D3DX9_XX_dll_\\(32Bit_All\\)
/Install/Nov2007_d3dx9_36_x86
.cab
unzip $REPERTOIRE
/ressources/X_XX_dll_
\\(32Bit_All\\).zip
cabextract X_XX_dll_\\(32Bit_All\\)
/Install/APR2007_xinput_x86
.cab
unzip $REPERTOIRE
/ressources/openal32
.zip
mkdir
"$WINEPREFIX/drive_c/Program Files/Codemasters"
mkdir
"$WINEPREFIX/drive_c/Program Files/Codemasters/GRID"
cd
"$WINEPREFIX/drive_c/Program Files/Codemasters/GRID"
cp
"$WINEPREFIX/drive_c/windows/temp/d3dx9_36.dll"
d3dx9_36.dll
cp
"$WINEPREFIX/drive_c/windows/temp/xinput1_3.dll"
xinput1_3.dll
cp
"$WINEPREFIX/drive_c/windows/temp/OpenAL32.dll"
OpenAL32.dll
cp
"$WINEPREFIX/drive_c/windows/temp/wrap_oal.dll"
wrap_oal.dll
cd
"$WINEPREFIX/drive_c/windows/temp/"
echo
"[HKEY_CURRENT_USER\\\\Software\\\\Wine\\\\DllOverrides]"
> override.reg
echo
"\\"
d3dx9_36.dll\\
"=\\"
native\\
""
>> override.reg
echo
"\\"
xinput1_3.dll\\
"=\\"
native\\
""
>> override.reg
regedit override.reg
echo
"[HKEY_CURRENT_USER\\\\Software\\\\Wine\\\\Direct3D]"
> multisampling.reg
echo
"\\"
OffscreenRenderingMode\\
"=\\"
fbo\\
""
>> fbo.reg
echo
"\\"
Multisampling\\
"=\\"
enabled\\
""
>> multisampling.reg
regedit multisampling.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/"
rm
-rf *
POL_SetupWindow_make_shortcut
"$PREFIX"
"Program Files/Codemasters/GRID"
"GRID.exe"
""
"$TYTUL"
""
""
POL_SetupWindow_wait_next_signal
"Installation in progress..."
"$TYTUL"
cd
$CDROM
wine
"setup.exe"
POL_SetupWindow_detect_exit
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_grid
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