El Foro

Runes Of Magic

Autor Respuestas
Nietzsche Tuesday 13 April 2010 at 17:40
NietzscheAnonymous

This is the first script I do, and I hope it would be useful.

I used the script from the repos, but it's a bit outdated. This version downloads the last official version, checks the md5sum if you have downloaded something manually or the POL_Installer crashed, it installs automatically some needed components, and so on.

Wine version : 1.1.42
Distribution : Ubuntu
Distribution Version : Linux Mint 8 (32 bit) based on Ubuntu 9.10
Graphics card : ATI Radeon x1650
Drivers of the graphics card : 1.5 Mesa 7.7.1-DEVEL

#!/bin/bash
# Date: (2010-04-13)
# Last revision: (2010-04-13)
# Distribution used to test: Ubuntu 9.10
# Wine version used: 1.1.42
# Licence: Creative Commons
# Author: Pablo Marcos Oltra
# Webpage: www.pablomarcos.es
 
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
 
#Programfiles variables
PROGRAMFILES="Program Files" 
POL_LoadVar_PROGRAMFILES
 
#Pefixes and constants
#You can download the client manually from http://us.runesofmagic.com/us/downloads,client,us.html
PREFIX="RunesOfMagic"
TITLE="Runes Of Magic"
VERSION="2.1.6.2049"
BASE_URL="http://frogster.vo.llnwd.net/o9/FOG/rom/"
FOLDER="$REPERTOIRE/tmp/$PREFIX"


mkdir "$FOLDER"
cd "$FOLDER"

#Downloading images
wget http://i41.tinypic.com/14y32fs.jpg -O left.jpg
wget http://i42.tinypic.com/347gwtx.jpg -O top.jpg
wget http://i41.tinypic.com/23trtro.png -O update.png

#Winetricks
wget http://www.kegel.com/wine/winetricks -O winetricks
chmod +x winetricks

POL_SetupWindow_Init "$FOLDER/top.jpg" "$FOLDER/left.jpg"


#Translation texts
if [ "$POL_LANG" = "es" ]; then

	presentation_text1="Instalación de Runes Of Magic por Pablo Marcos Oltra"  
	presentation_text2="Éste instalador te guiará paso a paso en la instalación de $TITLE $VERSION.\\n\\n1) Primero creará el prefijo del juego e instalará algunos componentes (vcrun2005, IE6 and wininet) via winetricks.\\n\\n2) En el siguiente paso, comprobará si tienes alguna parte (de 7) descargada correctamente. Si has descargado manualmente algún ROMSetup, simplemente mételo en $FOLDER.\\n\\n3) Más tarde, descargará de la página oficial los ficheros necesarios.\\n\\n4) Finalmente, abrirá el instalador del juego."
	
	components_text1="Instalando vcrun2005, IE6 y wininet via winetricks"
	components_text2="Instalando componentes necesarios para $TITLE"
	
	checking_text1="El instalador ha encontrado algunos ficheros descargados.\\n\\nAhora comprobará los ficheros que ya has descargado.\\nPuede llevar bastante tiempo, debido a que hace el md5sum de cada archivo (~1GB)." 
	checking_text2="Comprobando ficheros anteriores de $TITLE $VERSION"
		
	md5_needed_text1="No tienes el paquete md5sum instalado, por lo que no se comprobará si tienes\\nficheros anteriormente descargados.\\n\\nSi ya has descargado algo en $FOLDER,\\ncierra esto e instala md5sum antes de volver a abrir el instalador."
	md5_needed_text2="Paquete md5sum necesario"
	
	files_ok_text1="Los siguientes ficheros estaban correctos:\\n\\n"
	files_corrupted_text1="\\nLos ficheros listados abajo estaban corruptos, por lo que se volverán a bajar:\\n\\n"
	
	files_text2="Ficheros que necesitan ser descargados"
	
	downloading_text="PlayOnLinux está descargando $TITLE $VERSION"
	
	installation_text1="Instalando $TITLE\\n\\nA veces la ventana de instalación desaparece.\\nPara arreglar eso, se ha configurado wine en modo escritorio."
	installation_text2="Instalación de $TITLE"
	
	clean_text1="¿Quieres borrar los archivos temporales de la instalación?\\n\\nEn mi opinión, sería mejor que no lo hicieras y conservaras los ficheros, sólo por si acaso algo fuera\\nmal y necesitaras reinstalarlo.\\n\\nEn cualquier caso, todo ha sido almacenado en $FOLDER" 
	clean_text2="¿Borrar ficheros temporales?"
	
	finish_text="$TITLE $VERSION ha sido instalado correctamente\\n\\nMUY IMPORTANTE! El ClientUpdater tratará de reabrirse él mismo después de muchas actualizaciones.\\nProbablemente esto haga que wine de un error. Todo lo que tienes que hacer es matar wine y reabrir\\nel cliente cada vez. No te preocupes, se actualizará completamente después de varias reaparturas ;)\\n\\nDisfruta el juego! Y recuerda ayudar en www.playonlinux.com.\\nHay muchas formas de contribuir!"
	
else
	presentation_text1="Installation of Runes Of Magic by Pablo Marcos Oltra"  
	presentation_text2="This installer will guide you step-by-step in the $TITLE $VERSION installation.\\n\\n1) First, it will create the game prefix and install some needed components (vcrun2005, IE6 and wininet) via winetricks.\\n\\n2) In the next step, it will check if you have any part (out of 7) correcty downloaded. If you have downloaded manually some ROMSetup, just put it into $FOLDER.\\n\\n3) Later, it will download from the official webpage the files needed.\\n\\n4) Finally, it will run the game installer."
	
	components_text1="Installing vcrun2005, IE6 and wininet via winetricks"
	components_text2="Installing needed components for $TITLE"
	
	checking_text1="The installer has found some downloaded files.\\n\\nNow it will check the previous files you have downloaded.\\nIt can take several time, due to it's making the md5sum of each file (~1GB)." 
	checking_text2="Checking previous files of $TITLE $VERSION"
	
	md5_needed_text1="You don't have the md5sum package installed, so it will not check if you had \\nprevious versions downloaded.\\n\\nIf you have something downloaded already in $FOLDER,\\nclose this and install md5sum before running the installer again."
	md5_needed_text2="md5sum packet needed"
	
	files_ok_text1="The files listed below were OK:\\n\\n"
	files_corrupted_text1="\\nThe files listed below were corrupted, so they'll be downloaded again:\\n\\n"
	
	files_text2="Files that needs to be downloaded"
	
	downloading_text="PlayOnLinux is downloading $TITLE $VERSION"
	
	installation_text1="Installing $TITLE\\n\\nThe installation window disappears, usually.\\nIn order to fix that, the wine desktop mode has been set."
	installation_text2="Installation of $TITLE"
	
	clean_text1="Do you want to clean all the temporary files?\\n\\nIn my opinion you shouldn't do it and you'd better keep the files, just in case something went\\nwrong and you need to reinstall it.\\n\\nAnyway, everything has been stored in $FOLDER" 
	clean_text2="Clean temporary files?"
	
	finish_text="$TITLE $VERSION has been installed succesfully\\n\\nVERY IMPORTANT! The ClientUpdater will try to re-run itself after most updates.\\nThis will probably cause a wine crash. All you have to do is kill wine and re-run manually the client\\neach time. Don't worry, it would be updated after some re-runs ;)\\n\\nEnjoy the game! And remember helping with PlayOnLinux on www.playonlinux.com.\\nThere are lots of ways to contribute!"
fi
	
POL_SetupWindow_free_presentation "$presentation_text1" "$presentation_text2"

#Selecting prefix
select_prefix "$REPERTOIRE/wineprefix/$PREFIX"
POL_SetupWindow_prefixcreate


#Configuring wine
POL_SetupWindow_install_wine "1.1.42"
Use_WineVersion "1.1.42"
Set_WineVersion_Assign "1.1.42" "Runes Of Magic"

cd "$FOLDER"

#Installing needed components
POL_SetupWindow_pulsebar "$components_text1" "$components_text1"
		./winetricks -q vcrun2005
	POL_SetupWindow_pulse "33"
		./winetricks ie6
	POL_SetupWindow_pulse "66"
		./winetricks -q wininet
	POL_SetupWindow_pulse "100"

if [ -e ROMSetup.exe -o -e ROMSetup-1.bin -o -e ROMSetup-2.bin -o -e ROMSetup-3.bin -o -e ROMSetup-4.bin -o -e ROMSetup-5.bin -o -e ROMSetup-6.bin ]; then

	POL_SetupWindow_message "$checking_text1" "$checking_text2"

fi


#Checking if you have md5sum package installed
check_one "md5sum" "md5sum"

#Just in case you have not md5sum package
if [ $MANQUE ]; then
	POL_SetupWindow_message "$md5_needed_text1" "$md5_needed_text2"
fi


#Cheking if you have already downloaded some files, and if they're corrupted or not
md5_orig[0]="3774ff8339226fdf919cf13560251e7f"
md5_orig[1]="ec9c634cac6cc5c714fee3179cfd6a4c"
md5_orig[2]="eea2ac3561745eddf9b05dfeafe1f7d0"
md5_orig[3]="060a555b17c70296a780b8ecc5fffab0"
md5_orig[4]="7cf1f4bb711756e264f095bf935972cb"
md5_orig[5]="f80dfa8c35c1f2dc7087450fb6455bc2"
md5_orig[6]="906354d34eaa0e121e806d94ee3399d9"

files_num=0
files_corrupted=0
files_ok=0

if [ -e ROMSetup.exe ]; then

	md5[0]=`md5sum ROMSetup.exe | cut -f 1 -d " "`
	
	if [ ${md5[0]} == ${md5_orig[0]} ]; then
		files_ok_text2="$files_ok_text1 ROMSetup.exe\\n"
		files_ok=1
		part[0]=0
	else 
		part[0]=1
		files_corrupted=1
		files_corrupted_text2="$files_corrupted_text1 ROMSetup.exe\\n"
		files_num=1
	fi
else
	files_num=1
	part[0]=1
fi

for i in {1..6}
do
	part[$i]=1
	
	if [ -e ROMSetup-${i}.bin ]; then
	
		md5[$i]=`md5sum ROMSetup-${i}.bin | cut -f 1 -d " "`
		if [ ${md5[$i]} == ${md5_orig[$i]} ]; then
			if [ $files_ok = 0 ]; then
				files_ok_text2="$files_ok_text1"
			fi
			
			files_ok_text2="$files_ok_text2 ROMSetup-${i}.bin\\n"
			part[$i]=0
		else
			if [ $files_corrupted = 0 ]; then
				files_corrupted_text2="$files_corrupted_text1"
			fi
			
			files_corrupted=$(( $files_corrupted+1 ))
			files_corrupted_text2="$files_corrupted_text2 ROMSetup-${i}.bin\\n"
			
		fi
	fi
	
	files_num=$(( $files_num + ${part[$i]} ))
done

#Translation texts
if [ "$POL_LANG" = "es" ]; then
	files_text1="$files_ok_text2$files_corrupted_text2\\n\\nEl instalador descargará ahora $files_num ficheros."
else
	files_text1="$files_ok_text2$files_corrupted_text2\\n\\nThe installer will download now $files_num files."
fi

POL_SetupWindow_message_image "$files_text1" "$files_text2" "$FOLDER/update.png"



if [ ${part[0]} = 1 ]; then
	mv ROMSetup.exe ROMSetup.exe.old
	POL_SetupWindow_download "$downloading_text $TITLE $VERSION Part 0" "$TITLE $VERSION" "$BASE_URL/Runes_of_Magic_${VERSION}/ROMSetup.exe"
fi

for i in {1..6}
do
	if [ ${part[$i]} = 1 ]; then
		mv ROMSetup-${i}.bin ROMSetup-${i}.bin.old
		POL_SetupWindow_download "$downloading_text Part $i" "$TITLE $VERSION" "$BASE_URL/Runes_of_Magic_${VERSION}/ROMSetup-${i}.bin"
	fi
	
done

 
#Starting Setup
POL_SetupWindow_wait_next_signal "$installation_text1" "$installation_text2"
	Set_Desktop "On" "1024" "768"
	wine "ROMSetup.exe"
POL_SetupWindow_detect_exit

 
#Making Shortcut
POL_SetupWindow_make_shortcut "$PREFIX" "$PROGRAMFILES/Runes of Magic/" "Runes of Magic.exe" "" "$TITLE" "" "-game -opengl"
  
 
#Cleaning temporary files
POL_SetupWindow_question "$clean_text1" "$clean_text2"

if [ $APP_ANSWER = TRUE ]; then
	clean_tmp
fi
 
#FINISHING
POL_SetupWindow_message "$finish_text" "$TITLE" 
POL_SetupWindow_Close
exit

Editado por: Nietzsche

Nietzsche Tuesday 13 April 2010 at 17:45
NietzscheAnonymous

Some screenshots in http://flickcabin.com/public/viewset/15672








Editado por: Nietzsche