aveyo

prepare_dota_lan_share

Feb 20th, 2017
715
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 3.34 KB | None | 0 0
  1. /* 2>nul&goto init %~nx0
  2. :start
  3. echo.
  4. echo   -------------------------------------------------------------
  5. echo  ^|               PREPARE DOTA_LAN_SHARE BY AVEYO               ^|
  6. echo  ^|-------------------------------------------------------------^|
  7. echo  ^|  Run this once on the PC that will be sharing game files    ^|
  8. echo  ^|  Share the generated "steamapps\DOTA_LAN_SHARE" folder      ^|
  9. echo  ^|  Steam and DOTA should be set to enable automatic updates   ^|
  10. echo  ^|                                                             ^|
  11. echo  ^|  Other PCs should have DOTA automatic updates disabled      ^|
  12. echo  ^|  and when needing updates, close their Steam client then    ^|
  13. echo  ^|  manually sync this shared folder or use a batch / tool     ^|
  14. echo  ^|                                                             ^|
  15. echo  ^|  Exclude from "DOTA_LAN_SHARE\common\dota 2 beta\game\dota" ^|
  16. echo  ^|  cfg\* guides\* replays\* screenshots\* *.mdmp *.soc *.vcfg ^|
  17. echo  ^|  condump*.txt console.log server_log.txt rich_presence*.txt ^|
  18. echo   -------------------------------------------------------------
  19. echo.
  20. call :wait 10 Starting
  21. call :set_dota
  22. md "%steamapps%\DOTA_LAN_SHARE\common\dota 2 beta\game" 2>nul
  23. echo  SHARE = %steamapps%\DOTA_LAN_SHARE & echo  Do not directly modify content here!
  24. echo  Instead, delete DOTA_LAN_SHARE folder and re-run %~nx0 & echo.
  25. :: hard link
  26. mklink /h "%steamapps%\DOTA_LAN_SHARE\appmanifest_570.acf" "%steamapps%\appmanifest_570.acf" 1>nul 2>nul
  27. if exist "%steamapps%\DOTA_LAN_SHARE\appmanifest_570.acf" (set rez=OK!) else set rez=FAIL! Try running as admin..
  28. echo  Creating hard link to appmanifest_570.acf - %rez%
  29. :: junctions
  30. for %%s in (bin core dota) do mklink /j "%steamapps%\DOTA_LAN_SHARE\common\dota 2 beta\game\%%s" "%dota%\%%s" 1>nul 2>nul
  31. if exist "%steamapps%\DOTA_LAN_SHARE\common\dota 2 beta\game\dota\maps\dota.vpk" (set rez=OK!) else set rez=FAIL! Try running as admin..
  32. echo  Creating junctions to common\dota 2 beta\game\ - %rez%
  33. call :end DONE!
  34. goto :eof
  35. :: done!
  36. :set_dota
  37. for /f usebackq^ skip^=2^ delims^=^ eol^= %%s in (`reg query "HKCU\SOFTWARE\Valve\Steam" /v "SteamPath" /z`) do set "steampath=%%~s"
  38. set "steampath=%steampath:~31%" &set "libfilter=LibraryFolders { TimeNextStatsReport ContentStatsID }"
  39. if not exist "%steampath%\SteamApps\libraryfolders.vdf" call :end ! Cannot find Steam library!
  40. for /f usebackq^ delims^=^"^ tokens^=4 %%s in (`findstr /v "%libfilter%" "%steampath%\SteamApps\libraryfolders.vdf"`) do (
  41. if exist "%%s\steamapps\appmanifest_570.acf" if exist "%%s\steamapps\common\dota 2 beta\game\dota\maps\dota.vpk" set "libfs=%%s"
  42. ) & set "steamapps=%steampath%\steamapps"
  43. if defined libfs set "steamapps=%libfs:\\=\%\steamapps"
  44. set "steamapps=%steamapps:/=\%"
  45. if not exist "%steamapps%\common\dota 2 beta\game\dota\maps\dota.vpk" call :end ! Cannot find Dota 2!
  46. set "dota=%steamapps%\common\dota 2 beta\game"
  47. goto :eof
  48. :wait
  49. setlocal enabledelayedexpansion &if not defined x1337cr for /f %%a in ('copy /z "%~dpf0" nul') do set "x1337cr=%%a"
  50. (for /l %%i in (%1,-1,1) do <NUL SET /P "=_%2 in %%i !x1337cr!" &ping -n 2 localhost >nul 2>&1) & endlocal & goto :eof
  51. :init
  52. @echo off & setlocal & title %~nx0 & color 0B & cls & goto :start
  53. :end
  54. (if "%1"=="!" COLOR 7c) &echo. &echo  %* &(call :wait 5 Closing) &echo/             &(if "%1"=="!" exit) &endlocal &color &goto :eof
  55. ::
Add Comment
Please, Sign In to add comment