setup.bat 731 B

12345678910111213141516171819202122232425
  1. @echo off
  2. setlocal enabledelayedexpansion
  3. set PYTHON_URL=https://www.python.org/ftp/python/3.12.7/python-3.12.7-embed-amd64.zip
  4. set PIP_URL=https://bootstrap.pypa.io/get-pip.py
  5. set HF_ENDPOINT=https://hf-mirror.com
  6. if not exist pdf2zh/python.exe (
  7. powershell -Command "& {Invoke-WebRequest -Uri !PYTHON_URL! -OutFile python.zip}"
  8. powershell -Command "& {Expand-Archive -Path python.zip -DestinationPath pdf2zh -Force}"
  9. del python.zip
  10. echo import site >> pdf2zh/python312._pth
  11. )
  12. cd pdf2zh
  13. if not exist Scripts/pip.exe (
  14. powershell -Command "& {Invoke-WebRequest -Uri !PIP_URL! -OutFile get-pip.py}"
  15. python get-pip.py
  16. )
  17. path Scripts
  18. pip install --no-warn-script-location --upgrade pdf2zh
  19. pdf2zh -i
  20. pause