Index: Tools/msi/msi.py =================================================================== --- Tools/msi/msi.py (revision 65805) +++ Tools/msi/msi.py (working copy) @@ -843,18 +843,38 @@ result.append((f, kw)) return result +def find_msvs90_docdir(): + + install_dir = os.path.join(os.environ['VS90COMNTOOLS'], + r'..\..') + for subdir in os.listdir(install_dir): + pathname = os.path.join(install_dir, subdir) + if not os.path.isdir(subdir): + continue + if subdir.startswith('Microsoft Visual Studio 2008'): + # Found + return os.path.abspath(pathname) + raise TypeError( + 'Could not find the MS VC9 product documentation directory') + def generate_license(): import shutil, glob out = open("LICENSE.txt", "w") shutil.copyfileobj(open(os.path.join(srcdir, "LICENSE")), out) - for name, pat, file in (("bzip2","bzip2-*", "LICENSE"), - ("Berkeley DB", "db-*", "LICENSE"), - ("openssl", "openssl-*", "LICENSE"), - ("Tcl", "tcl8*", "license.terms"), - ("Tk", "tk8*", "license.terms"), - ("Tix", "tix-*", "license.terms")): + for name, pat, file in ( + ("bzip2","bzip2-*", "LICENSE"), + ("Berkeley DB", "db-*", "LICENSE"), + ("openssl", "openssl-*", "LICENSE"), + ("Tcl", "tcl8*", "license.terms"), + ("Tk", "tk8*", "license.terms"), + ("Tix", "tix-*", "license.terms"), + ("Microsoft Visual C++ 9.0 Runtime", find_msvs90_docdir(), "eula.txt"), + ): out.write("\nThis copy of Python includes a copy of %s, which is licensed under the following terms:\n\n" % name) - dirs = glob.glob(srcdir+"/../"+pat) + if os.path.isabs(pat): + dirs = [pat] + else: + dirs = glob.glob(srcdir+"/../"+pat) if not dirs: raise ValueError, "Could not find "+srcdir+"/../"+pat if len(dirs) > 2: