102 lines
2.3 KiB
Batchfile
102 lines
2.3 KiB
Batchfile
@echo off
|
|
REM ====
|
|
REM CSV zu DBF Konverter - Windows Build Script
|
|
REM Version 1.0
|
|
REM ====
|
|
|
|
setlocal enabledelayedexpansion
|
|
|
|
echo.
|
|
echo ====
|
|
echo CSV zu DBF Konverter - Windows Build
|
|
echo ====
|
|
echo.
|
|
|
|
REM Wechsle ins Projektverzeichnis
|
|
cd /d "%~dp0\.."
|
|
|
|
REM Prüfe Python Installation
|
|
echo [1/5] Pruefe Python Installation...
|
|
py --version >nul 2>&1
|
|
if errorlevel 1 (
|
|
echo.
|
|
echo FEHLER: Python wurde nicht gefunden!
|
|
echo.
|
|
echo Bitte installieren Sie Python von:
|
|
echo https://www.python.org/downloads/
|
|
echo.
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
for /f "tokens=2" %%v in ('py --version 2^>^&1') do set PYTHON_VERSION=%%v
|
|
echo Python %PYTHON_VERSION% gefunden.
|
|
|
|
REM Prüfe/Installiere PyInstaller
|
|
echo.
|
|
echo [2/5] Pruefe PyInstaller...
|
|
py -m PyInstaller --version >nul 2>&1
|
|
if errorlevel 1 (
|
|
echo PyInstaller nicht gefunden. Installiere...
|
|
py -m pip install pyinstaller
|
|
if errorlevel 1 (
|
|
echo.
|
|
echo FEHLER: PyInstaller konnte nicht installiert werden!
|
|
pause
|
|
exit /b 1
|
|
)
|
|
)
|
|
for /f "tokens=*" %%v in ('py -m PyInstaller --version 2^>^&1') do set PYINSTALLER_VERSION=%%v
|
|
echo PyInstaller %PYINSTALLER_VERSION% gefunden.
|
|
|
|
REM Bereinige alte Builds
|
|
echo.
|
|
echo [3/5] Bereinige alte Build-Dateien...
|
|
if exist build rmdir /s /q build
|
|
if exist dist rmdir /s /q dist
|
|
if exist *.spec del /f /q *.spec
|
|
echo Alte Dateien entfernt.
|
|
|
|
REM Erstelle Executable
|
|
echo.
|
|
echo [4/5] Erstelle Windows Executable...
|
|
echo Dies kann einige Minuten dauern...
|
|
echo.
|
|
|
|
py -m PyInstaller --onefile --windowed --name "CSV_DBF_Konverter" ^
|
|
csv_dbf_converter_gui.py
|
|
|
|
if errorlevel 1 (
|
|
echo.
|
|
echo FEHLER: Build fehlgeschlagen!
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
REM Kopiere zusätzliche Dateien
|
|
echo.
|
|
echo [5/5] Kopiere zusaetzliche Dateien...
|
|
xcopy config dist\config\ /E /I /Y >nul 2>&1
|
|
copy csv_dbf_converter.py dist\ >nul 2>&1
|
|
copy README.md dist\ >nul 2>&1
|
|
echo Dateien kopiert.
|
|
|
|
REM Erfolgsmeldung
|
|
echo.
|
|
echo ====
|
|
echo BUILD ERFOLGREICH!
|
|
echo ====
|
|
echo.
|
|
echo Die Executable befindet sich in:
|
|
echo dist\CSV_DBF_Konverter.exe
|
|
echo.
|
|
echo Zusaetzliche Dateien in dist\:
|
|
echo - config\ (Beispiel-Konfigurationsdateien)
|
|
echo - csv_dbf_converter.py (CLI-Version)
|
|
echo - README.md
|
|
echo.
|
|
echo Hinweis: Die Konfigurationsdateien muessen
|
|
echo im gleichen Ordner wie die .exe liegen!
|
|
echo.
|
|
pause
|