| @echo off
|
| setlocal enabledelayedexpansion
|
|
|
| echo ========================================
|
| echo AI File Converter Pro - Build Script
|
| echo ========================================
|
| echo.
|
| |
|
|
| 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
|
| )
|
| |
|
|
| 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.
|
| |
|
|
| echo [2/4] Creating executable with PyInstaller...
|
| echo This may take several minutes...
|
| |
|
|
| 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!
|
| )
|
| |
|
|
| if not exist "dist\AIFileConverter.exe" (
|
| echo ERROR: Executable not found at dist\AIFileConverter.exe!
|
| pause
|
| exit /b 1
|
| )
|
| |
|
|
| 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
|
| )
|
| |
|
|
| echo [3/4] Creating installer with Inno Setup...
|
| |
|
|
| 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
|
| )
|
| |
|
|
| 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!
|
| )
|
| |
|
|
| 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 |