()
| 572 | # environment variables & default paths. Supports both native Windows and |
| 573 | # Cygwin. |
| 574 | def auto_detect_toolset_versions(): |
| 575 | if on_windows() or on_cygwin(): |
| 576 | for version in _known_versions: |
| 577 | versionVarName = '__version_{}_reg'.format(version.replace('.','_')) |
| 578 | if versionVarName in globals(): |
| 579 | vc_path = None |
| 580 | for x in [ '', 'Wow6432Node\\' ]: |
| 581 | try: |
| 582 | with _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Microsoft\\{}{}'.format(x, globals()[versionVarName])) as reg_key: |
| 583 | vc_path = _winreg.QueryValueEx(reg_key, "ProductDir")[0] |
| 584 | except: |
| 585 | pass |
| 586 | if vc_path: |
| 587 | vc_path = os.path.join(vc_path,'bin') |
| 588 | register_configuration(version,os.path.normpath(vc_path)) |
| 589 | |
| 590 | for i in _known_versions: |
| 591 | if not i in __versions.all(): |
| 592 | register_configuration(i,default_path(i)) |
| 593 | |
| 594 | |
| 595 | # Worker rule for toolset version configuration. Takes an explicit version id or |
no test coverage detected