diff --git a/scripts/mk_win_dist.py b/scripts/mk_win_dist.py index e226a275e..10bb5a6ef 100644 --- a/scripts/mk_win_dist.py +++ b/scripts/mk_win_dist.py @@ -257,11 +257,21 @@ def cp_vs_runtime(x64): else: platform = "x86" vcdir = os.environ['VCINSTALLDIR'] - path = '%sredist\\%s' % (vcdir, platform) + path = '%sredist' % vcdir vs_runtime_files = [] + print("Walking %s" % path) + # Everything changes with every release of VS + # Prior versions of VS had DLLs under "redist\x64" + # There are now several variants of redistributables + # The naming convention defies my understanding so + # we use a "check_root" filter to find some hopefully suitable + # redistributable. + def check_root(root): + return platform in root and "CRT" in root and "onecore" not in root and "debug" not in root for root, dirs, files in os.walk(path): for filename in files: - if fnmatch(filename, '*.dll'): + if fnmatch(filename, '*.dll') and check_root(root): + print("Checking %s %s" % (root, filename)) for pat in VS_RUNTIME_PATS: if pat.match(filename): fname = os.path.join(root, filename)