AllFileConverter / build_installer.bat
embedingHF's picture
Upload folder using huggingface_hub
84fc8e7 verified
Raw
History Blame Contribute Delete
3.54 kB
@echo off
setlocal enabledelayedexpansion
echo ========================================
echo AI File Converter Pro - Build Script
echo ========================================
echo.
REM Check Python/pyinstaller availability
echo [0/4] Checking build tools...
where pyinstaller >nul 2>&1
if %errorlevel% neq 0 (
echo ERROR: PyInstaller not found! Install with: pip install pyinstaller
pause
exit /b 1
)
REM Clean previous builds
echo [1/4] Cleaning previous builds...
if exist build rmdir /s /q build
if exist dist rmdir /s /q dist
if exist *.spec del /q *.spec
echo Clean complete.
REM Run PyInstaller with better options
echo [2/4] Creating executable with PyInstaller...
echo This may take several minutes...
REM Use --collect-all for problematic packages and --hidden-import for missing modules
pyinstaller --noconsole --onefile ^
--icon=logo.ico ^
--name="AIFileConverter" ^
--hidden-import=pycparser.lextab ^
--hidden-import=pycparser.yacctab ^
--hidden-import=scipy.special._cdflib ^
--collect-all=torch ^
--collect-all=transformers ^
--collect-all=cv2 ^
--add-data="logo.ico;." ^
main.py
if !errorlevel! neq 0 (
echo ERROR: PyInstaller failed with error !errorlevel!
pause
exit /b !errorlevel!
)
REM Check if executable was created
if not exist "dist\AIFileConverter.exe" (
echo ERROR: Executable not found at dist\AIFileConverter.exe!
pause
exit /b 1
)
REM Get executable size for info
for %%A in ("dist\AIFileConverter.exe") do (
set EXE_SIZE=%%~zA
set /a EXE_SIZE_MB=!EXE_SIZE!/1048576
echo Executable size: !EXE_SIZE_MB! MB
)
REM Create installer with Inno Setup
echo [3/4] Creating installer with Inno Setup...
REM Check if Inno Setup installer script exists
if not exist "setup_advanced.iss" (
echo WARNING: setup_advanced.iss not found in current directory!
echo Listing current directory contents:
dir *.iss 2>nul
echo.
echo Please ensure setup_advanced.iss exists.
pause
exit /b 1
)
REM Try to find Inno Setup compiler
set ISCC_PATH=
if exist "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" set ISCC_PATH=C:\Program Files (x86)\Inno Setup 6\ISCC.exe
if exist "C:\Program Files\Inno Setup 6\ISCC.exe" set ISCC_PATH=C:\Program Files\Inno Setup 6\ISCC.exe
if exist "C:\Program Files (x86)\Inno Setup 7\ISCC.exe" set ISCC_PATH=C:\Program Files (x86)\Inno Setup 7\ISCC.exe
if exist "C:\Program Files\Inno Setup 7\ISCC.exe" set ISCC_PATH=C:\Program Files\Inno Setup 7\ISCC.exe
if "%ISCC_PATH%"=="" (
echo ERROR: Inno Setup not found!
echo Please install Inno Setup from: https://jrsoftware.org/isdl.php
echo Or place ISCC.exe in your PATH.
pause
exit /b 1
)
echo Using Inno Setup at: %ISCC_PATH%
"%ISCC_PATH%" setup_advanced.iss
if !errorlevel! neq 0 (
echo ERROR: Inno Setup compilation failed with error !errorlevel!
pause
exit /b !errorlevel!
)
REM Check if installer was created
if exist "InstallerOutput\AI_File_Converter_Pro_v2.0_Setup.exe" (
echo.
echo [4/4] Build completed successfully!
echo.
echo ========================================
echo Installer created: InstallerOutput\AI_File_Converter_Pro_v2.0_Setup.exe
echo ========================================
) else (
echo WARNING: Build completed but installer not found at expected location!
echo Check Inno Setup output for actual location.
)
echo.
pause