@@ -1,28 +1,60 @@
#!/bin/bash
-if [ "$PLAYONLINUX" = "" ]
-then
-exit 0
-fi
-source "$PLAYONLINUX/lib/sources"
-
-cfg_check
+# Date : (2014)
+# Last revision : see the changelog below
+# Wine version used : see the changelog below
+# Distribution used to test : KUbuntu 18.04 x64
+# Author : Dadu042
+# Licence : Retail
+#
+# TESTED Editions: local v1.2 from GOG.com
+
+
+# CHANGELOG
+# [Quentin P] (2014 ?)
+# Initial writting.
+# [Dadu042] (2019-11-15 21:14)
+# Add install from local (tested GOG.com release, game v1.2)
+# game from GOG (v1.2) allows Wine v4, while game 1.0 to 1.1 (from CD) prefers Wine 2.22 max.
-#Presentation
-
-if [ "$POL_LANG" == "fr" ];then
-LNG_PROTECT="Attention : La protection CD ou DVD de ce jeu ne marche pas correctment avec wine.\nVous ne pourrez donc pas jouer à ce jeu sans désactiver cette protection.\nPlayOnLinux ne pourra être tenu reponsable de l'utilisation d'un tel patch"
-else
-LNG_PROTECT="Be carreful : The CD or DVD protection of this game doesn't work correctly with wine.\nYou will nor be able to play this game without deactiving this protection.\nPlayOnLinux can't be responsible of your utilization of these patch."
-fi
+# KNOWN ISSUES:
+# - Wine amd64 2.22: after selecting the .EXE (installer v1.2 from GOG), a mini window does open but nothing more. Fix: SetArch amd64 -> x86.
+[ "$PLAYONLINUX" = "" ] && exit 0
+source "$PLAYONLINUX/lib/sources"
+
+TITLE="Star Wars - Battlefront (2004)"
+PREFIX="StarWarsBattlefront2004"
+
POL_SetupWindow_Init
-
-TITLE="Star Wars : BattleFront"
-PREFIXE_="StarWars_Battlefront"
-
-POL_SetupWindow_message "$LNG_PROTECT"
-
+POL_Debug_Init
+POL_SetupWindow_presentation "$TITLE" "LucasArts" "" "Tinou" "$PREFIX"
+
+POL_Call POL_Function_NoCDWarning
+
+POL_RequiredVersion "4.2.12" || POL_Debug_Fatal "$APPLICATION_TITLE $VERSION is required to install $TITLE"
+
+POL_Wine_SelectPrefix "$PREFIX"
+POL_Wine_PrefixCreate "2.22"
+POL_System_SetArch "x86"
+
+POL_SetupWindow_InstallMethod "DVD,LOCAL,CD"
+
+if [ "$INSTALL_METHOD" = "DVD" ]; then
+ POL_SetupWindow_cdrom
+ POL_SetupWindow_check_cdrom "Gamedata/Setup.exe"
+ cd "$CDROM"
+ POL_Wine --ignore-errors "$CDROM/Gamedata/Setup.exe"
+ POL_Wine_WaitExit "$TITLE"
+elif [ "$INSTALL_METHOD" == "LOCAL" ]; then
+ cd "$HOME"
+ POL_SetupWindow_browse "$(eval_gettext 'Please select the setup file to run')" "$TITLE"
+ # POL_SetupWindow_message "$(eval_gettext 'Note: we recommend you to uncheck all the checkboxes:\n[x] -> [ ]')" "$TITLE"
+ SETUP_EXE="$APP_ANSWER"
+ POL_Wine --ignore-errors "$SETUP_EXE" # "/SILENT"
+ POL_Wine_WaitExit "$TITLE"
+elif [ "$INSTALL_METHOD" == "CD" ]; then
POL_SetupWindow_message "PlayOnLinux will temporarily copy the three cdrom in you home directory.\nPlease ensure you have enought disk space\n\nPlease mount the first CD-ROM" "$TITLE"
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "LaunchBF.exe"
@@ -33,7 +65,7 @@
mkdir -p $REPERTOIRE/wineprefix/$PREFIXE_
mkdir -p $TEMP
cd "$REPERTOIRE/wineprefix/$PREFIXE_"
-
+
select_prefixe "$(pwd)"
POL_SetupWindow_prefixcreate
cd $WINEPREFIX/dosdevices
@@ -41,41 +73,41 @@
ln -s ../drive_c c:
ln -s / z:
ln -s $REPERTOIRE/tmp/jka d:
-
+
cd $TEMP
POL_SetupWindow_wait_next_signal "PlayOnLinux is copying the first CD-ROM" "$TITLE"
cp $CDROM//* ./ -r
chmod 777 $TEMP/ -R
-
+
POL_SetupWindow_detect_exit
POL_SetupWindow_message "Please insert the second CD-ROM" "$TITLE"
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "GameData/data3.cab"
-
+
POL_SetupWindow_wait_next_signal "PlayOnLinux is copying the second CD-ROM" "$TITLE"
cd $TEMP
cp $CDROM/* ./ -r
chmod 777 $TEMP -R
-
+
POL_SetupWindow_detect_exit
POL_SetupWindow_message "Please insert the third CD-ROM" "$TITLE"
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "GameData/data4.cab"
-
+
POL_SetupWindow_wait_next_signal "PlayOnLinux is copying the third CD-ROM" "$TITLE"
cd $TEMP
cp $CDROM/* ./ -r
chmod 777 $TEMP -R
-
+
POL_SetupWindow_detect_exit
-
+
POL_SetupWindow_wait_next_signal "PlayOnLinux is installing $TITLE ..." "$TITLE"
wine $TEMP/GameData/Setup.exe
-
+
POL_SetupWindow_detect_exit
POL_SetupWindow_reboot
-
-POL_SetupWindow_wait_next_signal "Clealing temp directory" "$TITLE"
+
+POL_SetupWindow_wait_next_signal "Cleaning temp directory" "$TITLE"
chmod 777 $TEMP -R
rm $TEMP -R
cd $WINEPREFIX/dosdevices
@@ -83,13 +115,11 @@
ln -s $ORIGINAL_CDROM ./d:
POL_SetupWindow_detect_exit
-POL_SetupWindow_make_shortcut "$PREFIXE_" "Program Files/LucasArts/Star Wars Battlefront/" "LaunchBF.exe" "" "Star Wars : Battlefront"
+fi
-#Création Icone
-cd "$REPERTOIRE/tmp"
-mv "$REPERTOIRE/tmp/Battlefront.png" "$REPERTOIRE/icones/32/Star Wars : Battlefront"
+POL_Shortcut "battlefront.exe" "$TITLE" "" "" "Game;Shooter;"
+POL_Shortcut "LaunchBF.exe" "$TITLE multiplayer" "" "" "Game;Shooter;"
+POL_Shortcut_QuietDebug "$TITLE"
-POL_SetupWindow_message "Installation finished" "$TITLE"
POL_SetupWindow_Close
-exit
\ No newline at end of file
+exit 0
\ No newline at end of file