Skip to content
This repository
tree: ad373da899
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 122 lines (87 sloc) 4.223 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
#!/bin/bash
# Date : (2011-12-18 11-39)
# Last revision : (2012-09-23 18-44)
# Wine version used : 1.3.36
# Distribution used to test : Debian Sid (Unstable)
# Author : Pierre Etchemaite pe-pol@concept-micro.com
# Script licence : GPL v.2
# Program licence : Retail
# Depend :

# 1.3.35 has a problem with Direct3D9 renderer water effects
# Seems to be fixed in 1.3.36 :)

[ -z "$PLAYONLINUX" ] && exit 0
source "$PLAYONLINUX/lib/sources"

GOGID="far_cry"
PREFIX="FarCry_gog"
WORKING_WINE_VERSION="1.3.36"

TITLE="Far Cry (GoG release)"
SHORTCUT_NAME="Far Cry"
SHORTCUT_EDITOR="$SHORTCUT_NAME - CryEngine Sandbox"

POL_GetSetupImages "http://files.playonlinux.com/resources/setups/$PREFIX/top.jpg" "http://files.playonlinux.com/resources/setups/$PREFIX/left.jpg" "$TITLE"

POL_SetupWindow_Init
POL_SetupWindow_SetID 1024
POL_Debug_Init

POL_SetupWindow_presentation "$TITLE" "Crytek Studios / Ubisoft" "http://www.gog.com/en/gamecard/$GOGID" "Pierre Etchemaite" "$PREFIX"

POL_Call POL_GoG_setup "$GOGID" "964f27d319571bd614db5d1df08e1912" "77a792e45ba865d6bbd0ca4e5a39a2a7" "d6c8edb29a4a1cce4e9f46774bf47eb0"

POL_Wine_SelectPrefix "$PREFIX"
POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"

# Prevent GoG installer from installing Acrobat Reader or Foxit in each prefix
POL_Call POL_Function_SetNativeExtension "pdf"

POL_Wine_WaitBefore "$TITLE"

POL_Wine "$POL_GoG_location" || POL_Debug_Fatal "$(eval_gettext 'Error while installing archive')"

cd "$WINEPREFIX/drive_c/$PROGRAMFILES/GOG.com/Far Cry/"
if [ $? -eq 0 ]; then
    # Disable new external configurator, as it generates setups that are
    # not compatible with Wine...
    mv "Bin32/FarCryConfigurator.exe" "Bin32/FarCryConfigurator.exe.disabled"
else
  POL_Debug_Error "$(eval_gettext 'Could not find program directory')"
fi

# GoG work!
Set_OS winxp

POL_SetupWindow_VMS "64"

# Doesn't hurt ;)
POL_Wine_reboot

LNG_EDITOR="$(eval_gettext 'The level editor')"
POL_SetupWindow_checkbox_list "$(eval_gettext 'What extra shortcuts should be created?')" "$TITLE" "${LNG_EDITOR}" "~"
SHORTCUTS="$APP_ANSWER"

POL_Shortcut "FarCry.exe" "$SHORTCUT_NAME" "$SHORTCUT_NAME.png" ""
POL_Shortcut_Document "$SHORTCUT_NAME" "$WINEPREFIX/drive_c/$PROGRAMFILES/GOG.com/Far Cry/Manual.pdf"
# C:/$PROGRAMFILES/GOG.com/Far Cry/Readme.txt
# C:/$PROGRAMFILES/GOG.com/Far Cry/Manual_1_4.pdf

if echo "$SHORTCUTS" | grep -q "$LNG_EDITOR"; then
    POL_Shortcut "Editor.exe" "$SHORTCUT_EDITOR" "$SHORTCUT_EDITOR.png" ""
    POL_Shortcut_Document "$SHORTCUT_EDITOR" "$WINEPREFIX/drive_c/$PROGRAMFILES/GOG.com/Far Cry/Editor Manual.pdf"
fi

# C:/$PROGRAMFILES/GOG.com/Far Cry/Dedicated server guide.rtf
# C:/$PROGRAMFILES/GOG.com/Far Cry/Using the FarCry dedicated server.rtf
# C:/$PROGRAMFILES/GOG.com/Far Cry/Server_Command_Table.pdf

POL_SetupWindow_message "$(eval_gettext 'Default video settings are a bit low for modern computers,\nremember to click on "Auto-detect" in advanced video settings.')" "$TITLE"

POL_SetupWindow_Close

cat <<_EOF_ > "$POL_USER_ROOT/configurations/configurators/$SHORTCUT_NAME"
#!/bin/bash
[ -z "\$PLAYONLINUX" ] && exit 0
source "\$PLAYONLINUX/lib/sources"
export WINEPREFIX="\$POL_USER_ROOT/wineprefix/$PREFIX"
export WINEDEBUG=""

POL_LoadVar_PROGRAMFILES

cd "\$WINEPREFIX/drive_c/\$PROGRAMFILES/GOG.com/Far Cry/" || exit 1

TITLE="$TITLE"

POL_SetupWindow_Init
POL_Debug_Init

[ -f system.cfg ] || POL_Debug_Fatal "\$(eval_gettext 'Run the game once to create the configuration file!')"

DRIVER="\$(sed -e 's/^r_Driver = \"\(.*\)\".*/\1/p; d' system.cfg)"
VERBOSITY="\$(sed -e 's/^log_Verbosity = \"\(.*\)\".*/\1/p; d' system.cfg)"

POL_SetupWindow_menu_list "\$(eval_gettext 'Pick video driver to use [experimental]:')" "\$TITLE" "Direct3D9~OpenGL" "~" "\$DRIVER"
NEW_DRIVER="\$APP_ANSWER"

POL_SetupWindow_menu_list "\$(eval_gettext 'Verbosity while loading maps:')" "\$TITLE" "0~1~2~3~4~5~6~7~8" "~" "\$VERBOSITY"
NEW_VERBOSITY="\$APP_ANSWER"

if [ "\$NEW_DRIVER" != "\$DRIVER" -o "\$NEW_VERBOSITY" != "\$VERBOSITY" ]; then
    sed -i.bak -e 's/^r_Driver = ".*"/r_Driver = "'"\$NEW_DRIVER"'"/' \
               -e 's/^log_Verbosity = ".*"/log_Verbosity = "'"\$NEW_VERBOSITY"'"/' \
      system.cfg
fi

POL_SetupWindow_Close
exit
_EOF_

exit
Something went wrong with that request. Please try again.