Skip to content

Add Hooks for PyInstaller #59

Description

Currently, packaging and running the following minimal example with PyInstaller and --collect-data mscerts results in a FileNotFoundError.

from pathlib import Path

from signify.authenticode import AuthenticodeFile

with Path("test.dll").open("rb") as file_obj:
    _, exception = AuthenticodeFile.from_stream(file_obj).explain_verify()
    if exception is not None:
        raise exception

This is caused by signify\authenticode\legacy-certs.pem not being added to the package by PyInstaller.

The current workaround for users is to include --collect-data signify in the PyInstaller command or to add signify\authenticode\legacy-certs.pem with --add-data. It is likely better to do the former since the increase in size from doing so is negligible (or potentially non-existent) while reducing the risk of an error.

A proper fix for this would be for signify to include a PyInstaller hook to make sure relevant data files are collected. Documentation for adding hooks can be found here: https://pyinstaller.org/en/stable/hooks.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions