uninstall.bat 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. @echo off
  2. rem ============================================================================
  3. rem Guanlan uninstaller (entry). ASCII ONLY (see docs 11.3).
  4. rem
  5. rem Usage:
  6. rem uninstall.bat uninstall everything (plan first)
  7. rem uninstall.bat --module app_ETL uninstall one module
  8. rem uninstall.bat --module app_ETL --dry-run dry run for one module
  9. rem uninstall.bat --list list module names
  10. rem (other flags --yes --purge --all --keep-logs are passed through)
  11. rem ============================================================================
  12. chcp 65001 >nul
  13. set PYTHONUTF8=1
  14. set "HERE=%~dp0"
  15. if /i "%~1"=="--list" (
  16. echo app_frontEnd app_backEnd app_algorithmModel app_ETL
  17. pause
  18. exit /b 0
  19. )
  20. if /i "%~1"=="--module" goto by_module
  21. rem ---- whole-package uninstall (unchanged behaviour) ----
  22. set "SCRIPT=%HERE%scripts\guanlan_uninstall.py"
  23. cd /d "%TEMP%"
  24. if exist "%HERE%.venv\Scripts\python.exe" (
  25. "%HERE%.venv\Scripts\python.exe" "%SCRIPT%" %*
  26. goto done
  27. )
  28. where py >nul 2>nul && ( py -3 "%SCRIPT%" %* & goto done )
  29. python "%SCRIPT%" %*
  30. goto done
  31. :by_module
  32. set "MODS=%~2"
  33. shift
  34. shift
  35. for %%M in (%MODS:,= %) do (
  36. if not exist "%HERE%%%M\uninstall.bat" (
  37. echo [X] unknown module: %%M
  38. ) else (
  39. echo == uninstall module %%M
  40. call "%HERE%%%M\uninstall.bat" %1 %2 %3 %4 %5
  41. )
  42. )
  43. goto done
  44. :done
  45. pause