Specifies whether User Account Control (UAC) information is embedded in the program manifest.
/MANIFESTUAC /MANIFESTUAC:NO /MANIFESTUAC:fragment /MANIFESTUAC:level=_level /MANIFESTUAC:uiAccess=_uiAccess
If you specify multiple /MANIFESTUAC options on the command-line, the last one entered takes precedence.
The choices for /MANIFESTUAC:level are as follows:
-
asInvoker: The application will run with the same permissions as the process that started it. The application can be elevated to a higher permission level by selecting Run as Administrator.
-
highestAvailable: The application will run with the highest permission level that it can. If the user who starts the application is a member of the Administrators group, this option is the same as requireAdministrator. If the highest available permission level is higher than the level of the opening process, the system will prompt for credentials.
-
requireAdministrator: The application will run with administrator permissions. The user who starts the application must be a member of the Administrators group. If the opening process is not running with administrative permissions, the system will prompt for credentials.
You can specify the level and uiAccess values in one step by using the /MANIFESTUAC:fragment option. The fragment must be in the following form:
"level=[ asInvoker | highestAvailable | requireAdministrator ] uiAccess=[ true | false ]"
To set this linker option in the Visual Studio development environment
-
Open the project's Property Pages dialog box. For details, see How to: Open Project Property Pages.
-
Expand the Configuration Properties node.
-
Expand the Linker node.
-
Select the Manifest File property page.
-
Modify the Enable User Account Control (UAC), UAC Execution Level, and UAC Bypass UI Protection properties.
To set this linker option programmatically
-
See EnableUAC, UACExecutionLevel, and UACUIAccess.
Reference
I believe this page was written for an earlier verison of Visual Studio.
For Visual Studio 2010, please give this page a try - it has detailed instruction on how you can manaully edit the app.manifest XML:
http://msdn.microsoft.com/en-us/library/hafybdaa.aspx
After opening it in Visual Studio, look for the tag <requestedExecutionLevel> in the XML editor.
I was looking for it too and finally had that "A-ha" moment when I found it. :)
Hope this helps,
John
PS. As Bryan Dougherty pointed out in the comments in this page http://msdn.microsoft.com/en-us/library/bb756929.aspx, you can achieve the same thing if you use "Add New Item..." to add a new "Application Manifest File". You can then easily open the "app.manifest" file later on under your Project > Properties in the Solution Explorer.
/MANIFESTUAC:level='requireAdministrator'
otherwise the generated manifest can't be parsed by mt.exe - it gives "general error c1010070: Failed to load and parse the manifest. The operation failed."
Opening the Project Properties doesn't show anything like "Configuration" node, can't find any linker node either.
More instructions on how to access these things would be great, as well as why it isn't showing (in case I miss an option in my Visual Studio 2010 configuration)