From a0007476051943b04034880516a36278f117929e Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Sat, 10 Nov 2018 14:13:43 -0800 Subject: [PATCH] fixing mk-win-dist to include redist #1924 Signed-off-by: Nikolaj Bjorner --- scripts/mk_win_dist.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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)