PDA

View Full Version : calling wupdate from our app



andyboyd
02-25-2009, 11:29 AM
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

linder
02-26-2009, 01:56 PM
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

andyboyd
02-27-2009, 07:19 AM
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?

linder
02-28-2009, 04:52 AM
Hi Andy,

Perhaps the following is of interest :)

http://www.lindersoft.com/forums/showthread.php?t=13819

Friedrich

andyboyd
04-17-2009, 04:07 AM
I just got round to trying out the new wucheck functionality. It seems to work a treat!

Thanks a lot!