Skip to content

Commit 55e45da

Browse files
authored
finding install dirs in non-standard locations (#336)
* finding install dirs in non-standard locations * directly return calculated dirs
1 parent 38e6099 commit 55e45da

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ansys/mapdl/core/launcher.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,13 @@ def _get_available_base_ansys():
387387
"""
388388
base_path = None
389389
if os.name == 'nt':
390-
base_path = os.path.join(os.environ['PROGRAMFILES'], 'ANSYS INC')
390+
supported_versions = [194, 202, 211, 212]
391+
awp_roots = {ver: os.environ.get(f'AWP_ROOT{ver}', '') for ver in supported_versions}
392+
installed_versions = {ver: path for ver, path in awp_roots.items() if path and os.path.isdir(path)}
393+
if installed_versions:
394+
return installed_versions
395+
else:
396+
base_path = os.path.join(os.environ['PROGRAMFILES'], 'ANSYS INC')
391397
elif os.name == 'posix':
392398
for path in ['/usr/ansys_inc', '/ansys_inc']:
393399
if os.path.isdir(path):

0 commit comments

Comments
 (0)