Magic number : 115
#!/bin/bash
# Date : (2009-06-14 12-15)
# Last revision : (2009-06-18 15-00)
# Wine version used : N/A
# Distribution used to test : N/A
# Author : NSLW
# Licence : Retail
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
#fetching PROGRAMFILES environmental variable
PROGRAMFILES=`wine cmd /c echo "%ProgramFiles%"`
PROGRAMFILES=${PROGRAMFILES:3}
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."
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."
fi
#procedure for patching DarkMessiah
patch_DarkMessiah()
{
POL_SetupWindow_browse "Select patch file" "$TYTUL" ""
wine "$APP_ANSWER"
POL_SetupWindow_message "Patch for $TYTUL has been installed successfully" "$TYTUL"
}
TYTUL="Dark Messiah Of Might And Magic"
PREFIX="DarkMessiahOfMightAndMagic"
cd $REPERTOIRE/tmp
rm *.jpg
wget $SITE/setups/darkmessiah/left.jpg
POL_SetupWindow_Init "" "$REPERTOIRE/tmp/left.jpg"
POL_SetupWindow_presentation "$TYTUL" "Arkane Studios" "http://www.mightandmagic.com/fr" "GNU_Raziel and NSLW" "$PREFIX"
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "Disk1/setup.exe"
Use_WineVersion "1.1.23" #because DirectX won't install on stable Wine-1.0.1
select_prefix "$REPERTOIRE/wineprefix/DarkMessiahOfMightAndMagic/"
#asking about patching or updating Wine version
if [ -e "$REPERTOIRE/configurations/installed/$TYTUL" ]; then
POL_SetupWindow_menu "What do you want to do?" "Actions" "Patch game" "~"
if [ "$APP_ANSWER" == "Patch game" ]; then
patch_DarkMessiah
fi
POL_SetupWindow_prefixcreate
Set_OS "winxp"
cd "$REPERTOIRE/ressources"
#downloading winetricks
if [ "`sha1sum < winetricks | sed 's/ .*//'`" != "bf24bc6d84a40a836d7ce6de41ff04f910b34434" ]; 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`
#downloading DirectX
if [ ! -e "$HOME/.winetrickscache/directx_${WINETRICKSDX}_redist.exe" ]; then
mkdir "$HOME/.winetrickscache"
cd "$HOME/.winetrickscache"
POL_SetupWindow_download "$LNG_DX9_DL" "$TITLE" "http://download.microsoft.com/download/$WINETRICKSDXLINK/directx_${WINETRICKSDX}_redist.exe"
fi
cd "$REPERTOIRE/ressources"
#installing DirectX
POL_SetupWindow_wait_next_signal "$LNG_DX9_INSTALL" "Dark Messiah Of Might And Magic"
bash winetricks -q directx9
POL_SetupWindow_detect_exit
wine d:\\Disk1\\setup.exe
POL_SetupWindow_message "$LNG_WAIT_END" "Dark Messiah Of Might And Magic"
Set_Managed "On"
Set_DXGrab "On"
POL_SetupWindow_reboot
Use_WineVersion "--reset"
POL_SetupWindow_make_shortcut "DarkMessiahOfMightAndMagic" "$PROGRAMFILES/Ubisoft/Dark Messiah of Might and Magic" "mm.exe" "DarkMessiahOfMightAndMagic.xpm" "Dark Messiah Of Might And Magic"
POL_SetupWindow_message "Dark Messiah Of Might And Magic has been installed successfully" "Dark Messiah Of Might And Magic"
#asking about patching
POL_SetupWindow_question "Do you want to patch your game?" "$TYTUL"
if [ "$APP_ANSWER" == "TRUE" ] ;then
patch_DarkMessiah
fi
POL_SetupWindow_Close
exit