diff --git a/monkey/monkey_island/monkey_island.spec b/monkey/monkey_island/monkey_island.spec index fd6d0c3e1..f56fc8069 100644 --- a/monkey/monkey_island/monkey_island.spec +++ b/monkey/monkey_island/monkey_island.spec @@ -19,7 +19,7 @@ def main(): a = Analysis(['cc/main.py'], pathex=['..'], hiddenimports=get_hidden_imports(), - hookspath=None, + hookspath=[os.path.join(".", "pyinstaller_hooks")], runtime_hooks=None, binaries=None, datas=added_datas, diff --git a/monkey/monkey_island/pyinstaller_hooks/__init__.py b/monkey/monkey_island/pyinstaller_hooks/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/monkey/monkey_island/pyinstaller_hooks/hook-stix2.py b/monkey/monkey_island/pyinstaller_hooks/hook-stix2.py new file mode 100644 index 000000000..22a9c9774 --- /dev/null +++ b/monkey/monkey_island/pyinstaller_hooks/hook-stix2.py @@ -0,0 +1,7 @@ +# Workaround for packaging Monkey Island using PyInstaller. See https://github.com/oasis-open/cti-python-stix2/issues/218 + +import os +from PyInstaller.utils.hooks import get_module_file_attribute + +stix2_dir = os.path.dirname(get_module_file_attribute('stix2')) +datas = [(stix2_dir, 'stix2')]