-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_exe.bat
More file actions
73 lines (63 loc) · 1.62 KB
/
build_exe.bat
File metadata and controls
73 lines (63 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
@echo off
chcp 65001 >nul
echo ========================================
echo Windows Update管理工具 - EXE打包脚本
echo ========================================
echo.
echo 正在清理旧的构建文件...
if exist "build" rmdir /s /q "build"
if exist "dist" rmdir /s /q "dist"
if exist "__pycache__" rmdir /s /q "__pycache__"
for /d /r . %%d in (__pycache__) do @if exist "%%d" rmdir /s /q "%%d"
echo ✅ 清理完成
echo.
echo 正在检查PyInstaller...
pyinstaller --version >nul 2>&1
if errorlevel 1 (
echo ❌ PyInstaller未安装,正在安装...
pip install pyinstaller
if errorlevel 1 (
echo ❌ PyInstaller安装失败
pause
exit /b 1
)
)
echo ✅ PyInstaller检查通过
echo.
echo 正在打包EXE文件...
echo 这可能需要几分钟时间,请耐心等待...
echo.
pyinstaller build_config.spec --clean --noconfirm
if errorlevel 1 (
echo ❌ EXE打包失败
echo 请检查错误信息并重试
pause
exit /b 1
)
echo.
echo ✅ EXE打包完成!
echo.
echo 正在验证打包结果...
if exist "dist\WindowsUpdateManager\WindowsUpdateManager.exe" (
echo ✅ 主程序文件存在
) else (
echo ❌ 主程序文件不存在
pause
exit /b 1
)
echo.
echo ========================================
echo 🎉 打包成功完成!
echo ========================================
echo.
echo 打包结果位置:
echo dist\WindowsUpdateManager\
echo.
echo 主程序文件:
echo dist\WindowsUpdateManager\WindowsUpdateManager.exe
echo.
echo 下一步:
echo 1. 测试运行打包后的程序
echo 2. 运行 create_installer.bat 创建安装程序
echo.
pause