#!/bin/bash
[
"$PLAYONLINUX"
=
""
] &&
exit
0
source
"$PLAYONLINUX/lib/sources"
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
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"
}
convert
"$CDROM/gf.ico"
-geometry 32X32
"$REPERTOIRE/icones/32/$TYTUL"
convert
"$CDROM/gf.ico"
-geometry 32X32
"$REPERTOIRE/icones/32/$TYTUL Launcher"
CHOSENWINEVERSION=
"$LATESTVERSION"
POL_SetupWindow_install_wine
"$CHOSENWINEVERSION"
POL_SetupWindow_prefixcreate
Use_WineVersion
"$CHOSENWINEVERSION"
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
cd
"$CDROM"
wine
"setup.exe"
POL_SetupWindow_message
"Click \\"
Next\\
" when installation will finish."
"$TYTUL"
POL_SetupWindow_question
"Do you want to install Grim Fandango Launcher?"
"$TYTUL"
if
[
"$APP_ANSWER"
==
"TRUE"
] ;
then
cd
"$REPERTOIRE/ressources"
if
[ ! -e
"GrimLauncher1.5.zip"
]
then
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"
POL_SetupWindow_detect_exit
fi
POL_SetupWindow_wait_next_signal
"PlayOnLinux is installing Grim Fandango 1.0.1 patch."
"$TYTUL"
wine start
/unix
Gfupd101.exe
POL_SetupWindow_detect_exit
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
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