- reg = _winreg.ConnectRegistry(None, HKEY_LOCAL_MACHINE)
- key = _winreg.OpenKey(reg, "SOFTWARE\\tinc")
+ reg = _winreg.ConnectRegistry(None, _winreg.HKEY_LOCAL_MACHINE)
+ try:
+ key = _winreg.OpenKey(reg, "SOFTWARE\\tinc", 0, sam)
+ except WindowsError:
+ key = _winreg.OpenKey(reg, "SOFTWARE\\Wow6432Node\\tinc", 0, sam)