Is it possible for a problem to call a function, to get the UAC prompt up, so a certain function in my program i run as the Administrator.
(Developing an application that downloads an MSI file over the network, and needs to run it as the Administrator, to get the application updated)
And I do that?
-
-
No, you can't partially elevate an application. Only processes can be elevated.
Thus, you need to ShellExecute another program - e.g. a console application created by you - using the "runas" verb to prompt the user for elevation.
-
T-Shooter wrote:
No, you can't partially elevate an application. Only processes can be elevated.
Thus, you need to ShellExecute another program - e.g. a console application created by you - using the "runas" verb to prompt the user for elevation.
Well, technically you can ask the user for a username and password and impersonate that account from your code, but this would require having the actual password, and requesting that from a user is mighty suspicious, and will probably trigger ANOTHER password check from UAC afterwards. -
If I get the application to launch an MSI, wont vista ask about UAC then?
-
It should. If not right away, then at least when installation begins.
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.