From c6f3b19e73e1d76a195d3c9a63e894ace6ea2508 Mon Sep 17 00:00:00 2001 From: Tati Date: Thu, 5 May 2022 09:14:28 +0000 Subject: [PATCH] Fix missing DLL issue Windows machines without VCRuntime (#977) * Fix missing DLL issue windows without VC This issue was fixed by PyInstaller in a newer version, but since we still use the old one we need to patch it ourselves. It can be removed as soon as we upgrade. For more information, see https://github.com/pyinstaller/pyinstaller/pull/5770/files * Add windows binaries _only_ on windows --- grr/core/grr_response_core/config/build.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/grr/core/grr_response_core/config/build.py b/grr/core/grr_response_core/config/build.py index 66154d40f..4d1933f1e 100644 --- a/grr/core/grr_response_core/config/build.py +++ b/grr/core/grr_response_core/config/build.py @@ -131,14 +131,20 @@ def FromString(self, string): CHIPSEC_IMPORTS = ["chipsec.helper.oshelper", "chipsec.helper.linux.linuxhelper"] WINDOWS_IMPORTS = [] +WINDOWS_BINARIES = [] if platform.system\(\).lower\(\) == 'windows': WINDOWS_IMPORTS = ["win32process", "win32timezone"] + WINDOWS_BINARIES = [\("C:\\\\Windows\\\\System32\\\\VCRUNTIME140_1.dll", "."\)] a = Analysis\( [client_path], # TODO\(https://github.com/pypa/setuptools/issues/1963\): py2_warn is # a workaround. Revisit in the future, whether this is needed. hiddenimports=CHIPSEC_IMPORTS + WINDOWS_IMPORTS + ["pkg_resources.py2_warn"], + # TODO: Remove this binary once PyInstaller version is updated. + # The binary below is needed in machines that do not have VC installed. + # This was patched by them in: https://github.com/pyinstaller/pyinstaller/pull/5770/files + binaries=WINDOWS_BINARIES, hookspath=None\) # Remove some optional libraries that would be packed but serve no purpose.