Skip to content

Commit

Permalink
Add script to find all instances of a DLL in PATH
Browse files Browse the repository at this point in the history
This will help find issues similar to #54
  • Loading branch information
adang1345 committed Oct 21, 2024
1 parent 08cca04 commit 28f2090
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: '3.12'
# - name: find instances of msvcp140.dll
# working-directory: ${{ github.workspace }}
# run: |
# pip install pefile
# python scripts\find_library.py
- name: build and install
working-directory: ${{ github.workspace }}
run: |
Expand Down
13 changes: 13 additions & 0 deletions scripts/find_library.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"""Find all instances of a given DLL in PATH and output information about
each."""

import os
import pefile

dll_name = 'msvcp140.dll'

for d in os.environ['PATH'].split(os.pathsep):
if os.path.isfile(path := os.path.join(d, dll_name)):
print(path, end=': ')
with pefile.PE(path) as pe:
print((pe.OPTIONAL_HEADER.MajorLinkerVersion, pe.OPTIONAL_HEADER.MinorLinkerVersion))

0 comments on commit 28f2090

Please sign in to comment.