409
409
# This isn't required for Python 2.5 or earlier because
410
410
# py2exe handles it then.
411
411
if self.python.find("26") >= 0:
412
redist_name = os.path.basename(self.msvc_redist_dir)
413
redist_dir = os.path.join(exe_dir, redist_name)
415
copy_files(self.msvc_redist_dir, redist_dir, [
412
copy_files(self.msvc_redist_dir, exe_dir, [
419
416
# Mess around with manifests, see bug and related mp for reasons:
420
417
# <https://bugs.launchpad.net/bzr-windows-installers/+bug/632465>
421
m_name = "%s.manifest" % redist_name
418
m_name = "%s.manifest" % os.path.basename(self.msvc_redist_dir)
422
419
# Remove the file element for the dll bzr doesn't need
423
420
m_contents = file(os.path.join(self.msvc_redist_dir, m_name)
424
421
).read().replace(' <file name="msvcm90.dll" />', "")
425
422
# Write the manifest to the root dir so the python dll finds it
426
file(os.path.join(redist_dir, m_name), "w").write(m_contents)
423
file(os.path.join(exe_dir, m_name), "w").write(
427
425
# Write another copy to the lib folder for the extension modules
428
file(os.path.join(exe_dir, "lib", m_name), "w").write(m_contents)
426
# that need it, modifying the dll names to look in the parent dir
427
file(os.path.join(exe_dir, "lib", m_name), "w").write(
428
m_contents.replace('<file name="', '<file name="..\\'))
430
430
# Generate the Installer spec file and compile it
431
431
iss_file = issgen.generate_iss(self.distro,