This article is a guide to making applications UAC aware for Vista. An application can be made Vista aware through the use of an embedded manifest.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
|asInvoker||Does not require elevation, runs without requesting elevation using privileges of its parent process.|
|highestAvailable||Requests the highest available privilege tokens of its parent process. An administrator account will attempt to elevate to full administrator level, but a standard account will only request elevation to its own highest set of access tokens.|
|requireAdministrator||Requires elevation to full administrator privileges.|
Embedding the manifest into the file
In this example a manifest file saved as Foobar.exe.manifest is added to an application named Foobar.exe. Note the #1 for application.
mt.exe -manifest "Foobar.exe.manifest" -outputresource:"Foobar.exe";#1
In this example a manifest file saved as Foobar.dll.manifest is added to a class library named Foobar.dll. Note the #2 for a code library.
mt.exe -manifest "Foobar.dll.manifest" -outputresource:"Foobar.dll";#2
Using Visual Studio post-build command to embed the manifest
"$(DevEnvDir)..\..\SDK\v2.0\bin\mt.exe" -manifest "$(ProjectDir)Foobar.exe.manifest" -outputresource:"$(TargetPath)";#1
Making Your Application UAC Aware link