Advertisement
Guest User

GTA5 Launcher

a guest
Apr 29th, 2017
360
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 4.30 KB | None | 0 0
  1. ::Request admin access for Win10 support
  2. :-------------------------------------
  3. >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
  4. if '%errorlevel%' NEQ '0' (
  5.     goto UACPrompt
  6. ) else ( goto gotAdmin )
  7.  
  8. :UACPrompt
  9.     echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
  10.     set params = %*:"=""
  11.     echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs"
  12.  
  13.     "%temp%\getadmin.vbs"
  14.     del "%temp%\getadmin.vbs"
  15.     exit /B
  16.  
  17. :gotAdmin
  18.     pushd "%CD%"
  19.     CD /D "%~dp0"
  20. :--------------------------------------
  21.  
  22. ::Set the basic shit. I know delayed expansion isn't needed, but I include it anyways.
  23. Title GTA5 Mode Selector
  24. SETLOCAL EnableDelayedExpansion EnableExtensions
  25. @echo off
  26. cls
  27.  
  28. ::Basic prompt.
  29. :Start
  30. @echo Which mode do you want to run?
  31. @echo (1) Vanilla
  32. @echo (2) Modded
  33. SET /p GTA5Switch=
  34. IF "%GTA5Switch%"=="1" goto Vanilla
  35. IF "%GTA5Switch%"=="2" goto Modded
  36. @echo I didn't get that. Type only 1 or 2.
  37. goto Start
  38.  
  39. ::If the 2 files are found in the main directory then inform the user.
  40. :Vanilla
  41. cls
  42. @echo Checking if mods are present.
  43. IF EXIST "D:\Games\Grand Theft Auto V\dinput8.dll" SET dinputfound=1
  44. IF EXIST "D:\Games\Grand Theft Auto V\ScriptHookV.dll" SET ScriptHookVFound=1
  45. timeout 3 /nobreak >nul
  46. IF DEFINED dinputfound @echo Found dinput
  47. IF DEFINED ScriptHookVFound @echo Found ScriptHookV
  48. timeout 3 /nobreak >nul
  49. IF DEFINED dinputfound goto dinput
  50. IF DEFINED ScriptHookVFound goto ScriptHookVFound
  51.  
  52. ::Check specifically for dinput8.dll. If it's present, move it to the ../mods folder. Also creates a mods folder if it is not present, then skips attempting to make the folder for the next time the program is ran.
  53. :dinput
  54. IF EXIST "D:\Games\Grand Theft Auto V\Mods" GOTO SkipMkDirDinput
  55. MKDIR "D:\Games\Grand Theft Auto V\Mods\"
  56. :SkipMkdirDinput
  57. MOVE /Y "D:\Games\Grand Theft Auto V\dinput8.dll" "D:\Games\Grand Theft Auto V\Mods\" >nul
  58.  
  59. ::Check specifically for ScriptHookV.dll. If it's present, move it to the ../mods folder. Also creates a mods folder if it is not present, then skips attempting to make the folder for the next time the program is ran.
  60. :ScriptHookVFound
  61. IF EXIST "D:\Games\Grand Theft Auto V\Mods" GOTO SkipMkDirScriptHook
  62. MKDIR "D:\Games\Grand Theft Auto V\Mods\"
  63. :SkipMkdirScriptHook
  64. MOVE /Y "D:\Games\Grand Theft Auto V\ScriptHookV.dll" "D:\Games\Grand Theft Auto V\Mods\" >nul
  65.  
  66. ::Start the game, wait, then close the window.
  67. :StartGTAV
  68. cls
  69. @echo Launching vanilla GTA5.
  70. START "" "D:\Games\Grand Theft Auto V\GTAVLauncher.exe"
  71. timeout 10 /nobreak >nul
  72. exit
  73.  
  74. ::All of the documentation for this section is the same as vanilla, other than the MOVE command being reversed.
  75. ::Only difference is multiple checks to ensure both files are present and ready.
  76.  
  77. :Modded
  78. cls
  79. @echo Checking if mods are present.
  80. IF EXIST "D:\Games\Grand Theft Auto V\dinput8.dll" SET dinputfound=1
  81. IF EXIST "D:\Games\Grand Theft Auto V\ScriptHookV.dll" SET ScriptHookVFound=1
  82. timeout 3 /nobreak >nul
  83. IF DEFINED dinputfound @echo Found dinput
  84. IF DEFINED ScriptHookVFound @echo Found ScriptHookV
  85. timeout 3 /nobreak >nul
  86. IF DEFINED dinputfound goto GTA5Modded
  87. @echo You are missing dinput8.dll. Importing.
  88. :Moddinput
  89. IF EXIST "D:\Games\Grand Theft Auto V\Mods" GOTO ModSkipMkDirDinput
  90. MKDIR "D:\Games\Grand Theft Auto V\Mods\"
  91. :ModSkipMkdirDinput
  92. MOVE /Y "D:\Games\Grand Theft Auto V\Mods\dinput8.dll" "D:\Games\Grand Theft Auto V\" >nul
  93. timeout 3 /nobreak >nul
  94. goto Modded
  95.  
  96. :GTA5Modded
  97. IF DEFINED ScriptHookVFound goto ModStartGTAV
  98. cls
  99. @echo It seems you are missing ScriptHookV. Importing.
  100. :ModScriptHookVFound
  101. IF EXIST "D:\Games\Grand Theft Auto V\Mods" GOTO ModSkipMkDirScriptHook
  102. MKDIR "D:\Games\Grand Theft Auto V\Mods\"
  103. :ModSkipMkdirScriptHook
  104. MOVE /Y "D:\Games\Grand Theft Auto V\Mods\ScriptHookV.dll" "D:\Games\Grand Theft Auto V\" >nul
  105. timeout 3 /nobreak >nul
  106. IF EXIST "D:\Games\Grand Theft Auto V\ScriptHookV.dll" goto ModStartGTAV
  107. goto Modded
  108.  
  109. :ModStartGTAV
  110. cls
  111. @echo Launching modded GTA5.
  112. START "" "D:\Games\Grand Theft Auto V\GTAVLauncher.exe"
  113. timeout 10 /nobreak >nul
  114. exit
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121. ::Script written by Jake Jensen, alias Sapphire.
  122. ::Contact me over reddit at /u/Sapphireex if you want more of my scripts!
  123.  
  124. ::Script version: 1.0
  125. ::Script date: 4/29/2017
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement