-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_exe.bat
More file actions
34 lines (30 loc) · 1.29 KB
/
Copy pathbuild_exe.bat
File metadata and controls
34 lines (30 loc) · 1.29 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
@echo off
rem Build the portable one-file executable (no Python needed on the target PC).
rem For the full installer instead, run: powershell -File installer\build.ps1
rem Requires: pip install pyinstaller
setlocal
cd /d "%~dp0"
rem Build scratch space lives outside the project: when the repo sits in
rem OneDrive, sync locks files under the work directory and PyInstaller's
rem --clean fails with "Access is denied ... localpycs".
set "WORK=%TEMP%\dxcommand_build_portable"
rem Paths must be absolute: the spec file lives in %WORK%, so PyInstaller would
rem resolve relative --add-data sources against that folder instead of here.
pyinstaller --noconfirm --clean --onefile --windowed --name DXCommand ^
--icon "%~dp0dxcommand.ico" ^
--add-data "%~dp0static;static" ^
--add-data "%~dp0app\bundled;app\bundled" ^
--distpath "%~dp0dist" --workpath "%WORK%" --specpath "%WORK%" ^
"%~dp0run_app.py"
rem Never package silently after a failed build - that once shipped a stale exe.
if errorlevel 1 (
echo.
echo BUILD FAILED - dist\DXCommand.exe was NOT updated.
pause
exit /b 1
)
echo.
echo Done. The executable is dist\DXCommand.exe
echo Ship it on its own - config.json and data\ are created next to the exe
echo on first run, or under %%LOCALAPPDATA%%\DXCommand if that folder is read-only.
pause