The forum

[Script] Grand Theft Auto IV on Mac

Author Replies
og_wolf_3d Saturday 29 June 2013 at 23:32
og_wolf_3dAnonymous

Hi All,

I am new to PlayOnMac and this forum. I will try to conform to the standards as best I can.

My System:
MacBook Pro
2 GHz Intel Core i7
4GB Mem
AMD Radeon HD 6490M 256 MB

I tried installing GTA IV using the script found on the Supported software page and my Retail DVD install discs. I made it through the install process but was unable to run the game.

When trying to run the game it said the DVD could not be found. I found the Securom LaunchGTAIV.exe which does not require the DVD and tried that. Then I got a error saying install Mono 2.0. I tried installing various version of Mono and dotNet with no success.

I am now trying to update the script to get it working with a newer version of Wine. I have based my changes on the Bulletstorm and Fallout3 scripts. Both of which use xliveless. I still can't get it to work.

My current process is run the below script. Install The Securom LaunchGTAIV.exe then the GrandTheft Auto Title Update 7 from the install > patch section.

Here is my script:

[code language=playonlinux]
#!/bin/bash
# Date : (2010-03-09 10-00)
# Last revision : (2011-02-08 21-00)
# Wine version used : 1.5.3-xliveless2-rawinput3
# Distribution used to test : Mac OS X
# Author : NSWL & GNU_Raziel
# Licence : Retail
# Only For : http://www.playonmac.com

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

TITLE="Grand Theft Auto IV"
PREFIX="GTAIV"
EDITOR="Rockstar Games"
GAME_URL="www.rockstargames.com/IV/"
AUTHOR="NSLW & GNU_Raziel"
WORKING_WINE_VERSION="1.3.26-xliveless2"
GAME_VMS="256"

if [ "$POL_LANG" == "fr" ]; then
        LNG_CHOOSE_MEDIA="Quelle version possédez-vous?"
        LNG_DVD="Version DVD"
        LNG_STEAM="Version Steam Store"
        LNG_DDV="Version Digital Download"
        LNG_INSTALL_NOTE="Annulez la vérification de la date à  la fin de\\nl'installation, elle ne fonctionnera pas correctement."
        LNG_CHOOSE_DDV="Veuillez selectionner votre executable Digital Download de $TITLE"
        LNG_INSERT_MEDIA="Veuillez insérer le disque $TITLE dans votre lecteur\\nsi ce n'est pas déja fait."
        LNG_WAIT_END="Appuyez sur \\"Suivant\\" UNIQUEMENT quand l'installation du\\njeu sera terminée sous peine de devoir recommencer l'installation."
        LNG_WAIT_STEAM_END="Appuyez sur \\"Suivant\\" UNIQUEMENT quand l'installation du jeu Steam\\nsera terminée sous peine de devoir recommencer l'installation."
        LNG_INSTALL_ON="Installation en cours..."
        LNG_DL_XLIVELESS="Téléchargement de xliveless 1.0a4..."
        LNG_INSTALL_XLIVELESS="Installation de xliveless 1.0a4..."
        LNG_GAME_VMS="Quelle est la quantité de mémoire (Mo) de votre carte graphique ?"
        LNG_VMS_ERROR="Ce jeu ne fonctionnera correctement qu'avec une carte graphique ayant plus de 256Mo de mémoire."
        LNG_SUCCES="$TITLE a été installé avec succès."
else
        LNG_CHOOSE_MEDIA="Which version do you have?"
        LNG_DVD="DVD Version"
        LNG_STEAM="Steam Store Version"
        LNG_DDV="Digital Download Version"
        LNG_INSTALL_NOTE="Cancel online release date check at the end of installation\\nit will not work properlly."
        LNG_CHOOSE_DDV="Please select your $TITLE Digital Download executable"
        LNG_INSERT_MEDIA="Please insert $TITLE media into your disk drive\\nif not already done."
        LNG_WAIT_END="Click on \\"Forward\\" ONLY when the game installation is finished\\nor you will have to redo the installation."
        LNG_WAIT_STEAM_END="Click on \\"Forward\\" ONLY when Steam game installation\\nwill be finished or you will have to redo the installation."
        LNG_INSTALL_ON="Installation in progress..."
        LNG_DL_XLIVELESS="Downloading xliveless 1.0a4..."
        LNG_INSTALL_XLIVELESS="Installing xliveless 1.0a4..."
        LNG_GAME_VMS="How much memory does your graphics board have?"
        LNG_VMS_ERROR="This game will work correctly only with a graphic card with more than 256MB of memory."
        LNG_SUCCES="$TITLE has been installed successfully."
fi

# Starting the script
POL_SetupWindow_Init

# Starting debugging API
POL_Debug_Init
POL_SetupWindow_presentation "$TITLE" "$EDITOR" "$GAME_URL" "$AUTHOR" "$PREFIX"

# Setting prefix path
POL_Wine_SelectPrefix "$PREFIX"

# Downloading wine if necessary and creating prefix
POL_System_SetArch "x86"

# For dotnet/mono
POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"

# Fix for dvd
Set_OS "win7"
# Choose between DVD and Digital Download version
POL_SetupWindow_InstallMethod "DVD,STEAM,LOCAL"

#
# Choose between DVD and Digital Download version
# POL_SetupWindow_menu "$LNG_CHOOSE_MEDIA" "$TITLE" "$LNG_DVD~$LNG_STEAM~$LNG_DDV" "~"

# if [ "$APP_ANSWER" == "$LNG_DVD" ]; then
#         GAME_MEDIAVERSION="DVD"
# elif [ "$APP_ANSWER" == "$LNG_STEAM" ]; then
#         GAME_MEDIAVERSION="STEAM"
# else
#         GAME_MEDIAVERSION="DD"
# fi

# Installing mandatory components
if [ "$INSTALL_METHOD" == "STEAM" ]; then
        POL_Call POL_Install_steam
else
        POL_Call POL_Install_vcrun2005
fi
POL_Call POL_Install_msxml3
POL_Call POL_Install_dxfullsetup
POL_Call POL_Install_dotnet35
# POL_Call POL_Install_gfwl
POL_Call POL_Install_wmp9
POL_Call POL_Install_wmpcodecs

# Set Graphic Card information keys for wine
POL_Wine_SetVideoDriver

# Asking about memory size of graphic card
POL_SetupWindow_VMS $GAME_VMS

## Fix for this game
# Set Graphic Card information keys for wine
POL_Wine_SetVideoDriver
POL_SetupWindow_message "$LNG_INSTALL_NOTE"
# Pre-install fix - Need to backup dll because game setup install xlive and override it
# cd "$WINEPREFIX/drive_c/windows/system32/"
# cp xlive.dll xlive2.dll

if [ "$INSTALL_METHOD" == "DVD" ]; then
        # Asking for CDROM and checking if it's correct one
        POL_SetupWindow_message "$LNG_INSERT_MEDIA"
        POL_SetupWindow_cdrom
        POL_SetupWindow_check_cdrom "GTAIV/setup.exe"
        wine start /unix "$CDROM/Autorun.exe"
        POL_Wine_WaitExit "$TITLE"
elif [ "$INSTALL_METHOD" == "STEAM" ]; then
        cd "$WINEPREFIX/drive_c/$PROGRAMFILES/Steam"
        wine "Steam.exe" -applaunch 12210
        POL_Wine_WaitExit "$TITLE"
else
        # Asking then installing DDV of the game
        cd "$HOME"
        POL_SetupWindow_browse "$LNG_CHOOSE_DDV" "$TITLE"
        SETUP_EXE="$APP_ANSWER"
        POL_SetupWindow_wait_next_signal "$LNG_INSTALL_ON" "$TITLE"
        wine start /unix "$SETUP_EXE"
        wineserver -w
        POL_SetupWindow_detect_exit
fi

# Mandatory to make the game work with wine
POL_Call POL_Remove_gfwl
# cd "$WINEPREFIX/drive_c/windows/system32/"
# cp xlive2.dll xlive.dll

## Fix for this game
GAME_PATH=`find $WINEPREFIX -name "LaunchGTAIV.exe" | sed s/LaunchGTAIV.exe//g

# POL_Call POL_Function_OverrideDLL "" "mmdevapi"

# Sound problem fix - pulseaudio related
[ "$POL_OS" = "Linux" ] && Set_SoundDriver "alsa"
[ "$POL_OS" = "Linux" ] && Set_SoundEmulDriver "Y"
## End Fix
## PlayOnMac Section
[ "$POL_OS" = "Mac" ] && Set_Managed "Off"
## End Section

#
# Cleaning temp
# if [ -e "$WINEPREFIX/drive_c/windows/temp/" ]; then
#         rm -rf "$WINEPREFIX/drive_c/windows/temp/*"
#         chmod -R 777 "$POL_USER_ROOT/tmp/"
#         rm -rf "$POL_USER_ROOT/tmp/*"
# fi

# Making shortcut
POL_SetupWindow_auto_shortcut "$PREFIX" "LaunchGTAIV.exe" "$TITLE" "" ""
Set_WineVersion_Assign "$WORKING_WINE_VERSION" "$TITLE"

POL_SetupWindow_message "$LNG_SUCCES" "$TITLE"
POL_SetupWindow_Close
exit 0[/code]

Edited by petch

petch Sunday 30 June 2013 at 0:11
petch

Hi,

There was a problem posting the script with the browser you used (Chrome maybe?)
I tried to unmangle it, but small differences may subsist.

The other problem is that lots of things are deprecated in this script, and that updating it would ideally require more cleanups.

if [ "$POL_LANG" == "fr" ]; then
        LNG_CHOOSE_MEDIA="Quelle version possédez-vous?"
...

Localization is now handled with eval_gettext, so this whole section is obsolete, see
http://www.playonmac.com/en/dev-documentation-10.html

        wine start /unix "$SETUP_EXE"

Running wine directly is forbidden (doesn't enable debug logging), use POL_Wine instead. Beside, "start /unix" is most of the time useless, and has a known side effect that programs started that way are not stopped if the user cancels the installation.
In fact, wineserver -w and POL_SetupWindow_detect_exit may be necessary just because of start /unix.

POL_SetupWindow_auto_shortcut "$PREFIX" "LaunchGTAIV.exe" "$TITLE" "" ""
Set_WineVersion_Assign "$WORKING_WINE_VERSION" "$TITLE"

POL_SetupWindow_auto_shortcut is deprecated, try POL_Shortcut.
Set_WineVersion_Assign is deprecated, POL/POM4 does not longer support setting a Wine version per shortcut.

Hopefully someone can get you some feedback about the xlive issue, too.
og_wolf_2d Sunday 30 June 2013 at 3:05
og_wolf_2dAnonymous

Hi Again. I generated a password for the og_wolf_3d account and promptly lost it (doh) so I am back with a new registration. If you could reset my password I promise to not loose the password again.

I am now using Safari so hopefully my script won't be mangled. I have updated my script with your suggestions and also uncommented the section where the xlive.dll is backed up and restored. I haven't run it again yet. Will try again later today but if anyone has any other tips on getting xlive working that would be great.

[code language=playonlinux]
#!/bin/bash
# Date : (2010-03-09 10-00)
# Last revision : (2011-02-08 21-00)
# Wine version used : 1.5.3-xliveless2-rawinput3
# Distribution used to test : Mac OS X
# Author : NSWL & GNU_Raziel
# Licence : Retail
# Only For : http://www.playonmac.com

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

TITLE="Grand Theft Auto IV"
PREFIX="GTAIV"
EDITOR="Rockstar Games"
GAME_URL="www.rockstargames.com/IV/"
AUTHOR="NSLW & GNU_Raziel"
WORKING_WINE_VERSION="1.3.26-xliveless2"
GAME_VMS="256"

# Starting the script
POL_SetupWindow_Init

# Starting debugging API
POL_Debug_Init
POL_SetupWindow_presentation "$TITLE" "$EDITOR" "$GAME_URL" "$AUTHOR" "$PREFIX"

# Setting prefix path
POL_Wine_SelectPrefix "$PREFIX"

# Downloading wine if necessary and creating prefix
POL_System_SetArch "x86"

# For dotnet/mono
POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"

# Fix for dvd
Set_OS "win7"
# Choose between DVD and Digital Download version
POL_SetupWindow_InstallMethod "DVD,STEAM,LOCAL"

# Installing mandatory components
if [ "$INSTALL_METHOD" == "STEAM" ]; then
        POL_Call POL_Install_steam
        STEAM_ID="12210"
fi
POL_Call POL_Install_vcrun2005
POL_Call POL_Install_dxfullsetup
POL_Call POL_Install_dotnet35
POL_Call POL_Install_wmp9
POL_Call POL_Install_wmpcodecs

# Set Graphic Card information keys for wine
POL_Wine_SetVideoDriver

# Asking about memory size of graphic card
POL_SetupWindow_VMS $GAME_VMS

## Fix for this game
# Set Graphic Card information keys for wine
POL_Wine_SetVideoDriver
POL_SetupWindow_message "$(eval_gettext 'Cancel online release date check at the end of installation\\nit will not work properlly.')" "$TITLE"
# Pre-install fix - Need to backup dll because game setup install xlive and override it
cd "$WINEPREFIX/drive_c/windows/system32/"
cp xlive.dll xlive2.dll

if [ "$INSTALL_METHOD" == "DVD" ]; then
        # Asking for CDROM and checking if it's correct one
        POL_SetupWindow_message "$(eval_gettext 'Please insert game media into your disk drive\\nif not already done.')"
        POL_SetupWindow_cdrom
        POL_SetupWindow_check_cdrom "GTAIV/setup.exe"
        POL_Winewine start /unix "$CDROM/Autorun.exe"
        POL_Wine_WaitExit "$TITLE"
elif [ "$INSTALL_METHOD" == "STEAM" ]; then
        cd "$WINEPREFIX/drive_c/$PROGRAMFILES/Steam"
        POL_Wine "Steam.exe" -applaunch 12210
        POL_Wine_WaitExit "$TITLE"
else
        # Asking then installing DDV of the game
        cd "$HOME"
        POL_SetupWindow_browse "$(eval_gettext 'Please select the setup file to run:')" "$TITLE"
        SETUP_EXE="$APP_ANSWER"
        POL_SetupWindow_wait_next_signal "$(eval_gettext 'Installation in progress...')" "$TITLE"
        POL_Wine start /unix "$SETUP_EXE"
        wineserver -w
        POL_SetupWindow_detect_exit
fi

# Mandatory to make the game work with wine
POL_Call POL_Remove_gfwl
cd "$WINEPREFIX/drive_c/windows/system32/"
cp xlive2.dll xlive.dll

## Fix for this game
GAME_PATH=`find $WINEPREFIX -name "LaunchGTAIV.exe" | sed s/LaunchGTAIV.exe//g

# POL_Call POL_Function_OverrideDLL "" "mmdevapi"

# Sound problem fix - pulseaudio related
[ "$POL_OS" = "Linux" ] && Set_SoundDriver "alsa"
[ "$POL_OS" = "Linux" ] && Set_SoundEmulDriver "Y"
## End Fix
## PlayOnMac Section
[ "$POL_OS" = "Mac" ] && Set_Managed "Off"
## End Section

# # Cleaning temp
# if [ -e "$WINEPREFIX/drive_c/windows/temp/" ]; then
#         rm -rf "$WINEPREFIX/drive_c/windows/temp/*"
#         chmod -R 777 "$POL_USER_ROOT/tmp/"
#         rm -rf "$POL_USER_ROOT/tmp/*"
# fi

# Making shortcut
POL_Shortcut "LaunchGTAIV.exe" "$TITLE" "" ""

POL_SetupWindow_message POL_SetupWindow_wait_next_signal "$(eval_gettext '$TITLE has been installed successfully.')" "$TITLE"
POL_SetupWindow_Close
exit 0
[/code]

Edited by petch

Malik Friday 2 August 2013 at 3:39
MalikAnonymous

Everytime i try to install grand theft auto iv on the playonlinux the program it doesn't work it keep giving me an error and a frowny face. I'm a noob on linux and this very confusin for me. Can someone please help me.
Ronin DUSETTE Friday 2 August 2013 at 21:37
Ronin DUSETTE

@malik, you are now banned

Please:
Post debug logs & full computer specs in first post
No private messages for general help, use the forums
Read the wiki, Report broken scripts

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