Always look at the registry to find vmrun.exe on Windows.

This commit is contained in:
grossmj 2016-02-03 19:08:41 -07:00
parent 4673424da7
commit 4f61443b20

View File

@ -97,20 +97,10 @@ class VMware(BaseManager):
if sys.platform.startswith("win"): if sys.platform.startswith("win"):
vmrun_path = shutil.which("vmrun") vmrun_path = shutil.which("vmrun")
if vmrun_path is None: if vmrun_path is None:
# look for vmrun.exe in default VMware Workstation directory # look for vmrun.exe using the VMware Workstation directory listed in the registry
vmrun_ws = os.path.expandvars(r"%PROGRAMFILES(X86)%\VMware\VMware Workstation\vmrun.exe")
if os.path.exists(vmrun_ws):
vmrun_path = vmrun_ws
else:
# look for vmrun.exe using the directory listed in the registry
vmrun_path = self._find_vmrun_registry(r"SOFTWARE\Wow6432Node\VMware, Inc.\VMware Workstation") vmrun_path = self._find_vmrun_registry(r"SOFTWARE\Wow6432Node\VMware, Inc.\VMware Workstation")
if vmrun_path is None: if vmrun_path is None:
# look for vmrun.exe in default VMware VIX directory # look for vmrun.exe using the VIX directory listed in the registry
vmrun_vix = os.path.expandvars(r"%PROGRAMFILES(X86)%\VMware\VMware VIX\vmrun.exe")
if os.path.exists(vmrun_vix):
vmrun_path = vmrun_vix
else:
# look for vmrun.exe using the directory listed in the registry
vmrun_path = self._find_vmrun_registry(r"SOFTWARE\Wow6432Node\VMware, Inc.\VMware VIX") vmrun_path = self._find_vmrun_registry(r"SOFTWARE\Wow6432Node\VMware, Inc.\VMware VIX")
elif sys.platform.startswith("darwin"): elif sys.platform.startswith("darwin"):
vmrun_path = "/Applications/VMware Fusion.app/Contents/Library/vmrun" vmrun_path = "/Applications/VMware Fusion.app/Contents/Library/vmrun"