Monday, July 19, 2021

Portable GTA IV on PC

The guide is updated in May 2026 and this method now works for any GTA IV PC version.

  1. Preparation for GTA IV Complete Edition 1.2.0.X
  2. Preparation for GTA IV 1.0.0.0 - 1.0.8.0
  3. Launching your portable game with portableIV.bat script
  4. portableIV.bat

Portable GTA IV became possible due to XLivelessAddon settings and savegame folders redirection for game versions 1.0.0.0 - 1.0.8.0. For Complete Edition 1.2.0.X settings and savegame folders redirection became possible due to Fusion Fix (2.0 and above) and Goldberg Social Club emulator local save feature. 

Preparation for GTA IV Complete Edition 1.2.0.X 

  • Copy GTA IV game folder and Fusion Fix into your portable device
  • To remove DRM and enable redirection of savegame location unpack GTA_IV_v1.2.0.59_CS_with_SteamAPI_init_cs.rin.ru.7z (password is at the end after _) to game folder
  • Create text file named local_save.txt in game folder, put local folder name where savegames will be stored e.g. _savegame. Do not press Enter (do not add new line) at the end of file. Local folder for savegames will be created on next launch if it doesn't exist (in this example if you put _savegame into local_save.txt then actual savegames will be created later by the game in "_savegame\GTA IV\0F74F4C4" subfolder)
  • Configure profile redirection in plugins\GTAIV.EFLC.FusionFix.ini - specify local folder for profile which contains Settings subfolder among others
    [USERPROFILE]
    CustomUserProfilePath = _profile

  • (optional) Copy your savegames into "_savegame\GTA IV\0F74F4C4" folder. Complete Edition should be able to also load older GFWL-compatible savegames.

Preparation for GTA IV 1.0.0.0 - 1.0.8.0

  • Copy GTA IV game folder and XLivelessAddon into your portable device
  • Edit plugins\XLivelessAddon.ini so that it contains
    CustomSavePath = "_savegame"
    CustomSettingsPath = "_settings"
  • Create these two folders _savegame and _settings in GTA IV game folder
  • (optional) Copy your GFWL-compatible savegames into _savegame folder

Launching your portable game with portableIV.bat script

  • Create portableIV.bat (see below) in game folder
  • (Only for game versions 1.0.X.0) If Settings folder is redirected through XLivelessAddon edit portableIV.bat at the beginning:
    set FUSION_FIX_PROFILE_REDIRECTION=0 
  • Run portableIV.bat from your portable game folder, modify graphics settings and key mappings as needed. After you exit the game your SETTINGS.CFG for this PC will be maintained in SETTINGS.CFG.{PC_NAME_HERE} by portableIV.bat automatically.
    Example:
      If your PC name is NEW-PC its portable settings file will be named SETTINGS.CFG.NEW-PC  
  • (optional) If you need custom commandline.txt file for each PC you may edit portableIV.bat so that it contains in the beginning
      set COPY_COMMANDLINETXT=1
    and then create in game folder files commandline.txt.{PC_NAME_HERE} for each PC
  • Always use portableIV.bat script to start your portable game afterwards, it will maintain and switch SETTINGS.CFG for all your PCs. 

portableIV.bat

@echo off
set PIV_DEBUG=0
setlocal enabledelayedexpansion
rem PortableIV v1.1 (C) 2026 Anton Shabunin  https://ant-sh.blogspot.com/2021/07/portable-gta-iv-on-pc.html 
rem Changelog
rem   1.1 supports Fusion Fix profile folder redirection for Complete Edition

rem FUSION_FIX_PROFILE_REDIRECTION set to 0 assumes older game version with XLivelessAddon
rem Set to 1 if profile folder redirection (which contains Settings) is done by Fusion Fix for Complete Edition
set FUSION_FIX_PROFILE_REDIRECTION=1

rem Subfolder name must be the same as CustomSettingsPath specified in XLivelessAddon.ini
set CustomSettingsPath=_settings
rem If Complete Editon with Fusion Fix is used
if %FUSION_FIX_PROFILE_REDIRECTION%==1 (
  set CustomUserProfilePath=_profile
  set CustomSettingsPath=!CustomUserProfilePath!\Rockstar Games\GTA IV
)
rem This is actual subfolder that contains SETTINGS.CFG
rem For each computer custom settings file must be named SETTINGS.CFG.{COMPUTERNAME}
set settingsfolder=%CustomSettingsPath%\Settings
echo %~n0: FUSION_FIX_PROFILE_REDIRECTION is %FUSION_FIX_PROFILE_REDIRECTION%, settings folder is %settingsfolder%

set GAME_LAUNCHER=GTAIV.exe
rem If your Complete Edition is cracked and can be launched directly through GTAIV.exe
rem then comment out the line below
if %FUSION_FIX_PROFILE_REDIRECTION%==1 set GAME_LAUNCHER=PlayGTAIV.exe

rem When PC change detected commandline.txt.%COMPUTERNAME% is copied as commandline.txt
set COPY_COMMANDLINETXT=0

rem If settings files differ more than mindiff bytes consider them from different PCs
set mindiff=3

if not exist "%CustomSettingsPath%" (
  rem First run
  rem XLivelessAddon doesn't create settings folder specified as CustomSettingsPath in its .ini!
  echo Settings subfolder "%CustomSettingsPath%" not found - creating it!
  md "%CustomSettingsPath%"
)

if not exist "%settingsfolder%" (
   echo First run detected.
   md %settingsfolder%
   if exist "%LOCALAPPDATA%\Rockstar Games\GTA IV\Settings\SETTINGS.CFG" (
     echo Using default "%LOCALAPPDATA%\Rockstar Games\GTA IV\Settings\SETTINGS.CFG" as a template
     copy /y  "%LOCALAPPDATA%\Rockstar Games\GTA IV\Settings\SETTINGS.CFG" "%settingsfolder%\SETTINGS.CFG" > nul
   )
   set FIRST_RUN=1
   echo After you configure graphics settings in the game
   echo "%settingsfolder%\SETTINGS.CFG" will be copied as 
   echo "%settingsfolder%\SETTINGS.CFG.%COMPUTERNAME%" upon game exit
   pause
) else (
   if not exist "%settingsfolder%\SETTINGS.CFG.%COMPUTERNAME%" (
     echo Portable settings file for this PC %COMPUTERNAME% not found!
     if exist "%LOCALAPPDATA%\Rockstar Games\GTA IV\Settings\SETTINGS.CFG" (
       echo Using default "%LOCALAPPDATA%\Rockstar Games\GTA IV\Settings\SETTINGS.CFG" as a template
       copy /y  "%LOCALAPPDATA%\Rockstar Games\GTA IV\Settings\SETTINGS.CFG" "%settingsfolder%\SETTINGS.CFG" > nul
     )
     set FIRST_RUN=1
     echo After you configure graphics settings in the game
     echo "%settingsfolder%\SETTINGS.CFG" will be copied as 
     echo "%settingsfolder%\SETTINGS.CFG.%COMPUTERNAME%" upon game exit
     pause
   ) else (
     if not exist "%settingsfolder%\SETTINGS.CFG" (
       echo Using settings file SETTINGS.CFG.%COMPUTERNAME%
       copy /y "%settingsfolder%\SETTINGS.CFG.%COMPUTERNAME%"  "%settingsfolder%\SETTINGS.CFG" > nul
     ) else (
       rem SETTINGS.CFG exists but it may be left from playing on another PC
       rem Must compare settings file to find out if current SETTINGS.CFG is from this computer
       call :settings_diff "%settingsfolder%\SETTINGS.CFG" "%settingsfolder%\SETTINGS.CFG.%COMPUTERNAME%" p
       if %PIV_DEBUG%==1 echo DEBUG Found !p! differences
       if !p! LEQ %mindiff% (
         echo Looks like settings file is for this PC
       ) else (
         echo Copying settings file for this PC - SETTINGS.CFG.%COMPUTERNAME%
         copy /y "%settingsfolder%\SETTINGS.CFG.%COMPUTERNAME%"  "%settingsfolder%\SETTINGS.CFG" > nul
         if %PIV_DEBUG%==1 pause
         if %COPY_COMMANDLINETXT%==1 (
           if exist commandline.txt.%COMPUTERNAME% (
             echo Copying commandline.txt for this PC - commandline.txt.%COMPUTERNAME%
             copy /y commandline.txt.%COMPUTERNAME% commandline.txt > nul
           )
         )
       )
     )
   )
)

echo Starting GTA IV through %GAME_LAUNCHER%
start "GTAIV" /wait %GAME_LAUNCHER%
rem After game exit SETTINGS.CFG will be created/updated
if not exist "%settingsfolder%\SETTINGS.CFG" (
   echo ERROR "%settingsfolder%\SETTINGS.CFG" not found!
   if %FUSION_FIX_PROFILE_REDIRECTION%==1 (
      echo Check that CustomUserProfilePath specified in ^[USERPROFILE^] section of plugins\GTAIV.EFLC.FusionFix.ini
      echo matches CustomUserProfilePath variable set at the start of this script
   ) else (
      echo Check that CustomSettingsPath specified in XLivelessAddon.ini
      echo matches first occurence of CustomSettingsPath variable set at the start of this script
   )
)
if defined FIRST_RUN (
   if %PIV_DEBUG%==1 echo DEBUG started game process, waited for the exit and now copying settings for this PC
   copy /y "%settingsfolder%\SETTINGS.CFG" "%settingsfolder%\SETTINGS.CFG.%COMPUTERNAME%"  > nul
) else (
   rem SETTINGS.CFG may be changed in 1 byte or more even if no settings during the game were changed
   if %PIV_DEBUG%==1 echo DEBUG check if significant changes were made to SETTINGS.CFG that warrant updating SETTINGS.CFG.%COMPUTERNAME%
   call :settings_diff "%settingsfolder%\SETTINGS.CFG" "%settingsfolder%\SETTINGS.CFG.%COMPUTERNAME%" p
   if %PIV_DEBUG%==1 echo DEBUG Found !p! differences && pause
   if !p! GTR 1 (
      echo !p! changes were made to SETTINGS.CFG that warrant updating SETTINGS.CFG.%COMPUTERNAME%
      copy /y "%settingsfolder%\SETTINGS.CFG" "%settingsfolder%\SETTINGS.CFG.%COMPUTERNAME%"  > nul
   ) else (
      echo Only !p! changes were made to SETTINGS.CFG - not updating SETTINGS.CFG.%COMPUTERNAME%
   )
)
echo Exiting
if %PIV_DEBUG%==1 pause
goto :eof

:settings_diff
rem Subroutine to calculate number of bytes that differ in files specified as 1st and 2nd arguments
rem Result will be assigned to variable NAME specified as 3rd argument
set /a %3=0
for /f %%D in ('fc /b %1 %2 ^| findstr "^[0-9]"') do (
      set /a %3+=1
)
goto :eof

9 comments:

  1. You deserve a medal! I mean it! This deserves way more attention. I mod GTA IV a lot and have lots of different patch versions on my hard drive and it was such a pain to back up saves and settings all the time as to not break the game.
    All this pain is now over and I can't tell you how glad I am! It makes everything so much easier. Also your tutorial was very easy to understand and it worked first try!

    T H A N K Y OU

    ReplyDelete
    Replies
    1. You are welcome. I just would like to not that if you have single PC you may skip portableIV.bat as its settings-juggling logic is not needed and you may launch GTAIV.exe directly from corresponding folder.

      Delete
  2. Hello Anton. First thing I got to say, incredible GTA IV content you got man. Second, I want some help with running GTA IV correctly. I want silky smooth gameplay and am using DXVK. I am using patch 1.0.7.0 and my GPU is Radeon RX580 8gb. So how much VRAM should I specify in commandline?

    ReplyDelete
    Replies
    1. Hello, thanks! For older game versions use this table and experiment https://ant-sh.blogspot.com/2020/09/easy-downgrade-gta-iv-to-1040.html#_Toc50220895 In general 2Gb VRAM or above is OK as long as Resource Usage in Graphics menu is green.

      Delete
    2. Thanks. Another question, I get really long loading times with patch 1.0.7.0. It only happens with this patch. Game performance is fine but the loading times are really frustrating. ColAccel manages to reduce it a little bit but not much. Do you have any potential solution to this?

      Delete
    3. I have some workarounds but no definitive solution as it has something to do with particular PC/OS/driver. FusionFix and/or enabling/disabling fps limiter may help.
      https://ant-sh.blogspot.com/2020/09/easy-downgrade-gta-iv-to-1040.html?showComment=1630512160568#c5034333421747188290

      Delete
    4. By fps limiter do you mean the ingame V-sync option? Or another fps limiter. I have fusionfix installed in the game but it doesn't seem to do loading times any good.

      Delete
    5. Try with ingame vsync on and off. I mean some external fps limiter e.g. RTSS. Experiment with some compatibility options for GTAIV.exe and if you find something that helped you please share.

      Delete
    6. Thanks for your help. I will try it out and let you know.

      Delete