#!/bin/bash
if [ "$PLAYONLINUX" = "" ]
then
exit 0
fi
source "$PLAYONLINUX/lib/sources"
cfg_check
if [ "$POL_LANG" == "fr" ]; then
LNG_WAIT_CP="Patientez pendant la préparation de l'installation..."
LNG_MFC42_DL="Téléchargement de mfc42..."
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_FABLE_WARNING="A la fin de l'installation si on vous demande d'insérer le CD1\nappuyez juste sur ANNULER et fermez correctement l'installeur\nle jeu est déjà parfaitement installé et fonctionnel."
LNG_WAIT_END="Appuyez sur \"Suivant\" UNIQUEMENT quand l'installation du jeu sera terminée\nsous peine de devoir recommencer l'installation."
else
NG_WAIT_CP="Wait while the installation is prepared..."
LNG_MFC42_DL="Downloading mfc42..."
LNG_DX9_DL="Downloading Wine DirectX9.0c Update..."
LNG_DX9_INSTALL="DirectX9.0c Update installation will begin."
LNG_FABLE_WARNING="A the end of the installation proccess, if you're asked to insert CD1\njust press CANCEL et close installer\nthe game is already fully installed"
LNG_WAIT_END="Click on \"Next\" ONLY when the game installation is finished\nor you will have to redo the installation."
fi
cd $REPERTOIRE/tmp
rm *.jpg
wget $SITE/setups/ftlc/left.jpg
POL_SetupWindow_Init "" "$REPERTOIRE/tmp/left.jpg"
POL_SetupWindow_presentation "Fable : The Lost Chapters" "Microsoft Games" "http://www.microsoft.com/games/fable/default.asp" "GNU_Raziel" "FableTheLostChapters"
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "install.exe"
TEMP="$HOME/.PlayOnLinux/tmp/FableTheLostChapters"
chmod 777 $TEMP -R
rm $TEMP -R
mkdir -p $TEMP
select_prefixe "$REPERTOIRE/wineprefix/FableTheLostChapters/"
POL_SetupWindow_prefixcreate
cd $WINEPREFIX/drive_c/windows/
mkdir temp
cd $WINEPREFIX/dosdevices
rm ./*
ln -s ../drive_c c:
ln -s / z:
ln -s $TEMP d:
POL_SetupWindow_wait_next_signal "$LNG_WAIT_CP" "Fable : The Lost Chapters"
cp -r $CDROM/* $TEMP
chmod 777 $TEMP -R
## CD-ROM 2
POL_SetupWindow_cdrom
POL_SetupWindow_wait_next_signal "$LNG_WAIT_CP" "Fable : The Lost Chapters"
cp -r $CDROM/* $TEMP
chmod 777 $TEMP -R
## CD-ROM 3
POL_SetupWindow_cdrom
POL_SetupWindow_wait_next_signal "$LNG_WAIT_CP" "Fable : The Lost Chapters"
cp -r $CDROM/* $TEMP
chmod 777 $TEMP -R
## CD-ROM 4
POL_SetupWindow_cdrom
POL_SetupWindow_wait_next_signal "$LNG_WAIT_CP" "Fable : The Lost Chapters"
cp -r $CDROM/* $TEMP
chmod 777 $TEMP -R
cp $CDROM/mgspid.dll $WINEPREFIX/drive_c/windows/system32/
cp $CDROM/PidGen.dll $WINEPREFIX/drive_c/windows/system32/
if [ ! -e $REPERTOIRE/ressources/ ]; then
mkdir -p $REPERTOIRE/ressources/
fi
cd $REPERTOIRE/ressources/
if [ ! -e $REPERTOIRE/ressources/D3DX9_XX_dll_\(32Bit_All\).zip ]; then
POL_SetupWindow_download "$LNG_DX9_DL" "Fable : The Lost Chapters" "http://mulx.net/file_pol/D3DX9_XX_dll_(32Bit_All).zip"
fi
if [ ! -e $REPERTOIRE/ressources/mfc42.dll.zip ]; then
POL_SetupWindow_download "$LNG_MFC42_DL" "Fable : The Lost Chapters" "http://www.dllbank.com/zip/m/mfc42.dll.zip"
fi
cd $WINEPREFIX/drive_c/windows/system32/
unzip $REPERTOIRE/ressources/mfc42.dll.zip
regsvr32 mfc42.dll
Set_OS "winxp"
cd $WINEPREFIX/drive_c/windows/temp/
unzip $REPERTOIRE/ressources/D3DX9_XX_dll_\(32Bit_All\).zip
POL_SetupWindow_message "$LNG_DX9_INSTALL" "Fable : The Lost Chapters"
wine c:\\windows\\temp\\D3DX9_XX_dll_\(32Bit_All\)\\Install\\DXSETUP.exe
fonts_to_prefixe
POL_SetupWindow_message "$LNG_FABLE_WARNING" "Fable : The Lost Chapters"
wine d:\\install.exe
POL_SetupWindow_message "$LNG_WAIT_END" "Fable : The Lost Chapters"
Set_Managed "On"
Set_DXGrab "On"
echo "[HKEY_CURRENT_USER\\Software\\Wine\\DllOverrides]" > $REPERTOIRE/tmp/dlloverrides.reg
echo "\"quartz\"=\"native,builtin\"" >> $REPERTOIRE/tmp/dlloverrides.reg
regedit $REPERTOIRE/tmp/dlloverrides.reg
POL_SetupWindow_reboot
chmod 777 $TEMP -R
rm $TEMP -R
cd $WINEPREFIX/dosdevices
rm ./d:
ln -s $CDROM ./d:
POL_SetupWindow_make_shortcut "FableTheLostChapters" "Program Files/Microsoft Games/Fable - The Lost Chapters" "Fable.exe" "FableTheLostChapter.xpm" "Fable - The Lost Chapters"
POL_SetupWindow_Close
exit