#!/bin/bash
[
"$PLAYONLINUX"
=
""
] &&
exit
0
source
"$PLAYONLINUX/lib/sources"
PROGRAMFILES=`wine cmd
/c
echo
"%ProgramFiles%"
`
PROGRAMFILES=${PROGRAMFILES:3}
if
[
"$POL_LANG"
==
"fr"
];
then
LNG_WITCHER_WARNING=
"Attention, ce jeu ne sera pleinement utilisable que par\\nles possésseurs de Nvidia GeForce 8 ou supérieurs."
LNG_GDI_DL=
"Téléchargement de gdiplus..."
LNG_DX9_DL=
"Téléchargement de la mise a jour DirectX9.0c pour Wine..."
LNG_DX9_INSTALL=
"L'installation de la mise a jour DirectX9.0c pour Wine va débuter."
LNG_WAIT_END=
"Appuyez sur \\"
Suivant\\
" UNIQUEMENT quand l'installation du jeu sera terminée\\nsous peine de devoir recommencer l'installation."
LNG_WITCHER_VMS=
"Quelle est la quantité de mémoire (Mo) de votre carte graphique ?\\n(minimum pour ce jeu : 256)"
LNG_WITCHER_WARNING_VMS=
"Attention, votre carte graphique ne possède pas assez de mémoire\\npour faire fonctionner correctement ce jeu."
else
LNG_WITCHER_WARNING=
"Warning, this game will be usable only if you have an Nvidia GeForce 8 or later."
LNG_GDI_DL=
"Downloading gdiplus..."
LNG_DX9_DL=
"Downloading Wine DirectX9.0c Update..."
LNG_DX9_INSTALL=
"DirectX9.0c Update installation will begin."
LNG_WAIT_END=
"Click on \\"
Next\\
" ONLY when the game installation is finished\\nor you will have to redo the installation."
LNG_WITCHER_VMS=
"How much memory does your graphics board have?\\n(minimum for this game : 256)"
LNG_WITCHER_WARNING_VMS=
"warning, your graphic card do not have enough memory to play this game."
fi
cd
$REPERTOIRE
/tmp
rm
*.jpg
wget $SITE
/setups/witcher/left
.jpg
POL_SetupWindow_Init
""
"$REPERTOIRE/tmp/left.jpg"
POL_SetupWindow_message_image
"$LNG_WITCHER_WARNING"
"The Witcher"
"$PLAYONLINUX/themes/tango/warning.png"
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom
"setup.exe"
select_prefixe
"$REPERTOIRE/wineprefix/TheWitcher/"
POL_SetupWindow_prefixcreate
if
[ ! -e $REPERTOIRE
/ressources/
];
then
mkdir
-p $REPERTOIRE
/ressources/
fi
cd
$REPERTOIRE
/ressources/
if
[ ! -e $REPERTOIRE
/ressources/gdiplus
.dll.zip ];
then
fi
cd
"$REPERTOIRE/ressources"
if
[
"`sha1sum < winetricks | sed 's/ .*//'`"
!=
"e71457524b2f9a0c81369745ea9018d9278565b2"
];
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
"$REPERTOIRE/ressources"
POL_SetupWindow_wait_next_signal
"$LNG_DX9_INSTALL"
"The Witcher"
bash
winetricks -q directx9
POL_SetupWindow_detect_exit
cd
$WINEPREFIX
/drive_c/windows/system32/
unzip $REPERTOIRE
/ressources/gdiplus
.dll.zip
Set_OS
"winxp"
wine d:\\\\setup.exe
POL_SetupWindow_message
"$LNG_WAIT_END"
"The Witcher"
TEMP=
"$REPERTOIRE/tmp"
echo
"[HKEY_CURRENT_USER\\Software\\Wine\\Direct3D]"
> $TEMP
/thewitcher
.reg
echo
"\\"
DirectDrawRenderer\\
"=\\"
opengl\\
""
>> $TEMP
/thewitcher
.reg
echo
"\\"
RenderTargetLockMode\\
"=\\"
textex\\
""
>> $TEMP
/thewitcher
.reg
echo
"\\"
OffscreenRenderingMode\\
"=\\"
fbo\\
""
>> $TEMP
/thewitcher
.reg
POL_SetupWindow_menu_list
"$LNG_WITCHER_VMS"
"The Witcher"
"32-64-128-256-384-512-768-1024-2048"
"-"
"256"
VMS=
"$APP_ANSWER"
if
[
"$VMS"
-lt
"256"
];
then
POL_SetupWindow_message_image
"$LNG_WITCHER_WARNING_VMS"
"The Witcher"
"$PLAYONLINUX/themes/tango/warning.png"
fi
echo
"\\"
VideoMemorySize\\
"=\\"
$VMS\\
""
>> $TEMP
/thewitcher
.reg
regedit $TEMP
/thewitcher
.reg
Set_Managed
"On"
Set_DXGrab
"On"
POL_SetupWindow_reboot
POL_SetupWindow_make_shortcut
"The Witcher"
"$PROGRAMFILES/The Witcher/"
"launcher.exe"
"The Witcher.xpm"
POL_SetupWindow_Close
exit