Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MFC redist DLLs not found: prefere corresponding version but accept different version #2248

Merged
merged 1 commit into from
May 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading