Byaidu 1 rok pred
rodič
commit
35fc80eb52
3 zmenil súbory, kde vykonal 37 pridanie a 4 odobranie
  1. 6 2
      README.md
  2. 6 2
      README_zh-CN.md
  3. 25 0
      setup.bat

+ 6 - 2
README.md

@@ -66,7 +66,7 @@ Note that the computing resources of the demo are limited, so please avoid abusi
 
 <h2 id="install">Installation and Usage</h2>
 
-We provide three methods for using this project: [Commandline](#cmd), [GUI](#gui), and [Docker](#docker).
+We provide three methods for using this project: [Commandline](#cmd), [GUI](#gui), [Portable](#portable), and [Docker](#docker).
 
 <h3 id="cmd">Method I. Commandline</h3>
 
@@ -108,7 +108,11 @@ We provide three methods for using this project: [Commandline](#cmd), [GUI](#gui
 
 See [documentation for GUI](./docs/README_GUI.md) for more details.
 
-<h3 id="docker">Method III. Docker</h3>
+<h3 id="portable">Method III. Portable</h3>
+
+Download and double-click to run [setup.bat](https://raw.githubusercontent.com/Byaidu/PDFMathTranslate/refs/heads/main/setup.bat)
+
+<h3 id="docker">Method IV. Docker</h3>
 
 1. Pull and run:
 

+ 6 - 2
README_zh-CN.md

@@ -66,7 +66,7 @@
 
 <h2 id="install">安装和使用</h2>
 
-我们提供了三种使用该项目的方法:[命令行工具](#cmd)、[图形交互界面](#gui) 和 [容器化部署](#docker).
+我们提供了三种使用该项目的方法:[命令行工具](#cmd)、[图形交互界面](#gui)、[便携式安装](#portable) 和 [容器化部署](#docker).
 
 <h3 id="cmd">方法一、命令行工具</h3>
 
@@ -108,7 +108,11 @@
 
 查看 [documentation for GUI](./docs/README_GUI.md) 获取细节说明
 
-<h3 id="docker">方法三、容器化部署</h3>
+<h3 id="portable">方法三、便携式安装</h3>
+
+下载并双击运行 [setup.bat](https://raw.githubusercontent.com/Byaidu/PDFMathTranslate/refs/heads/main/setup.bat)
+
+<h3 id="docker">方法四、容器化部署</h3>
 
 1. 拉取 Docker 镜像并运行:
 

+ 25 - 0
setup.bat

@@ -0,0 +1,25 @@
+@echo off
+setlocal enabledelayedexpansion
+
+set PYTHON_URL=https://www.python.org/ftp/python/3.12.7/python-3.12.7-embed-amd64.zip
+set PIP_URL=https://bootstrap.pypa.io/get-pip.py
+set HF_ENDPOINT=https://hf-mirror.com
+
+if not exist pdf2zh/python.exe (
+    powershell -Command "& {Invoke-WebRequest -Uri !PYTHON_URL! -OutFile python.zip}"
+    powershell -Command "& {Expand-Archive -Path python.zip -DestinationPath pdf2zh -Force}"
+    del python.zip
+    echo import site >> pdf2zh/python312._pth
+)
+cd pdf2zh
+
+if not exist Scripts/pip.exe (
+    powershell -Command "& {Invoke-WebRequest -Uri !PIP_URL! -OutFile get-pip.py}"
+    python get-pip.py
+)
+path Scripts
+
+pip install --no-warn-script-location --upgrade pdf2zh
+pdf2zh -i
+
+pause