You are here    Forums    Your creations.    [script] Grim Fandango fr

The forum

[script] Grim Fandango

Author Replies
NSLW Monday 21 September 2009 at 15:08
NSLW

Hello,
I wrote script which installs Grim Fandango.
Wine version : 1.1.29
Distribution : Fedora
Distribution Version : 11 (32 bit)
Graphics card : Nvidia, GeForce 9xxx
Drivers of the graphics card : 190.32

Icon for the game:


#!/bin/bash
# Date : (2009-09-18 18-00)
# Last revision : (2009-09-18 18-00)
# Wine version used : 1.1.29
# Distribution used to test : Fedora 11
# Author : NSLW
# Licence : Retail
# Depend : ImageMagick

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

#fetching PROGRAMFILES environmental variable
PROGRAMFILES=`wine cmd /c echo "%ProgramFiles%"`
PROGRAMFILES=${PROGRAMFILES:3}

TYTUL="Grim Fandango"
PREFIX="GrimFandango"
GRIMLAUNCHER="0"

Get_Latest_Wine_Version()
{
wget http://mulx.playonlinux.com/wine/linux-i386/LIST --output-document="$REPERTOIRE/tmp/LIST"
xyz=`cat "$REPERTOIRE/tmp/LIST" | sed -e 's/\\.//g' | cut -d';' -f2 | sort -n | tail -n1`
echo "$(echo $xyz | cut -c1-1).$(echo $xyz | cut -c2-2).$(echo $xyz | cut -c3-4)"
}

wget http://upload.wikimedia.org/wikipedia/en/7/76/Grim_Fandango_artwork.jpg --output-document="$REPERTOIRE/tmp/leftnotscaled.jpeg"
convert "$REPERTOIRE/tmp/leftnotscaled.jpeg" -scale 150x356\\! "$REPERTOIRE/tmp/left.jpeg"
POL_SetupWindow_Init "" "$REPERTOIRE/tmp/left.jpeg"

POL_SetupWindow_presentation "$TYTUL" "LucasArts Entertainment Company LLC" "N/A" "NSLW" "$PREFIX" 

select_prefix "$REPERTOIRE/wineprefix/$PREFIX"

if [ -e "$REPERTOIRE/configurations/installed/$TYTUL" ]; then
	#game asked me ...
	cd "$WINEPREFIX/dosdevices"
	POL_SetupWindow_menu "Game asked me for ..." "$TYTUL" "First CD~Second CD~Nothing" "~"

	if [ "$APP_ANSWER" == "First CD" && ! -e "2d:" ]; then
	mv d: 2d:
	mv 1d: d:
	elif [ "$APP_ANSWER" == "Second CD" && ! -e "1d:" ]; then
	mv d: 1d:
	mv 2d: d:
	fi
POL_SetupWindow_Close
exit
fi


POL_SetupWindow_message "Please insert first $TYTUL media into your disk drive."
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "grim.exe"
CDROM2=${CDROM//"A"/"B"} #GRIM_DISK_B

#taking icon from the game
convert "$CDROM/gf.ico" -geometry 32X32 "$REPERTOIRE/icones/32/$TYTUL"
convert "$CDROM/gf.ico" -geometry 32X32 "$REPERTOIRE/icones/32/$TYTUL Launcher"

#LATESTVERSION=$(Get_Latest_Wine_Version)
CHOSENWINEVERSION="$LATESTVERSION"
POL_SetupWindow_install_wine "$CHOSENWINEVERSION"
POL_SetupWindow_prefixcreate
Use_WineVersion "$CHOSENWINEVERSION"

#adding CD-ROM as drive d: to winecfg
cd "$WINEPREFIX/dosdevices"
ln -s "$CDROM" d:
ln -s "$CDROM2" e:

cd "$WINEPREFIX/drive_c/windows/temp/"
echo "[HKEY_LOCAL_MACHINE\\\\Software\\\\Wine\\\\Drives]" > cdrom.reg
echo "\\"d:\\"=\\"cdrom\\"" >> cdrom.reg
echo "\\"e:\\"=\\"cdrom\\"" >> cdrom.reg
regedit cdrom.reg
sleep 5

#starting installation
cd "$CDROM"
wine "setup.exe"
POL_SetupWindow_message "Click \\"Next\\" when installation will finish." "$TYTUL"

#asking for Grim Fandago Launcher
POL_SetupWindow_question "Do you want to install Grim Fandango Launcher?" "$TYTUL"
if [ "$APP_ANSWER" == "TRUE" ] ;then
	cd "$REPERTOIRE/ressources"
	# checking if GrimLauncher1.5.zip is in winetricks cache if not then download
	if [ ! -e "GrimLauncher1.5.zip" ]
	then
	POL_SetupWindow_download "PlayOnLinux is downloading Grim Fandango Launcher" "$TYTUL" "http://quick.mixnmojo.com/files/GrimLauncher1.5.zip"
	fi
cd "$WINEPREFIX/drive_c/$PROGRAMFILES/LucasArts/Grim"
unzip "$REPERTOIRE/ressources/GrimLauncher1.5.zip"
fi

cd "$REPERTOIRE/ressources"
if [ ! -e "Gfupd101.exe" ]
then

POL_SetupWindow_wait_next_signal "PlayOnLinux is downloading Gfupd101.exe (ca. 2 MB)" "$TYTUL"
wget "ftp://ftp.lucasarts.com/patches/pc/Gfupd101.exe"
POL_SetupWindow_detect_exit

fi

#installing patch
POL_SetupWindow_wait_next_signal "PlayOnLinux is installing Grim Fandango 1.0.1 patch." "$TYTUL"
wine start /unix Gfupd101.exe
POL_SetupWindow_detect_exit

#asking for playing from HDD
POL_SetupWindow_question "Do you want to play Grim Fandango entirely from your HDD?" "$TYTUL"
if [ "$APP_ANSWER" == "TRUE" ] ;then
GRIMLAUNCHER="1"
POL_SetupWindow_wait_next_signal "PlayOnLinux is copying first CD" "$TYTUL"
cd "$CDROM/grimdata"
cp *.lab "$WINEPREFIX/drive_c/$PROGRAMFILES/LucasArts/Grim"
POL_SetupWindow_detect_exit

POL_SetupWindow_message "Please insert second $TYTUL media into your disk drive."
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "autostub.exe"
POL_SetupWindow_wait_next_signal "PlayOnLinux is copying second CD" "$TYTUL"
cd "$CDROM/grimdata"
cp * "$WINEPREFIX/drive_c/$PROGRAMFILES/LucasArts/Grim"
POL_SetupWindow_detect_exit

else
POL_SetupWindow_message_image "Run this installation script again\\nif game will ask for second CD" "$TYTUL" "/usr/share/playonlinux/themes/tango/info.png"
fi

#making shortcut
if [ "$GRIMLAUNCHER" == "1" ] ;then
POL_SetupWindow_make_shortcut "$PREFIX" "$PROGRAMFILES/LucasArts/Grim" "Grim Fandango Launcher.exe" "" "$TYTUL Launcher" "" ""
Set_WineVersion_Assign "$CHOSENWINEVERSION" "$TYTUL Launcher"
fi

POL_SetupWindow_make_shortcut "$PREFIX" "$PROGRAMFILES/LucasArts/Grim" "grimfandango.exe" "" "$TYTUL" "" ""
Set_WineVersion_Assign "$CHOSENWINEVERSION" "$TYTUL"
POL_SetupWindow_message "$TYTUL has been installed successfully" "$TYTUL"

POL_SetupWindow_Close
exit

Edited by NSLW

sjkwizard Friday 12 November 2010 at 14:12
sjkwizard Anonymous

Hi,
I've tried to install Grim Fandango from a mounted ISO but after selecting the cdrom drive the script freeze. Is there a way to get a log to understand what is the problem?
sbk Friday 13 May 2011 at 20:42
sbk Anonymous

this line

#LATESTVERSION=$(Get_Latest_Wine_Version)

should be

LATESTVERSION=$(Get_Latest_Wine_Version)

Quentin PÂRIS Sunday 15 May 2011 at 17:57
Quentin PÂRIS
Admin

Nope, this script should no longer be used
Levan Sunday 24 July 2011 at 3:02
Levan

Is there a way to bypass the cd selection screen
no matter what i try it does not work ,,put the cd in drive or rip it and mount it "


I am a total noob in linux