@@ -1,68 +1,61 @@
-#!/bin/bash
-# Wine version used : 1.2
+#!/bin/bash
+# Last revision : (2014-08-20 19:20)
# Author : Tutul
-
-[ "$PLAYONLINUX" = "" ] && exit
+# License : GNU/GPL v3
+
+[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
-
+
TITLE="The Elder Scrolls 3 - Bloodmoon"
+TITLE_REQUIRED="The Elder Scrolls 3 - Morrowind"
PREFIX="TES3_Morrowind"
-
-if [ "$POL_LANG" == "fr" ]; then
-LNG_INSERT_MEDIA="Veuillez insérer le disque $TITLE dans votre lecteur\nsi ce n'est pas déja fait."
-LNG_WAIT_END="Appuyez sur \"Suivant\" UNIQUEMENT quand l'installation du\njeu sera terminée sous peine de devoir recommencer l'installation."
-LNG_EXTENTIONS="Si vous avez les extensions, vous devrez commencer par Tribunal."
-LNG_SUCCES="$TITLE a été installé avec succès."
-else
-LNG_INSERT_MEDIA="Please insert $TITLE media into your disk drive\nif not already done."
-LNG_WAIT_END="Click on \"Next\" ONLY when the game installation is finished\nor you will have to redo the installation."
-LNG_EXTENTIONS="If you’ve the extentions, you must install Tribunal first."
-LNG_SUCCES="$TITLE has been installed successfully."
-fi
-
-cd $REPERTOIRE/tmp
-rm *.jpg
+EDITOR="Bethesda Softworks"
+AUTHOR="Tutul"
+
-[ "$PLAYONMAC" == "" ] || POL_SetupWindow_Init
-[ "$PLAYONMAC" == "" ] && POL_SetupWindow_InitWithImages
-
-POL_SetupWindow_presentation "$TITLE" "Bethesda Softworks" "http://bethsoft.com" "Tutul" "$PREFIX"
-
-POL_SetupWindow_message "$LNG_EXTENTIONS"
+POL_SetupWindow_Init
+POL_SetupWindow_SetID 709
+
+# Starting debugging API
+POL_Debug_Init
+
+POL_SetupWindow_presentation "$TITLE" "$EDITOR" "$GAME_URL" "$AUTHOR" "$PREFIX"
+
+if [ "$(POL_Wine_PrefixExists "$PREFIX")" = "False" ]; then
+ POL_SetupWindow_message "$(eval_gettext 'This is an installer for an update or an addon;\nPlease install $TITLE_REQUIRED first')"
+ POL_SetupWindow_Close
+ exit
+fi
-POL_SetupWindow_checkexist()
-{
-if [ ! -e $REPERTOIRE/wineprefix/$1 ]; then
-if [ "$POL_LANG" == "fr" ]; then
-LNG_WARNING="Le jeu n’est pas installé"
+POL_SetupWindow_message "$(eval_gettext 'If you have the extentions, you should install Tribunal first !')" "$TITLE"
+
+# Setting prefix path
+POL_Wine_SelectPrefix "$PREFIX"
+
+# Choose between DVD and Digital Download version
+POL_SetupWindow_InstallMethod "DVD,LOCAL"
+
+if [ "$INSTALL_METHOD" == "DVD" ]; then
+ # Asking for CDROM and checking if it's correct one
+ POL_SetupWindow_message "$(eval_gettext 'Please insert game media into your disk drive\nif not already done.')" "$TITLE"
+
+ POL_SetupWindow_cdrom
+ POL_Call POL_Sudo_UnhideCdrom
+ POL_SetupWindow_check_cdrom "Setup.exe"
+
+ SETUP_EXE="$CDROM/Setup.exe"
else
-LNG_WARNING="The game is not install"
-fi
-POL_SetupWindow_message "$LNG_WARNING" "$TITLE " "$PLAYONLINUX/themes/tango/warning.png"
-exit
+ # Asking then installing DDV of the game
+ cd "$HOME"
+ POL_SetupWindow_browse "$(eval_gettext 'Please select the setup file to run')" "$TITLE"
+ SETUP_EXE="$APP_ANSWER"
fi
-}
-POL_SetupWindow_checkexist "$PREFIX"
-
-select_prefix "$REPERTOIRE/wineprefix/$PREFIX"
-
-POL_SetupWindow_message "$LNG_INSERT_MEDIA"
-POL_SetupWindow_cdrom
-POL_SetupWindow_check_cdrom "Setup.exe"
-
-cd $CDROM
-Set_OS "winxp"
-wine start /unix "$CDROM/Setup.Exe"
-POL_Setupwindow_message "$LNG_WAIT_END" "$TITLE"
-POL_SetupWindow_detect_exit
-
-## PlayOnMac Section
-[ "$PLAYONMAC" == "" ] && Set_Managed "On"
-[ "$PLAYONMAC" == "" ] || Set_Managed "Off"
-## End Section
-
-POL_Setupwindow_message "$LNG_SUCCES" "$TITLE"
-
+# Run the install
+POL_Wine_WaitBefore "$TITLE"
+POL_Wine $SETUP_EXE
+POL_Wine_WaitExit "$TITLE"
+
POL_SetupWindow_Close
-exit
\ No newline at end of file
+exit 0
\ No newline at end of file