views:

621

answers:

2

I'm working on the bootstrap application of a new installer for some of our products. So far, I've been relying on two things that I read about somewhere:

  1. Applications whose name contains "setup" or "install" will run elevated by default.
  2. Applications that run elevated will launch other applications in elevated mode.

Recent testing has found that one or both of these statements is false, because one of the applications that I'm launching is a third party installer that requires elevation, and it's failing because of the elevation requirement.

How do I set my application to require elevation? I know it has something to do with the manifest file. As I'm working in Visual Studio 2008, and the manifest file is generated, I'd like to know what to enter into the project's properties and where to make it require elevation.

+2  A: 

In VS2008: Add new item; application manifest file (app.manifest; the comments in the template file tell you how to demand more access).

You can now specify the manifest in project properties on the Application tab (but you need to uncheck "Enable the Visual Studio hosting process" to debug it).

Marc Gravell
I don't see application manifest in the list of things that I can add. The closest thing in the list that comes to it is a configuration file (app.config), but I'm guessing that's not it. (It's a C++ project.)
RobH
+3  A: 

When I couldn't find application manifest as a new item that could be added to my project, I went into the online help and found this:

configure the VS2008 in Configuration Properties - Linker - Manifest File - UAC Execution Level (requireAdministrator)

That did the trick.

RobH
Interesting that C#/VB makes this so much easier...
Marc Gravell
Funny. To me, changing a setting in the project's properties is so much easier than adding and editing a manifest file.
RobH