Skip to content

Commit

Permalink
Fix MFC redist DLLs not found: prefere corresponding version but acce…
Browse files Browse the repository at this point in the history
…pt different version
  • Loading branch information
abravetti committed Apr 13, 2024
1 parent dde12b8 commit ba45f1c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,11 +631,15 @@ def build_extensions(self):
redist_globs = [vcbase + r"redist\%s\*MFC\mfc140u.dll" % self.plat_dir]
m = re.search(r"\\VC\\Tools\\", vcbase)
if m:
# typical path on newer Visual Studios - ensure corresponding version
# typical path on newer Visual Studios
# prefere corresponding version but accept different version
same_version = vcverdir is not None and os.path.isdir(
vcbase[: m.start()] + r"\VC\Redist\MSVC\{}{}".format(
vcverdir, self.plat_dir
))
redist_globs.append(
vcbase[: m.start()]
+ r"\VC\Redist\MSVC\{}{}\*\mfc140u.dll".format(
vcverdir or "*\\", self.plat_dir
vcbase[: m.start()] + r"\VC\Redist\MSVC\{}{}\*\mfc140u.dll".format(
vcverdir if same_version else "*\\", self.plat_dir
)
)
# Only mfcNNNu DLL is required (mfcmNNNX is Windows Forms, rest is ANSI)
Expand Down

0 comments on commit ba45f1c

Please sign in to comment.