Skip to content

Repository files navigation

Installer Builder

A Python package that simplifies creating Windows and macOS installers for Python applications.

Features

  • Create Windows installers using InnoSetup
  • Create macOS DMG installers
  • Automatic code signing support
  • Bundle Visual C++ runtime libraries
  • Support for COM servers and Windows services
  • Automatic startup registration
  • Localization support
  • Update archive creation

Requirements

Windows

  • Python 2.5 or later
  • py2exe
  • pywin32
  • InnoSetup

macOS

  • py2app

Installation

pip install installer_builder

Testing

Run the tracked test suite with:

uv run pytest

Basic Usage

frominstaller_builderimportInstallerBuilderbuilder=InstallerBuilder(
main_module="your_app.py",
name="YourApp",
version="1.0.0",
author="Your Name",
author_email="your.email@example.com",
url="https://yourapp.example.com",
)
builder.build()

Advanced Usage

frominstaller_builderimportInstallerBuilderbuilder=InstallerBuilder(
main_module="your_app.py",
name="YourApp",
version="1.0.0",
author="Your Name",
author_email="your.email@example.com",
url="https://yourapp.example.com",
datafiles=[("", ["README.md", "LICENSE"])],
includes=["module1", "module2"],
excludes=["module3", "module4"],
extra_packages=["package1", "package2"],
create_update=True,
certificate_file="path/to/certificate.pfx",
register_startup=True,
has_translations=True,
)
builder.build()

AppInstallerBuilder

For applications that follow a specific structure, you can use the AppInstallerBuilder:

frominstaller_builderimportAppInstallerBuilderclassMyApp:
name="MyApp"version="1.0.0"author="Your Name"website="https://myapp.example.com"# Optional attributesregister_startup=Trueupdate_endpoint="https://myapp.example.com/updates"app=MyApp()
builder=AppInstallerBuilder(
application=app,
certificate_file="path/to/certificate.pfx",
has_translations=True,
)
builder.build()

Integration with app_framework

The AppInstallerBuilder is designed to work seamlessly with applications built using the app_framework. It automatically handles:

  • Configuration files and specs
  • Internationalization and localization
  • Sound output and UI sounds
  • Activation and product key management
  • Autoupdater integration
  • Debug shell configuration

For app_framework applications, simply pass your application object:

importapp_frameworkfrominstaller_builderimportAppInstallerBuilder# Your app_framework applicationimportapplicationbuilder=AppInstallerBuilder(
application=application,
certificate_file="path/to/certificate.pfx",
has_translations=True,
)
builder.build()

The builder will automatically detect app_framework-specific attributes like:

  • config_file and config_spec
  • output for accessibility
  • sound and UI_sounds
  • update_endpoint
  • activation_module
  • main_window_class
  • debug_port and debug_host

Code Signing

To sign your Windows executables and installer:

builder=InstallerBuilder(
# ... other parameterscertificate_file="path/to/certificate.pfx",
certificate_password="your_password", # Optional, will prompt if not providedextra_files_to_sign=["additional.exe", "library.dll"],
)

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Build Cross-platform installers (Innosetup on Windows and .dmg on Mac) along with update archives

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages