Added support for 64-bit Python

This commit is contained in:
Nick Bolton 2009-12-03 20:33:01 +00:00
parent 69b06429bf
commit ba7ec582c3
1 changed files with 20 additions and 10 deletions

28
hm.py
View File

@ -619,13 +619,17 @@ def complete_command(arg):
return possible_completions return possible_completions
def get_vcvarsall(generator): def get_vcvarsall(generator):
# This is the *only* valid way of detecting VC8/9 (may work for others also) import platform
# Remark: "VC7" key does not change between VC8/9
# [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\SxS\VC7] # os_bits should be loaded with '32bit' or '64bit'
# "9.0"="C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\" (os_bits, other) = platform.architecture()
value = None
type = None # visual studio is a 32-bit app, so when we're on 64-bit, we need to check the WoW dungeon
key_name = r'SOFTWARE\Microsoft\VisualStudio\SxS\VC7' if os_bits == '64bit':
key_name = r'SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7'
else:
key_name = r'SOFTWARE\Microsoft\VisualStudio\SxS\VC7'
key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, key_name) key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, key_name)
if generator.startswith('Visual Studio 8'): if generator.startswith('Visual Studio 8'):
value,type = _winreg.QueryValueEx(key, '8.0') value,type = _winreg.QueryValueEx(key, '8.0')
@ -635,9 +639,15 @@ def get_vcvarsall(generator):
value,type = _winreg.QueryValueEx(key, '10.0') value,type = _winreg.QueryValueEx(key, '10.0')
else: else:
raise Exception('Cannot determin vcvarsall.bat location for: ' + generator) raise Exception('Cannot determin vcvarsall.bat location for: ' + generator)
path = value + 'vcvarsall.bat'
# not sure why, but the value on 64-bit differs slightly to the original
if os_bits == '64bit':
path = value + r'vc\vcvarsall.bat'
else:
path = value + r'vcvarsall.bat'
if not os.path.exists(path): if not os.path.exists(path):
raise Exception("'%s' not found.") raise Exception("'%s' not found." % path)
return path return path
def run_vcbuild(generator, mode, args=''): def run_vcbuild(generator, mode, args=''):