launcher.bat 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 SCRIPT_SANITY_BEGIN
  6. echo ERROR: This file needs postprocessing. Run the script to generate it.
  7. exit
  8. REM SCRIPT_SANITY_END
  9. REM DOMAIN_CHECK_BEGIN
  10. SET perr1=1
  11. SET perr2=1
  12. SET perr3=1
  13. SET perr4=1
  14. SET perr5=1
  15. setlocal EnableDelayedExpansion
  16. FOR /f "delims=" %%i IN ('ping -n 1 -w 1 UNKNOWN_DOMAIN') DO (
  17. echo %%i | find "[0.0.0.0]" >nul
  18. IF !ERRORLEVEL! EQU 0 SET "perr1=0"
  19. echo %%i | find "could not find host" >nul
  20. IF !ERRORLEVEL! EQU 0 SET "perr1=0"
  21. )
  22. FOR /f "delims=" %%i IN ('ping -n 1 -w 1 UNKNOWN_DOMAIN') DO (
  23. echo %%i | find "[0.0.0.0]" >nul
  24. IF !ERRORLEVEL! EQU 0 SET "perr2=0"
  25. echo %%i | find "could not find host" >nul
  26. IF !ERRORLEVEL! EQU 0 SET "perr2=0"
  27. )
  28. FOR /f "delims=" %%i IN ('ping -n 1 -w 1 UNKNOWN_DOMAIN') DO (
  29. echo %%i | find "[0.0.0.0]" >nul
  30. IF !ERRORLEVEL! EQU 0 SET "perr3=0"
  31. echo %%i | find "could not find host" >nul
  32. IF !ERRORLEVEL! EQU 0 SET "perr3=0"
  33. )
  34. FOR /f "delims=" %%i IN ('ping -n 1 -w 1 UNKNOWN_DOMAIN') DO (
  35. echo %%i | find "[0.0.0.0]" >nul
  36. IF !ERRORLEVEL! EQU 0 SET "perr4=0"
  37. echo %%i | find "could not find host" >nul
  38. IF !ERRORLEVEL! EQU 0 SET "perr4=0"
  39. )
  40. FOR /f "delims=" %%i IN ('ping -n 1 -w 1 UNKNOWN_DOMAIN') DO (
  41. echo %%i | find "[0.0.0.0]" >nul
  42. IF !ERRORLEVEL! EQU 0 SET "perr5=0"
  43. echo %%i | find "could not find host" >nul
  44. IF !ERRORLEVEL! EQU 0 SET "perr5=0"
  45. )
  46. REM There's no OR operator for "IF"
  47. SET perr=0
  48. IF %perr1% EQU 1 SET perr=1
  49. IF %perr2% EQU 1 SET perr=1
  50. IF %perr3% EQU 1 SET perr=1
  51. IF %perr4% EQU 1 SET perr=1
  52. IF %perr5% EQU 1 SET perr=1
  53. IF %perr% NEQ 0 (
  54. REM Show the message to the user
  55. echo ERROR: You opted to block the analytics servers but they are reachable. Please re-run the patch script. >_error.txt
  56. notepad _error.txt
  57. del _error.txt
  58. exit
  59. )
  60. REM DOMAIN_CHECK_END
  61. REM ============= Launch the game =============
  62. REM https://docs.unity3d.com/Manual/PlayerCommandLineArguments.html
  63. REM Append the arguments to the command: launcher.bat arg1 arg2 ...
  64. start /wait GenshinImpact.exe %*