Repository navigation
Expand file tree
/
Copy pathBuild_Simple_SFTP_Server.bat
More file actions
80 lines (72 loc) · 2.72 KB
/
Copy pathBuild_Simple_SFTP_Server.bat
File metadata and controls
80 lines (72 loc) · 2.72 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
74
75
76
77
78
79
80
@echo off
REM ============================================================
REM Build script for Simple SFTP Server - standalone Windows app
REM Author: JDE-Projects
REM ============================================================
REM Installs the pinned deps from requirements.txt (pywebview + PySide6,
REM paramiko + crypto stack), then builds a standalone --onedir app. The
REM resulting dist\ folder runs on any Windows PC with no Python or other
REM software installed.
REM
REM Qt binding: PySide6 (LGPL), NOT PyQt6 (GPL). QT_API=pyside6 makes any
REM qtpy import bind PySide6. --onedir keeps the bundled LGPL Qt replaceable.
REM ============================================================
cd /d "%~dp0"
REM --- skip interactive pauses when running in CI (GitHub Actions sets CI) ---
set "PAUSE=pause"
if defined CI set "PAUSE="
REM --- force the LGPL Qt binding for any qtpy import during the build ---
set QT_API=pyside6
echo.
echo ============================================================
echo Simple SFTP Server - Standalone App Builder
echo ============================================================
echo.
REM --- check Python ---
python --version >nul 2>&1
if errorlevel 1 (
echo ERROR: Python is not installed or not in PATH.
echo Install Python 3 from https://python.org and tick "Add Python to PATH".
%PAUSE%
exit /b 1
)
echo [1/3] Installing pinned dependencies from requirements.txt ...
python -m pip install --upgrade pip >nul
python -m pip install -r requirements.txt
if errorlevel 1 (
echo ERROR: Failed to install dependencies from requirements.txt.
%PAUSE%
exit /b 1
)
REM --- clean previous output for a fresh build ---
if exist build rmdir /s /q build
if exist dist rmdir /s /q dist
if exist "Simple SFTP Server.spec" del /q "Simple SFTP Server.spec"
echo [2/3] Building standalone app (--onedir) ... this may take a few minutes.
python -m PyInstaller --noconfirm --onedir --windowed --name "Simple SFTP Server" ^
--icon "simple_sftp_server.ico" ^
--add-data "simple_sftp_server-UI.html;." ^
--add-data "simple_sftp_server.png;." ^
--add-data "fonts;fonts" ^
--collect-all PySide6 ^
--collect-all qtpy ^
--collect-all webview ^
--hidden-import truststore ^
simple_sftp_server.py
if errorlevel 1 (
echo ERROR: Build failed. Read the last lines above for the cause.
%PAUSE%
exit /b 1
)
echo [3/3] Done.
echo.
echo ============================================================
echo BUILD SUCCESSFUL!
echo ============================================================
echo.
echo dist\Simple SFTP Server\Simple SFTP Server.exe
echo.
echo Distribute the WHOLE "Simple SFTP Server" folder (zip it).
echo ============================================================
echo.
%PAUSE%