Forums

[script] Updated and fixed Guild Wars script

Auteur Réponses
Deleted account Vendredi 6 Aoüt 2010 à 15:07
Deleted accountAnonymous

Hi!

I fixed the Guild Wars script and also did some clean-up. It did not work on my Ubuntu Lucid machine.

Changes I made:
- Update and correct German translation
- Set wine to current version which is 1.2 (should work fine for GW)
- Removed stuff that we don't need anymore
- MOST IMPORTANT/BUGFIX: After copying the .dat-file from CD1 we have to go up on folder because we are still in the CD-folder. This will cause Ubuntu to not be able to umount the CD since it is still busy and therefore it cannot detect CD2 after CD1 is removed.
- Automatically eject CDs using wine command
- Use a different variable for check of CD2 (don't know if this is necessary, I just did it to try if the variable was the problem, but I left it this way so you can distinguish between the variable for CD1 and CD2)


#!/bin/bash
if [ "$PLAYONLINUX" = "" ]then
	exit 0
fi
source "$PLAYONLINUX/lib/sources"
 
cfg_check
 
 
POL_SetupWindow_Init
POL_SetupWindow_presentation "Guild Wars" "NCsoft" "http://www.guildwars.com" "Tinou, modified by MulX and Henne" "GuildWars" 
if [ "$POL_LANG" == "fr" ] ; then #French messages
	LNG_CD="Disposez vous du CD ?"
	COPY="Copie des fichiers ..."
	DOWNLOAD="Patientez pendant le téléchargement des fichiers minimal pour le jeu"
	EXTRACT="Patientez pendant l'extraction des fichiers minimal de Guild Wars"
	CD2="Inserer le CD2"
	CD1="Inserer le CD1"
	SWITCHCD="Cliquez sur Suivant ou OK quand le jeu demande le CD2"
	ENDCD="Quand l'installation a fini, fermer le jeu, puis cliquez sur OK"
	DVD="Disposez vous du DVD ?"
elif [ "$POL_LANG" == "de" ] ; then #German messages
	LNG_CD="Sind Sie im Besitz der CDs ?"
	COPY="Kopiere Dateien ..."
	DOWNLOAD="Bitte warten Sie, bis die für das Spiel benötigten Dateien heruntergeladen wurden"
	EXTRACT="Bitte warten Sie, bis die soeben heruntergeladenen Dateien entpackt wurden"
	CD2="Bitte legen Sie CD2 ein"
	CD1="Bitte legen Sie CD1 ein"
	SWITCHCD="Klicken Sie auf WEITER, wenn das Spiel nach CD2 fragt"
	ENDCD="Wenn die Installation abgeschlossen ist, beenden Sie das Spiel und klicken Sie auf WEITER"
	DVD="Sind Sie im Besitz der DVD ?"
else #English messages
	LNG_CD="Do you have CD ?"
	COPY="Copying files ..."
	DOWNLOAD="Please wait during downloading minimal file for game"
	EXTRACT="Please wait during unziping minimal file for game"
	CD2="Please, insert CD2"
	CD1="Please, insert CD1"
	SWITCHCD="Press next or OK, when game ask for cd2"
	ENDCD="When setup is finished, close game, and press ok or next"
	DVD="Do you have the DVD ?"
fi
TITRE="Guild Wars"
# Use current wine
POL_SetupWindow_install_wine "1.2"
Set_WineVersion_Session "1.2"
rm $REPERTOIRE/tmp/GuildWars/ -R
mkdir -p $REPERTOIRE/tmp/GuildWars
cd $REPERTOIRE/tmp/GuildWars
POL_SetupWindow_download "$DOWNLOAD" "$TITRE" "$SITE/divers/Gw.zip"
select_prefixe "$HOME/.PlayOnLinux/wineprefix/GuildWars/"
POL_SetupWindow_prefixcreate
#Install minimal files
POL_SetupWindow_wait_next_signal "$EXTRACT" "$TITRE" 
unzip Gw.zip
mkdir -p $REPERTOIRE/wineprefix/GuildWars/drive_c/GW
cp ./Gw.exe $REPERTOIRE/wineprefix/GuildWars/drive_c/GW/.
regedit ./Gw.reg
POL_SetupWindow_detect_exit
#Ask for DVD
POL_SetupWindow_question "$DVD" "$TITRE"
if [ "$APP_ANSWER" == "TRUE" ] ; then
        POL_SetupWindow_cdrom 
        POL_SetupWindow_check_cdrom "/Data/Gw/Gw.dat"
	#Here is it the spet 13 because we don't support use of CD and DVD (and DVD is easier of use than CD)
        POL_SetupWindow_wait_next_signal "$COPY" "$TITRE"
	cp $CDROM/Data/Gw/Gw.dat $REPERTOIRE/wineprefix/GuildWars/drive_c/GW/Gw.dat
	POL_SetupWindow_detect_exit
 
else	#Ask for CDs
	POL_SetupWindow_question "$LNG_CD" "$TITRE"
	if [ "$APP_ANSWER" == "TRUE" ] ; then
		mkdir "$REPERTOIRE/tmp/GuildWars/cd1"
		mkdir "$REPERTOIRE/tmp/GuildWars/cd2"
		# Copy files from CD1
		POL_SetupWindow_message "$CD1" "$TITRE"
		POL_SetupWindow_cdrom
		# tests to do POL_SetupWindow_check_cdrom "/Data/Gw/Gw.dat" but with case insensitivity
		cd $CDROM
		CHECK=$(find . -iwholename ./Data/Gw/Gw.dat)
		if [ "$CHECK" == "" ] ; then
			POL_SetupWindow_check_cdrom "POL_fail" # makes an error and retries POL_SetupWindow_cdrom
		else
			POL_SetupWindow_check_cdrom "$CHECK"
		fi
		POL_SetupWindow_wait_next_signal "$COPY" "$TITRE"
		cp -ra $CDROM/*  $REPERTOIRE/tmp/GuildWars/cd1
		cd .. # move one folder up to make umount of CD possible, since we are moving to the CD 9 lines up
		wine eject # eject CD1 to ensure correct removal
		# Copy files from CD2
		POL_SetupWindow_message "$CD2" "$TITRE"
		POL_SetupWindow_cdrom
		# tests to do POL_SetupWindow_check_cdrom "/Data/Gw/Gw2.dat" but with case insensitivity
		cd $CDROM
		CHECK2=$(find . -iwholename ./Data/Gw/Gw2.dat)
		if [ "$CHECK2" == "" ] ; then
			POL_SetupWindow_check_cdrom "POL_fail" # to make an error and retry POL_SetupWindow_cdrom
		else
			POL_SetupWindow_check_cdrom "$CHECK2"
		fi
		POL_SetupWindow_wait_next_signal "$COPY" "$TITRE"
		cp -ar $CDROM/*  $REPERTOIRE/tmp/GuildWars/cd2
		cd .. # same as CD1
		wine eject
		chmod +rwx $REPERTOIRE/tmp/GuildWars/ -R
		mv $REPERTOIRE/tmp/GuildWars/cd1 $REPERTOIRE/tmp/GuildWars/current 
		# Start Setup.exe using wine
		wine "$REPERTOIRE/tmp/GuildWars/current/Setup.exe"
		POL_SetupWindow_detect_exit
		POL_SetupWindow_message "$SWITCHCD" "$TITRE"
		mv $REPERTOIRE/tmp/GuildWars/current $REPERTOIRE/tmp/GuildWars/cd1
		mv $REPERTOIRE/tmp/GuildWars/cd2 $REPERTOIRE/tmp/GuildWars/current
		POL_SetupWindow_message "$ENDCD" "$TITRE"
	fi
fi
#fix a bug of the next command when answer is no.
touch "$REPERTOIRE/wineprefix/GuildWars/drive_c/GW/Gw.dat"
#fix a bug when file created is not rw 
chmod +rw "$REPERTOIRE/wineprefix/GuildWars/drive_c/GW/Gw.dat"
 
POL_SetupWindow_make_shortcut "GuildWars" "GW/" "Gw.exe" "GuildWars.xpm" "Guild Wars" "" ""
POL_SetupWindow_make_shortcut "GuildWars" "GW/" "Gw.exe" "GuildWars.xpm" "Update Guild Wars" "" "-image"
 
Set_WineVersion_Assign "1.2" "Guild Wars"
Set_WineVersion_Assign "1.2" "Update Guild Wars"
 
rm $REPERTOIRE/tmp/GuildWars/ -R
POL_SetupWindow_Close
exit


There is one thing I haven't been able to fix yet: Guild Wars automatically creates a menu shortcut even if you tell POL not to create one. Is it possible to prevent GW from doing this?

And another question: Can anybody tell me where I can find the translation files for the POL Installation wizard (the one that you start when you run a script)? I would like to update and correct the German translation of it too.

Hendrik
Aymeric P. Mercredi 11 Aoüt 2010 à 9:39
Aymeric P.

Hi,
Script updated in your database, can you test and report information on your bug ticket?

For German translation - need confirmation - I think that there is the .po/.mo file in the tar.gz. You can review on it and after open a bug ticket. You can also ask Tinou directly but he is very busy...

Aymeric

Former member.

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