uninstall.bat 787 B

12345678910111213141516171819202122
  1. @echo off
  2. rem Guanlan uninstaller (entry). Windows batch must stay pure ASCII: see src/entry_refs.py.
  3. rem Usage: uninstall.bat [--dry-run] [--yes] [--purge] [--all] [--keep-logs] [--selftest]
  4. rem NOTE: the console working directory is moved to %TEMP% on purpose. Windows refuses to delete
  5. rem a directory that is the current directory of a live process, and --all has to delete
  6. rem this very folder. All paths below are absolute, so nothing depends on the cwd.
  7. chcp 65001 >nul
  8. set PYTHONUTF8=1
  9. set "HERE=%~dp0"
  10. set "SCRIPT=%HERE%scripts\guanlan_uninstall.py"
  11. cd /d "%TEMP%"
  12. if exist "%HERE%.venv\Scripts\python.exe" (
  13. "%HERE%.venv\Scripts\python.exe" "%SCRIPT%" %*
  14. goto done
  15. )
  16. where py >nul 2>nul && (
  17. py -3 "%SCRIPT%" %*
  18. goto done
  19. )
  20. python "%SCRIPT%" %*
  21. :done
  22. pause