-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_exe.bat
More file actions
48 lines (39 loc) · 1.35 KB
/
Copy pathbuild_exe.bat
File metadata and controls
48 lines (39 loc) · 1.35 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
@echo off
setlocal EnableExtensions
cd /d "%~dp0"
set "PYTHONIOENCODING=utf-8"
set "PROJECT_NAME=PDFtoPDFocr"
set "PROJECT_ROOT=%CD%"
set "SPEC_FILE=%PROJECT_ROOT%\PDFtoPDFocr.spec"
set "BUILD_ROOT=C:\_Local_DEV\BUILDS\%PROJECT_NAME%\1.1.4"
set "DIST_DIR=%PROJECT_ROOT%\dist"
echo [INFO] Starte Build fuer %PROJECT_NAME%...
python --version >nul 2>&1
if errorlevel 1 (
echo [FEHLER] Python wurde nicht gefunden.
exit /b 1
)
python -c "import PyInstaller" >nul 2>&1
if errorlevel 1 (
echo [FEHLER] PyInstaller fehlt. Bitte im Venv installieren.
exit /b 1
)
if not exist "%BUILD_ROOT%" mkdir "%BUILD_ROOT%"
if not exist "%DIST_DIR%" mkdir "%DIST_DIR%"
REM --specpath ist NICHT erlaubt, wenn PyInstaller mit einem bestehenden .spec
REM aufgerufen wird (nur workpath/distpath/noconfirm/clean gelten dann; Fund
REM 2026-08-18, T-20260816-296785081: "option(s) not allowed: --specpath").
python -m PyInstaller --noconfirm --clean ^
--workpath "%BUILD_ROOT%\build" ^
--distpath "%BUILD_ROOT%\dist" ^
"%SPEC_FILE%"
if errorlevel 1 (
echo [FEHLER] PyInstaller-Build fehlgeschlagen.
exit /b 1
)
if exist "%BUILD_ROOT%\dist\%PROJECT_NAME%" (
echo [INFO] Synchronisiere Dist-Artefakte...
xcopy /E /I /Y "%BUILD_ROOT%\dist\%PROJECT_NAME%" "%DIST_DIR%\%PROJECT_NAME%" >nul
)
echo [OK] Build erfolgreich: %DIST_DIR%\%PROJECT_NAME%
endlocal