#!/bin/bash
PROGRAMFILES=`wine cmd /c echo "%ProgramFiles%"`
PROGRAMFILES=${PROGRAMFILES:3}
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
Title="HOMM5"
if [ "$POL_LANG" == "fr" ]; then
LNG_MEM="La taille de votre mémoire graphique?"
LNG_WAIT_END="Appuyez sur \\"Suivant\\" UNIQUEMENT quand l'installation du jeu sera
terminée sous peine de devoir recommencer l'installation."
LNG_FILEPATCH="Selectionner le patch à installer"
LNG_INST="Patch pour $Title installé avec succès"
else
LNG_MEM="How much memory do your graphic card have got?."
LNG_WAIT_END="Click on \\"Next\\" ONLY when the game installation
is finished or you will have to redo the installation."
LNG_FILEPATCH="Select patch file"
LNGINST="Patch for $Title has been installed successfully"
fi
patch_homm()
{
POL_SetupWindow_browse "$LNG_FILEPATCH" "$Title" ""
wine "$APP_ANSWER"
POL_SetupWindow_message "$LNG_INST" "$Title"
}
wget http://image.jeuxvideo.com/images/pc/h/o/hom5pc0ft.jpg --output-document="$REPERTOIRE/tmp/hom5pc0ft.jpeg"
convert "$REPERTOIRE/tmp/hom5pc0ft.jpeg" -scale 150x356\\! "$REPERTOIRE/tmp/left.jpg"
POL_SetupWindow_Init "" "$REPERTOIRE/tmp/left.jpg"
POL_SetupWindow_menu "$LNG_INST" "Actions" "Patch game~Install Game" "~"
if [ "$APP_ANSWER" == "Patch game" ]; then
select_prefix "$REPERTOIRE/wineprefix/$Title"
patch_homm
POL_SetupWindow_Close
exit
fi
POL_SetupWindow_install_wine "1.1.29"
select_prefix "$REPERTOIRE/wineprefix/$Title"
POL_SetupWindow_prefixcreate
Set_OS winxp
POL_SetupWindow_textbox "Your Memory Graphic ?" "Memory Graphic"
VMS="$APP_ANSWER"
cd "$WINEPREFIX/drive_c/windows/temp"
echo "[HKEY_CURRENT_USER\\\\Software\\\\Wine\\\\Direct3D]" > OGL.reg
echo "\\"VideoMemorySize\\"=\\"$VMS\\"" >> OGL.reg
regedit OGL.reg
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "Setup.exe"
wine $CDROM/Setup.exe
POL_SetupWindow_message "$LNG_WAIT_END" "$Title"
POL_SetupWindow_make_shortcut "$Title" "$PROGRAMFILES/Ubisoft/Heroes of Might and Magic V/bin/" "H5_Game.exe" "" "$Title"
Set_WineVersion_Assign "1.1.29" "$Title"
POL_SetupWindow_Close
exit