-
-
Notifications
You must be signed in to change notification settings - Fork 174
/
Copy pathbuild.bat
executable file
·51 lines (46 loc) · 1.23 KB
/
build.bat
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
@echo off
REM Get the directory path of the script
set "dirpath=%~dp0"
if "%dirpath:~-1%" == "\" set "dirpath=%dirpath:~0,-1%"
REM Check if the virtual environment exists
if not exist "%dirpath%\env" (
echo:
echo No virtual environment found! Run setup_env.bat to set it up first.
echo:
pause
exit /b 1
)
REM Check if PyInstaller and pywin32 is installed in the virtual environment
if not exist "%dirpath%\env\scripts\pyinstaller.exe" (
echo Installing PyInstaller...
"%dirpath%\env\scripts\pip" install pyinstaller
if errorlevel 1 (
echo:
echo Failed to install PyInstaller.
echo:
pause
exit /b 1
)
"%dirpath%\env\scripts\python" "%dirpath%\env\scripts\pywin32_postinstall.py" -install -silent
if errorlevel 1 (
echo:
echo Failed to run pywin32_postinstall.py.
echo:
pause
exit /b 1
)
)
REM Run PyInstaller with the specified build spec file
echo Building...
"%dirpath%\env\scripts\pyinstaller" "%dirpath%\build.spec"
if errorlevel 1 (
echo:
echo PyInstaller build failed.
echo:
pause
exit /b 1
)
echo:
echo Build completed successfully.
echo:
pause