- launcher.py reescrito para PyInstaller (Voila in-process, kernel router) - build_exe.bat: script PyInstaller (onedir + collect-all dependencias Jupyter) - build_installer.bat + installer.iss: instalador Inno Setup - schema_registro_sqlite.sql: schema DataStage en SQLite - _make_conn_str ahora respeta SCAII_TRUSTED (Windows Auth) - .env.example: quitar variables DB_* (Postgres ya no usado por DataStage) - requirements.txt: quitar psycopg2-binary Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
132 lines
4.0 KiB
Batchfile
Executable File
132 lines
4.0 KiB
Batchfile
Executable File
@echo off
|
|
REM ============================================================
|
|
REM Build .exe de Utilerias RECON 2 con PyInstaller (modo onedir)
|
|
REM Usa un conda env limpio para empaquetado reproducible.
|
|
REM ============================================================
|
|
|
|
setlocal
|
|
cd /d "%~dp0"
|
|
|
|
set ENV_NAME=utilerias-recon-build
|
|
set PY_VERSION=3.11
|
|
|
|
REM ------------------------------------------------------------
|
|
REM 1) Verificar conda
|
|
REM ------------------------------------------------------------
|
|
where conda >nul 2>nul
|
|
if errorlevel 1 (
|
|
echo [ERROR] Conda no esta en PATH. Abre "Anaconda Prompt" y vuelve a ejecutar.
|
|
goto :end
|
|
)
|
|
|
|
REM ------------------------------------------------------------
|
|
REM 2) Crear env si no existe
|
|
REM ------------------------------------------------------------
|
|
call conda env list | findstr /B "%ENV_NAME% " >nul
|
|
if errorlevel 1 (
|
|
echo [INFO] Creando env conda "%ENV_NAME%" con Python %PY_VERSION%...
|
|
call conda create -y -n %ENV_NAME% python=%PY_VERSION%
|
|
if errorlevel 1 (
|
|
echo [ERROR] No se pudo crear el env.
|
|
goto :end
|
|
)
|
|
)
|
|
|
|
REM ------------------------------------------------------------
|
|
REM 3) Activar env e instalar dependencias
|
|
REM ------------------------------------------------------------
|
|
call conda activate %ENV_NAME%
|
|
if errorlevel 1 (
|
|
echo [ERROR] No se pudo activar el env.
|
|
goto :end
|
|
)
|
|
|
|
echo [INFO] Instalando dependencias...
|
|
call pip install --upgrade pip
|
|
call pip install -r requirements.txt
|
|
if errorlevel 1 (
|
|
echo [ERROR] Fallo la instalacion de dependencias.
|
|
goto :end
|
|
)
|
|
|
|
REM ------------------------------------------------------------
|
|
REM 4) Limpiar builds previos
|
|
REM ------------------------------------------------------------
|
|
if exist build rmdir /s /q build
|
|
if exist dist rmdir /s /q dist
|
|
if exist UtileriasReconV2.spec del /q UtileriasReconV2.spec
|
|
|
|
REM ------------------------------------------------------------
|
|
REM 5) Ejecutar PyInstaller (onedir, noconsole)
|
|
REM ------------------------------------------------------------
|
|
echo [INFO] Construyendo .exe (esto tarda 3-8 minutos)...
|
|
|
|
pyinstaller launcher.py ^
|
|
--name UtileriasReconV2 ^
|
|
--onedir ^
|
|
--noconsole ^
|
|
--noconfirm ^
|
|
--collect-all voila ^
|
|
--collect-all jupyter_server ^
|
|
--collect-all jupyter_client ^
|
|
--collect-all jupyter_core ^
|
|
--collect-all nbformat ^
|
|
--collect-all nbconvert ^
|
|
--collect-all ipykernel ^
|
|
--collect-all ipywidgets ^
|
|
--collect-all jupyterlab_pygments ^
|
|
--collect-all notebook ^
|
|
--collect-all rfc3987_syntax ^
|
|
--collect-all jsonschema_specifications ^
|
|
--collect-all jsonschema ^
|
|
--collect-all jupyter_events ^
|
|
--collect-all nbclient ^
|
|
--collect-all terminado ^
|
|
--collect-all debugpy ^
|
|
--collect-all matplotlib_inline ^
|
|
--collect-all matplotlib ^
|
|
--collect-all dotenv ^
|
|
--collect-all sklearn ^
|
|
--collect-all scipy ^
|
|
--collect-all pandas ^
|
|
--collect-all numpy ^
|
|
--collect-all sqlalchemy ^
|
|
--collect-all openpyxl ^
|
|
--hidden-import pyodbc ^
|
|
--hidden-import sqlalchemy.dialects.sqlite ^
|
|
--hidden-import sqlalchemy.dialects.mssql ^
|
|
--hidden-import sklearn.utils._typedefs ^
|
|
--hidden-import sklearn.neighbors._partition_nodes
|
|
|
|
if errorlevel 1 (
|
|
echo.
|
|
echo [ERROR] PyInstaller fallo. Revisa el log arriba.
|
|
goto :end
|
|
)
|
|
|
|
REM ------------------------------------------------------------
|
|
REM 6) Copiar app.ipynb y .env.example al lado del .exe
|
|
REM ------------------------------------------------------------
|
|
copy /Y app.ipynb dist\UtileriasReconV2\app.ipynb >nul
|
|
echo [INFO] app.ipynb copiado a dist\UtileriasReconV2\
|
|
|
|
if exist ..\.env.example (
|
|
copy /Y ..\.env.example dist\UtileriasReconV2\.env.example >nul
|
|
echo [INFO] .env.example copiado a dist\UtileriasReconV2\
|
|
)
|
|
|
|
echo.
|
|
echo ============================================================
|
|
echo BUILD EXITOSO (--onedir)
|
|
echo Carpeta lista: dist\UtileriasReconV2\
|
|
echo Ejecutable: dist\UtileriasReconV2\UtileriasReconV2.exe
|
|
echo.
|
|
echo Siguiente paso: empaquetar como instalador con Inno Setup
|
|
echo .\build_installer.bat
|
|
echo ============================================================
|
|
|
|
:end
|
|
echo.
|
|
pause
|
|
endlocal
|