1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-30 20:28:08 +00:00

Use vnetlib64.exe when possible

Fix https://github.com/GNS3/gns3-gui/issues/1648
This commit is contained in:
Julien Duponchelle 2016-11-21 17:49:40 +01:00
parent 1beae95443
commit 9be293909e
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8

View File

@ -110,8 +110,11 @@ def find_vnetlib_registry(regkey):
# default path not used, let's look in the registry # default path not used, let's look in the registry
hkey = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, regkey) hkey = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, regkey)
install_path, _ = winreg.QueryValueEx(hkey, "InstallPath") install_path, _ = winreg.QueryValueEx(hkey, "InstallPath")
vnetlib_path = os.path.join(install_path, "vnetlib.exe")
winreg.CloseKey(hkey) winreg.CloseKey(hkey)
vnetlib_path = os.path.join(install_path, "vnetlib64.exe")
if os.path.exists(vnetlib_path):
return vnetlib_path
vnetlib_path = os.path.join(install_path, "vnetlib.exe")
if os.path.exists(vnetlib_path): if os.path.exists(vnetlib_path):
return vnetlib_path return vnetlib_path
except OSError: except OSError:
@ -124,10 +127,13 @@ def find_vnetlib_on_windows():
vnetlib_path = shutil.which("vnetlib") vnetlib_path = shutil.which("vnetlib")
if vnetlib_path is None: if vnetlib_path is None:
# look for vnetlib.exe in default VMware Workstation directory # look for vnetlib.exe in default VMware Workstation directory
vnetlib_ws = os.path.expandvars(r"%PROGRAMFILES(X86)%\VMware\VMware Workstation\vnetlib.exe") vnetlib_ws = os.path.expandvars(r"%PROGRAMFILES(X86)%\VMware\VMware Workstation\vnetlib64.exe")
if not os.path.exists(vnetlib_ws):
vnetlib_ws = os.path.expandvars(r"%PROGRAMFILES(X86)%\VMware\VMware Workstation\vnetlib.exe")
if os.path.exists(vnetlib_ws): if os.path.exists(vnetlib_ws):
vnetlib_path = vnetlib_ws vnetlib_path = vnetlib_ws
else:
if vnetlib_path is None:
# look for vnetlib.exe using the directory listed in the registry # look for vnetlib.exe using the directory listed in the registry
vnetlib_path = find_vnetlib_registry(r"SOFTWARE\Wow6432Node\VMware, Inc.\VMware Workstation") vnetlib_path = find_vnetlib_registry(r"SOFTWARE\Wow6432Node\VMware, Inc.\VMware Workstation")
if vnetlib_path is None: if vnetlib_path is None: