contrib/packaging/inno/build.py
changeset 41910 1440dd6164f2
parent 41909 1e8fb6522fee
child 41911 dc7827a9ba64
--- a/contrib/packaging/inno/build.py	Thu Mar 07 10:20:37 2019 -0800
+++ b/contrib/packaging/inno/build.py	Thu Mar 07 10:22:09 2019 -0800
@@ -24,31 +24,6 @@
 '''.strip()
 
 
-def find_vc_runtime_files(x64=False):
-    """Finds Visual C++ Runtime DLLs to include in distribution."""
-    winsxs = pathlib.Path(os.environ['SYSTEMROOT']) / 'WinSxS'
-
-    prefix = 'amd64' if x64 else 'x86'
-
-    candidates = sorted(p for p in os.listdir(winsxs)
-                  if p.lower().startswith('%s_microsoft.vc90.crt_' % prefix))
-
-    for p in candidates:
-        print('found candidate VC runtime: %s' % p)
-
-    # Take the newest version.
-    version = candidates[-1]
-
-    d = winsxs / version
-
-    return [
-        d / 'msvcm90.dll',
-        d / 'msvcp90.dll',
-        d / 'msvcr90.dll',
-        winsxs / 'Manifests' / ('%s.manifest' % version),
-    ]
-
-
 def build(source_dir: pathlib.Path, build_dir: pathlib.Path,
           python_exe: pathlib.Path, iscc_exe: pathlib.Path,
           version=None):
@@ -66,6 +41,7 @@
     from hgpackaging.util import (
         extract_tar_to_directory,
         extract_zip_to_directory,
+        find_vc_runtime_files,
     )
 
     if not iscc.exists():