patch_revert.sh 908 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. if [[ -e "$FILE.bak" ]]; then
  10. # Restore from backup
  11. mv -f "$FILE.bak" "$FILE"
  12. echo "-- Restored $FILE"
  13. else
  14. echo "-- Cannot restore '$FILE' (.bak not found)"
  15. fi
  16. if [[ -e "$CEXE" ]]; then
  17. echo "-- Crash reporter already exists"
  18. else
  19. if [[ -e "$CEXE.bak" ]]; then
  20. # Restore from backup
  21. mv -f "$CEXE.bak" "$CEXE"
  22. echo "-- Restored the crash reporter"
  23. else
  24. echo "-- Cannot restore '$CEXE' (.bak not found)"
  25. fi
  26. fi
  27. echo "-- Removing all newly added files"
  28. # The error messages for inexistent files are intended
  29. rm "launcher.bat"
  30. rm "mhyprot2_running.reg"
  31. # dxvk files
  32. rm *.dxvk-cache
  33. rm *_d3d9.log
  34. rm *_d3d11.log
  35. rm *_dxgi.log
  36. echo "==> Patch reverted."
  37. exit 0