-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
59 lines (49 loc) · 1.34 KB
/
build.bat
File metadata and controls
59 lines (49 loc) · 1.34 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
@echo off
REM CapScope Windows 打包脚本
echo ========================================
echo CapScope Windows Build Script
echo ========================================
REM 检查 Python
python --version >nul 2>&1
if errorlevel 1 (
echo Error: Python not found
exit /b 1
)
REM 创建虚拟环境(如果不存在)
if not exist "venv" (
echo Creating virtual environment...
python -m venv venv
)
REM 激活虚拟环境
call venv\Scripts\activate.bat
REM 安装依赖
echo Installing dependencies...
pip install -r requirements.txt
pip install pyinstaller
REM 清理旧构建
echo Cleaning old build...
rmdir /s /q build 2>nul
rmdir /s /q dist 2>nul
REM 执行打包
echo Building CapScope...
pyinstaller CapScope.spec
REM 检查结果
if exist "dist\CapScope.exe" (
echo ========================================
echo Build successful!
echo Output: dist\CapScope.exe
echo ========================================
) else (
echo ========================================
echo Build failed!
echo ========================================
exit /b 1
)
REM 创建发布包
echo Creating release package...
mkdir "dist\CapScope-v1.0.0-win64" 2>nul
copy "dist\CapScope.exe" "dist\CapScope-v1.0.0-win64\"
copy "README.txt" "dist\CapScope-v1.0.0-win64\" 2>nul
copy "LICENSE" "dist\CapScope-v1.0.0-win64\" 2>nul
echo Done!
pause