@@ -1,119 +1,127 @@
#!/bin/bash
-# Date: (2010-08-13)
-# Distribution used to test: Debian Sid 32bits
-# Wine version used: 2.22
-# Author: Berillions
-
-#Vérifier que PlayOnLinux est bien exécuté avant
-[ "$PLAYONLINUX" = "" ] && exit 0
-
+# Date : (2019-08-18)
+# Last revision : see changelog
+# Wine version used : see below
+# Distribution used to test : XUbuntu 18.04 x64
+# Script licence : GPL3
+# Program licence : Retail
+# Playonlinux v4.3.4
+#
+# Tested version : v1.0.0 (retail, 2x DVDs, western europe)
+#
+# Game based on (ie: middlewares): .
+#
+#
# CHANGELOG:
# [Berillions] (2010-08-13)
# First script.
# [Dadu042] (2019-08-18)
-# Cleanup, french -> english.
-# Wine 1.3.0 -> 2.22
-# Script (using DVD) currently blocks on the stage 'Updating Steam...'.
+# Cleanup, french -> english.
+# Wine 1.3.0 -> 2.22
+# Script (using DVD) currently blocks on the stage 'Updating Steam...'.
+# [Dadu042] (2019-08-18)
+# Script rewrite. Don't work because Steam update process does fail (stuck, it don't start downloading).
+#
+# KNOWN ISSUES:
+# - 4.11 "Failed to run install script" (when Steam installation should start), fix: POL_Install_dotnet20
-# Load libraries
+
+
+[ -z "$PLAYONLINUX" ] && exit 0
source "$PLAYONLINUX/lib/sources"
+
+TITLE="F.E.A.R.2 : Project Origin"
+PREFIX="F.E.A.R.2_PO"
+WORKING_WINE_VERSION="4.0.1"
+AUTHOR="Dadu042"
+EDITOR="Monolith Productions"
+GAME_URL=""
+
+POL_SetupWindow_Init
+POL_Debug_Init
+
+POL_SetupWindow_presentation "$TITLE" "$EDITOR" "$GAME_URL" "$AUTHOR" "$PREFIX"
+
+POL_RequiredVersion "4.3.4" || POL_Debug_Fatal "$APPLICATION_TITLE $VERSION is required to install $TITLE"
+
+POL_Wine_SelectPrefix "$PREFIX"
+POL_System_SetArch "x86"
+POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"
+# POL_Wine_PrefixCreate
+POL_System_TmpCreate "$TITLE"
-Title="F.E.A.R.2 : Project Origin"
-Prefix="F.E.A.R.2"
-
-if [ "$POL_LANG" == "fr" ]; then
- LNG_WAIT_END="Appuyez sur \"Suivant\" UNIQUEMENT quand l'installation du jeu sera
- terminée sous peine de devoir recommencer l'installation."
- LNG_CHANGE_DVD="Appuyez sur \"Suivant\" lorsque l'installation demande d'insérer le second DVD."
- LNG_WMF9="PlayOnLinux télécharge Windows Media Format 9"
-else
- LNG_WAIT_END="Click on \"Next\" ONLY when the game installation
- is finished or you will have to redo the installation.."
- LNG_CHANGE_DVD="Click on \"Next\" when the installation ask you to insert the Second DVD."
- LNG_WMF9="PlayOnLinux is downloading Windows Media Format 9"
-fi
+Set_OS "vista"
+
+# steam : 'Fail to run install script' (wine 4.12.1)
+# POL_Call POL_Install_steam_flags
+# POL_Call POL_Install_steam
+# POL_Call POL_Install_vcrun2008
+
+
+# Wine 4.11 : setup does crash before steam ! (miss msls? -> same with)
+POL_Call POL_Install_riched30
+POL_Call POL_Install_vcrun2008
+
+POL_Call POL_Install_msls31
+
+POL_Call POL_Install_dotnet20
+POL_Call POL_Install_vcrun2008
+
+POL_Call POL_Install_d3dx9_43
+
+
+# useless
+# POL_Call POL_Install_wininet
+# POL_Call POL_Install_winhttp
-cd $REPERTOIRE/tmp
-
-convert "$REPERTOIRE/tmp/$Prefix.jpg" -scale 150x356\! "$REPERTOIRE/tmp/left.jpg"
-
-POL_SetupWindow_Init "$REPERTOIRE/tmp/FEAR2.png" "$REPERTOIRE/tmp/left.jpg"
-
-# Presentation
-
-# Detect the DVD-ROM
-POL_SetupWindow_cdrom
-POL_SetupWindow_check_cdrom "Setup.exe"
-
-# Wine Installation
-POL_SetupWindow_install_wine "2.22"
-
-# Preapare prefix
-select_prefix "$REPERTOIRE/wineprefix/$Prefix"
-POL_SetupWindow_prefixcreate
-
-# Add CDROM to Winecfg
-cd "$WINEPREFIX/dosdevices"
-ln -s "$CDROM" d:
-
-cd "$WINEPREFIX/drive_c/windows/temp/"
-echo "[HKEY_LOCAL_MACHINE\\Software\\Wine\\Drives]" > cdrom.reg
-echo "\"d:\"=\"cdrom\"" >> cdrom.reg
-regedit cdrom.reg
-
-# Fetching PROGRAMFILES environmental variable
-PROGRAMFILES="Program Files"
-POL_LoadVar_PROGRAMFILES
-
-# Installation corefonts and Directx9
-POL_Call POL_Install_d3dx9
-fonts_to_prefix
-
-# Set graphic memory size
-POL_SetupWindow_menu_list "Your Memory Graphic" "$Title" "32 64 128 256 384 512 768 896 1024 2048" " "
-VMS="$APP_ANSWER"
-
-# Set Direct3D
-cd "$WINEPREFIX/drive_c/windows/temp"
-cat << EOF > OGL.reg
-[HKEY_CURRENT_USER\\Software\\Wine\\Direct3D]
-"VideoMemorySize"="$VMS"
-EOF
-regedit OGL.reg
-
-POL_SetupWindow_wait_next_signal "Installing ..." "$Title"
-wine start /unix "$CDROM/Setup.exe"
-
-POL_SetupWindow_message "$LNG_CHANGE_DVD" "$Title"
-env WINEPREFIX="$REPERTOIRE/wineprefix/$Prefix" wine eject d:
-
-POL_SetupWindow_message "$LNG_WAIT_END" "$Title"
-
-# Make Icon
-cd "$REPERTOIRE/tmp"
-convert "$REPERTOIRE/tmp/FEAR2.png" -geometry 32x32 "$REPERTOIRE/icones/32/$Title"
-# Windows Media Format 9 Download and Installation
-POL_SetupWindow_wait_next_signal "$LNG_WMF9" "$Title"
-wine wmfadist.exe /Q
-POL_SetupWindow_detect_exit
+# POL_Call POL_Install_corefonts
-# Create Launcher
-POL_SetupWindow_make_shortcut "$Prefix" "$PROGRAMFILES/Steam" "Steam.exe" "" "$Title"
-
-# Set Sound
-cd "$WINEPREFIX/drive_c/windows/temp"
-cat << EOF > Sound.reg
-[HKEY_CURRENT_USER\\Software\\Wine\\DirectSound]
-"HardwareAcceleration"="Emulation"
-EOF
-regedit Sound.reg
-
-Set_WineVersion_Assign "2.22" "$Title"
+## Begin Common PlayOnMac Section ##
+[ "$POL_OS" = "Mac" ] && Set_Managed "Off"
+# End Section ##
+
+# This web game was not released on CD/DVD.
+# POL_SetupWindow_InstallMethod "LOCAL,STEAM,CD"
+POL_SetupWindow_InstallMethod "LOCAL,DVD,STEAM"
+
+if [ "$INSTALL_METHOD" == "LOCAL" ]; then
+
+ cd "$HOME"
+ POL_SetupWindow_browse "$(eval_gettext 'Please select the setup file to run:')" "$TITLE"
+ SETUP_EXE="$APP_ANSWER"
+
+# POL_SetupWindow_message "We recommend to uncheck all checkboxes (ie: about DirectX, VC++ ..." "$TITLE"
+
+ POL_Wine start /unix "$SETUP_EXE"
+ POL_Wine_WaitExit "$TITLE"
+
+elif [ "$INSTALL_METHOD" == "STEAM" ];then
+ POL_Call POL_Install_steam
+ cd "$WINEPREFIX/drive_c/$PROGRAMFILES/Steam"
+ POL_Wine_WaitBefore "$TITLE"
+
+elif [ "$INSTALL_METHOD" == "DVD" ];then
+ POL_SetupWindow_cdrom
+ POL_SetupWindow_check_cdrom "Project Origin_disk1.sis"
+ POL_Wine start /unix "$CDROM/Setup.exe"
+ POL_Wine_WaitExit "Setup.exe"
+ cd "$POL_System_TmpDir"
+fi
+
+
+if [ "$INSTALL_METHOD" == "STEAM" ]; then
+else
+ POL_Shortcut "steam.exe" "$TITLE Steam" "" "" "Game;Shooter;"
+ POL_Shortcut "F.E.A.R.exe" "$TITLE" "" "" "Game;Shooter;"
+ POL_Shortcut_Document "$TITLE" "FFOW_Manual.pdf"
+fi
+# GPU selection. Useful when there is 2 GPU on the same computer (ie: Intel HD + Nvidia).
+POL_Call POL_Install_VideoDriver
+
+POL_System_TmpDelete
POL_SetupWindow_Close
-exit
\ No newline at end of file
+exit 0
\ No newline at end of file