Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :restart
- :: ******************************************************
- :: * GRAND THEFT AUTO V MOD SWITCHER *
- :: * By *
- :: * RainBawZ *
- :: * SocialClub: kukpappa *
- :: ******************************************************
- setlocal enabledelayedexpansion
- mode con cols=100 lines=50
- set curfile=gtavms.bat
- set dbg=0
- set force=0
- set single=0
- set break=0
- if /i "%1"=="debug" (
- @Echo on
- set dbg=1
- prompt GTAVMS CODE EXECUTION$S$G$G$S
- if /i "%2"=="force" (
- set force=1
- )
- ) else (
- @Echo off
- )
- if /i "%1"=="force" (
- set force=1
- )
- if /i "%1"=="cnt" (
- if !updd!==0 (
- goto update.dl.continue
- )
- )
- title GTA V Mod Switcher [v!version!]
- color 8F
- for /F "tokens=1,2 delims=#" %%A in ('"prompt #$H#$E# & echo on & for %%B in (1) do rem"') do (
- set "DEL=%%A"
- )
- set protected=bink2w64.dll,common.rpf,d3dcompiler_46.dll,d3dcsx_46.dll,GFSDK_ShadowLib.win64.dll,GFSDK_TXAA.win64.dll,GFSDK_TXAA_AlphaResolve.win64.dll,GTA5.exe,GTAVLauncher.exe,installscript.vdf,steam_api64.dll,x64a.rpf,x64b.rpf,x64c.rpf,x64d.rpf,x64e.rpf,x64f.rpf,x64g.rpf,x64h.rpf,x64i.rpf,x64j.rpf,x64k.rpf,x64l.rpf,x64m.rpf,x64n.rpf,x64o.rpf,x64p.rpf,x64q.rpf,x64r.rpf,x64s.rpf,x64t.rpf,x64u.rpf,x64v.rpf,x64w.rpf,update\update.rpf,update\x64\metadata.dat,update\x64\data\errorcodes\american.txt,update\x64\data\errorcodes\chinese.txt,update\x64\data\errorcodes\french.txt,update\x64\data\errorcodes\german.txt,update\x64\data\errorcodes\italian.txt,update\x64\data\errorcodes\japanese.txt,update\x64\data\errorcodes\korean.txt,update\x64\data\errorcodes\mexican.txt,update\x64\data\errorcodes\polish.txt,update\x64\data\errorcodes\portuguese.txt,update\x64\data\errorcodes\russian.txt,update\x64\data\errorcodes\spanish.txt,update\x64\dlcpacks\mpchristmas2\dlc.rpf,update\x64\dlcpacks\mpheist\dlc.rpf,update\x64\dlcpacks\mpluxe\dlc.rpf,update\x64\dlcpacks\mpluxe2\dlc.rpf,update\x64\dlcpacks\mppatcheseng\dlc.rpf,update\x64\dlcpacks\patchday1ng\dlc.rpf,update\x64\dlcpacks\patchday2bng\dlc.rpf,update\x64\dlcpacks\patchday2ng\dlc.rpf,update\x64\dlcpacks\patchday3ng\dlc.rpf,update\x64\dlcpacks\patchday4ng\dlc.rpf,update\x64\dlcpacks\patchday5ng\dlc.rpf,x64\metadata.dat,x64\audio\audio_rel.rpf,x64\audio\occlusion.rpf,x64\audio\sfx\ANIMALS.rpf,x64\audio\sfx\ANIMALS_FAR.rpf,x64\audio\sfx\ANIMALS_NEAR.rpf,x64\audio\sfx\CUTSCENE_MASTERED_ONLY.rpf,x64\audio\sfx\DLC_GTAO.rpf,x64\audio\sfx\INTERACTIVE_MUSIC.rpf,x64\audio\sfx\ONESHOT_AMBIENCE.rpf,x64\audio\sfx\PAIN.rpf,x64\audio\sfx\POLICE_SCANNER.rpf,x64\audio\sfx\PROLOGUE.rpf,x64\audio\sfx\RADIO_01_CLASS_ROCK.rpf,x64\audio\sfx\RADIO_02_POP.rpf,x64\audio\sfx\RADIO_03_HIPHOP_NEW.rpf,x64\audio\sfx\RADIO_04_PUNK.rpf,x64\audio\sfx\RADIO_05_TALK_01.rpf,x64\audio\sfx\RADIO_06_COUNTRY.rpf,x64\audio\sfx\RADIO_07_DANCE_01.rpf,x64\audio\sfx\RADIO_08_MEXICAN.rpf,x64\audio\sfx\RADIO_09_HIPHOP_OLD.rpf,x64\audio\sfx\RADIO_11_TALK_02.rpf,x64\audio\sfx\RADIO_12_REGGAE.rpf,x64\audio\sfx\RADIO_13_JAZZ.rpf,x64\audio\sfx\RADIO_14_DANCE_02.rpf,x64\audio\sfx\RADIO_15_MOTOWN.rpf,x64\audio\sfx\RADIO_16_SILVERLAKE.rpf,x64\audio\sfx\RADIO_17_FUNK.rpf,x64\audio\sfx\RADIO_18_90S_ROCK.rpf,x64\audio\sfx\RADIO_ADVERTS.rpf,x64\audio\sfx\RADIO_NEWS.rpf,x64\audio\sfx\RESIDENT.rpf,x64\audio\sfx\S_FULL_AMB_F.rpf,x64\audio\sfx\S_FULL_AMB_M.rpf,x64\audio\sfx\S_FULL_GAN.rpf,x64\audio\sfx\S_FULL_SER.rpf,x64\audio\sfx\S_MINI_AMB.rpf,x64\audio\sfx\S_MINI_GAN.rpf,x64\audio\sfx\S_MINI_SER.rpf,x64\audio\sfx\S_MISC.rpf,x64\audio\sfx\SCRIPT.rpf,x64\audio\sfx\SS_AC.rpf,x64\audio\sfx\SS_DC.rpf,x64\audio\sfx\SS_FF.rpf,x64\audio\sfx\SS_GM.rpf,x64\audio\sfx\SS_NP.rpf,x64\audio\sfx\SS_QR.rpf,x64\audio\sfx\SS_ST.rpf,x64\audio\sfx\SS_UZ.rpf,x64\audio\sfx\STREAMED_AMBIENCE.rpf,x64\audio\sfx\STREAMED_VEHICLES.rpf,x64\audio\sfx\STREAMED_VEHICLES_GRANULAR.rpf,x64\audio\sfx\STREAMED_VEHICLES_GRANULAR_NPC.rpf,x64\audio\sfx\STREAMED_VEHICLES_LOW_LATENCY.rpf,x64\audio\sfx\STREAMS.rpf,x64\audio\sfx\WEAPONS_PLAYER.rpf
- set rootDrive="%~d0"
- cls
- if !dbg!==1 (
- del /q GTAVMS_debug.bat > nul
- )
- Echo Initializing GTAV Mod Switcher...
- Echo.
- if not exist GTAVMS_debug.bat (
- Echo Creating debug script...
- Echo @Echo off > GTAVMS_debug.bat
- Echo setlocal enabledelayedexpansion >> GTAVMS_debug.bat
- Echo for /F "tokens=1,2 delims=#" %%%%A in ^('"prompt #$H#$E# & echo on & for %%%%B in (1) do rem"'^) do ^( >> GTAVMS_debug.bat
- Echo set "DEL=%%%%A" >> GTAVMS_debug.bat
- Echo ^) >> GTAVMS_debug.bat
- Echo color 8C >> GTAVMS_debug.bat
- Echo call :clr 8F " ***DEBUGGER*** " >> GTAVMS_debug.bat
- Echo Echo. >> GTAVMS_debug.bat
- Echo call :clr 89 "*COLLECTING DATA. Please wait...*" >> GTAVMS_debug.bat
- Echo call :clr 8F "----------" >> GTAVMS_debug.bat
- Echo call :clr 8C "Error log:" >> GTAVMS_debug.bat
- Echo call gtavms debug force ^>gtavms_debug_log.log >> GTAVMS_debug.bat
- Echo @Echo off >> GTAVMS_debug.bat
- Echo call :clr 8F "----------" >> GTAVMS_debug.bat
- Echo call :clr 8A "*DONE*" >> GTAVMS_debug.bat
- Echo pause ^> nul >> GTAVMS_debug.bat
- Echo exit >> GTAVMS_debug.bat
- Echo :clr >> GTAVMS_debug.bat
- Echo ^<nul ^> X set /p ".=." >> GTAVMS_debug.bat
- Echo set "param=^^%%^~2" ^^! >> GTAVMS_debug.bat
- Echo set "param=^!param:"=^\"^!" >> GTAVMS_debug.bat
- Echo findstr /p /A:%%1 "." "^!param^!\..\X" nul >> GTAVMS_debug.bat
- Echo ^<nul set /p ".=%%DEL%%%%DEL%%%%DEL%%%%DEL%%%%DEL%%%%DEL%%%%DEL%%" >> GTAVMS_debug.bat
- Echo del /q X ^> nul >> GTAVMS_debug.bat
- Echo Echo. >> GTAVMS_debug.bat
- Echo exit /b >> GTAVMS_debug.bat
- call :ColorMsg 8A " OK"
- Echo.
- )
- Echo Getting Windows version...
- for /f "tokens=2 delims==" %%A in ('wmic os get version /format:value') do (
- set osVersion=%%A
- )
- call :ColorMsg 8A " OK"
- Echo.
- Echo Getting PowerShell version...
- set n=0
- for /f "skip=3 tokens=2 delims=:" %%A in ('powershell -command "get-host"') do (
- set /a n=!n!+1
- set c=%%A
- if !n!==1 set PSVersion=!c!
- )
- set PSVersion=!PSVersion: =!
- call :ColorMsg 8A " OK"
- Echo.
- Echo Querying registry for GTAVMS version...
- reg query HKCU\Software\FoddEx\GTAVMS /v version > nul
- if !errorlevel!==1 (
- call :ColorMsg 8E " No entry. Adding..."
- set version=1.5.0
- reg add HKCU\Software\FoddEx\GTAVMS /f /v version /t REG_SZ /d "!version!" > nul
- call :ColorMsg 8A " OK"
- ) else (
- for /f "tokens=2* skip=2" %%A in ('reg query HKCU\Software\FoddEx\GTAVMS /v version') do (
- set version=%%B
- )
- call :ColorMsg 8A " OK"
- )
- Echo.
- Echo Setting title...
- title GTA V Mod Switcher [v!version!]
- call :ColorMsg 8A " OK"
- Echo.
- Echo Checking connection...
- ping wearegoth.altervista.org -n 1 -w 1000 > nul
- if !errorlevel!==1 (
- call :ColorMsg 8C " No connection."
- Echo.
- goto pre.cnt
- )
- call :ColorMsg 8A " OK"
- Echo.
- Echo Setting update server...
- set dlServer=http://wearegoth.altervista.com/kaspercoding/gtavms
- call :ColorMsg 8A " OK"
- Echo.
- Echo Checking temporary folder...
- if not exist "%TEMP%\gtavms" (
- call :ColorMsg 8E " Folder not found. Creating..."
- mkdir "%TEMP%\gtavms" > nul
- call :ColorMsg 8A " OK"
- ) else (
- if exist "%TEMP%\gtavms\switch.bat" (
- del /q "%TEMP%\gtavms\switch.bat" > nul
- )
- call :ColorMsg 8A " OK"
- )
- Echo.
- Echo Setting update storage path...
- set "dlPath=%TEMP%\gtavms"
- call :ColorMsg 8A " OK"
- Echo.
- Echo Checking Windows version...
- set useFastDownload=0
- for /f "tokens=1 delims=." %%A in ("!osVersion!") do (
- if %%A GEQ 10 (
- call :ColorMsg 8B " Windows 10 or higher detected. Using fast updating."
- set useFastDownload=1
- ) else (
- if %%B GTR 1 (
- call :ColorMsg 8B " Windows 8 or higher detected. Using fast updating."
- set useFastDownload=1
- ) else (
- call :ColorMsg 89 " Windows 7 or lower detected."
- Echo Checking PowerShell version...
- for /f "tokens=1 delims=." %%B in ("!PSVersion!") do (
- if %%B GEQ 3 (
- call :ColorMsg 8A " PowerShell version is !PSVersion!. Using fast updating."
- ) else (
- call :ColorMsg 8B " PowerShell version is !PSVersion!. Using normal updating."
- )
- )
- )
- )
- )
- Echo.
- Echo Getting online version details...
- if !useFastDownload!==1 (
- call :fastDownload ver
- ) else (
- Echo Downloading version file...
- bitsadmin /reset > nul
- bitsadmin /transfer "gtavms_version" "!dlServer!/ver.dat" "!dlPath!\ver.dat" > nul
- call :ColorMsg 8A " OK"
- )
- Echo Checking download...
- if not exist "!dlPath!\ver.dat" (
- call :ColorMsg 8C " FAILED"
- Echo.
- goto pre.cnt
- )
- call :ColorMsg 8A " OK"
- Echo Reading version data...
- for /f "tokens=2* delims==" %%A in (!dlPath!\ver.dat) do (
- set onlineVersion=%%A
- )
- call :ColorMsg 8A " OK"
- Echo Matching version data...
- del /q "!dlPath!\ver.dat" > nul
- for /f "tokens=1,2,3 delims=." %%A in ("!onlineVersion!") do (
- for /f "tokens=1,2,3 delims=." %%D in ("!version!") do (
- if %%A GTR %%D (
- call :ColorMsg 8A " Update available. Downloading..."
- goto update.dl
- )
- if %%B GTR %%E (
- call :ColorMsg 8A " Update available. Downloading..."
- goto update.dl
- )
- if %%C GTR %%F (
- call :ColorMsg 8A " Update available. Downloading..."
- goto update.dl
- )
- call :ColorMsg 8A " OK"
- Echo.
- )
- )
- goto pre.cnt
- :update.dl
- set updd=0
- if !useFastDownload!==1 (
- call :fastDownload main
- ) else (
- Echo Downloading GTAVMS...
- bitsadmin /transfer "gtavms" "!dlServer!/gtavms.bat" "!dlPath!\GTAVMS.bat" > nul
- call :ColorMsg 8A " OK"
- Echo Downloading switch...
- bitsadmin /transfer "gtavms_switch" "!dlServer!/switch.bat" "!dlPath!\switch.bat" > nul
- call :ColorMsg 8A " OK"
- )
- Echo Applying update...
- if !useFastDownload!==1 (
- Echo Resetting BITS jobs...
- bitsadmin /reset > nul
- call :ColorMsg 8A " OK"
- )
- Echo Changing current directory...
- cd "!dlPath!"
- call :ColorMsg 8A " OK"
- call :ColorMsg 89 " Running switcher..."
- call switch.bat "%~f0"
- :update.dl.continue
- del /q switch.bat > nul
- call :displayChg
- endlocal
- set updd=1
- goto restart
- :pre.cnt
- Echo Checking GTA5 process...
- tasklist /fi "IMAGENAME eq GTA5.exe" | find /i "GTA5.exe" > nul
- if !errorlevel!==0 (
- cls
- call :ColorMsg 8C "GTA V is running."
- Echo.
- Echo Modifying game files while the game is running
- Echo might affect game behavior and gameplay.
- Echo.
- Echo Press any key to continue.
- if !force!==0 pause > nul
- cls
- )
- call :ColorMsg 8A " OK"
- Echo.
- if not !search!==1 (
- Echo Querying registry for GTA path...
- reg query HKCU\Software\FoddEx\GTAVMS /v path > nul
- ) else (
- set errorlevel=1
- )
- if !errorlevel!==1 (
- cls
- Echo Locating Grand Theft Auto V installation. Please be patient...
- Echo NOTE: The duration may vary depending on the size of your
- Echo file system and number of disks.
- Echo.
- for /f "tokens=2 delims==" %%Z in ('wmic logicaldisk get name /value') do (
- Echo **%%Z**>tmp
- for /f %%C in (tmp) do (
- set disk=%%C
- set disk=!disk:~2,-3!
- Echo Searching !disk!\ drive...
- del /q tmp > nul
- for /f "tokens=*" %%A in ('dir "!disk!\GTA5.exe" /b /s 2^> nul') do (
- for /f "tokens=*" %%I in ("%%A") do (
- set pDrive=%%~dI
- set pPath=%%~pI
- Echo.
- call :ColorMsg 89 " GTA V.exe file: %%I"
- call :ColorMsg 89 " Disk: !pDrive!"
- call :ColorMsg 89 " Disk location: !pPath!"
- Echo.
- Echo Is this correct? Y/N
- if !force!==1 (
- Echo END
- endlocal
- exit /b
- )
- set /p conf=">> "
- if /i "!conf!"=="Y" (
- set gtaPath=!pDrive!!pPath!
- if exist "!gtaPath!" (
- reg add HKCU\Software\FoddEx\GTAVMS /f /v path /t REG_SZ /d "!gtaPath!" > nul
- if "%%~dI"=="!rootDrive!" (
- cd "%%~dpI"
- ) else (
- cd /d "%%~dpI"
- )
- cd..
- goto search.break
- ) else (
- call :ColorMsg 8C "An unknown error occurred."
- if !force!==0 pause > nul
- endlocal
- exit /b
- )
- )
- )
- )
- )
- call :ColorMsg 8C " Done. No result"
- Echo.
- )
- ) else (
- for /f "tokens=2* skip=2" %%A in ('reg query HKCU\Software\FoddEx\GTAVMS /v path') do (
- set gtaPath=%%B
- if exist "!gtaPath!" (
- for /f "tokens=*" %%C in ("!gtaPath!") do (
- if "!_drive!"=="!rootDrive!" (
- cd "%%C"
- ) else (
- cd /d "%%C"
- )
- cd..
- )
- call :ColorMsg 8A " OK"
- goto search.break
- )
- call :ColorMsg 8C "Registry value "HKCU\Software\FoddEx\GTAVMS\path" contains invalid data."
- Echo.
- goto manualPath
- )
- )
- :manualPath
- Echo Unable to locate Grand Theft Auto V on your computer.
- Echo Please enter the path manually.
- if !force!==1 (
- Echo END
- endlocal
- exit /b
- )
- set /p gtaPath="Path: "
- if not exist "!gtaPath!\GTA5.exe" (
- call :ColorMsg 8C "!gtaPath! is not a valid path."
- timeout /t 3 > nul
- cls
- goto manualPath
- ) else (
- reg add HKCU\Software\FoddEx\GTAVMS /f /v path /t REG_SZ /d "!gtaPath!" > nul
- goto search.break
- )
- :reset
- :search.break
- timeout /t 1 > nul
- set "curDir=%cd%"
- if not exist "Grand Theft Auto V\GTA5.exe" (
- cls
- call :ColorMsg 8C "An error occurred."
- if !dbg!==1 (
- Echo.
- Echo ERROR: GTA5.EXE not found in "%cd%"
- )
- Echo.
- Echo Press any key to run a new search.
- if !force!==0 pause > nul
- reg delete HKCU\Software\FoddEx\GTAVMS /v /f path > nul
- cls
- endlocal
- set search=1
- goto restart
- )
- set "gtaBin=Grand Theft Auto V"
- if not exist GTAVmodBin (
- mkdir GTAVmodBin
- )
- set modBin=GTAVmodBin
- :analyze
- set asiList=
- set ModAsiList=
- set dllList=
- set ModDllList=
- set txtList=
- set ModTxtList=
- set asiCount=0
- set ModAsiCount=0
- set dllCount=0
- set ModDllCount=0
- set txtCount=0
- set ModTxtCount=0
- cls
- Echo Analyzing Mods directory...
- for /f %%A in ('dir /b "!modBin!\*.asi" 2^> nul') do (
- set /a ModAsiCount=!ModAsiCount!+1
- set ModAsiList=!ModAsiList!,%%A
- )
- Echo Found !ModAsiCount! .asi files.
- Echo.
- for /f %%A in ('dir /b "!modBin!\*.dll" 2^> nul') do (
- set /a ModDllCount=!ModDllCount!+1
- set ModDllList=!ModDllList!,%%A
- )
- Echo Found !ModDllCount! .dll files.
- Echo.
- for /f %%A in ('dir /b "!modBin!\*.txt" 2^> nul') do (
- set /a ModTxtCount=!ModTxtCount!+1
- set ModTxtList=!ModTxtList!,%%A
- )
- for /f %%A in ('dir /b "!modBin!\*.ini" 2^> nul') do (
- set /a ModTxtCount=!ModTxtCount!+1
- set ModTxtList=!ModTxtList!,%%A
- )
- for /f %%A in ('dir /b "!modBin!\*.inf" 2^> nul') do (
- set /a ModTxtCount=!ModTxtCount!+1
- set ModTxtList=!ModTxtList!,%%A
- )
- for /f %%A in ('dir /b "!modBin!\*.cfg" 2^> nul') do (
- set /a ModTxtCount=!ModTxtCount!+1
- set ModTxtList=!ModTxtList!,%%A
- )
- Echo Found !ModTxtCount! mod related plain-text files.
- Echo.
- if exist !modBin!\scripts (
- Echo Found scripts folder for .NET mods.
- Echo.
- )
- Echo ----------
- Echo Analyzing GTA V directory...
- for /f %%A in ('dir /b "!gtaBin!\*.asi" 2^> nul') do (
- set /a asiCount=!asiCount!+1
- set asiList=!asiList!,%%A
- )
- Echo Found !asiCount! .asi files.
- Echo.
- for /f %%A in ('dir /b "!gtaBin!\*.dll" 2^> nul') do (
- if not %%A==bink2w64.dll (
- if not %%A==d3dcompiler_46.dll (
- if not %%A==GFSDK_ShadowLib.win64.dll (
- if not %%A==GFSDK_TXAA.win64.dll (
- if not %%A==GFSDK_TXAA_AlphaResolve.win64.dll (
- if not %%A==steam_api64.dll (
- if not %%A==d3dcsx_46.dll (
- set /a dllCount=!dllCount!+1
- set dllList=!dllList!,%%A
- )
- )
- )
- )
- )
- )
- )
- )
- Echo Found !dllCount! non standard .dll files.
- Echo.
- for /f %%A in ('dir /b "!gtaBin!\*.txt" 2^> nul') do (
- set /a txtCount=!txtCount!+1
- set txtList=!txtList!,%%A
- )
- for /f %%A in ('dir /b "!gtaBin!\*.ini" 2^> nul') do (
- set /a txtCount=!txtCount!+1
- set txtList=!txtList!,%%A
- )
- for /f %%A in ('dir /b "!gtaBin!\*.inf" 2^> nul') do (
- set /a txtCount=!txtCount!+1
- set txtList=!txtList!,%%A
- )
- for /f %%A in ('dir /b "!gtaBin!\*.cfg" 2^> nul') do (
- set /a txtCount=!txtCount!+1
- set txtList=!txtList!,%%A
- )
- Echo Found !txtCount! mod related plain-text files.
- Echo.
- if exist !gtaBin!\scripts (
- Echo Found scripts folder for .NET mods.
- Echo.
- )
- Echo.
- Echo Done.
- timeout /t 2 > nul
- goto main
- :main
- set modActive=0
- set modInactive=0
- cls
- call :ColorMsg 89 "Active mods:"
- if exist !gtaBin!\NativeTrainer.asi (
- call :ColorMsg 8A " -Native Trainer"
- Echo.
- set modActive=1
- )
- if exist !gtaBin!\ScriptHookV.dll (
- call :ColorMsg 8A " -Script Hook V"
- Echo.
- set modActive=1
- )
- if exist !gtaBin!\OpenIV.asi (
- call :ColorMsg 8A " -OpenIV ASI Loader"
- Echo.
- set modActive=1
- )
- if exist !gtaBin!\ScriptHookVDotNet.asi (
- set modActive=1
- if exist !gtaBin!\ScriptHookVDotNet.dll (
- call :ColorMsg 8A " -Script Hook V .NET"
- Echo.
- ) else (
- call :ColorMsg 8E " -Script Hook V .NET [Partial]"
- Echo.
- )
- ) else (
- if exist !gtaBin!\ScriptHookVDotNet.dll (
- set modActive=1
- call :ColorMsg 8E " -Script Hook V .NET [Partial]"
- Echo.
- )
- )
- if exist !gtaBin!\dinput8.dll (
- call :ColorMsg 8A " -ASI Loader dinput8.dll"
- Echo.
- set modActive=1
- )
- if !asiCount! GTR 1 (
- set modActive=1
- Echo -One or more unknown mod scripts/DLLs:
- for /f %%A in ('dir /b "!gtaBin!\*.asi" 2^> nul') do (
- if not %%A==NativeTrainer.asi (
- if not %%A==ScriptHookVDotNet.asi (
- if not %%A==OpenIV.asi (
- call :ColorMsg 8A " -%%A"
- Echo.
- )
- )
- )
- )
- for /f %%A in ('dir /b "!gtaBin!\*.dll" 2^> nul') do (
- if not %%A==bink2w64.dll (
- if not %%A==d3dcompiler_46.dll (
- if not %%A==GFSDK_ShadowLib.win64.dll (
- if not %%A==GFSDK_TXAA.win64.dll (
- if not %%A==GFSDK_TXAA_AlphaResolve.win64.dll (
- if not %%A==steam_api64.dll (
- if not %%A==d3dcsx_46.dll (
- if not %%A==ScriptHookVDotNet.dll (
- if not %%A==ScriptHookV.dll (
- if not %%A==dinput8.dll (
- call :ColorMsg 8A " -%%A"
- Echo.
- )
- )
- )
- )
- )
- )
- )
- )
- )
- )
- )
- )
- if exist !gtaBin!\scripts (
- set modActive=1
- if !asiCount! LSS 2 (
- Echo -One or more unknown mod scripts/DLLs:
- Echo -Script folder for .NET based mods:
- for /f %%A in ('dir /b "!gtaBin!\scripts\*.asi" 2^> nul') do (
- call :ColorMsg 8A " -%%A"
- Echo.
- )
- for /f %%A in ('dir /b "!gtaBin!\scripts\*.dll" 2^> nul') do (
- call :ColorMsg 8A " -%%A"
- Echo.
- )
- ) else (
- Echo -Script folder for .NET based mods:
- for /f %%A in ('dir /b "!gtaBin!\scripts\*.asi" 2^> nul') do (
- call :ColorMsg 8A " -%%A"
- Echo.
- )
- for /f %%A in ('dir /b "!gtaBin!\scripts\*.dll" 2^> nul') do (
- call :ColorMsg 8A " -%%A"
- Echo.
- )
- )
- )
- if !modActive!==0 (
- call :ColorMsg 8B " None."
- )
- Echo.
- Echo ----------
- call :ColorMsg 89 "Inactive mods:"
- if exist !modBin!\NativeTrainer.asi (
- call :ColorMsg 8E " -Native Trainer"
- Echo.
- set modInactive=1
- )
- if exist !modBin!\ScriptHookV.dll (
- call :ColorMsg 8E " -Script Hook V"
- Echo.
- set modInactive=1
- )
- if exist !modBin!\OpenIV.asi (
- call :ColorMsg 8E " -OpenIV ASI Loader"
- Echo.
- set modInactive=1
- )
- if exist !modBin!\ScriptHookVDotNet.asi (
- set modInactive=1
- if exist !modBin!\ScriptHookVDotNet.dll (
- call :ColorMsg 8E " -Script Hook V .NET"
- Echo.
- ) else (
- call :ColorMsg 8B " -Script Hook V .NET [Partial]"
- Echo.
- )
- ) else (
- if exist !modBin!\ScriptHookVDotNet.dll (
- set modInactive=1
- call :ColorMsg 8B " -Script Hook V .NET [Partial]"
- Echo.
- )
- )
- if exist !modBin!\dinput8.dll (
- call :ColorMsg 8E " -ASI Loader dinput8.dll"
- Echo.
- set modInactive=1
- )
- if !ModAsiCount! GTR 1 (
- set modInactive=1
- Echo -One or more unknown mod scripts/DLLs:
- for /f %%A in ('dir /b "!modBin!\*.asi" 2^> nul') do (
- if not %%A==NativeTrainer.asi (
- if not %%A==ScriptHookVDotNet.asi (
- if not %%A==OpenIV.asi (
- call :ColorMsg 8E " -%%A"
- Echo.
- )
- )
- )
- )
- for /f %%A in ('dir /b "!modBin!\*.dll" 2^> nul') do (
- if not %%A==ScriptHookVDotNet.dll (
- if not %%A==ScriptHookV.dll (
- if not %%A==dinput8.dll (
- call :ColorMsg 8E " -%%A"
- Echo.
- )
- )
- )
- )
- )
- if exist !modBin!\scripts (
- set modInactive=1
- if !ModAsiCount! LSS 2 (
- Echo -One or more unknown mod scripts:
- Echo -Script folder for .NET based mods:
- for /f %%A in ('dir /b "!modBin!\scripts\*.asi" 2^> nul') do (
- call :ColorMsg 8E " -%%A"
- Echo.
- )
- for /f %%A in ('dir /b "!modBin!\scripts\*.dll" 2^> nul') do (
- call :ColorMsg 8E " -%%A"
- Echo.
- )
- ) else (
- Echo -Script folder for .NET based mods:
- for /f %%A in ('dir /b "!modBin!\scripts\*.asi" 2^> nul') do (
- call :ColorMsg 8E " -%%A"
- Echo.
- )
- for /f %%A in ('dir /b "!modBin!\scripts\*.dll" 2^> nul') do (
- call :ColorMsg 8E " -%%A"
- Echo.
- )
- )
- )
- if !modInactive!==0 (
- call :ColorMsg 8B " None."
- )
- Echo.
- Echo ----------
- if !single!==0 (
- if not !modInactive!==0 (
- call :ColorMsg 8A "Press 1 to enable all inactive mods."
- )
- if not !modActive!==0 (
- call :ColorMsg 8E "Press 2 to disable all active mods."
- )
- set actionPrompt=
- ) else (
- set actionPrompt=Disable/Enable mod
- )
- if !single!==0 (
- call :ColorMsg 8B "Press Z for single-mode"
- ) else (
- call :ColorMsg 8B "Press Z for multi-mode"
- )
- Echo Press X to exit
- if !force!==1 (
- Echo END
- endlocal
- exit /b
- )
- set /p action="!actionPrompt!>> "
- if !single!==1 (
- if /i not !action!==Z (
- if /i not !action!==X (
- call :CheckMod !action!
- )
- )
- ) else (
- if !action!==1 (
- if !modInactive! NEQ 0 (
- goto enable
- )
- )
- if !action!==2 (
- if !modActive! NEQ 0 (
- goto disable
- )
- )
- )
- if /i !action!==X (
- goto end
- )
- if /i !action!==Z (
- if !single!==0 (
- set single=1
- ) else (
- set single=0
- )
- )
- goto main
- :disable
- cls
- Echo Disabling mods...
- Echo .ASI files...
- for %%A in (!asiList!) do (
- move "!curDir!\!gtaBin!\%%A" "!curDir!\!modBin!" > nul
- if not exist "!curDir!\!modBin!\%%A" (
- call :ColorMsg 8C " ERROR: %%A could not be disabled."
- Echo Press any key to continue...
- pause > nul
- ) else (
- call :ColorMsg 8E " Disabled %%A"
- )
- )
- Echo.
- Echo .DLL files...
- for %%A in (!dllList!) do (
- move "!curDir!\!gtaBin!\%%A" "!curDir!\!modBin!" > nul
- call :ColorMsg 8E " Disabled %%A"
- )
- Echo.
- Echo Configuration/documentation files [.TXT, .INI, .CFG, .INF]...
- for %%A in (!txtList!) do (
- move "!curDir!\!gtaBin!\%%A" "!curDir!\!modBin!" > nul
- if not exist "!curDir!\!modBin!\%%A" (
- call :ColorMsg 8C " ERROR: %%A could not be disabled."
- Echo Press any key to continue...
- pause > nul
- ) else (
- call :ColorMsg 8E " Disabled %%A"
- )
- )
- Echo.
- if exist !gtaBin!\scripts (
- Echo .NET based scripts [scripts folder]...
- move "!curDir!\!gtaBin!\scripts" "!curDir!\!modBin!" > nul
- if not exist "!curDir!\!modBin!\scripts" (
- call :ColorMsg 8C " ERROR: .NET based scripts could not be disabled."
- Echo Press any key to continue...
- pause > nul
- ) else (
- call :ColorMsg 8E " Disabled .NET based scripts."
- )
- )
- Echo.
- timeout /t 2 > nul
- goto reset
- :enable
- cls
- for /f %%A in ('dir /b "!modBin!\*.*" 2^> nul') do (
- goto enable.cnt
- )
- call :ColorMsg 8C "No mods to enable."
- timeout /t 2 > nul
- goto reset
- :enable.cnt
- cls
- Echo Enabling mods...
- if exist !modBin!\*.asi (
- Echo .ASI files...
- for /f %%A in ('dir /b "!modBin!\*.asi" 2^> nul') do (
- move "!curDir!\!modBin!\%%A" "!curDir!\!gtaBin!" > nul
- if not exist "!curDir!\!gtaBin!\%%A" (
- call :ColorMsg 8C " ERROR: %%A could not be enabled."
- Echo Press any key to continue...
- pause > nul
- ) else (
- call :ColorMsg 8A " Enabled %%A"
- )
- )
- Echo.
- )
- if exist !modBin!\*.dll (
- Echo .DLL files...
- for /f %%A in ('dir /b "!modBin!\*.dll" 2^> nul') do (
- move "!curDir!\!modBin!\%%A" "!curDir!\!gtaBin!" > nul
- if not exist "!curDir!\!gtaBin!\%%A" (
- call :ColorMsg 8C " ERROR: %%A could not be enabled."
- Echo Press any key to continue...
- pause > nul
- ) else (
- call :ColorMsg 8A " Enabled %%A"
- )
- )
- Echo.
- )
- if exist !modBin!\*.txt (
- Echo Configuration/documentation files: .TXT
- for /f %%A in ('dir /b "!modBin!\*.txt" 2^> nul') do (
- move "!curDir!\!modBin!\%%A" "!curDir!\!gtaBin!" > nul
- if not exist "!curDir!\!gtaBin!\%%A" (
- call :ColorMsg 8C " ERROR: %%A could not be enabled."
- Echo Press any key to continue...
- pause > nul
- ) else (
- call :ColorMsg 8A " Enabled %%A"
- )
- )
- Echo.
- )
- if exist !modBin!\*.ini (
- Echo Configuration/documentation files: .INI
- for /f %%A in ('dir /b "!modBin!\*.ini" 2^> nul') do (
- move "!curDir!\!modBin!\%%A" "!curDir!\!gtaBin!" > nul
- if not exist "!curDir!\!gtaBin!\%%A" (
- call :ColorMsg 8C " ERROR: %%A could not be enabled."
- Echo Press any key to continue...
- pause > nul
- ) else (
- call :ColorMsg 8A " Enabled %%A"
- )
- )
- Echo.
- )
- if exist !modBin!\*.inf (
- Echo Configuration/documentation files: .INF
- for /f %%A in ('dir /b "!modBin!\*.inf" 2^> nul') do (
- move "!curDir!\!modBin!\%%A" "!curDir!\!gtaBin!" > nul
- if not exist "!curDir!\!gtaBin!\%%A" (
- call :ColorMsg 8C " ERROR: %%A could not be enabled."
- Echo Press any key to continue...
- pause > nul
- ) else (
- call :ColorMsg 8A " Enabled %%A"
- )
- )
- Echo.
- )
- if exist !modBin!\*.cfg (
- Echo Configuration/documentation files: .CFG
- for /f %%A in ('dir /b "!modBin!\*.cfg" 2^> nul') do (
- move "!curDir!\!modBin!\%%A" "!curDir!\!gtaBin!" > nul
- if not exist "!curDir!\!gtaBin!\%%A" (
- call :ColorMsg 8C " ERROR: %%A could not be enabled."
- Echo Press any key to continue...
- pause > nul
- ) else (
- call :ColorMsg 8A " Enabled %%A"
- )
- )
- Echo.
- )
- if exist !modBin!\scripts (
- Echo .NET based scripts [scripts folder]...
- move "!curDir!\!modBin!\scripts" "!curDir!\!gtaBin!" > nul
- if not exist "!curDir!\!gtaBin!\scripts" (
- call :ColorMsg 8C " ERROR: .NET based scripts could not be enabled."
- Echo Press any key to continue...
- pause > nul
- ) else (
- call :ColorMsg 8A " Enabled .NET based scripts."
- )
- )
- Echo.
- timeout /t 2 > nul
- goto reset
- :end
- endlocal
- if !dbg!==1 (
- exit /b
- )
- exit
- :: SUBROUTINES
- :displayChg
- cls
- Echo Features and changes
- Echo.
- call :ColorMsg 8A "v!onlineVersion! [CURRENT]"
- Echo - Removed unnecessary labels
- Echo - Added Single Mode
- Echo * Allows the user to enable/disable a chosen mod instead
- Echo of all mods
- Echo * Added game file protection [so you don't break anything]
- Echo - Various optimizations
- Echo - Fixed parts of the updater not displaying colored text
- Echo - Known issues:
- Echo * When disabling a .NET based script using Single Mode, it can't
- Echo be re-enabled with the mod switcher, but instead enabled manually.
- Echo * The debugger does not output text.
- Echo * Mods enabled or disabled with Single Mode does not refresh in the
- Echo action menu. A program restart is required for changes to be seen.
- Echo.
- Echo Press any key to continue.
- pause > nul
- goto :eof
- Echo.
- Echo v1.4.4
- Echo - Fixed various bugs related to Windows 10
- Echo * Fixed bug where the program detected Windows 8 instead
- Echo of Windows 10.
- Echo * Fixed bug where the OS version would be misinterpreted
- Echo in Windows 10 versions.
- Echo * Fixed title being set to "Windows PowerShell"
- Echo - Added error messages to mod enabling and disabling process
- Echo - Added a small timeout during loading
- Echo.
- Echo v1.4.3
- Echo - Improved debugging
- Echo - Fixed a bug that caused the debugger to mess up the display
- Echo - Fixed a bug where the program looked for the game file in the
- Echo wrong directory, causing errors and mods staying enabled/disabled.
- Echo.
- Echo v1.4.2
- Echo - Fixed bug where some colored texts would output "FINDSTR: Cannot open..."
- Echo - Fixed issues involving newlines on colored text.
- Echo.
- Echo v1.4.1
- Echo - Added color coded messages for easier readability.
- Echo NOTE: Debugger still works, but cannot output understandable text
- ECHO as of now.
- Echo.
- Echo v1.4.0
- Echo - Added custom prompt to the debugger. The log should now be easier
- Echo to read.
- Echo - Improved debugging.
- Echo - Errors now display properly in the debugger
- Echo - Fixed bug that caused the program to crash after installing
- Echo an update.
- Echo - Added PowerShell version check, allowing for faster downloading
- Echo even on Windows 7 and earlier. In order for the fast download
- Echo function to work, you need PowerShell v3.0 or newer.
- Echo.
- Echo v1.3.11
- Echo - Added some more details to the search function.
- Echo - Small under-the-hood changes
- Echo.
- Echo v1.3.10
- Echo - Improved search function. The user can now continue the search if
- Echo the location is incorrect.
- Echo - Reorganized the changelog.
- Echo - Added some more pause prompts.
- Echo - Removed some characters in the code that was affecting program
- Echo behaviour.
- Echo.
- Echo v1.3.9
- Echo - Added mode details to the initialization process.
- Echo - Fixed bug that caused the progaram not to catch an invalid path.
- Echo.
- Echo v1.3.8
- Echo - Optimized the program for computers with Windows 8 or newer. The progam is
- Echo now utilizing PowerShell to download updates instead of BITS. (BETA^)
- Echo - Fixed bug that caused the program to crash when the path to GTA V
- Echo contained the characters "(" or ")".
- Echo - Removed an unnecessary line that was causing errors.
- Echo - Added automatic changelog display (this screen).
- Echo - Added debugging mode. To run in debug mode, run GTAVMS_debug.bat.
- Echo.
- Echo.
- Echo Press any key to continue...
- if !force!==0 pause > nul
- goto :eof
- :fastDownload
- if %1==ver (
- Echo Downloading version file...
- powershell -Command "& {$host.ui.RawUI.WindowTitle='GTA V Mod Switcher [v!version!]'; Invoke-WebRequest "!dlServer!/ver.dat" -OutFile "!dlPath!\ver.dat";}" > nul
- call :ColorMsg 8A " OK"
- )
- if %1==main (
- Echo Downloading GTAVMS...
- powershell -Command "& {$host.ui.RawUI.WindowTitle='GTA V Mod Switcher [v!version!]'; Invoke-WebRequest "!dlServer!/gtavms.bat" -OutFile "!dlPath!\GTAVMS.bat";}" > nul
- call :ColorMsg 8A " OK"
- Echo Downloading switch...
- powershell -Command "& {$host.ui.RawUI.WindowTitle='GTA V Mod Switcher [v!version!]'; Invoke-WebRequest "!dlServer!/switch.bat" -OutFile "!dlPath!\switch.bat";}" > nul
- call :ColorMsg 8A " OK"
- )
- goto :eof
- :ColorMsg
- <nul > X set /p ".=."
- set "param=^%~2" !
- set "param=!param:"=\"!"
- findstr /p /A:%1 "." "!param!\..\X" nul
- <nul set /p ".=%DEL%%DEL%%DEL%%DEL%%DEL%%DEL%%DEL%"
- del /q X > nul
- Echo.
- exit /b
- :CheckMod
- set arg=%1
- if not exist "!curDir!\!gtaBin!\!arg!" (
- if not exist "!modBin!\!arg!" (
- Echo.
- call :ColorMsg 8C "No mod file called !arg!"
- timeout /t 2 > nul
- goto menu
- ) else (
- call :enableSingle !arg!
- )
- ) else (
- call :disableSingle !arg!
- )
- goto :eof
- :enableSingle
- set arg=%1
- move "!curDir!\!modBin!\!arg!" "!curDir!\!gtaBin!" > nul
- if not exist "!curDir!\!gtaBin!\!arg!" (
- call :ColorMsg 8C " ERROR: !arg! could not be enabled."
- Echo Press any key to continue...
- pause > nul
- goto menu
- ) else (
- call :ColorMsg 8A " Enabled !arg!"
- )
- timeout /t 2 > nul
- goto reset
- :disableSingle
- set arg=%1
- call :ProtectionTable !arg!
- if !break!==1 goto reset
- move "!curDir!\!gtaBin!\!arg!" "!curDir!\!modBin!" > nul
- if not exist "!curDir!\!modBin!\!arg!" (
- call :ColorMsg 8C " ERROR: !arg! could not be disabled."
- Echo Press any key to continue...
- pause > nul
- goto menu
- ) else (
- call :ColorMsg 8E " Disabled !arg!"
- )
- timeout /t 2 > nul
- goto reset
- :ProtectionTable
- set arg=%1
- for %%X in (!protected!) do (
- if /i !arg!==%%X (
- call :ColorMsg 8C "ERROR: !arg! could not be disabled due to game integrity protection"
- Echo.
- Echo Press any key to continue.
- pause > nul
- set break=1
- )
- )
- goto :eof
Add Comment
Please, Sign In to add comment