launcher.bat 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. SET perr1=1
  6. SET perr2=1
  7. SET perr=0
  8. REM Verify that the important hosts are blocked
  9. setlocal EnableDelayedExpansion
  10. FOR /f "delims=" %%i IN ('ping -n 1 -w 1 log-upload-os.mihoyo.com') DO (
  11. echo %%i | find "[0.0.0.0]" >nul
  12. IF !ERRORLEVEL! EQU 0 SET "perr1=0"
  13. echo %%i | find "could not find host" >nul
  14. IF !ERRORLEVEL! EQU 0 SET "perr1=0"
  15. )
  16. FOR /f "delims=" %%i IN ('ping -n 1 -w 1 overseauspider.yuanshen.com') DO (
  17. echo %%i | find "[0.0.0.0]" >nul
  18. IF !ERRORLEVEL! EQU 0 SET "perr2=0"
  19. echo %%i | find "could not find host" >nul
  20. IF !ERRORLEVEL! EQU 0 SET "perr2=0"
  21. )
  22. REM There's no OR operator for "IF"
  23. IF %perr1% EQU 1 SET perr=1
  24. IF %perr2% EQU 1 SET perr=1
  25. IF %perr% NEQ 0 (
  26. REM Show the message to the user
  27. echo ERROR: Crucial domains are not blocked. Please re-run the patch script. >_error.txt
  28. notepad _error.txt
  29. del _error.txt
  30. exit
  31. )
  32. REM Emulate the games behaviour
  33. copy mhyprot2.sys "%TEMP%\"
  34. regedit mhyprot2_running.reg
  35. REM Disable crash reporting
  36. IF EXIST GenshinImpact_Data\upload_crash.exe (
  37. move "GenshinImpact_Data\upload_crash.exe" "GenshinImpact_Data\upload_crash.exe.bak"
  38. )
  39. REM ============= Launch the game =============
  40. REM https://docs.unity3d.com/Manual/CommandLineArguments.html
  41. REM Append the arguments to the command: launcher.bat arg1 arg2 ...
  42. start GenshinImpact.exe %*