Applications

Choose a category

accessories
Accessories
development
Development
education
Education
games
Games
graphics
Graphics
internet
Internet
multimedia
Multimedia
office
Office
other
Other

Guild Wars

#!/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, modifié par MulX" "GuildWars"
if [ $LANG == "fr_FR.UTF-8" ] ; then
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 ?"
else
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"
POL_SetupWindow_install_wine "1.0~rc2"
Set_WineVersion_Session "1.0~rc2"

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
#Installing minimal file
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
#Asking for dvd drive
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 #Asking for CDs
POL_SetupWindow_question "$LNG_CD" "$TITRE"
if [ "$APP_ANSWER" == "TRUE" ] ; then
mkdir "$REPERTOIRE/tmp/GuildWars/cd1"
mkdir "$REPERTOIRE/tmp/GuildWars/cd2"
POL_SetupWindow_message "$CD1" "$TITRE"
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "/Data/Gw/Gw.dat"
POL_SetupWindow_wait_next_signal "$COPY" "$TITRE"
cp -ra $CDROM/* $REPERTOIRE/tmp/GuildWars/cd1
POL_SetupWindow_message "$CD2" "$TITRE"
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "/Data/Gw/Gw2.dat"
POL_SetupWindow_wait_next_signal "$COPY" "$TITRE"
cp -ar $CDROM/* $REPERTOIRE/tmp/GuildWars/cd2
chmod +rwx $REPERTOIRE/tmp/GuildWars/ -R
mv $REPERTOIRE/tmp/GuildWars/cd1 $REPERTOIRE/tmp/GuildWars/current
#We need to use 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"
#Disable since wine1.0rc2 seem to fix all bug :-)
#ATI Chipset need wine 0.9.46, can work with other wine release but no sure.
#So we do a basic check : if fglrx is loaded we set Wine to version 0.9.46
#Else we use the installed release of Wine.
#if [ $(lsmod | grep -q "fglrx") ] ; then
# Set_WineVersion_Assign "0.9.46" "Guild Wars"
#else
# Set_WineVersion_Assign "0.9.58" "Guild Wars"
#fi

Set_WineVersion_Assign "1.0~rc2" "Guild Wars"
Set_WineVersion_Assign "1.0~rc2" "Update Guild Wars"

rm $REPERTOIRE/tmp/GuildWars/ -R
POL_SetupWindow_Close
exit