mirror of
https://github.com/GNS3/gns3-server.git
synced 2024-12-21 21:57:49 +00:00
Fixed the VMware default VM location on Windows, so that it doesn't assume the "Documents" folder is within the %USERPROFILE% folder, and also support Windows Server's folder (which is "My Virtual Machines" instead of "Virtual Machines").
This commit is contained in:
parent
0a4a01fed0
commit
a9eae691f6
@ -540,7 +540,13 @@ class VMware(BaseManager):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
if sys.platform.startswith("win"):
|
if sys.platform.startswith("win"):
|
||||||
return os.path.expandvars(r"%USERPROFILE%\Documents\Virtual Machines")
|
from win32com.shell import shell, shellcon
|
||||||
|
documents_folder = shell.SHGetSpecialFolderPath(None, shellcon.CSIDL_PERSONAL)
|
||||||
|
windows_type = sys.getwindowsversion().product_type
|
||||||
|
if windows_type == 2 or windows_type == 3:
|
||||||
|
return '{}\My Virtual Machines'.format(documents_folder)
|
||||||
|
else:
|
||||||
|
return '{}\Virtual Machines'.format(documents_folder)
|
||||||
elif sys.platform.startswith("darwin"):
|
elif sys.platform.startswith("darwin"):
|
||||||
return os.path.expanduser("~/Documents/Virtual Machines.localized")
|
return os.path.expanduser("~/Documents/Virtual Machines.localized")
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user