@echo off REM ============================================================================ REM Build script para IPSExtractor REM Genera el ejecutable con PyInstaller y opcionalmente el instalador con REM Inno Setup. REM REM Uso: REM build_installer.bat (solo PyInstaller) REM build_installer.bat --inno (PyInstaller + Inno Setup) REM ============================================================================ setlocal set "ROOT=%~dp0" cd /d "%ROOT%" echo. echo ======================================== echo IPSExtractor - Build echo ======================================== echo. REM -- Verificar Python --- python --version >nul 2>&1 if errorlevel 1 ( echo ERROR: Python no encontrado en PATH. pause exit /b 1 ) REM -- Verificar PyInstaller --- python -c "import PyInstaller" >nul 2>&1 if errorlevel 1 ( echo Instalando PyInstaller... pip install pyinstaller ) REM -- Limpiar builds anteriores --- echo Limpiando builds anteriores... if exist "build" rmdir /s /q "build" if exist "dist\IPSExtractor" rmdir /s /q "dist\IPSExtractor" REM -- Ejecutar PyInstaller --- echo. echo Ejecutando PyInstaller... echo. pyinstaller ipsextractor.spec --noconfirm if errorlevel 1 ( echo. echo ERROR: PyInstaller fallo. Revise los errores arriba. pause exit /b 1 ) echo. echo ======================================== echo Build exitoso! echo Output: dist\IPSExtractor\ echo ======================================== echo. REM -- Inno Setup (opcional) --- if /i "%~1"=="--inno" ( echo Buscando Inno Setup... set "ISCC=" if exist "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" ( set "ISCC=C:\Program Files (x86)\Inno Setup 6\ISCC.exe" ) if exist "C:\Program Files\Inno Setup 6\ISCC.exe" ( set "ISCC=C:\Program Files\Inno Setup 6\ISCC.exe" ) if not defined ISCC ( echo AVISO: Inno Setup no encontrado. Instale Inno Setup 6 para generar el instalador. echo Descargue en: https://jrsoftware.org/isdl.php pause exit /b 0 ) echo Generando instalador con Inno Setup... "%ISCC%" "%ROOT%installer.iss" if errorlevel 1 ( echo ERROR: Inno Setup fallo. pause exit /b 1 ) echo. echo ======================================== echo Instalador generado en: dist\ echo ======================================== ) pause