launcher.bat 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. @echo off
  2. REM Notice: This file is overwritten for each patch for safety reasons.
  3. REM Hence, any manual changes will be overwritten by the next patch.
  4. REM ============ AVOID CHANGES HERE ============
  5. REM DOMAIN_CHECK_BEGIN
  6. SET perr1=1
  7. SET perr2=1
  8. SET perr3=1
  9. SET perr=0
  10. setlocal EnableDelayedExpansion
  11. FOR /f "delims=" %%i IN ('ping -n 1 -w 1 log-upload-os.hoyoverse.com') DO (
  12. echo %%i | find "[0.0.0.0]" >nul
  13. IF !ERRORLEVEL! EQU 0 SET "perr1=0"
  14. echo %%i | find "could not find host" >nul
  15. IF !ERRORLEVEL! EQU 0 SET "perr1=0"
  16. )
  17. FOR /f "delims=" %%i IN ('ping -n 1 -w 1 sg-public-data-api.hoyoverse.com') DO (
  18. echo %%i | find "[0.0.0.0]" >nul
  19. IF !ERRORLEVEL! EQU 0 SET "perr2=0"
  20. echo %%i | find "could not find host" >nul
  21. IF !ERRORLEVEL! EQU 0 SET "perr2=0"
  22. )
  23. FOR /f "delims=" %%i IN ('ping -n 1 -w 1 overseauspider.yuanshen.com') DO (
  24. echo %%i | find "[0.0.0.0]" >nul
  25. IF !ERRORLEVEL! EQU 0 SET "perr3=0"
  26. echo %%i | find "could not find host" >nul
  27. IF !ERRORLEVEL! EQU 0 SET "perr3=0"
  28. )
  29. REM There's no OR operator for "IF"
  30. IF %perr1% EQU 1 SET perr=1
  31. IF %perr2% EQU 1 SET perr=1
  32. IF %perr3% EQU 1 SET perr=1
  33. IF %perr% NEQ 0 (
  34. REM Show the message to the user
  35. echo ERROR: You opted to block the analytics servers but they are reachable. Please re-run the patch script. >_error.txt
  36. notepad _error.txt
  37. del _error.txt
  38. exit
  39. )
  40. REM DOMAIN_CHECK_END
  41. REM Emulate the games behaviour
  42. copy mhyprot3.sys "%TEMP%\"
  43. regedit mhyprot2_running.reg
  44. REM Disable crash reporting
  45. IF EXIST GenshinImpact_Data\upload_crash.exe (
  46. move "GenshinImpact_Data\upload_crash.exe" "GenshinImpact_Data\upload_crash.exe.bak"
  47. )
  48. IF EXIST GenshinImpact_Data\Plugins\crashreport.exe (
  49. move "GenshinImpact_Data\Plugins\crashreport.exe" "GenshinImpact_Data\Plugins\crashreport.exe.bak"
  50. )
  51. REM ============= Launch the game =============
  52. REM https://docs.unity3d.com/Manual/PlayerCommandLineArguments.html
  53. REM Append the arguments to the command: launcher.bat arg1 arg2 ...
  54. start GenshinImpact.exe %*