Skip to content

Latest commit

 

History

History
140 lines (103 loc) · 3.74 KB

File metadata and controls

140 lines (103 loc) · 3.74 KB

Building Transaction Manager Executable

This guide will help you create a standalone Windows executable (.exe) for the Transaction Manager application.

Quick Start

Simply run:

build_exe.bat

This will automatically:

  1. Install PyInstaller if needed
  2. Build the executable
  3. Create a distributable folder

What Gets Created

After building, you'll find:

  • dist/TransactionManager/ - This is your distributable folder
  • dist/TransactionManager/TransactionManager.exe - The main executable

Distribution

To share your application with others:

  1. Copy the entire dist/TransactionManager folder (not just the .exe)

  2. The folder contains:

    • TransactionManager.exe - The main program
    • All required DLL files and dependencies
    • Python runtime (embedded)
  3. Users can run it by:

    • Double-clicking TransactionManager.exe
    • No Python installation required!

Database Location

The application will create/use transactions.db in the same folder where the executable is run.

Important Notes

First-Time Build

  • The first build may take 5-10 minutes
  • PyInstaller will download and package all dependencies
  • Subsequent builds are faster

File Size

  • The executable folder will be ~50-100 MB
  • This includes the entire Python runtime and all libraries
  • This is normal for PyInstaller applications

Antivirus Warnings

  • Some antivirus programs may flag PyInstaller executables as suspicious
  • This is a false positive (common with all PyInstaller apps)
  • You can add an exception or submit the file for analysis

Customization

Adding an Icon

  1. Get an .ico file (you can create one from a PNG using online tools)
  2. Save it as icon.ico in this folder
  3. Edit transaction_manager.spec, find the line:
    icon=None,  # Add icon='icon.ico' if you have an icon file
  4. Change it to:
    icon='icon.ico',
  5. Run build_exe.bat again

Creating a Single-File Executable

If you want a single .exe file (no folder), edit transaction_manager.spec:

Change:

exe = EXE(
    ...
    exclude_binaries=True,  # Change this to False
    ...
)

Then remove or comment out the COLLECT section at the bottom.

Note: Single-file executables:

  • Are easier to distribute (just one file)
  • Take longer to start (unpacks to temp folder)
  • Are larger in size

Troubleshooting

Build Fails

  • Make sure you're in the correct directory
  • Try: pip install --upgrade pyinstaller
  • Delete build/ and dist/ folders, then rebuild

Import Errors

  • If you get import errors, add the missing module to hiddenimports in transaction_manager.spec

Database Not Found

  • Make sure transactions.db is in the same folder as the .exe
  • Or users can import their CSV files to create a new database

Building from Command Line

If you prefer manual control:

# Install PyInstaller
pip install pyinstaller

# Build using spec file
pyinstaller --clean transaction_manager.spec

# Or build with one command (without spec file)
pyinstaller --name TransactionManager --windowed --onedir transaction_manager_gui.py

Advanced: Creating an Installer

To create a proper installer (like setup.exe), you can use:

These tools can create installers that:

  • Add shortcuts to Start Menu/Desktop
  • Handle uninstallation
  • Set up file associations
  • Look more professional

Support

If you encounter issues:

  1. Check the build/ folder for error logs
  2. Try running with console enabled (set console=True in spec file) to see error messages
  3. Make sure all Python files are in the same directory