Advertisement
Guest User

VS post-build auto copy to GTA V dir

a guest
Oct 9th, 2017
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.93 KB | None | 0 0
  1. :: copy and paste the below line into the post-build event
  2. :: if you place cp-gta.bat somewhere other than your Projects directory, change "$(SolutionDir)..\cp-gta.bat" accordingly
  3. call "$(SolutionDir)..\cp-gta.bat" "$(TargetPath)" "$(TargetFileName)"
  4.  
  5.  
  6. :: copy and paste the text below into a file named cp-gta.bat, and put the file into your Projects directory ("Documents\Visual Studio 2015\Projects\" or wherever you store yours)
  7. @echo OFF
  8.  
  9. set argFilePath=%1
  10. set argFileName=%2
  11.  
  12. setlocal ENABLEEXTENSIONS
  13. set KEY_NAME="HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Rockstar Games\Grand Theft Auto V"
  14. set VALUE_NAME=InstallFolder
  15.  
  16. FOR /F "tokens=1-3" %%A IN ('REG QUERY %KEY_NAME% /v %VALUE_NAME% 2^>nul') DO (
  17.     set ValueName=%%A
  18.     set ValueType=%%B
  19.     set ValueValue=%%C
  20. )
  21.  
  22. if defined ValueName (
  23.     copy /Y %argFilePath% "%ValueValue%\scripts\%argFileName%"
  24. ) else (
  25.     echo GTA V InstallLocation registry key not found.
  26. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement