calling wupdate from our app
Hi,
We're trying to add functionality to our application so as it will call the wupdate.exe file in silent mode upon the application starting.
The code seems to be executing properly, and finding wupdate.exe correctly, but I get an error message saying "error 740: the requested operation requires elevation". Does wupdate require some sort of administrator privileges to run?
I'm running Vista, by the way, if that makes a difference.
Thanks,
Andy
Re: calling wupdate from our app
Andy,
This only happens if a non-elevated application tries to launch an application via CreateProcess on a UAC-aware Windows operating system (Windows Vista, Windows Server 2008, Windows 7 and Windows Server 2008 R2). The CreateProcess() Windows API will always fail if a non-elevated application attempts to launch another application whose manifest requires elevation. GetLastError will return 740 (ERROR_ELEVATION_REQUIRED) in this case.
Use ShellExecuteEx and you are done.
Does this help?
Friedrich
Re: calling wupdate from our app
Yes, thanks Friedrich. We actually came across this solution ourselves. But I can confirm it's correct.
One other issue though, do you know of any way to bypass the UAC dialog that asks for permission to continue, other than disabling UAC?
Re: calling wupdate from our app
Hi Andy,
Perhaps the following is of interest :)
http://www.lindersoft.com/forums/showthread.php?t=13819
Friedrich
Re: calling wupdate from our app
I just got round to trying out the new wucheck functionality. It seems to work a treat!
Thanks a lot!