Magic number : 15
#!/bin/bash
# Date : (2009-05-23 12-14)
# Last revision : (2009-12-05 13-20)
# Wine version used : N/A
# Distribution used to test : N/A
# Author : NSLW
# Licence : Retail
# Comments : CD has either setup.exe or install.exe and it isn't resolved here
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
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
appuyez juste sur ANNULER et fermez correctement l'installeur
le jeu est déjà parfaitement installé et fonctionnel."
LNG_WAIT_END="Appuyez sur \"Suivant\" UNIQUEMENT quand l'installation du jeu sera terminée
sous 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
just press CANCEL et close installer
the game is already fully installed"
LNG_WAIT_END="Click on \"Next\" ONLY when the game installation is finished
or you will have to redo the installation."
fi
TITLE="Fable : The Lost Chapters"
PREFIX="FableTheLostChapters"
cd $REPERTOIRE/tmp
rm *.jpg
wget $SITE/setups/ftlc/left.jpg
POL_SetupWindow_Init "" "$REPERTOIRE/tmp/left.jpg"
POL_SetupWindow_presentation "$TITLE" "Microsoft Games" "http://www.microsoft.com/games/fable/default.asp" "GNU_Raziel and NSLW" "$PREFIX"
select_prefix "$REPERTOIRE/wineprefix/$PREFIX"
POL_SetupWindow_cdrom
cd "$CDROM"
CHECK=$(find . -iwholename ./setup.exe)
if [ "$CHECK" == "" ]; then
CHECK="install.exe" #French
else
CHECK="setup.exe"
fi
POL_SetupWindow_check_cdrom "$CHECK"
POL_SetupWindow_prefixcreate
#fetching PROGRAMFILES environmental variable
PROGRAMFILES=`wine cmd /c echo "%ProgramFiles%"`
PROGRAMFILES=${PROGRAMFILES:3}
#adding CD-ROM as drive d: to winecfg
CDROM2=`echo $CDROM | sed 's/-1/-2/'`
CDROM3=`echo $CDROM | sed 's/-1/-3/'`
CDROM4=`echo $CDROM | sed 's/-1/-4/'`
cd "$WINEPREFIX/dosdevices"
ln -s $CDROM d:
ln -s $CDROM2 e:
ln -s $CDROM3 f:
ln -s $CDROM4 g:
cd "$WINEPREFIX/drive_c/windows/temp/"
echo "[HKEY_LOCAL_MACHINE\\Software\\Wine\\Drives]" > cdrom.reg
echo "\"d:\"=\"cdrom\"" >> cdrom.reg
echo "\"e:\"=\"cdrom\"" >> cdrom.reg
echo "\"f:\"=\"cdrom\"" >> cdrom.reg
echo "\"g:\"=\"cdrom\"" >> cdrom.reg
regedit cdrom.reg
sleep 5
cp "$CDROM/mgspid.dll" "$WINEPREFIX/drive_c/windows/system32"
cp "$CDROM/PidGen.dll" "$WINEPREFIX/drive_c/windows/system32"
cd "$REPERTOIRE/ressources"
#downloading winetricks
if [ "`sha1sum < winetricks | sed 's/ .*//'`" != "4d9334cf063ef6eff593ef33f304023311fc9f8a" ]; then
wget http://winezeug.googlecode.com/svn/trunk/winetricks --output-document=winetricks
fi
#downloading wmp9
if [ ! -e "$HOME/.winetrickscache/MPSetup.exe" ]; then
mkdir "$HOME/.winetrickscache"
cd "$HOME/.winetrickscache"
POL_SetupWindow_download "Downloading DirectX WMP 9" "$TITLE" "http://download.microsoft.com/download/1/b/c/1bc0b1a3-c839-4b36-8f3c-19847ba09299/MPSetup.exe"
fi
#installing wmp9
cd "$REPERTOIRE/ressources"
POL_SetupWindow_wait_next_signal "Installing WMP 9..." "$TITLE"
bash winetricks -q wmp9
POL_SetupWindow_detect_exit
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.playonlinux.com/files/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 "$CDROM/$CHECK"
#wine d:\\setup.exe
#wine d:\\install.exe #don't know if it's valid
POL_SetupWindow_message "$LNG_WAIT_END" "Fable : The Lost Chapters"
Set_Managed "On"
Set_DXGrab "On"
cd "$WINEPREFIX/drive_c/windows/temp/"
echo "[HKEY_CURRENT_USER\\Software\\Wine\\DllOverrides]" > dlloverrides.reg
echo "\"quartz\"=\"native,builtin\"" >> dlloverrides.reg
regedit dlloverrides.reg
POL_SetupWindow_reboot
POL_SetupWindow_make_shortcut "$PREFIX" "$PROGRAMFILES/Microsoft Games/Fable - The Lost Chapters" "Fable.exe" "FableTheLostChapter.xpm" "$TITLE"
POL_SetupWindow_message "$TITLE has been installed successfully" "$TITLE"
POL_SetupWindow_Close
exit