A Python package that simplifies creating Windows and macOS installers for Python applications.
- 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
- Python 3.8.6 or later
- py2exe
- pywin32
- InnoSetup
- py2app
pip install installer_builderRun the tracked test suite with:
uv run pytestCI runs the complete suite on Windows with CPython 3.8 and 3.14. The tests mock freezer, compiler and signing operations; they do not create or sign installers. Python 3.8 covers the declared minimum, and 3.14 is the latest minor supported by the current py2exe dependency. This matrix does not establish Python 3.15 support.
Build this library's wheel and source distribution without building an installer:
uv buildCI builds these packages after the tests and requires both artifacts. No lockfile is tracked, so the test command resolves the existing declared dependencies.
from installer_builder import InstallerBuilder
builder = 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()from installer_builder import InstallerBuilder
builder = 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()For applications that follow a specific structure, you can use the AppInstallerBuilder:
from installer_builder import AppInstallerBuilder
class MyApp:
name = "MyApp"
version = "1.0.0"
author = "Your Name"
website = "https://myapp.example.com"
# Optional attributes
register_startup = True
update_endpoint = "https://myapp.example.com/updates"
app = MyApp()
builder = AppInstallerBuilder(
application=app,
certificate_file="path/to/certificate.pfx",
has_translations=True,
)
builder.build()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:
import app_framework
from installer_builder import AppInstallerBuilder
# Your app_framework application
import application
builder = 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_fileandconfig_specoutputfor accessibilitysoundandUI_soundsupdate_endpointactivation_modulemain_window_classdebug_portanddebug_host
To sign your Windows executables and installer:
builder = InstallerBuilder(
# ... other parameters
certificate_file="path/to/certificate.pfx",
certificate_password="your_password", # Optional, will prompt if not provided
extra_files_to_sign=["additional.exe", "library.dll"],
)This project is licensed under the MIT License - see the LICENSE file for details.