FoddEx

GTA V Mod Switcher v1.5

Jul 7th, 2015
496
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 33.27 KB | None | 0 0
  1. :restart
  2.  
  3.  
  4. ::  ******************************************************
  5. ::  *          GRAND THEFT AUTO V  MOD SWITCHER          *
  6. ::  *                         By                         *
  7. ::  *                      RainBawZ                      *
  8. ::  *                SocialClub: kukpappa                *              
  9. ::  ******************************************************
  10.  
  11.  
  12.     setlocal enabledelayedexpansion
  13.     mode con cols=100 lines=50
  14.     set curfile=gtavms.bat
  15.     set dbg=0
  16.     set force=0
  17.     set single=0
  18.     set break=0
  19.     if /i "%1"=="debug" (
  20.         @Echo on
  21.         set dbg=1
  22.         prompt GTAVMS CODE EXECUTION$S$G$G$S
  23.         if /i "%2"=="force" (
  24.             set force=1
  25.         )
  26.     ) else (
  27.         @Echo off
  28.     )
  29.     if /i "%1"=="force" (
  30.         set force=1
  31.     )
  32.     if /i "%1"=="cnt" (
  33.         if !updd!==0 (
  34.             goto update.dl.continue
  35.         )
  36.     )
  37.     title GTA V Mod Switcher [v!version!]
  38.     color 8F
  39.     for /F "tokens=1,2 delims=#" %%A in ('"prompt #$H#$E# & echo on & for %%B in (1) do rem"') do (
  40.         set "DEL=%%A"
  41.     )
  42.     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
  43.     set rootDrive="%~d0"
  44.     cls
  45.     if !dbg!==1 (
  46.         del /q GTAVMS_debug.bat > nul
  47.     )
  48.     Echo Initializing GTAV Mod Switcher...
  49.     Echo.
  50.     if not exist GTAVMS_debug.bat (
  51.         Echo     Creating debug script...
  52.         Echo @Echo off > GTAVMS_debug.bat
  53.         Echo setlocal enabledelayedexpansion >> GTAVMS_debug.bat
  54.         Echo for /F "tokens=1,2 delims=#" %%%%A in ^('"prompt #$H#$E# & echo on & for %%%%B in (1) do rem"'^) do ^( >> GTAVMS_debug.bat
  55.         Echo     set "DEL=%%%%A" >> GTAVMS_debug.bat
  56.         Echo ^) >> GTAVMS_debug.bat
  57.         Echo color 8C >> GTAVMS_debug.bat
  58.         Echo call :clr 8F " ***DEBUGGER*** " >> GTAVMS_debug.bat
  59.         Echo Echo. >> GTAVMS_debug.bat
  60.         Echo call :clr 89 "*COLLECTING DATA. Please wait...*" >> GTAVMS_debug.bat
  61.         Echo call :clr 8F "----------" >> GTAVMS_debug.bat
  62.         Echo call :clr 8C "Error log:" >> GTAVMS_debug.bat
  63.         Echo call gtavms debug force ^>gtavms_debug_log.log >> GTAVMS_debug.bat
  64.         Echo @Echo off >> GTAVMS_debug.bat
  65.         Echo call :clr 8F "----------" >> GTAVMS_debug.bat
  66.         Echo call :clr 8A "*DONE*" >> GTAVMS_debug.bat
  67.         Echo pause ^> nul >> GTAVMS_debug.bat
  68.         Echo exit >> GTAVMS_debug.bat
  69.         Echo :clr >> GTAVMS_debug.bat
  70.         Echo ^<nul ^> X set /p ".=." >> GTAVMS_debug.bat
  71.         Echo set "param=^^%%^~2" ^^! >> GTAVMS_debug.bat
  72.         Echo set "param=^!param:"=^\"^!" >> GTAVMS_debug.bat
  73.         Echo findstr /p /A:%%1 "." "^!param^!\..\X" nul >> GTAVMS_debug.bat
  74.         Echo ^<nul set /p ".=%%DEL%%%%DEL%%%%DEL%%%%DEL%%%%DEL%%%%DEL%%%%DEL%%" >> GTAVMS_debug.bat
  75.         Echo del /q X ^> nul >> GTAVMS_debug.bat
  76.         Echo Echo. >> GTAVMS_debug.bat
  77.         Echo exit /b >> GTAVMS_debug.bat
  78.         call :ColorMsg 8A "        OK"
  79.         Echo.      
  80.     )
  81.     Echo     Getting Windows version...
  82.     for /f "tokens=2 delims==" %%A in ('wmic os get version /format:value') do (
  83.         set osVersion=%%A
  84.     )
  85.     call :ColorMsg 8A "        OK"
  86.     Echo.
  87.     Echo     Getting PowerShell version...
  88.     set n=0
  89.     for /f "skip=3 tokens=2 delims=:" %%A in ('powershell -command "get-host"') do (
  90.         set /a n=!n!+1
  91.         set c=%%A
  92.         if !n!==1 set PSVersion=!c!
  93.     )
  94.     set PSVersion=!PSVersion: =!
  95.     call :ColorMsg 8A "        OK"
  96.     Echo.
  97.     Echo     Querying registry for GTAVMS version...
  98.     reg query HKCU\Software\FoddEx\GTAVMS /v version > nul
  99.     if !errorlevel!==1 (
  100.         call :ColorMsg 8E "        No entry. Adding..."
  101.         set version=1.5.0
  102.         reg add HKCU\Software\FoddEx\GTAVMS /f /v version /t REG_SZ /d "!version!" > nul
  103.         call :ColorMsg 8A "             OK"
  104.     ) else (
  105.         for /f "tokens=2* skip=2" %%A in ('reg query HKCU\Software\FoddEx\GTAVMS /v version') do (
  106.             set version=%%B
  107.         )
  108.         call :ColorMsg 8A "        OK"
  109.     )
  110.     Echo.
  111.     Echo     Setting title...
  112.     title GTA V Mod Switcher [v!version!]
  113.     call :ColorMsg 8A "        OK"
  114.     Echo.
  115.     Echo     Checking connection...
  116.     ping wearegoth.altervista.org -n 1 -w 1000 > nul
  117.     if !errorlevel!==1 (
  118.         call :ColorMsg 8C "        No connection."
  119.         Echo.
  120.         goto pre.cnt
  121.     )
  122.     call :ColorMsg 8A "        OK"
  123.     Echo.
  124.     Echo     Setting update server...
  125.     set dlServer=http://wearegoth.altervista.com/kaspercoding/gtavms
  126.     call :ColorMsg 8A "        OK"
  127.     Echo.
  128.     Echo     Checking temporary folder...
  129.     if not exist "%TEMP%\gtavms" (
  130.         call :ColorMsg 8E "        Folder not found. Creating..."
  131.         mkdir "%TEMP%\gtavms" > nul
  132.         call :ColorMsg 8A "            OK"
  133.     ) else (
  134.         if exist "%TEMP%\gtavms\switch.bat" (
  135.             del /q "%TEMP%\gtavms\switch.bat" > nul
  136.         )
  137.         call :ColorMsg 8A "        OK"
  138.     )
  139.     Echo.
  140.     Echo     Setting update storage path...
  141.     set "dlPath=%TEMP%\gtavms"
  142.     call :ColorMsg 8A "        OK"
  143.     Echo.
  144.     Echo     Checking Windows version...
  145.     set useFastDownload=0
  146.     for /f "tokens=1 delims=." %%A in ("!osVersion!") do (
  147.         if %%A GEQ 10 (
  148.             call :ColorMsg 8B "        Windows 10 or higher detected. Using fast updating."
  149.             set useFastDownload=1
  150.         ) else (
  151.             if %%B GTR 1 (
  152.                 call :ColorMsg 8B "        Windows 8 or higher detected. Using fast updating."
  153.                 set useFastDownload=1
  154.             ) else (
  155.                 call :ColorMsg 89 "        Windows 7 or lower detected."
  156.                 Echo         Checking PowerShell version...
  157.                 for /f "tokens=1 delims=." %%B in ("!PSVersion!") do (
  158.                     if %%B GEQ 3 (
  159.                         call :ColorMsg 8A "            PowerShell version is !PSVersion!. Using fast updating."
  160.                     ) else (
  161.                         call :ColorMsg 8B "            PowerShell version is !PSVersion!. Using normal updating."
  162.                     )
  163.                 )
  164.             )
  165.         )
  166.     )
  167.     Echo.
  168.     Echo     Getting online version details...
  169.     if !useFastDownload!==1 (
  170.         call :fastDownload ver
  171.     ) else (
  172.         Echo         Downloading version file...
  173.         bitsadmin /reset > nul
  174.         bitsadmin /transfer "gtavms_version" "!dlServer!/ver.dat" "!dlPath!\ver.dat" > nul
  175.         call :ColorMsg 8A "            OK"
  176.     )
  177.     Echo         Checking download...
  178.     if not exist "!dlPath!\ver.dat" (
  179.         call :ColorMsg 8C "            FAILED"
  180.         Echo.
  181.         goto pre.cnt
  182.     )
  183.     call :ColorMsg 8A "            OK"
  184.     Echo         Reading version data...
  185.     for /f "tokens=2* delims==" %%A in (!dlPath!\ver.dat) do (
  186.         set onlineVersion=%%A
  187.     )
  188.     call :ColorMsg 8A "            OK"
  189.     Echo         Matching version data...
  190.     del /q "!dlPath!\ver.dat" > nul
  191.     for /f "tokens=1,2,3 delims=." %%A in ("!onlineVersion!") do (
  192.         for /f "tokens=1,2,3 delims=." %%D in ("!version!") do (
  193.             if %%A GTR %%D (
  194.                 call :ColorMsg 8A "            Update available. Downloading..."
  195.                 goto update.dl
  196.             )
  197.             if %%B GTR %%E (
  198.                 call :ColorMsg 8A "            Update available. Downloading..."
  199.                 goto update.dl
  200.             )
  201.             if %%C GTR %%F (
  202.                 call :ColorMsg 8A "            Update available. Downloading..."
  203.                 goto update.dl
  204.             )
  205.             call :ColorMsg 8A "            OK"
  206.             Echo.
  207.         )
  208.     )
  209.     goto pre.cnt
  210.    
  211. :update.dl
  212.     set updd=0
  213.     if !useFastDownload!==1 (
  214.         call :fastDownload main
  215.     ) else (
  216.         Echo                 Downloading GTAVMS...
  217.         bitsadmin /transfer "gtavms" "!dlServer!/gtavms.bat" "!dlPath!\GTAVMS.bat" > nul
  218.         call :ColorMsg 8A "                    OK"
  219.         Echo                 Downloading switch...
  220.         bitsadmin /transfer "gtavms_switch" "!dlServer!/switch.bat" "!dlPath!\switch.bat" > nul
  221.         call :ColorMsg 8A "                    OK"
  222.     )
  223.     Echo                 Applying update...
  224.     if !useFastDownload!==1 (
  225.         Echo                     Resetting BITS jobs...
  226.         bitsadmin /reset > nul
  227.         call :ColorMsg 8A "                        OK"
  228.     )
  229.     Echo                     Changing current directory...
  230.     cd "!dlPath!"
  231.     call :ColorMsg 8A "                        OK"
  232.     call :ColorMsg 89 "                    Running switcher..."
  233.     call switch.bat "%~f0"
  234.  
  235. :update.dl.continue
  236.     del /q switch.bat > nul
  237.     call :displayChg
  238.     endlocal
  239.     set updd=1
  240.     goto restart
  241.    
  242. :pre.cnt
  243.     Echo     Checking GTA5 process...
  244.     tasklist /fi "IMAGENAME eq GTA5.exe" | find /i "GTA5.exe" > nul
  245.     if !errorlevel!==0 (
  246.         cls
  247.         call :ColorMsg 8C "GTA V is running."
  248.         Echo.
  249.         Echo Modifying game files while the game is running
  250.         Echo might affect game behavior and gameplay.
  251.         Echo.
  252.         Echo Press any key to continue.
  253.         if !force!==0 pause > nul
  254.         cls
  255.     )
  256.     call :ColorMsg 8A "        OK"
  257.     Echo.
  258.     if not !search!==1 (
  259.         Echo     Querying registry for GTA path...
  260.         reg query HKCU\Software\FoddEx\GTAVMS /v path > nul
  261.     ) else (
  262.         set errorlevel=1
  263.     )
  264.     if !errorlevel!==1 (
  265.         cls
  266.         Echo Locating Grand Theft Auto V installation. Please be patient...
  267.         Echo NOTE: The duration may vary depending on the size of your
  268.         Echo file system and number of disks.
  269.         Echo.
  270.         for /f "tokens=2 delims==" %%Z in ('wmic logicaldisk get name /value') do (
  271.             Echo **%%Z**>tmp
  272.             for /f %%C in (tmp) do (
  273.                 set disk=%%C
  274.                 set disk=!disk:~2,-3!
  275.                 Echo Searching !disk!\ drive...
  276.                 del /q tmp > nul
  277.                 for /f "tokens=*" %%A in ('dir "!disk!\GTA5.exe" /b /s 2^> nul') do (
  278.                     for /f "tokens=*" %%I in ("%%A") do (
  279.                         set pDrive=%%~dI
  280.                         set pPath=%%~pI
  281.                         Echo.
  282.                         call :ColorMsg 89 "    GTA V.exe file:   %%I"
  283.                         call :ColorMsg 89 "    Disk:              !pDrive!"
  284.                         call :ColorMsg 89 "    Disk location:     !pPath!"
  285.                         Echo.
  286.                         Echo Is this correct? Y/N
  287.                         if !force!==1 (
  288.                             Echo END
  289.                             endlocal
  290.                             exit /b
  291.                         )
  292.                         set /p conf=">> "
  293.                         if /i "!conf!"=="Y" (
  294.                             set gtaPath=!pDrive!!pPath!
  295.                             if exist "!gtaPath!" (
  296.                                 reg add HKCU\Software\FoddEx\GTAVMS /f /v path /t REG_SZ /d "!gtaPath!" > nul
  297.                                 if "%%~dI"=="!rootDrive!" (
  298.                                     cd "%%~dpI"
  299.                                 ) else (
  300.                                     cd /d "%%~dpI"
  301.                                 )
  302.                                 cd..
  303.                                 goto search.break
  304.                             ) else (
  305.                                 call :ColorMsg 8C "An unknown error occurred."
  306.                                 if !force!==0 pause > nul
  307.                                 endlocal
  308.                                 exit /b
  309.                             )
  310.                         )
  311.                     )
  312.                 )
  313.             )
  314.             call :ColorMsg 8C "    Done. No result"
  315.             Echo.
  316.         )
  317.     ) else (
  318.         for /f "tokens=2* skip=2" %%A in ('reg query HKCU\Software\FoddEx\GTAVMS /v path') do (
  319.             set gtaPath=%%B
  320.             if exist "!gtaPath!" (
  321.                 for /f "tokens=*" %%C in ("!gtaPath!") do (
  322.                     if "!_drive!"=="!rootDrive!" (
  323.                         cd "%%C"
  324.                     ) else (
  325.                         cd /d "%%C"
  326.                     )
  327.                     cd..
  328.                 )
  329.                 call :ColorMsg 8A "        OK"
  330.                 goto search.break
  331.             )
  332.             call :ColorMsg 8C "Registry value "HKCU\Software\FoddEx\GTAVMS\path" contains invalid data."
  333.             Echo.
  334.             goto manualPath
  335.         )
  336.     )
  337.    
  338. :manualPath
  339.     Echo Unable to locate Grand Theft Auto V on your computer.
  340.     Echo Please enter the path manually.
  341.     if !force!==1 (
  342.         Echo END
  343.         endlocal
  344.         exit /b
  345.     )
  346.     set /p gtaPath="Path: "
  347.     if not exist "!gtaPath!\GTA5.exe" (
  348.         call :ColorMsg 8C "!gtaPath! is not a valid path."
  349.         timeout /t 3 > nul
  350.         cls
  351.         goto manualPath
  352.     ) else (
  353.         reg add HKCU\Software\FoddEx\GTAVMS /f /v path /t REG_SZ /d "!gtaPath!" > nul
  354.         goto search.break
  355.     )
  356.    
  357. :reset
  358.  
  359. :search.break
  360.     timeout /t 1 > nul
  361.     set "curDir=%cd%"
  362.     if not exist "Grand Theft Auto V\GTA5.exe" (
  363.         cls
  364.         call :ColorMsg 8C "An error occurred."
  365.         if !dbg!==1 (
  366.             Echo.
  367.             Echo ERROR: GTA5.EXE not found in "%cd%"
  368.         )
  369.         Echo.
  370.         Echo Press any key to run a new search.
  371.         if !force!==0 pause > nul
  372.         reg delete HKCU\Software\FoddEx\GTAVMS /v /f path > nul
  373.         cls
  374.         endlocal
  375.         set search=1
  376.         goto restart
  377.     )
  378.     set "gtaBin=Grand Theft Auto V"
  379.     if not exist GTAVmodBin (
  380.         mkdir GTAVmodBin
  381.     )
  382.     set modBin=GTAVmodBin
  383.    
  384. :analyze
  385.     set asiList=
  386.     set ModAsiList=
  387.     set dllList=
  388.     set ModDllList=
  389.     set txtList=
  390.     set ModTxtList=
  391.     set asiCount=0
  392.     set ModAsiCount=0
  393.     set dllCount=0
  394.     set ModDllCount=0
  395.     set txtCount=0
  396.     set ModTxtCount=0
  397.     cls
  398.     Echo Analyzing Mods directory...
  399.     for /f %%A in ('dir /b "!modBin!\*.asi" 2^> nul') do (
  400.         set /a ModAsiCount=!ModAsiCount!+1
  401.         set ModAsiList=!ModAsiList!,%%A
  402.     )
  403.     Echo     Found !ModAsiCount! .asi files.
  404.     Echo.
  405.     for /f %%A in ('dir /b "!modBin!\*.dll" 2^> nul') do (
  406.         set /a ModDllCount=!ModDllCount!+1
  407.         set ModDllList=!ModDllList!,%%A
  408.     )
  409.     Echo     Found !ModDllCount! .dll files.
  410.     Echo.
  411.     for /f %%A in ('dir /b "!modBin!\*.txt" 2^> nul') do (
  412.         set /a ModTxtCount=!ModTxtCount!+1
  413.         set ModTxtList=!ModTxtList!,%%A
  414.     )
  415.     for /f %%A in ('dir /b "!modBin!\*.ini" 2^> nul') do (
  416.         set /a ModTxtCount=!ModTxtCount!+1
  417.         set ModTxtList=!ModTxtList!,%%A
  418.     )
  419.     for /f %%A in ('dir /b "!modBin!\*.inf" 2^> nul') do (
  420.         set /a ModTxtCount=!ModTxtCount!+1
  421.         set ModTxtList=!ModTxtList!,%%A
  422.     )
  423.     for /f %%A in ('dir /b "!modBin!\*.cfg" 2^> nul') do (
  424.         set /a ModTxtCount=!ModTxtCount!+1
  425.         set ModTxtList=!ModTxtList!,%%A
  426.     )
  427.     Echo     Found !ModTxtCount! mod related plain-text files.
  428.     Echo.
  429.     if exist !modBin!\scripts (
  430.         Echo     Found scripts folder for .NET mods.
  431.         Echo.
  432.     )
  433.     Echo ----------
  434.     Echo Analyzing GTA V directory...
  435.     for /f %%A in ('dir /b "!gtaBin!\*.asi" 2^> nul') do (
  436.         set /a asiCount=!asiCount!+1
  437.         set asiList=!asiList!,%%A
  438.     )
  439.     Echo     Found !asiCount! .asi files.
  440.     Echo.
  441.     for /f %%A in ('dir /b "!gtaBin!\*.dll" 2^> nul') do (
  442.         if not %%A==bink2w64.dll (
  443.             if not %%A==d3dcompiler_46.dll (
  444.                 if not %%A==GFSDK_ShadowLib.win64.dll (
  445.                     if not %%A==GFSDK_TXAA.win64.dll (
  446.                         if not %%A==GFSDK_TXAA_AlphaResolve.win64.dll (
  447.                             if not %%A==steam_api64.dll (
  448.                                 if not %%A==d3dcsx_46.dll (
  449.                                     set /a dllCount=!dllCount!+1
  450.                                     set dllList=!dllList!,%%A
  451.                                 )
  452.                             )
  453.                         )
  454.                     )
  455.                 )
  456.             )
  457.         )
  458.     )
  459.     Echo     Found !dllCount! non standard .dll files.
  460.     Echo.
  461.     for /f %%A in ('dir /b "!gtaBin!\*.txt" 2^> nul') do (
  462.         set /a txtCount=!txtCount!+1
  463.         set txtList=!txtList!,%%A
  464.     )
  465.     for /f %%A in ('dir /b "!gtaBin!\*.ini" 2^> nul') do (
  466.         set /a txtCount=!txtCount!+1
  467.         set txtList=!txtList!,%%A
  468.     )
  469.     for /f %%A in ('dir /b "!gtaBin!\*.inf" 2^> nul') do (
  470.         set /a txtCount=!txtCount!+1
  471.         set txtList=!txtList!,%%A
  472.     )
  473.     for /f %%A in ('dir /b "!gtaBin!\*.cfg" 2^> nul') do (
  474.         set /a txtCount=!txtCount!+1
  475.         set txtList=!txtList!,%%A
  476.     )
  477.     Echo     Found !txtCount! mod related plain-text files.
  478.     Echo.
  479.     if exist !gtaBin!\scripts (
  480.         Echo     Found scripts folder for .NET mods.
  481.         Echo.
  482.     )
  483.     Echo.
  484.     Echo Done.
  485.     timeout /t 2 > nul
  486.     goto main
  487.    
  488. :main
  489.     set modActive=0
  490.     set modInactive=0
  491.     cls
  492.     call :ColorMsg 89 "Active mods:"
  493.     if exist !gtaBin!\NativeTrainer.asi (
  494.         call :ColorMsg 8A "    -Native Trainer"
  495.         Echo.
  496.         set modActive=1
  497.     )
  498.     if exist !gtaBin!\ScriptHookV.dll (
  499.         call :ColorMsg 8A "    -Script Hook V"
  500.         Echo.
  501.         set modActive=1
  502.     )
  503.     if exist !gtaBin!\OpenIV.asi (
  504.         call :ColorMsg 8A "    -OpenIV ASI Loader"
  505.         Echo.
  506.         set modActive=1
  507.     )
  508.     if exist !gtaBin!\ScriptHookVDotNet.asi (
  509.         set modActive=1
  510.         if exist !gtaBin!\ScriptHookVDotNet.dll (
  511.             call :ColorMsg 8A "    -Script Hook V .NET"
  512.             Echo.
  513.         ) else (
  514.             call :ColorMsg 8E "    -Script Hook V .NET [Partial]"
  515.             Echo.
  516.         )
  517.     ) else (
  518.         if exist !gtaBin!\ScriptHookVDotNet.dll (
  519.             set modActive=1
  520.             call :ColorMsg 8E "    -Script Hook V .NET [Partial]"
  521.             Echo.
  522.         )
  523.     )
  524.     if exist !gtaBin!\dinput8.dll (
  525.         call :ColorMsg 8A "    -ASI Loader dinput8.dll"
  526.         Echo.
  527.         set modActive=1
  528.     )
  529.     if !asiCount! GTR 1 (
  530.         set modActive=1
  531.         Echo     -One or more unknown mod scripts/DLLs:
  532.         for /f %%A in ('dir /b "!gtaBin!\*.asi" 2^> nul') do (
  533.             if not %%A==NativeTrainer.asi (
  534.                 if not %%A==ScriptHookVDotNet.asi (
  535.                     if not %%A==OpenIV.asi (
  536.                         call :ColorMsg 8A "        -%%A"
  537.                         Echo.
  538.                     )
  539.                 )
  540.             )
  541.         )
  542.         for /f %%A in ('dir /b "!gtaBin!\*.dll" 2^> nul') do (
  543.             if not %%A==bink2w64.dll (
  544.                 if not %%A==d3dcompiler_46.dll (
  545.                     if not %%A==GFSDK_ShadowLib.win64.dll (
  546.                         if not %%A==GFSDK_TXAA.win64.dll (
  547.                             if not %%A==GFSDK_TXAA_AlphaResolve.win64.dll (
  548.                                 if not %%A==steam_api64.dll (
  549.                                     if not %%A==d3dcsx_46.dll (
  550.                                         if not %%A==ScriptHookVDotNet.dll (
  551.                                             if not %%A==ScriptHookV.dll (
  552.                                                 if not %%A==dinput8.dll (
  553.                                                     call :ColorMsg 8A "        -%%A"
  554.                                                     Echo.
  555.                                                 )
  556.                                             )
  557.                                         )
  558.                                     )
  559.                                 )
  560.                             )
  561.                         )
  562.                     )
  563.                 )
  564.             )
  565.         )
  566.     )
  567.     if exist !gtaBin!\scripts (
  568.         set modActive=1
  569.         if !asiCount! LSS 2 (
  570.             Echo     -One or more unknown mod scripts/DLLs:
  571.             Echo         -Script folder for .NET based mods:
  572.             for /f %%A in ('dir /b "!gtaBin!\scripts\*.asi" 2^> nul') do (
  573.                 call :ColorMsg 8A "            -%%A"
  574.                 Echo.
  575.             )
  576.             for /f %%A in ('dir /b "!gtaBin!\scripts\*.dll" 2^> nul') do (
  577.                 call :ColorMsg 8A "            -%%A"
  578.                 Echo.
  579.             )
  580.         ) else (
  581.             Echo         -Script folder for .NET based mods:
  582.             for /f %%A in ('dir /b "!gtaBin!\scripts\*.asi" 2^> nul') do (
  583.                 call :ColorMsg 8A "            -%%A"
  584.                 Echo.
  585.             )
  586.             for /f %%A in ('dir /b "!gtaBin!\scripts\*.dll" 2^> nul') do (
  587.                 call :ColorMsg 8A "            -%%A"
  588.                 Echo.
  589.             )
  590.         )
  591.     )
  592.     if !modActive!==0 (
  593.         call :ColorMsg 8B "    None."
  594.     )
  595.     Echo.
  596.     Echo ----------
  597.     call :ColorMsg 89 "Inactive mods:"
  598.     if exist !modBin!\NativeTrainer.asi (
  599.         call :ColorMsg 8E "    -Native Trainer"
  600.         Echo.
  601.         set modInactive=1
  602.     )
  603.     if exist !modBin!\ScriptHookV.dll (
  604.         call :ColorMsg 8E "    -Script Hook V"
  605.         Echo.
  606.         set modInactive=1
  607.     )
  608.     if exist !modBin!\OpenIV.asi (
  609.         call :ColorMsg 8E "    -OpenIV ASI Loader"
  610.         Echo.
  611.         set modInactive=1
  612.     )
  613.     if exist !modBin!\ScriptHookVDotNet.asi (
  614.         set modInactive=1
  615.         if exist !modBin!\ScriptHookVDotNet.dll (
  616.             call :ColorMsg 8E "    -Script Hook V .NET"
  617.             Echo.
  618.         ) else (
  619.             call :ColorMsg 8B "    -Script Hook V .NET [Partial]"
  620.             Echo.
  621.         )
  622.     ) else (
  623.         if exist !modBin!\ScriptHookVDotNet.dll (
  624.             set modInactive=1
  625.             call :ColorMsg 8B "    -Script Hook V .NET [Partial]"
  626.             Echo.
  627.         )
  628.     )
  629.     if exist !modBin!\dinput8.dll (
  630.         call :ColorMsg 8E "    -ASI Loader dinput8.dll"
  631.         Echo.
  632.         set modInactive=1
  633.     )
  634.     if !ModAsiCount! GTR 1 (
  635.         set modInactive=1
  636.         Echo     -One or more unknown mod scripts/DLLs:
  637.         for /f %%A in ('dir /b "!modBin!\*.asi" 2^> nul') do (
  638.             if not %%A==NativeTrainer.asi (
  639.                 if not %%A==ScriptHookVDotNet.asi (
  640.                     if not %%A==OpenIV.asi (
  641.                         call :ColorMsg 8E "        -%%A"
  642.                         Echo.
  643.                     )
  644.                 )  
  645.             )
  646.         )
  647.         for /f %%A in ('dir /b "!modBin!\*.dll" 2^> nul') do (
  648.             if not %%A==ScriptHookVDotNet.dll (
  649.                 if not %%A==ScriptHookV.dll (
  650.                     if not %%A==dinput8.dll (
  651.                         call :ColorMsg 8E "        -%%A"
  652.                         Echo.
  653.                     )
  654.                 )
  655.             )
  656.         )
  657.     )
  658.     if exist !modBin!\scripts (
  659.         set modInactive=1
  660.         if !ModAsiCount! LSS 2 (
  661.             Echo     -One or more unknown mod scripts:
  662.             Echo         -Script folder for .NET based mods:
  663.             for /f %%A in ('dir /b "!modBin!\scripts\*.asi" 2^> nul') do (
  664.                 call :ColorMsg 8E "            -%%A"
  665.                 Echo.
  666.             )
  667.             for /f %%A in ('dir /b "!modBin!\scripts\*.dll" 2^> nul') do (
  668.                 call :ColorMsg 8E "            -%%A"
  669.                 Echo.
  670.             )
  671.         ) else (
  672.             Echo         -Script folder for .NET based mods:
  673.             for /f %%A in ('dir /b "!modBin!\scripts\*.asi" 2^> nul') do (
  674.                 call :ColorMsg 8E "            -%%A"
  675.                 Echo.
  676.             )
  677.             for /f %%A in ('dir /b "!modBin!\scripts\*.dll" 2^> nul') do (
  678.                 call :ColorMsg 8E "            -%%A"
  679.                 Echo.
  680.             )
  681.         )
  682.     )
  683.     if !modInactive!==0 (
  684.         call :ColorMsg 8B "    None."
  685.     )
  686.     Echo.
  687.     Echo ----------
  688.     if !single!==0 (
  689.         if not !modInactive!==0 (
  690.             call :ColorMsg 8A "Press 1 to enable all inactive mods."
  691.         )
  692.         if not !modActive!==0 (
  693.             call :ColorMsg 8E "Press 2 to disable all active mods."
  694.         )
  695.         set actionPrompt=
  696.     ) else (
  697.         set actionPrompt=Disable/Enable mod
  698.     )
  699.     if !single!==0 (
  700.         call :ColorMsg 8B "Press Z for single-mode"
  701.     ) else (
  702.         call :ColorMsg 8B "Press Z for multi-mode"
  703.     )
  704.     Echo Press X to exit
  705.     if !force!==1 (
  706.         Echo END
  707.         endlocal
  708.         exit /b
  709.     )
  710.     set /p action="!actionPrompt!>> "
  711.     if !single!==1 (
  712.         if /i not !action!==Z (
  713.             if /i not !action!==X (
  714.                 call :CheckMod !action!
  715.             )
  716.         )
  717.     ) else (
  718.         if !action!==1 (
  719.             if !modInactive! NEQ 0 (
  720.                 goto enable
  721.             )
  722.         )
  723.         if !action!==2 (
  724.             if !modActive! NEQ 0 (
  725.                 goto disable
  726.             )
  727.         )
  728.     )
  729.     if /i !action!==X (
  730.         goto end
  731.     )
  732.     if /i !action!==Z (
  733.         if !single!==0 (
  734.             set single=1
  735.         ) else (
  736.             set single=0
  737.         )
  738.     )
  739.     goto main
  740.    
  741. :disable
  742.     cls
  743.     Echo Disabling mods...
  744.     Echo     .ASI files...
  745.     for %%A in (!asiList!) do (
  746.         move "!curDir!\!gtaBin!\%%A" "!curDir!\!modBin!" > nul
  747.         if not exist "!curDir!\!modBin!\%%A" (
  748.             call :ColorMsg 8C "        ERROR: %%A could not be disabled."
  749.             Echo         Press any key to continue...
  750.             pause > nul
  751.         ) else (
  752.             call :ColorMsg 8E "        Disabled %%A"
  753.         )
  754.     )
  755.     Echo.
  756.     Echo     .DLL files...
  757.     for %%A in (!dllList!) do (
  758.         move "!curDir!\!gtaBin!\%%A" "!curDir!\!modBin!" > nul
  759.         call :ColorMsg 8E "        Disabled %%A"
  760.     )
  761.     Echo.
  762.     Echo     Configuration/documentation files [.TXT, .INI, .CFG, .INF]...
  763.     for %%A in (!txtList!) do (
  764.         move "!curDir!\!gtaBin!\%%A" "!curDir!\!modBin!" > nul
  765.         if not exist "!curDir!\!modBin!\%%A" (
  766.             call :ColorMsg 8C "        ERROR: %%A could not be disabled."
  767.             Echo         Press any key to continue...
  768.             pause > nul
  769.         ) else (
  770.             call :ColorMsg 8E "        Disabled %%A"
  771.         )
  772.     )
  773.     Echo.
  774.     if exist !gtaBin!\scripts (
  775.         Echo     .NET based scripts [scripts folder]...
  776.         move "!curDir!\!gtaBin!\scripts" "!curDir!\!modBin!" > nul
  777.         if not exist "!curDir!\!modBin!\scripts" (
  778.             call :ColorMsg 8C "        ERROR: .NET based scripts could not be disabled."
  779.             Echo         Press any key to continue...
  780.             pause > nul
  781.         ) else (
  782.             call :ColorMsg 8E "        Disabled .NET based scripts."
  783.         )
  784.     )
  785.     Echo.
  786.     timeout /t 2 > nul
  787.     goto reset
  788.  
  789. :enable
  790.     cls
  791.     for /f %%A in ('dir /b "!modBin!\*.*" 2^> nul') do (
  792.         goto enable.cnt
  793.     )
  794.     call :ColorMsg 8C "No mods to enable."
  795.     timeout /t 2 > nul
  796.     goto reset
  797.  
  798. :enable.cnt
  799.     cls
  800.     Echo Enabling mods...
  801.     if exist !modBin!\*.asi (
  802.         Echo     .ASI files...
  803.         for /f %%A in ('dir /b "!modBin!\*.asi" 2^> nul') do (
  804.             move "!curDir!\!modBin!\%%A" "!curDir!\!gtaBin!" > nul
  805.             if not exist "!curDir!\!gtaBin!\%%A" (
  806.                 call :ColorMsg 8C "        ERROR: %%A could not be enabled."
  807.                 Echo         Press any key to continue...
  808.                 pause > nul
  809.             ) else (
  810.                 call :ColorMsg 8A "        Enabled %%A"
  811.             )
  812.         )
  813.         Echo.
  814.     )
  815.     if exist !modBin!\*.dll (
  816.         Echo     .DLL files...
  817.         for /f %%A in ('dir /b "!modBin!\*.dll" 2^> nul') do (
  818.             move "!curDir!\!modBin!\%%A" "!curDir!\!gtaBin!" > nul
  819.             if not exist "!curDir!\!gtaBin!\%%A" (
  820.                 call :ColorMsg 8C "        ERROR: %%A could not be enabled."
  821.                 Echo         Press any key to continue...
  822.                 pause > nul
  823.             ) else (
  824.                 call :ColorMsg 8A "        Enabled %%A"
  825.             )
  826.         )
  827.         Echo.
  828.     )
  829.     if exist !modBin!\*.txt (
  830.         Echo     Configuration/documentation files: .TXT
  831.         for /f %%A in ('dir /b "!modBin!\*.txt" 2^> nul') do (
  832.             move "!curDir!\!modBin!\%%A" "!curDir!\!gtaBin!" > nul
  833.             if not exist "!curDir!\!gtaBin!\%%A" (
  834.                 call :ColorMsg 8C "        ERROR: %%A could not be enabled."
  835.                 Echo         Press any key to continue...
  836.                 pause > nul
  837.             ) else (
  838.                 call :ColorMsg 8A "        Enabled %%A"
  839.             )
  840.         )
  841.         Echo.
  842.     )
  843.     if exist !modBin!\*.ini (
  844.         Echo     Configuration/documentation files: .INI
  845.         for /f %%A in ('dir /b "!modBin!\*.ini" 2^> nul') do (
  846.             move "!curDir!\!modBin!\%%A" "!curDir!\!gtaBin!" > nul
  847.             if not exist "!curDir!\!gtaBin!\%%A" (
  848.                 call :ColorMsg 8C "        ERROR: %%A could not be enabled."
  849.                 Echo         Press any key to continue...
  850.                 pause > nul
  851.             ) else (
  852.                 call :ColorMsg 8A "        Enabled %%A"
  853.             )
  854.         )
  855.         Echo.
  856.     )
  857.     if exist !modBin!\*.inf (
  858.         Echo     Configuration/documentation files: .INF
  859.         for /f %%A in ('dir /b "!modBin!\*.inf" 2^> nul') do (
  860.             move "!curDir!\!modBin!\%%A" "!curDir!\!gtaBin!" > nul
  861.             if not exist "!curDir!\!gtaBin!\%%A" (
  862.                 call :ColorMsg 8C "        ERROR: %%A could not be enabled."
  863.                 Echo         Press any key to continue...
  864.                 pause > nul
  865.             ) else (
  866.                 call :ColorMsg 8A "        Enabled %%A"
  867.             )
  868.         )
  869.         Echo.
  870.     )
  871.     if exist !modBin!\*.cfg (
  872.         Echo     Configuration/documentation files: .CFG
  873.         for /f %%A in ('dir /b "!modBin!\*.cfg" 2^> nul') do (
  874.             move "!curDir!\!modBin!\%%A" "!curDir!\!gtaBin!" > nul
  875.             if not exist "!curDir!\!gtaBin!\%%A" (
  876.                 call :ColorMsg 8C "        ERROR: %%A could not be enabled."
  877.                 Echo         Press any key to continue...
  878.                 pause > nul
  879.             ) else (
  880.                 call :ColorMsg 8A "        Enabled %%A"
  881.             )
  882.         )
  883.         Echo.
  884.     )
  885.     if exist !modBin!\scripts (
  886.         Echo     .NET based scripts [scripts folder]...
  887.         move "!curDir!\!modBin!\scripts" "!curDir!\!gtaBin!" > nul
  888.         if not exist "!curDir!\!gtaBin!\scripts" (
  889.             call :ColorMsg 8C "        ERROR: .NET based scripts could not be enabled."
  890.             Echo         Press any key to continue...
  891.             pause > nul
  892.         ) else (
  893.             call :ColorMsg 8A "        Enabled .NET based scripts."
  894.         )
  895.     )
  896.     Echo.
  897.     timeout /t 2 > nul
  898.     goto reset
  899.  
  900. :end
  901.     endlocal
  902.     if !dbg!==1 (
  903.         exit /b
  904.     )
  905.     exit
  906.    
  907.    
  908. ::  SUBROUTINES
  909.  
  910. :displayChg
  911.     cls
  912.     Echo Features and changes
  913.     Echo.
  914.     call :ColorMsg 8A "v!onlineVersion! [CURRENT]"
  915.     Echo - Removed unnecessary labels
  916.     Echo - Added Single Mode
  917.     Echo     * Allows the user to enable/disable a chosen mod instead
  918.     Echo     of all mods
  919.     Echo     * Added game file protection [so you don't break anything]
  920.     Echo - Various optimizations
  921.     Echo - Fixed parts of the updater not displaying colored text
  922.     Echo - Known issues:
  923.     Echo     * When disabling a .NET based script using Single Mode, it can't
  924.     Echo     be re-enabled with the mod switcher, but instead enabled manually.
  925.     Echo     * The debugger does not output text.
  926.     Echo     * Mods enabled or disabled with Single Mode does not refresh in the
  927.     Echo     action menu. A program restart is required for changes to be seen.
  928.     Echo.
  929.     Echo Press any key to continue.
  930.     pause > nul
  931.     goto :eof
  932.     Echo.
  933.     Echo v1.4.4
  934.     Echo - Fixed various bugs related to Windows 10
  935.     Echo     * Fixed bug where the program detected Windows 8 instead
  936.     Echo     of Windows 10.
  937.     Echo     * Fixed bug where the OS version would be misinterpreted
  938.     Echo     in Windows 10 versions.
  939.     Echo     * Fixed title being set to "Windows PowerShell"
  940.     Echo - Added error messages to mod enabling and disabling process
  941.     Echo - Added a small timeout during loading
  942.     Echo.
  943.     Echo v1.4.3
  944.     Echo - Improved debugging
  945.     Echo - Fixed a bug that caused the debugger to mess up the display
  946.     Echo - Fixed a bug where the program looked for the game file in the
  947.     Echo wrong directory, causing errors and mods staying enabled/disabled.
  948.     Echo.
  949.     Echo v1.4.2
  950.     Echo - Fixed bug where some colored texts would output "FINDSTR: Cannot open..."
  951.     Echo - Fixed issues involving newlines on colored text.
  952.     Echo.
  953.     Echo v1.4.1
  954.     Echo - Added color coded messages for easier readability.
  955.     Echo NOTE: Debugger still works, but cannot output understandable text
  956.     ECHO as of now.
  957.     Echo.
  958.     Echo v1.4.0
  959.     Echo - Added custom prompt to the debugger. The log should now be easier
  960.     Echo to read.
  961.     Echo - Improved debugging.
  962.     Echo - Errors now display properly in the debugger
  963.     Echo - Fixed bug that caused the program to crash after installing
  964.     Echo an update.
  965.     Echo - Added PowerShell version check, allowing for faster downloading
  966.     Echo even on Windows 7 and earlier. In order for the fast download
  967.     Echo function to work, you need PowerShell v3.0 or newer.
  968.     Echo.
  969.     Echo v1.3.11
  970.     Echo - Added some more details to the search function.
  971.     Echo - Small under-the-hood changes
  972.     Echo.
  973.     Echo v1.3.10
  974.     Echo - Improved search function. The user can now continue the search if
  975.     Echo the location is incorrect.
  976.     Echo - Reorganized the changelog.
  977.     Echo - Added some more pause prompts.
  978.     Echo - Removed some characters in the code that was affecting program
  979.     Echo behaviour.
  980.     Echo.
  981.     Echo v1.3.9
  982.     Echo - Added mode details to the initialization process.
  983.     Echo - Fixed bug that caused the progaram not to catch an invalid path.
  984.     Echo.
  985.     Echo v1.3.8
  986.     Echo - Optimized the program for computers with Windows 8 or newer. The progam is
  987.     Echo now utilizing PowerShell to download updates instead of BITS. (BETA^)
  988.     Echo - Fixed bug that caused the program to crash when the path to GTA V
  989.     Echo contained the characters "(" or ")".
  990.     Echo - Removed an unnecessary line that was causing errors.
  991.     Echo - Added automatic changelog display (this screen).
  992.     Echo - Added debugging mode. To run in debug mode, run GTAVMS_debug.bat.
  993.     Echo.
  994.     Echo.
  995.     Echo Press any key to continue...
  996.     if !force!==0 pause > nul
  997.     goto :eof
  998.  
  999. :fastDownload
  1000.     if %1==ver (
  1001.         Echo         Downloading version file...
  1002.         powershell -Command "& {$host.ui.RawUI.WindowTitle='GTA V Mod Switcher [v!version!]'; Invoke-WebRequest "!dlServer!/ver.dat" -OutFile "!dlPath!\ver.dat";}" > nul
  1003.         call :ColorMsg 8A "            OK"
  1004.     )
  1005.     if %1==main (
  1006.         Echo                 Downloading GTAVMS...
  1007.         powershell -Command "& {$host.ui.RawUI.WindowTitle='GTA V Mod Switcher [v!version!]'; Invoke-WebRequest "!dlServer!/gtavms.bat" -OutFile "!dlPath!\GTAVMS.bat";}" > nul
  1008.         call :ColorMsg 8A "                    OK"
  1009.         Echo                 Downloading switch...
  1010.         powershell -Command "& {$host.ui.RawUI.WindowTitle='GTA V Mod Switcher [v!version!]'; Invoke-WebRequest "!dlServer!/switch.bat" -OutFile "!dlPath!\switch.bat";}" > nul
  1011.         call :ColorMsg 8A "                    OK"
  1012.     )
  1013.     goto :eof
  1014.  
  1015. :ColorMsg
  1016.     <nul > X set /p ".=."
  1017.     set "param=^%~2" !
  1018.     set "param=!param:"=\"!"
  1019.     findstr /p /A:%1 "." "!param!\..\X" nul
  1020.     <nul set /p ".=%DEL%%DEL%%DEL%%DEL%%DEL%%DEL%%DEL%"
  1021.     del /q X > nul
  1022.     Echo.
  1023.     exit /b
  1024.  
  1025. :CheckMod
  1026.     set arg=%1
  1027.     if not exist "!curDir!\!gtaBin!\!arg!" (
  1028.         if not exist "!modBin!\!arg!" (
  1029.             Echo.
  1030.             call :ColorMsg 8C "No mod file called !arg!"
  1031.             timeout /t 2 > nul
  1032.             goto menu
  1033.         ) else (
  1034.             call :enableSingle !arg!
  1035.         )
  1036.     ) else (
  1037.         call :disableSingle !arg!
  1038.     )
  1039.     goto :eof
  1040.    
  1041. :enableSingle
  1042.     set arg=%1
  1043.     move "!curDir!\!modBin!\!arg!" "!curDir!\!gtaBin!" > nul
  1044.     if not exist "!curDir!\!gtaBin!\!arg!" (
  1045.         call :ColorMsg 8C "        ERROR: !arg! could not be enabled."
  1046.         Echo         Press any key to continue...
  1047.         pause > nul
  1048.         goto menu
  1049.     ) else (
  1050.         call :ColorMsg 8A "        Enabled !arg!"
  1051.     )
  1052.     timeout /t 2 > nul
  1053.     goto reset
  1054.  
  1055. :disableSingle
  1056.     set arg=%1
  1057.     call :ProtectionTable !arg!
  1058.     if !break!==1 goto reset
  1059.     move "!curDir!\!gtaBin!\!arg!" "!curDir!\!modBin!" > nul
  1060.     if not exist "!curDir!\!modBin!\!arg!" (
  1061.         call :ColorMsg 8C "        ERROR: !arg! could not be disabled."
  1062.         Echo         Press any key to continue...
  1063.         pause > nul
  1064.         goto menu
  1065.     ) else (
  1066.         call :ColorMsg 8E "        Disabled !arg!"
  1067.     )
  1068.     timeout /t 2 > nul
  1069.     goto reset
  1070.  
  1071. :ProtectionTable
  1072. set arg=%1
  1073. for %%X in (!protected!) do (
  1074.     if /i !arg!==%%X (
  1075.         call :ColorMsg 8C "ERROR: !arg! could not be disabled due to game integrity protection"
  1076.         Echo.
  1077.         Echo Press any key to continue.
  1078.         pause > nul
  1079.         set break=1
  1080.     )
  1081. )
  1082. goto :eof
Add Comment
Please, Sign In to add comment