This guide will help you create a standalone Windows executable (.exe) for the Transaction Manager application.
Simply run:
build_exe.batThis will automatically:
- Install PyInstaller if needed
- Build the executable
- Create a distributable folder
After building, you'll find:
dist/TransactionManager/- This is your distributable folderdist/TransactionManager/TransactionManager.exe- The main executable
To share your application with others:
-
Copy the entire
dist/TransactionManagerfolder (not just the .exe) -
The folder contains:
TransactionManager.exe- The main program- All required DLL files and dependencies
- Python runtime (embedded)
-
Users can run it by:
- Double-clicking
TransactionManager.exe - No Python installation required!
- Double-clicking
The application will create/use transactions.db in the same folder where the executable is run.
- The first build may take 5-10 minutes
- PyInstaller will download and package all dependencies
- Subsequent builds are faster
- The executable folder will be ~50-100 MB
- This includes the entire Python runtime and all libraries
- This is normal for PyInstaller applications
- 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
- Get an
.icofile (you can create one from a PNG using online tools) - Save it as
icon.icoin this folder - Edit
transaction_manager.spec, find the line:icon=None, # Add icon='icon.ico' if you have an icon file
- Change it to:
icon='icon.ico',
- Run
build_exe.batagain
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
- Make sure you're in the correct directory
- Try:
pip install --upgrade pyinstaller - Delete
build/anddist/folders, then rebuild
- If you get import errors, add the missing module to
hiddenimportsintransaction_manager.spec
- Make sure
transactions.dbis in the same folder as the .exe - Or users can import their CSV files to create a new database
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.pyTo create a proper installer (like setup.exe), you can use:
- Inno Setup (free, popular): https://jrsoftware.org/isinfo.php
- NSIS (free): https://nsis.sourceforge.io/
- WiX Toolset (free, Microsoft): https://wixtoolset.org/
These tools can create installers that:
- Add shortcuts to Start Menu/Desktop
- Handle uninstallation
- Set up file associations
- Look more professional
If you encounter issues:
- Check the
build/folder for error logs - Try running with console enabled (set
console=Truein spec file) to see error messages - Make sure all Python files are in the same directory