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
Currently, packaging and running the following minimal example with PyInstaller and
--collect-data mscertsresults in aFileNotFoundError.This is caused by
signify\authenticode\legacy-certs.pemnot being added to the package by PyInstaller.The current workaround for users is to include
--collect-data signifyin the PyInstaller command or to addsignify\authenticode\legacy-certs.pemwith--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