def isVistaUACEnabled(self):
"""
Return boolean indicating whether this is a Windows Vista system with
User Account Control enabled.
Warning: If modifies the UAC setting but has not yet rebooted,
this method will return the wrong result.
"""
if self._isVistaUACEnabled is not None:
return self._isVistaUACEnabled
if self.getWindowsVersion() != self.VERSION_VISTA:
return False
hkey = reg.HKEY_LOCAL_MACHINE
key = 'Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System'
value = 'EnableLUA'
if not self.registryHasValue(hkey, key, value):
self._isVistaUACEnabled = False
elif self.getValueFromRegKey(hkey, key, value) == 0:
self._isVistaUACEnabled = False
else:
self._isVistaUACEnabled = True
return self._isVistaUACEnabled
评论列表
文章目录