Skip to content

Building SentraCore

Asiedu Minta Kwaku edited this page May 3, 2026 · 1 revision

Building SentraCore

This guide covers how to produce standalone, production-ready executables for both the Python Engine and the Flutter Dashboard, and how to compile the final Windows installer.


Prerequisites

Before running any build, ensure the following are installed and verified:

Requirement Verification Command
Python 3.11+ with virtual environment .venv\Scripts\python --version
PyInstaller (installed in venv) .venv\Scripts\pyinstaller --version
Flutter SDK (stable) flutter --version
Visual Studio with "Desktop development with C++" flutter doctor (should show green)
Inno Setup 6 Installed from jrsoftware.org

Step 1: Build the Python Engine

Run the provided build script from the repository root:

scripts\build_engine.bat

This script will:

  1. Activate the virtual environment.
  2. Clean any previous build artifacts.
  3. Run PyInstaller with the correct hidden imports for uvicorn and fastapi.
  4. Output SentraCoreEngine.exe to the dist/ directory.

The engine is compiled with the --noconsole flag so it runs as a completely invisible background process. No terminal window will appear when the user launches it.

Expected output location: dist\SentraCoreEngine.exe


Step 2: Build the Flutter Dashboard

Run the dashboard build script from the repository root:

scripts\build_dashboard.bat

This script navigates to the dashboard/ directory and runs flutter build windows --release.

Expected output location: dashboard\build\windows\x64\runner\Release\

Note: Flutter bundles the executable alongside several required DLL files and data directories. The entire Release\ folder contents must be included in the installer, not just the .exe file.


Step 3: Compile the Installer

Once both builds have completed successfully:

  1. Open Inno Setup Compiler.
  2. Go to File → Open and select installer\sentracore.iss.
  3. Press Ctrl+F9 (or click Build → Compile).

Inno Setup will package all files, shortcuts, and registry entries into a single setup executable.

Expected output location: dist\SentraCore_Setup_v1.0.exe


What the Installer Does

The sentracore.iss script configures the installer to perform the following actions:

Action Detail
Install location C:\Program Files\SentraCore\
Desktop shortcut SentraCore Dashboard.lnk (optional, user-selectable)
Start Menu group SentraCore\ with shortcuts to Dashboard and Uninstaller
Auto-start on login Adds SentraCoreEngine.exe to HKCU\...\Run (optional, user-selectable)
Post-install launch Starts the engine in the background and optionally opens the dashboard
Uninstall Kills the engine process and removes all files and registry keys

Releasing a New Version

To release a new version of SentraCore:

  1. Update the version string in engine/__init__.py (__version__).
  2. Update the AppVersion field in installer/sentracore.iss.
  3. Update the OutputBaseFilename in installer/sentracore.iss to match the new version.
  4. Commit all changes.
  5. Create and push an annotated Git tag:
    git tag -a v1.1.0 -m "Release v1.1.0"
    git push origin main --tags
  6. Run the three build steps above to produce the new installer.
  7. Create a GitHub Release from the tag and attach the new SentraCore_Setup_v*.exe as a release asset.

Clone this wiki locally