PDA

View Full Version : Custom Action with Vista Elevated Privledges



jstergar
09-25-2007, 12:04 PM
I have a custom action that fires an EXE at the end of the install, however, it is being run using the account the user logged in with which is most likely a standard account. The EXE writes registry entries and runs RegAsm to register some type libraries from .NET dlls. It is crutial to the application that the application completes successfully which requires elevated privledges.

Is there anyway I can get that EXE to get Vista to prompt for elevation? I know that there are something inside install EXE's that Vista uses to identify them as install programs. Anybody have any advice they can give?

DebbieL
09-28-2007, 09:27 AM
When you create your .exe file, you'll want to add an XML manifest. Here's a sample snippet that contains the relevant portion of XML:


<requestedExecutionLevel
level="requireAdministrator"
uiAccess="false"/>

In the above example, requireAdministrator indicates that elevation to full administrator privileges would be required. Other possible values are highestAvailable and asInvoker.

If you search MSDN, you'll find a lot of articles that discuss the manifest. Here's one to get you started:
http://msdn.microsoft.com/msdnmag/issues/07/01/UAC/default.aspx#S8

Debbie Landers
Macrovision Corporation

happyjanezj
10-30-2007, 10:14 PM
how can i set the manifest for VC Project or Java project?