Is there any way to check from .NET if windows update is enabled?
I want to prompt the users every time they log into my app that their computer might be at risk and give them a link to windows update website (or windows update application from control panel).
Preferably it should work on XP, Vista and Windows 7. Maybe there is a registry key or even better an API?
First add a reference to WUApiLib ‘C:\windows\system32\Wuapi.dll’
Then you can use this code snippet.
MSDN: ‘The ServiceEnabled property indicates whether all the components that Automatic Updates requires are available.’
The Setting auc.Settings.NotificationLevel contains the information about the current mode. http://msdn.microsoft.com/en-us/library/aa385806(VS.85).aspx