-
Notifications
You must be signed in to change notification settings - Fork 1
/
build-win.bat
55 lines (46 loc) · 1.26 KB
/
build-win.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
52
53
54
55
@echo off
setlocal enabledelayedexpansion
REM
set "DATA_DIR=%~dp0"
set "VENV_DIR=%DATA_DIR%\env"
set "REQUIREMENTS_FILE=%DATA_DIR%\requirements.txt"
set "ELECTRUMZ_FILE_EXE=%DATA_DIR%\dist\ElectrumZ-Server.exe"
set "BUILD_DIR=%DATA_DIR%\dist"
REM
echo Checking for Python installation...
where python >nul 2>&1
if %errorlevel% neq 0 (
echo Python is not installed. Please install Python and try again.
pause
exit /b 1
)
echo Python is installed.
REM
echo.
echo Setting up Python virtual environment...
timeout /t 1 /nobreak >nul
if not exist "%VENV_DIR%\Scripts\activate.bat" (
echo Virtual environment does not exist, creating it...
python -m venv %VENV_DIR%
) else (
echo Virtual environment already exists, skipping creation...
)
call %VENV_DIR%\Scripts\activate.bat
python -m pip install --upgrade pip
echo Installing required packages from %REQUIREMENTS_FILE%...
pip install -r %REQUIREMENTS_FILE%
REM
echo Running PyInstaller to build the executable...
pyinstaller ./deterministic.spec
REM
call %VENV_DIR%\Scripts\deactivate.bat
REM
where makensis >nul 2>&1
if %errorlevel% neq 0 (
echo NSIS is not installed. Skipping NSIS packaging.
) else (
echo Running NSIS to create installer...
makensis ./electrumz.nsi
)
echo Build completed.
pause