Magic number : 47
#!/bin/bash
# Date : (2009-12-07 20-00)
# Last revision : (2009-12-07 20-00)
# Wine version used : -
# Distribution used to test : -
# Author : -
# Licence : Retail
# Depend : unzip
[ "$PLAYONLINUX" = "" ] && exit
source "$PLAYONLINUX/lib/sources"
if [ "$POL_LANG" == "fr" ]; then
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\nterminée sous peine de devoir recommencer l'installation."
LNG_WARNING_UPDATE="Si vous n'avez pas l'add-on \"Shivering Isle\" il est recommander\nde patcher le jeu avant de l'utiliser."
else
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\nis finished or you will have to redo the installation."
LNG_WARNING_UPDATE="If you do not have \"Shivering Isle\" addon\nit's recommanded to update this game before use it."
fi
cd $REPERTOIRE/tmp
rm *.jpg
wget $SITE/setups/oblivion/left.jpg
POL_SetupWindow_Init "" "$REPERTOIRE/tmp/left.jpg"
POL_SetupWindow_presentation "The Elder Scrolls 4 - Oblivion" "2K Games" "http://www.elderscrolls.com/games/oblivion_overview.htm" "GNU_Raziel" "TheElderScrolls4_Oblivion"
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "setup.exe"
select_prefix "$REPERTOIRE/wineprefix/TheElderScrolls4_Oblivion/"
POL_SetupWindow_prefixcreate
#fetching PROGRAMFILES environmental variable
PROGRAMFILES=`wine cmd /c echo "%ProgramFiles%"`
PROGRAMFILES=${PROGRAMFILES:3}
fonts_to_prefix
cd "$REPERTOIRE/ressources/"
if [ ! -e "D3DX9_XX_dll_(32Bit_All).zip" ]; then
POL_SetupWindow_download "$LNG_DX9_DL" "The Elder Scrolls 4 - Oblivion" "http://mulx.playonlinux.com/files/D3DX9_XX_dll_(32Bit_All).zip"
fi
cd "$WINEPREFIX/drive_c/windows/temp"
unzip "$REPERTOIRE/ressources/D3DX9_XX_dll_(32Bit_All).zip"
POL_SetupWindow_message "$LNG_DX9_INSTALL" "The Elder Scrolls 4 - Oblivion"
Set_OS "winxp"
wine c:\\windows\\temp\\D3DX9_XX_dll_\(32Bit_All\)\\Install\\DXSETUP.exe
#wine d:\\setup.exe
wine "$CDROM/setup.exe"
POL_SetupWindow_message "$LNG_WAIT_END" "The Elder Scrolls 4 - Oblivion"
cd $REPERTOIRE/tmp/
Set_Managed "On"
Set_DXGrab "On"
echo "[HKEY_CURRENT_USER\Software\Wine\DirectSound]" > $REPERTOIRE/tmp/directsound.reg
echo "\"DefaultBitsPerSample\"=\"16\"" >> $REPERTOIRE/tmp/directsound.reg
echo "\"DefaultSampleRate\"=\"44100\"" >> $REPERTOIRE/tmp/directsound.reg
echo "\"EmulDriver\"=\"Y\"" >> $REPERTOIRE/tmp/directsound.reg
echo "\"HardwareAcceleration\"=\"Emulation\"" >> $REPERTOIRE/tmp/directsound.reg
regedit $REPERTOIRE/tmp/directsound.reg
echo "[HKEY_CURRENT_USER\Software\Wine\Drivers]" > $REPERTOIRE/tmp/drivers.reg
echo "\"Audio\"=\"oss\"" >> $REPERTOIRE/tmp/drivers.reg
regedit $REPERTOIRE/tmp/drivers.reg
echo "[HKEY_CURRENT_USER\Software\Wine\Direct3D]" > $REPERTOIRE/tmp/d3d.reg
echo "\"OffscreenRenderingMode\"=\"fbo\"" >> $REPERTOIRE/tmp/d3d.reg
regedit $REPERTOIRE/tmp/d3d.reg
cd "$WINEPREFIX/drive_c/Program Files/Bethesda Softworks/Oblivion/"
mv Oblivion_default.ini Oblivion_default.ini.save
cat Oblivion_default.ini.save | sed s/bForce1XShaders=1/bForce1XShaders=0/g | sed s/bSaveOnInteriorExteriorSwitch=1/bSaveOnInteriorExteriorSwitch=0/g | sed s/bUseWaterShader=1/bUseWaterShader=0/g > Oblivion_default.ini
#mv Data/Video Data/Video2
#mkdir -p Data/Video
POL_SetupWindow_reboot
POL_SetupWindow_make_shortcut "TheElderScrolls4_Oblivion" "$PROGRAMFILES/Bethesda Softworks/Oblivion/" "OblivionLauncher.exe" "ElderScroll4_Oblivion.xpm" "The Elder Scrolls 4 - Oblivion"
POL_SetupWindow_message_image "$LNG_WARNING_UPDATE" "The Elder Scrolls 4 - Oblivion" "$PLAYONLINUX/themes/tango/warning.png"
POL_SetupWindow_Close
exit