File tree Expand file tree Collapse file tree 1 file changed +58
-0
lines changed
Expand file tree Collapse file tree 1 file changed +58
-0
lines changed Original file line number Diff line number Diff line change 1+ @ echo off
2+ chcp 65001 > nul
3+ title 时间同步工具打包脚本
4+
5+ echo ==============================================
6+ echo 时间同步工具打包程序
7+ echo ==============================================
8+ echo .
9+
10+ :: 检查Python是否安装
11+ where python > nul 2 > nul
12+ if %errorlevel% neq 0 (
13+ echo 错误: 未找到Python环境,请先安装Python
14+ echo 下载地址: https://www.python.org/downloads/
15+ pause
16+ exit /b 1
17+ )
18+
19+ :: 安装/升级PyInstaller
20+ echo 正在安装/升级打包工具...
21+ pip install --upgrade pyinstaller > nul 2 > nul
22+ if %errorlevel% neq 0 (
23+ echo 错误: 安装PyInstaller失败,请手动执行: pip install pyinstaller
24+ pause
25+ exit /b 1
26+ )
27+
28+ :: 开始打包
29+ echo 正在打包应用程序,请稍候...
30+ echo .
31+
32+ pyinstaller ^
33+ --onefile ^
34+ --windowed ^
35+ --name=" 时间同步工具" ^
36+ --icon=" clock.ico" ^
37+ --manifest=" uac.manifest" ^
38+ --clean ^
39+ --add-data=" clock.ico;." ^
40+ main.py
41+
42+ :: 检查打包结果
43+ if %errorlevel% equ 0 (
44+ echo .
45+ echo ==============================================
46+ echo 打包成功!
47+ echo 可执行文件位置: %cd% \dist\时间同步工具.exe
48+ echo ==============================================
49+ :: 打开输出目录
50+ start dist
51+ ) else (
52+ echo .
53+ echo ==============================================
54+ echo 打包失败! 请查看上面的错误信息
55+ echo ==============================================
56+ )
57+
58+ pause
You can’t perform that action at this time.
0 commit comments