The forum

[script] Re-Volt

Author Replies
NSLW Monday 19 October 2009 at 19:23
NSLW

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

#!/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 : unzip, icotools

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

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

TYTUL="Re-Volt"
PREFIX="ReVolt"
WORKINGWINEVERSION="1.1.29"
ABANDONIASUM="39c68216faf3af9c2e30afede4d9e46dea034dfd"
UTOPIASUM="8f45478076c8b5ccd327ce2ce6163f3b20f58114"

POL_SetupWindow_make_icon_for_shortcut()
{
LAUNCHERFILENAME="$REPERTOIRE/configurations/installed/$1"
EXEPATH=`cat "$LAUNCHERFILENAME" | tail -n 2 | head -n 1 | cut -d'"' -f2`
EXENAME=`cat "$LAUNCHERFILENAME" | tail -n 1 | cut -d'"' -f2`

wrestool "$EXEPATH/$EXENAME" -x -t14 > "$REPERTOIRE/tmp/icon.ico"
ICOBITDEPTH=`icotool -l "$REPERTOIRE/tmp/icon.ico" | grep '\\-\\-width=32' | cut -d' ' -f5 | cut -d'=' -f2 | sort -n |tail -n 1`
ICOINDEX=`icotool -l "$REPERTOIRE/tmp/icon.ico" | grep "\\-\\-width=32" | grep "\\-\\-bit-depth=$ICOBITDEPTH" | tail -n 1 | cut -d' ' -f2 | cut -d'=' -f2`
icotool -x --index=$ICOINDEX "$REPERTOIRE/tmp/icon.ico" -o "$REPERTOIRE/icones/32/$1"
}

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/e/e7/Re-Volt_Coverart.png --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" "Acclaim Entertainment" "N/A" "NSLW" "$PREFIX" 

select_prefix "$REPERTOIRE/wineprefix/$PREFIX"

cd "$REPERTOIRE/ressources"
POL_SetupWindow_menu "Please select source of your Re-Volt archive" "$TYTUL" "www.abandonware-utopia.com (POL will download the game)~www.abandonia.com (You have to download the game)" "~"

	if [ "$APP_ANSWER" == "www.abandonware-utopia.com (POL will download the game)" ]; then
	REVOLTSUM="$UTOPIASUM"
	REVOLTARCHIVE="$REPERTOIRE/ressources/Revolt-utopia.zip"
	# checking if Revolt.zip is in ressources if not then download
	if [ ! -e "Revolt-utopia.zip" ]	then
	POL_SetupWindow_download "PlayOnLinux is downloading Re-Volt" "$TYTUL" "http://www.abandonware-utopia.com/pages/telechargement/jeux/Revolt.zip"
	mv Revolt.zip Revolt-utopia.zip
	fi

	elif [ "$APP_ANSWER" == "www.abandonia.com (You have to download the game)" ]; then
	REVOLTSUM="$ABANDONIASUM"
	POL_SetupWindow_browse "Select Re-Volt.zip archive" "$TYTUL" ""
	REVOLTARCHIVE="$APP_ANSWER"
	fi

#checking Re-Volt archive
if [ "`sha1sum < "$REVOLTARCHIVE" | sed 's/ .*//'`" != "$REVOLTSUM" ]; then
POL_SetupWindow_message_image "Downloaded archive is corrupted.\\nPlease try again." "Corrupted archive" "/usr/share/playonlinux/themes/tango/warning.png"
POL_SetupWindow_Close
exit
fi

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

cd "$WINEPREFIX/drive_c"


if [ "$REVOLTSUM" == "$UTOPIASUM" ]; then

POL_SetupWindow_wait_next_signal "Installation in progress..." "$TYTUL"
unzip "$REVOLTARCHIVE"
cd "./Re-Volt"
wine Re-Volt.part01.exe -s
rm -f Re-Volt.part*
POL_SetupWindow_detect_exit

elif [ "$REVOLTSUM" == "$ABANDONIASUM" ]; then

POL_SetupWindow_wait_next_signal "Installation in progress..." "$TYTUL"
unzip "$REVOLTARCHIVE"
POL_SetupWindow_detect_exit

fi

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

#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"

cd "$WINEPREFIX/drive_c/windows/temp"
echo "[HKEY_CURRENT_USER\\\\Software\\\\Wine\\\\Direct3D]" > vms.reg
echo "\\"VideoMemorySize\\"=\\"$VMS\\"" >> vms.reg
regedit vms.reg

echo "[HKEY_LOCAL_MACHINE\\\\Software\\\\Acclaim\\\\Re-Volt\\\\1.0]" > 24bit.reg
echo "\\"Texture24\\"=dword:1" >> 24bit.reg
regedit 24bit.reg

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

#making shortcut
POL_SetupWindow_make_shortcut "$PREFIX" "Re-Volt" "REVOLT.EXE" "" "$TYTUL" "" ""
Set_WineVersion_Assign "$CHOSENWINEVERSION" "$TYTUL"
POL_SetupWindow_make_icon_for_shortcut "$TYTUL"

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

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