patch_revert.sh 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #!/bin/bash
  2. if [[ ! -e "GenshinImpact.exe" ]]; then
  3. echo "-- GenshinImpact executable not found. Wrong directory?"
  4. exit 1
  5. fi
  6. # Restore files that have a backup
  7. FILE="UnityPlayer.dll"
  8. CEXE="GenshinImpact_Data/upload_crash.exe"
  9. XLUA="GenshinImpact_Data/Plugins/xlua.dll"
  10. if [[ -e "$FILE.bak" ]]; then
  11. # Restore from backup
  12. mv -f "$FILE.bak" "$FILE"
  13. echo "-- Restored $FILE"
  14. else
  15. echo "-- Nothing to restore for '$FILE' (no .bak file)"
  16. fi
  17. if [[ -e "$CEXE" ]]; then
  18. echo "-- Crash reporter already exists"
  19. else
  20. if [[ -e "$CEXE.bak" ]]; then
  21. # Restore from backup
  22. mv -f "$CEXE.bak" "$CEXE"
  23. echo "-- Restored the crash reporter"
  24. else
  25. echo "-- Cannot restore '$CEXE' (.bak not found)"
  26. fi
  27. fi
  28. if [[ -e "$XLUA.bak" ]]; then
  29. # Restore from backup
  30. mv -f "$XLUA.bak" "$XLUA"
  31. echo "-- Restored $XLUA"
  32. else
  33. echo "-- Nothing to restore for '$XLUA' (no .bak file)"
  34. fi
  35. echo "-- Removing all newly added files"
  36. # The error messages for inexistent files are intended
  37. rm "launcher.bat"
  38. rm "mhyprot2_running.reg"
  39. # xlua patch
  40. rm "no message"
  41. # dxvk files
  42. rm *.dxvk-cache
  43. rm *_d3d9.log
  44. rm *_d3d11.log
  45. rm *_dxgi.log
  46. echo "==> Patch reverted."
  47. exit 0