Forums

[script] Theme Park World

Auteur Réponses
NSLW Jeudi 17 September 2009 à 21:20
NSLW

Hello,
I wrote script which installs Theme Park World.
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-17 18-00)
# Last revision : (2009-09-17 18-00)
# Wine version used : 1.1.29
# Distribution used to test : Fedora 11
# Author : NSLW
# Licence : Retail
# Depend : -

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

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

TYTUL="Theme Park World"
PREFIX="TPW"

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/a/a5/SimThemeParkWorld.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" "Bullfrog Productions" "N/A" "NSLW" "$PREFIX" 

select_prefix "$REPERTOIRE/wineprefix/$PREFIX"

POL_SetupWindow_message "Please insert $TYTUL media into your disk drive."
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "Autorun.exe"

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:

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

#SafeDisk will work only on MS Windows 2000
Set_OS "win2k"

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

POL_SetupWindow_menu "What is your language version?" "Languages" "european and american~traditional chinese~simplified chinese~korean~japanese" "~"
	LANGUAGEVERSION=$APP_ANSWER
	if [ "$APP_ANSWER" == "european and american" ]; then
	LANGUAGEVERSIONSHRT="EUROAMER"
	elif [ "$APP_ANSWER" == "traditional chinese" ]
	then
	LANGUAGEVERSIONSHRT="TCHINESE"
	elif [ "$APP_ANSWER" == "simplified chinese" ]
	then
	LANGUAGEVERSIONSHRT="SCHINESE"
	elif [ "$APP_ANSWER" == "korean" ]
	then
	LANGUAGEVERSIONSHRT="KOREAN"
	elif [ "$APP_ANSWER" == "japanese" ]
	then
	LANGUAGEVERSIONSHRT="JAPANESE"
	fi

	cd "$REPERTOIRE/ressources"
	if [ ! -e "TPPatchTwo${LANGUAGEVERSIONSHRT}20000324a.exe" ]; then
	POL_SetupWindow_wait_next_signal "PlayOnLinux is downloading TPPatchTwo${LANGUAGEVERSIONSHRT}20000324a.exe" "$TYTUL"
	wget "ftp://159.153.229.114/Pub/TPW/PATCH/TPPatchTwo${LANGUAGEVERSIONSHRT}20000324a.exe"
	POL_SetupWindow_detect_exit
	fi
	POL_SetupWindow_wait_next_signal "Installation in progress..." "$TYTUL"
	wine "TPPatchTwo${LANGUAGEVERSIONSHRT}20000324a.exe"
	POL_SetupWindow_detect_exit
	POL_SetupWindow_message "Patch for $TYTUL has been installed successfully" "$TYTUL"	

cd "$WINEPREFIX/drive_c/windows/temp/"
#setting MouseWarpOverride to disable to get mouse working
echo "[HKEY_CURRENT_USER\\\\Software\\\\Wine\\\\DirectInput]" > mwo.reg
echo "\\"MouseWarpOverride\\"=\\"disable\\"" >> mwo.reg
regedit mwo.reg

#asking about memory size
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
regedit vms.reg

#cleaning temp
cd "$WINEPREFIX/drive_c/windows/temp/"
rm -rf *

#making shortcut
POL_SetupWindow_make_shortcut "$PREFIX" "$PROGRAMFILES/Bullfrog/Theme Park World" "TP.EXE" "" "$TYTUL" "" ""
Set_WineVersion_Assign "$CHOSENWINEVERSION" "$TYTUL"
POL_SetupWindow_make_icon_for_shortcut "$TYTUL" "fcc7_tp.0.png"

POL_SetupWindow_message "$TYTUL has been installed successfully" "$TYTUL"

POL_SetupWindow_message_image "Please note that this game has a copy protection system\\nand sadly, it can cause you a problem starting this game.\\n\\nThere are two solutions to this:\\n1) be patient at starting the game\\n2) find unoriginal executable file for\\nTheme Park World version 2.0
" "Note about copy protection" "/usr/share/playonlinux/themes/tango/warning.png"

POL_SetupWindow_Close
exit

This site allows content generated by members, and we promptly remove any content that infringes copyright according to our Terms of Service. To report copyright infringement, please send a notice to dmcayonlinux.com