Skip to content

Commit

Permalink
Support for binaries based on Python 2.6+. Include the VS90 DLL and m…
Browse files Browse the repository at this point in the history
…anifest files as distrubuted by the Bazaar Windows installer.
  • Loading branch information
shypike committed May 29, 2011
1 parent 8d470ca commit a94d114
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions package.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,28 @@ def rename_file(folder, old, new):
print "Cannot create %s" % newpath
exit(1)

def check_runtimes():
""" Return location of MS DLL files for Python 2.6 and higher
This assumes that the stand-alone version of Bazaar has been
installed, since this will be used as the source for the DLLs
and Manifest files.
"""
path = None
if sys.version_info >= (2, 6):
path = os.environ.get('ProgramFiles(x86)')
if not path:
path = os.environ.get('ProgramFiles')
if path:
path = os.path.join(path, 'Bazaar')
if not os.path.exists(path):
path = None
if not path:
print 'Cannot find runtime libraries, have you installed Bazaar'
print 'in %s ?' % path
exit(1)
return path



print sys.argv[0]

Expand Down Expand Up @@ -444,6 +466,8 @@ def rename_file(folder, old, new):
os.system(BzrRevert)
exit(1)

run_times = check_runtimes()

# Create MO files
os.system('tools\\make_mo.py all')

Expand Down Expand Up @@ -521,6 +545,15 @@ def rename_file(folder, old, new):
shutil.copy2(r'win\curl\curl.exe', r'dist\lib')
shutil.copy2(r'win\curl\libssh2.dll', r'dist\lib')

############################
# Copy MS runtime files, if needed
if run_times:
shutil.copy2(os.path.join(run_times, r'Microsoft.VC90.CRT.manifest'), r'dist')
shutil.copy2(os.path.join(run_times, r'msvcp90.dll'), r'dist')
shutil.copy2(os.path.join(run_times, r'msvcr90.dll'), r'dist')
shutil.copy2(os.path.join(run_times, r'lib\Microsoft.VC90.CRT.manifest'), r'dist\lib')


############################
if target == 'installer':

Expand Down

0 comments on commit a94d114

Please sign in to comment.