Skip to content

Commit

Permalink
Fix missing DLL issue Windows machines without VCRuntime (#977)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Tati1701 authored May 5, 2022
1 parent 4346725 commit c6f3b19
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions grr/core/grr_response_core/config/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit c6f3b19

Please sign in to comment.