#!/bin/bash
[
"$PLAYONLINUX"
=
""
] &&
exit
0
source
"$PLAYONLINUX/lib/sources"
TYTUL=
"Tropico 3"
PREFIX=
"Tropico3"
WORKINGWINEVERSION=
"1.2.3"
POL_SetupWindow_make_icon_for_shortcut()
{
convert
"$HOME/.local/share/icons/$2"
-geometry 32X32
"$REPERTOIRE/icones/32/$1"
}
is_checked ()
{
if
[
"$(echo "
$PATCHSET
" | grep -o "
$1
")"
!=
""
];
then
echo
"1"
else
echo
"0"
fi
}
PATCHFILE[0]=
"Tropico3_patch_v1.04_ddsetup.exe"
PATCHFILE[1]=
"Tropico3.patch.v1.09.exe"
PATCHFILE[2]=
"Tropico3Patch109-113_Installer.exe"
PATCHFILE[3]=
"trop3109fix_cz.exe"
PATCHFILE[4]=
"Tropico3Patch100Russian.exe"
PATCHFILE[5]=
"Tropico3Patch100-111Russian.exe"
PATCHFILE[6]=
"patchCD_Tropico3_v1.13.exe"
PATCHFILE[7]=
"Other patch"
STEAMAPP=
"23490"
patch_Tropico3()
{
POL_SetupWindow_checkbox_list
"Check patch files you've got on your hard disk."
"Patch list"
"${PATCHFILE[0]}~${PATCHFILE[1]}~${PATCHFILE[2]}~${PATCHFILE[3]}~${PATCHFILE[4]}~${PATCHFILE[5]}~${PATCHFILE[6]}~${PATCHFILE[7]}"
"~"
PATCHSET=
"$APP_ANSWER"
for
i
in
`
seq
0 7`;
do
if
[
"$(is_checked "
${PATCHFILE[$i]}
")"
=
"1"
]
then
POL_SetupWindow_browse
"Where is your ${PATCHFILE[$i]} located ?"
"$TYTUL"
""
POL_SetupWindow_wait_next_signal
"Installation in progress..."
"$TYTUL"
wine
"$APP_ANSWER"
POL_SetupWindow_detect_exit
fi
done
POL_SetupWindow_message
"Patches for $TYTUL have been installed successfully"
"$TYTUL"
}
wget http:
//upload
.wikimedia.org
/wikipedia/en/2/26/Tropico_3_Box_Art
.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"
"Kalypso Media"
"www.tropico3.com"
"NSLW, Steam mod by Fortitou"
"$PREFIX"
select_prefix
"$REPERTOIRE/wineprefix/$PREFIX"
POL_SetupWindow_install_wine
"$WORKINGWINEVERSION"
Use_WineVersion
"$WORKINGWINEVERSION"
POL_SetupWindow_prefixcreate
PROGRAMFILES=
"Program Files"
POL_LoadVar_PROGRAMFILES
POL_SetupWindow_InstallMethod
"DVD,STEAM,LOCAL"
if
[
"$INSTALL_METHOD"
==
"DVD"
];
then
if
[ -e
"$REPERTOIRE/configurations/installed/$TYTUL"
];
then
POL_SetupWindow_menu
"What do you want to do?"
"Actions"
"Patch game"
"~"
if
[
"$APP_ANSWER"
==
"Patch game"
];
then
patch_Tropico3
fi
POL_SetupWindow_Close
exit
fi
POL_SetupWindow_message
"Please insert $TYTUL media into your disk drive."
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom
"setup.exe"
cd
"$WINEPREFIX/dosdevices"
ln
-s
"$CDROM"
e:
cd
"$WINEPREFIX/drive_c/windows/temp/"
echo
"[HKEY_LOCAL_MACHINE\\\\Software\\\\Wine\\\\Drives]"
> cdrom.reg
echo
"\\"
e:\\
"=\\"
cdrom\\
""
>> cdrom.reg
regedit cdrom.reg
sleep
5
POL_Call
POL_Install_dotnet20
wine start
/unix
"$CDROM/setup.exe"
POL_SetupWindow_message
"Click \\"
Next\\
" when installation will finish."
"$TYTUL"
elif
[
"$INSTALL_METHOD"
==
"STEAM"
];
then
POL_Call
POL_Install_quartz
POL_Call
POL_Install_steam
POL_Call
POL_Install_dxfullsetup
POL_Call
POL_Install_steam_flags
"$STEAMAPP"
cd
"$WINEPREFIX/drive_c/$PROGRAMFILES/Steam"
POL_Wine
start
/unix
"steam.exe"
steam:
//install/
$STEAMAPP
POL_Wine_WaitExit
"$TITLE"
fi
POL_SetupWindow_menu_list
"How much memory do your graphic card have got?"
"$TYTUL"
"32-64-128-256-384-512-768-890-1024-2048"
"-"
"256"
VMS=
"$APP_ANSWER"
echo
"[HKEY_CURRENT_USER\\\\Software\\\\Wine\\\\Direct3D]"
> vms.reg
echo
"\\"
VideoMemorySize\\
"=\\"
$VMS\\
""
>> vms.reg
echo
"\\"
Multisampling\\
"=\\"
enabled\\
""
>> vms.reg
regedit vms.reg
cd
"$WINEPREFIX/drive_c/windows/temp"
echo
"[HKEY_CURRENT_USER\\\\Software\\\\Wine\\\\DllOverrides]"
> override.reg
echo
"\\"
mmdevapi\\
"=\\"
\\
""
>> override.reg
regedit override.reg
if
[ -e
"$WINEPREFIX/drive_c/windows/temp/"
];
then
rm
-rf
"$WINEPREFIX/drive_c/windows/temp/*"
chmod
-R 777
"$POL_USER_ROOT/tmp/"
rm
-rf
"$POL_USER_ROOT/tmp/*"
fi
if
[
"$INSTALL_METHOD"
==
"STEAM"
];
then
else
POL_SetupWindow_make_shortcut
"$PREFIX"
"$PROGRAMFILES/Kalypso/Tropico 3"
"tropico3.exe"
""
"$TYTUL"
""
""
Set_WineVersion_Assign
"$WORKINGWINEVERSION"
"$TYTUL"
POL_SetupWindow_make_icon_for_shortcut
"$TYTUL"
"*_tropico3.0.png"
fi
POL_SetupWindow_message
"$TYTUL has been installed successfully"
"$TYTUL"
if
[
"$INSTALL_METHOD"
==
"DVD"
];
then
POL_SetupWindow_question
"Do you want to patch your game?"
"$TYTUL"
if
[
"$APP_ANSWER"
==
"TRUE"
] ;
then
patch_Tropico3
fi
fi
POL_SetupWindow_Close
exit