#!/bin/bash
[
"$PLAYONLINUX"
=
""
] &&
exit
0
source
"$PLAYONLINUX/lib/sources"
PROGRAMFILES=`wine cmd
/c
echo
"%ProgramFiles%"
`
PROGRAMFILES=${PROGRAMFILES:3}
TYTUL=
"Escape from Monkey Island"
PREFIX=
"EFMI"
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)"
}
POL_SetupWindow_make_icon_for_shortcut()
{
convert
"$HOME/.local/share/icons/$2"
-geometry 32X32
"$REPERTOIRE/icones/32/$1"
}
wget http:
//upload
.wikimedia.org
/wikipedia/en/d/d6/Escape_from_Monkey_Island_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"
POL_SetupWindow_message
"Please insert first $TYTUL media into your disk drive."
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom
"Monkey.exe"
CDROM2=${CDROM
//
"1"
/
"2"
}
LATESTVERSION=$(Get_Latest_Wine_Version)
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
POL_SetupWindow_message_image
"Please choose \\"
Complete Installation\\
" if asked\\n\\nPlease return to this window if asked for second CD"
"Size of installation"
"/usr/share/playonlinux/themes/tango/info.png"
cd
"$WINEPREFIX/drive_c/windows/temp/"
echo
"#!/bin/bash"
>
install
echo
"cd \\"
$CDROM\\
""
>>
install
echo
"env WINEPREFIX=\\"
$REPERTOIRE
/wineprefix/
$PREFIX\\
" wine Install/setup.exe"
>>
install
chmod
777
install
.
/install
1&
POL_SetupWindow_message
"Please insert second CD when installer asks and press Forward"
"$TYTUL"
cd
"$WINEPREFIX/dosdevices"
mv
d: sd:
mv
e: d:
POL_SetupWindow_message
"Please insert first CD when installer asks and press Forward"
"$TYTUL"
mv
d: e:
mv
sd: d:
POL_SetupWindow_message
"Click \\"
Next\\
" when installation will finish."
"$TYTUL"
POL_SetupWindow_menu
"What is your language version?"
"Languages"
"English~French~Italian~German~Portuguese~Spanish"
"~"
LANGUAGEVERSION=$APP_ANSWER
if
[
"$APP_ANSWER"
==
"English"
];
then
LANGUAGEVERSIONSHRT=
""
elif
[
"$APP_ANSWER"
==
"French"
]
then
LANGUAGEVERSIONSHRT=
"_FRA"
elif
[
"$APP_ANSWER"
==
"Italian"
]
then
LANGUAGEVERSIONSHRT=
"_ITA"
elif
[
"$APP_ANSWER"
==
"German"
]
then
LANGUAGEVERSIONSHRT=
"_DEU"
elif
[
"$APP_ANSWER"
==
"Portuguese"
]
then
LANGUAGEVERSIONSHRT=
"_BRZ"
elif
[
"$APP_ANSWER"
==
"Spanish"
]
then
LANGUAGEVERSIONSHRT=
"_ESP"
fi
cd
"$REPERTOIRE/ressources"
if
[ ! -e
"MonkeyUpdate${LANGUAGEVERSIONSHRT}.exe"
];
then
POL_SetupWindow_wait_next_signal
"PlayOnLinux is downloading MonkeyUpdate${LANGUAGEVERSIONSHRT}.exe (ca. 1.12 MB)"
"$TYTUL"
POL_SetupWindow_detect_exit
fi
POL_SetupWindow_wait_next_signal
"Installation in progress..."
"$TYTUL"
wine
"MonkeyUpdate${LANGUAGEVERSIONSHRT}.exe"
POL_SetupWindow_detect_exit
POL_SetupWindow_message
"Patch for $TYTUL has been installed successfully"
"$TYTUL"
cd
"$WINEPREFIX/drive_c/windows/temp/"
echo
"[HKEY_LOCAL_MACHINE\\\\Software\\\\LucasArts Entertainment Company LLC\\\\Monkey4\\\\Retail]"
> OpenGL.reg
echo
"\\"
OpenGL\\
"=dword:1"
>> OpenGL.reg
regedit OpenGL.reg
Set_Managed
"Off"
POL_SetupWindow_make_shortcut
"$PREFIX"
"$PROGRAMFILES/LucasArts/Monkey 4"
"Monkey.exe"
""
"$TYTUL"
""
""
Set_WineVersion_Assign
"$CHOSENWINEVERSION"
"$TYTUL"
POL_SetupWindow_make_icon_for_shortcut
"$TYTUL"
"8aff_monkey.0.xpm"
POL_SetupWindow_message
"$TYTUL has been installed successfully"
"$TYTUL"
POL_SetupWindow_Close
exit