Dica de como fazer o Grand Theft Auto IV funcionar no linux!

Iniciado por Alyscom, 01 de Abril de 2010, 02:37

tópico anterior - próximo tópico

Alyscom

A poucos dias atrás descobri um script que automatiza e facilita a instalação do Grand Theft Auto IV no linux através do PlayOnLinux, pois achei muito legal e vim compartilhar com vocês!!

Para quem quiser aqui está ele:
#!/bin/bash
# Date : (2010-03-09 10-00)
# Last revision : (2010-03-09 10-00)
# Wine version used : 1.1.41
# Distribution used to test : Fedora 12
# Author : NSLW
# Licence : Retail
# Depend : ImageMagick, unrar

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

TYTUL="Grand Theft Auto IV"
PREFIX="GTAIV"
PATCHFILE="GTAIV_MAINTENANCE_UPDATE_1004"
PATCHFILEUNP="GTAIV_TU5.exe"
WORKINGWINEVERSION="1.1.41"

LNG_DOWNLOADING="PlayOnLinux is downloading"
LNG_INSTALLING="PlayOnLinux is installing"
LNG_INSTALLATIONINPROGRESS="Installation in progress..."
LNG_INSERTMEDIA="Please insert first $TYTUL media into your disk drive."
LNG_CLICKNEXT1DVD="When the installer will ask you for 1st DVD, click NEXT."
LNG_CLICKNEXT2DVD="When the installer will ask you for 2nd DVD, click NEXT."
LNG_CLICKNEXT="Click NEXT when the installation will finish"
LNG_SUCCES="$TYTUL has been installed successfully."
LNG_PATCHSUCCES="Patch for $TYTUL has been installed successfully"
LNG_PATCHQ="It's recommended to patch the game. Do you want to do it now?"
LNG_PATCHM="Let me choose patch manually"
LNG_PATCHA="Download patch automatically"
LNG_GFXMEM="How much memory do your graphic card have got?"
LNG_CHOOSEACTION="What do you want to do?"
LNG_PATCH="Patch game"
LNG_UPDATEWINEVER="Update Wine version to"
LNG_INSTALLATIONNOTE="Installer will start soon after you click NEXT. Please:\n- don't change default installation directory\n- cancel online release date check at the end of installation"

if [ "$POL_LANG" == "pl" ]; then
LNG_DOWNLOADING="PlayOnLinux pobiera"
LNG_INSTALLING="PlayOnLinux instaluje"
LNG_INSERTMEDIA="Włóż pierwszy dysk $TYTUL do twojego napędu."
LNG_CLICKNEXT1DVD="Gdy instalator zapyta cię o pierwszą płytę DVD, naciśnij DALEJ."
LNG_CLICKNEXT2DVD="Gdy instalator zapyta cię o drugą płytę DVD, naciśnij DALEJ."
LNG_CLICKNEXT="Naciśnij DALEJ tylko wtedy gdy instalator zakończy."
LNG_SUCCES="$TYTUL został zainstalowany pomyślnie."
LNG_PATCHSUCCES="Łatka do $TYTUL została zainstalowana pomyślnie"
LNG_PATCHQ="Zalecane jest zainstalowanie łatki. Czy chcesz to zrobić teraz?"
LNG_PATCHM="Pozwól mi wybrać łatkę samodzielnie"
LNG_PATCHA="Pobierz łatkę automatycznie"
LNG_GFXMEM="Jak dużo pamięci ma twoja karta graficzna?"
LNG_CHOOSEACTION="Co chcesz zrobić?"
LNG_PATCH="Łataj grę"
LNG_UPDATEWINEVER="Zaktualizuj wersję Wine do"
LNG_INSTALLATIONNOTE="Instalator zacznie zaraz po tym jak naciśniesz DALEJ. Proszę:\n- nie zmieniaj domyślnego folderu instalacji\n- anuluj \"online release date check\" na koń** instalacji"
elif [ "$POL_LANG" == "de" ]; then
LNG_DOWNLOADING="PlayOnLinux ladet herunter"
LNG_INSTALLING="PlayOnLinux installiert"
LNG_INSERTMEDIA="Bitte lege erstes DVD $TYTUL in dein Laufwerk ein."
LNG_CLICKNEXT1DVD="Klicke WEITER wenn die Installation dich nach erste DVD fragt."
LNG_CLICKNEXT2DVD="Klicke WEITER wenn die Installation dich nach zweite DVD fragt."
LNG_CLICKNEXT="Klicke WEITER wenn Installation vorbei ist."
LNG_SUCCES="$TYTUL ist erfolgreich installiert worden."
LNG_PATCHSUCCES="Patch für $TYTUL ist erfolgreich installiert worden."
LNG_PATCHQ="Es ist Willst du ein Patch einspielen?"
LNG_PATCHM="Lass mich Patch selbst aussuchen"
LNG_PATCHA="Lade Patch automatisch herunter"
LNG_GFXMEM="Wie viel Speicher hat deine Grafikkarte?"
LNG_CHOOSEACTION="Was willst du machen?"
LNG_PATCH="Patch einspielen"
LNG_UPDATEWINEVER="Aktualisiere Wine Version zu"
LNG_INSTALLATIONNOTE="Die Installation wird starten sobald du WEITER klickst. Bitte:\n- ändere nich voreingestelltes Installation-Verzeichnis\n- anuliere \"online release date check\" am Ende der Installation"
elif [ "$POL_LANG" == "fr" ]; then
LNG_CLICKNEXT="Appuyez sur \"Suivant\" UNIQUEMENT quand l'installation du jeu sera
terminée sous peine de devoir recommencer l'installation."
LNG_GFXMEM="La taille de votre mémoire graphique?"
LNG_PATCHSUCCES="Patch pour $TYTUL installé avec succès"
fi

POL_SetupWindow_make_icon_for_shortcut()
{
convert "$HOME/.local/share/icons/$2" -geometry 32X32 "$REPERTOIRE/icones/32/$1"
}

#procedure for patching GTA IV
patch_GTAIV()
{
POL_SetupWindow_menu "$LNG_CHOOSEACTION" "Actions" "$LNG_PATCHM~$LNG_PATCHA (ca. 100MB)" "~"
if [ "$APP_ANSWER" == "$LNG_PATCHM" ]; then
POL_SetupWindow_browse "Where is your patch located ?" "$TYTUL" ""
POL_SetupWindow_wait_next_signal "$LNG_INSTALLATIONINPROGRESS" "$TYTUL"
wine "$APP_ANSWER"
POL_SetupWindow_detect_exit
elif [ "$APP_ANSWER" == "$LNG_PATCHA (ca. 100MB)" ]; then

cd "$REPERTOIRE/ressources"
if [ ! -e "$PATCHFILEUNP" ]; then
POL_SetupWindow_download "$LNG_DOWNLOADING $PATCHFILE(a.k.a. 1.0.5.0)" "$TYTUL" "http://updates.rockstargames.com/patches/gtaiv/$PATCHFILE.rar"
unrar e "$PATCHFILE.rar"
rm -f "$PATCHFILE.rar"
fi
POL_SetupWindow_wait_next_signal "$LNG_INSTALLATIONINPROGRESS" "$TYTUL"
wine "$PATCHFILEUNP"
POL_SetupWindow_detect_exit
POL_SetupWindow_message "$LNG_PATCHSUCCES" "$TYTUL"
fi
}

download_TEXP70()
{
cd "$REPERTOIRE/ressources/"
if [ ! -e "$WORKINGWINEVERSION-mod.zip" ]; then
POL_SetupWindow_download "$LNG_DOWNLOADING TEXP70 patch\n(written by Yoann Laissus\n(corrected by David Kejzlar)" "$TYTUL" "http://s2.sigmirror.com/files/63363_sssrl/$WORKINGWINEVERSION-mod.zip"
fi
cd "$WINEPREFIX/drive_c/windows/temp/"
unzip "$REPERTOIRE/ressources/$WORKINGWINEVERSION-mod.zip"
./$WORKINGWINEVERSION-mod -y
cp gta4/* ./
}

Create_Patched_Wine_Version()
{
POL_SetupWindow_install_wine "$1"
cd "$REPERTOIRE/WineVersions"
POL_SetupWindow_wait_next_signal "Removing old patched Wine" "$TYTUL"
rm -fr "$1-$2"
POL_SetupWindow_detect_exit

POL_SetupWindow_wait_next_signal "Copying Wine $1" "$TYTUL"
cp -r "$1" "$1-$2"
POL_SetupWindow_detect_exit

POL_SetupWindow_wait_next_signal "Patching Wine $1 with TEXP70 patch" "$TYTUL"
rm -fr "$REPERTOIRE/WineVersions/$1-$2/usr/lib/wine/wined3d.dll.so"
cp "$WINEPREFIX/drive_c/windows/temp/wined3d.dll.so" "$REPERTOIRE/WineVersions/$1-$2/usr/lib/wine/wined3d.dll.so"
POL_SetupWindow_detect_exit
}

#starting the script
wget http://upload.wikimedia.org/wikipedia/en/0/09/GTAIV_Logo.jpg --output-document="$REPERTOIRE/tmp/leftnotscaled.jpeg"
convert "$REPERTOIRE/tmp/leftnotscaled.jpeg" -scale 150x356\! "$REPERTOIRE/tmp/left.jpeg"
wget http://upload.wikimedia.org/wikipedia/de/b/b6/GTA_IV_Logo.svg --output-document="$REPERTOIRE/tmp/topnotscaled.jpeg"
convert "$REPERTOIRE/tmp/topnotscaled.jpeg" -scale 60x60 "$REPERTOIRE/tmp/top.jpeg"
POL_SetupWindow_Init "$REPERTOIRE/tmp/top.jpeg" "$REPERTOIRE/tmp/left.jpeg"

POL_SetupWindow_presentation "$TYTUL" "Rockstar Games" "www.rockstargames.com/IV/" "NSLW" "$PREFIX"

#checking if unrar is installed
check_one "unrar" "unrar"
POL_SetupWindow_missing

select_prefix "$REPERTOIRE/wineprefix/$PREFIX"

#asking about patching
if [ -e "$REPERTOIRE/configurations/installed/$TYTUL" ]; then
POL_SetupWindow_menu "$LNG_CHOOSEACTION" "Actions" "$LNG_PATCH~$LNG_UPDATEWINEVER $WORKINGWINEVERSION" "~"

if [ "$APP_ANSWER" == "$LNG_PATCH" ]; then
patch_GTAIV
elif [ "$APP_ANSWER" == "$LNG_UPDATEWINEVER $WORKINGWINEVERSION" ]
then
download_TEXP70
Create_Patched_Wine_Version "$WORKINGWINEVERSION" "GTA4"
CHOSENWINEVERSION="$WORKINGWINEVERSION-GTA4"
Set_WineVersion_Assign "$CHOSENWINEVERSION" "$TYTUL"
Set_WineVersion_Assign "$CHOSENWINEVERSION" "$TYTUL Safe Mode"
fi

POL_SetupWindow_Close
exit
fi

#asking for CDROM and checking if it's correct one
POL_SetupWindow_message "$LNG_INSERTMEDIA"
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "GTAIV/setup.exe"

#downloading specific Wine
POL_SetupWindow_install_wine "$WORKINGWINEVERSION"
Use_WineVersion "$WORKINGWINEVERSION"

#creating application's own prefix
POL_SetupWindow_prefixcreate

#creating patched Wine version
download_TEXP70
Create_Patched_Wine_Version "$WORKINGWINEVERSION" "GTAIV"
CHOSENWINEVERSION="$WORKINGWINEVERSION-GTAIV"

#fetching PROGRAMFILES environmental variable
PROGRAMFILES="Program Files"
POL_LoadVar_PROGRAMFILES

#adding CD-ROM as drive e: to winecfg
cd "$WINEPREFIX/dosdevices"
ln -s "$CDROM" e:

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

POL_SetupWindow_message_image "$LNG_INSTALLATIONNOTE" "Note about installation process" "$PLAYONLINUX/themes/tango/info.png"

#starting installation
wine start /unix "$CDROM/Autorun.exe"
POL_SetupWindow_message "$LNG_CLICKNEXT2DVD" "$TYTUL"
wine eject
POL_SetupWindow_message "$LNG_CLICKNEXT1DVD" "$TYTUL"
wine eject
POL_SetupWindow_message "$LNG_CLICKNEXT" "$TYTUL"
wine eject

#asking about memory size of graphic card
POL_SetupWindow_menu_list "$LNG_GFXMEM" "$TYTUL" "128-256-320-384-512-640-768-896-1024-1792-2048" "-" "256"
VMS="$APP_ANSWER"

echo "[HKEY_CURRENT_USER\\Software\\Wine\\Direct3D]" > vms.reg
echo "\"VideoMemorySize\"=\"$VMS\"" >> vms.reg
regedit vms.reg

#downloading xliveless because xlive don't work under linux
cd "$REPERTOIRE/ressources"
if [ ! -e "xliveless-0.99b1.rar" ]; then
POL_SetupWindow_download "$LNG_DOWNLOADING xliveless 0.99b1" "$TYTUL" "http://public.sannybuilder.com/GTA4/xliveless-0.99b1.rar"
fi
cd "$WINEPREFIX/drive_c/windows/temp/"
POL_SetupWindow_wait_next_signal "$LNG_INSTALLING xliveless 0.99b1" "$TYTUL"
unrar e "$REPERTOIRE/ressources/xliveless-0.99b1.rar"
mv xlive.dll "$WINEPREFIX/drive_c/$PROGRAMFILES/Rockstar Games/Grand Theft Auto IV/xlive.dll"
POL_SetupWindow_detect_exit

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

#making shortcut
POL_SetupWindow_make_shortcut "$PREFIX" "$PROGRAMFILES/Rockstar Games/Grand Theft Auto IV" "LaunchGTAIV.exe" "" "$TYTUL" "" ""
Set_WineVersion_Assign "$CHOSENWINEVERSION" "$TYTUL"
POL_SetupWindow_make_icon_for_shortcut "$TYTUL" "*_gtaiv.xpm"
POL_SetupWindow_make_shortcut "$PREFIX" "$PROGRAMFILES/Rockstar Games/Grand Theft Auto IV" "LaunchGTAIV.exe" "" "$TYTUL Safe Mode" "" "-safemode"
Set_WineVersion_Assign "$CHOSENWINEVERSION" "$TYTUL Safe Mode"
POL_SetupWindow_make_icon_for_shortcut "$TYTUL Safe Mode" "*_gtaiv.xpm"

POL_SetupWindow_message "$LNG_SUCCES" "$TYTUL"

POL_SetupWindow_message_image "Please note that this game has a copy protection system\nand sadly, it prevents Wine from running the game.\n\nPlayOnLinux will not provide any help concerning any illegal\nstuff." "Note about copy protection" "$PLAYONLINUX/themes/tango/warning.png"

#asking about patching
POL_SetupWindow_question "$LNG_PATCHQ" "$TYTUL"
if [ "$APP_ANSWER" == "TRUE" ] ;then
patch_GTAIV
fi

POL_SetupWindow_Close
exit
Copie para dentro de um editor de texto(gedit, etc.. ) e salve com o nome que desejar, mas lembrem-se, Este script funciona somente no PlayOnLinux!!

Para fazer funcionar faça assim: Abra o PlayOnLinux vá até a aba Tools e em Run a non-official script, agora é só abrir o script recém criado!!  :)

Esse script instala o Grand Theft Auto IV e também faz automaticamente o download e instalação do mais recente patch para o jogo (1.0.5.0).

Ícone para o jogo:




__________________________________________________________________________________________________
Boa sorte a todos! ;)


[]'s


Alyscom
O álcool é o photoshop da vida real
 

arturararipe

Tenho um blog, logo existo
arturandrade.wordpress.com

rmaia

Muito Muito bom essa dica, agora precisamos de alguém que descreva o hardware e diga como roda..
Vou começar :

Intel I3    velocidade 3.1 ghz 4 núcleos
4 gb Ram
GeForce 9500 GT/PCI/SSE2   1gb mem
500 gb Hd

bom é isso, no próximo tópico respondo como se comporta em ação..

vampire_thunder

Aproveitando, acabei de instalar o GTA III no meu Tablet com Android. Alguém sabe rodar apps do Android no Ubuntu?