102 lines
3.1 KiB
Batchfile
102 lines
3.1 KiB
Batchfile
@echo off
|
|
setlocal enabledelayedexpansion
|
|
|
|
echo ============================================================
|
|
echo Parts Lookup Program - Automated Installer Builder
|
|
echo ============================================================
|
|
echo.
|
|
|
|
echo === Step 1: Compiling PyInstaller Distribution ===
|
|
echo Running build.bat...
|
|
call build.bat
|
|
|
|
if errorlevel 1 (
|
|
echo.
|
|
echo [ERROR] PyInstaller compilation failed!
|
|
echo Cannot compile the setup installer without a valid "dist\PartsLookup" directory.
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
echo.
|
|
echo === Step 2: Compiling Windows Installer (Inno Setup) ===
|
|
|
|
REM Define common installation paths for Inno Setup 6 Compiler (ISCC.exe)
|
|
set "ISCC_PATH=C:\Program Files (x86)\Inno Setup 6\ISCC.exe"
|
|
if not exist "!ISCC_PATH!" (
|
|
set "ISCC_PATH=C:\Program Files\Inno Setup 6\ISCC.exe"
|
|
)
|
|
if not exist "!ISCC_PATH!" (
|
|
set "ISCC_PATH=%LocalAppData%\Programs\Inno Setup 6\ISCC.exe"
|
|
)
|
|
|
|
REM Fallback check to see if ISCC is in the system PATH
|
|
where ISCC.exe >nul 2>nul
|
|
if not errorlevel 1 (
|
|
set "ISCC_PATH=ISCC.exe"
|
|
)
|
|
|
|
REM Verify if the compiler exists
|
|
if not exist "!ISCC_PATH!" (
|
|
if "!ISCC_PATH!"=="ISCC.exe" (
|
|
goto :NOSUPPORT
|
|
) else (
|
|
goto :NOSUPPORT
|
|
)
|
|
)
|
|
|
|
echo Found Inno Setup Compiler at: !ISCC_PATH!
|
|
echo Compiling "installer.iss" to create single-file installer...
|
|
echo.
|
|
|
|
"!ISCC_PATH!" installer.iss
|
|
|
|
if errorlevel 1 (
|
|
echo.
|
|
echo [ERROR] Inno Setup compilation failed!
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
echo.
|
|
echo ============================================================
|
|
echo SUCCESSFULLY COMPILED!
|
|
echo ============================================================
|
|
echo.
|
|
echo Your single-file Windows Installer has been created at:
|
|
echo c:\Users\mario\OneDrive\Documents\Claude\Projects\Part Lookup Program (1)\CSGPackerShipperHelper_Setup.exe
|
|
echo.
|
|
echo You can copy this single setup file to any Windows computer to:
|
|
echo - Cleanly install CSG Packer Shipper Helper
|
|
echo - Automatically overwrite old versions (upgrade) safely
|
|
echo - Generate Desktop and Start Menu shortcuts with the app icon
|
|
echo - Register a clean uninstaller in Windows Add/Remove Programs
|
|
echo.
|
|
echo ============================================================
|
|
pause
|
|
exit /b 0
|
|
|
|
:NOSUPPORT
|
|
echo.
|
|
echo ============================================================
|
|
echo [NOTICE] Inno Setup Compiler (ISCC.exe) was not detected!
|
|
echo ============================================================
|
|
echo Your PyInstaller application built successfully at:
|
|
echo dist\CSGPackerShipperHelper\
|
|
echo.
|
|
echo To wrap this folder into a professional Windows Installer (.exe):
|
|
echo.
|
|
echo 1. Download and install the free Inno Setup (version 6 recommended):
|
|
echo https://jrsoftware.org/isdl.php
|
|
echo.
|
|
echo 2. Once Inno Setup is installed, run this "build_installer.bat" script
|
|
echo again, and it will automatically compile the installer for you!
|
|
echo.
|
|
echo Alternatively, you can:
|
|
echo - Right-click "installer.iss" in File Explorer and choose "Compile".
|
|
echo - Double-click "installer.iss" to edit/run it inside the Inno Setup GUI.
|
|
echo ============================================================
|
|
echo.
|
|
pause
|
|
endlocal
|