<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Connecting the Dots : UAC</title><link>http://blogs.msdn.com/cheller/archive/tags/UAC/default.aspx</link><description>Tags: UAC</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Quick Tip: Manifests AND VC++ Projects</title><link>http://blogs.msdn.com/cheller/archive/2006/12/04/quick-tip-manifests-and-vc-projects.aspx</link><pubDate>Tue, 05 Dec 2006 01:29:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1207857</guid><dc:creator>cheller</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/cheller/comments/1207857.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cheller/commentrss.aspx?PostID=1207857</wfw:commentRss><description>&lt;p&gt;In a recent post, I listed a number of methods for embedding&amp;nbsp;manifests in managed assemblies.&amp;nbsp;As I mention in that &lt;a href="http://blogs.msdn.com/cheller/archive/2006/08/24/how-to-embed-a-manifest-in-an-assembly-let-me-count-the-ways.aspx"&gt;post&lt;/a&gt;, my preferred option is to call the mt.exe tool during a custom post-build step. But I recently found that this doesn't work so well for VC++ projects, as it overwrites the manifest that may have been added during the VC++ build process. (Not good, since VC++ applications also&amp;nbsp;commonly use manifests for defining other settings&amp;nbsp;- like side-by-side assemblies).&lt;/p&gt; &lt;p&gt;Last week I learned that, for VC++ 2005 projects, all you have to do is add the manifest file to the project and VC++ does the rest! (Just make sure the manifest file ends with a .manifest extension). And this works for both native and managed C++ apps. (Thank you&amp;nbsp;&lt;a href="http://blogs.msdn.com/borisj/"&gt;Boris&lt;/a&gt;, for pointing this out to me!)&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1207857" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cheller/archive/tags/UAC/default.aspx">UAC</category></item><item><title>UAC Distilled</title><link>http://blogs.msdn.com/cheller/archive/2006/10/11/uac-distilled.aspx</link><pubDate>Thu, 12 Oct 2006 09:26:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:818466</guid><dc:creator>cheller</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/cheller/comments/818466.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cheller/commentrss.aspx?PostID=818466</wfw:commentRss><description>&lt;p&gt;As I mentioned in&amp;nbsp;an earlier&amp;nbsp;post (&lt;a href="http://blogs.msdn.com/cheller/archive/2006/09/26/772391.aspx"&gt;New UAC Whitepaper Released&lt;/a&gt;), the UAC team recently published a very detailed whitepaper that covers everything you could every want or need to know about UAC from a developer perspective. I typically begin all my Windows Vista presentations with a&amp;nbsp;discussion of&amp;nbsp;User Account Control (UAC), and I thought I'd share my&amp;nbsp;condensed version of&amp;nbsp;what I've found to be the key high-level points - just in case you haven't yet found the time to read all 91 pages of the whitepaper :-) &lt;/p&gt; &lt;p&gt;I like to think about UAC according to the following three principles:&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;font size="2"&gt;1. By default, interactive processes launched by the user run as standard user - even if they are a member of the Administrators group.&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#000000" size="2"&gt;Let's parse this sentence and look at the&amp;nbsp;key points I want to emphasize:&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#000000" size="2"&gt;&lt;em&gt;&lt;font color="#0000a0"&gt;by default&lt;/font&gt;&lt;/em&gt;: unless otherwise specified, meaning that some other behavior is possible (see principle&amp;nbsp;#2)&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#000000" size="2"&gt;&lt;em&gt;&lt;font color="#0000a0"&gt;interactive processes&lt;/font&gt;:&lt;/em&gt;&amp;nbsp;UAC applies to processes running in the interactive session; it does not apply to Windows services that are launched by the SCM (Service Control Manager)&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#000000" size="2"&gt;&lt;em&gt;&lt;font color="#0000a0"&gt;launched by the user&lt;/font&gt;: &lt;/em&gt;the Windows Vista Shell (the Start menu, the desktop, Explorer, etc.) runs as standard user; applications launched from these locations also run as standard user&amp;nbsp;(unless otherwise specified, as noted above)&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#000000" size="2"&gt;&lt;em&gt;&lt;font color="#0000a0"&gt;run as standard user&lt;/font&gt;:&lt;/em&gt;&amp;nbsp;&amp;nbsp;meaning with the kind of minimal default privileges a user has when created&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#000000" size="2"&gt;&lt;em&gt;&lt;font color="#0000a0"&gt;even if they are a member of the Administrators group&lt;/font&gt;:&amp;nbsp;&lt;/em&gt;under UAC, certain well-defined memberships in security groups (like Administrators) and privileges are stripped from the user's token (this is sometimes&amp;nbsp;referred to as a&amp;nbsp;"filtered token"); from&amp;nbsp;an application's perspective, members of the Administrator's group appear to be plain standard users. (See the section titled &lt;em&gt;Access Token Changes&lt;/em&gt; in the UAC whitepaper for a list of the specific groups and privileges that are removed)&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;font size="2"&gt;2. Privilege elevation cannot occur in process&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Privilege elevation is&amp;nbsp;a mechanism by which an application is&amp;nbsp;launched by the OS&amp;nbsp;with the user's full token. (It does not grant any additional privileges that the user doesn't already have.)&lt;/p&gt; &lt;p&gt;There is no API&amp;nbsp;that will enable your code to elevate itself, in-process - you must request the OS to launch a new process that runs elevated (i.e. with the user's full token).&lt;/p&gt; &lt;p&gt;Once a process is running elevated, any process that it creates will also run elevated. (And there's no way to go from a full token back to a filtered token)&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;font size="2"&gt;3. Privilege elevation requires user consent&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Explicit user consent is required in order for the OS to&amp;nbsp;run a process as elevated (i.e. with the user's full token).&amp;nbsp;&lt;/p&gt; &lt;p&gt;Context&amp;nbsp;is important to the user, when deciding whether or not to give consent.&lt;/p&gt; &lt;p&gt;There are standard visual cues to help define context for the user:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;The security shield icon is used to decorate UI elements that launch privileged operations&lt;/li&gt; &lt;li&gt;The color of the banner on the elevation consent/credential prompt varies depending on whether the executable is a system app, whether it's signed by a trusted publisher or not signed.&lt;/li&gt;&lt;/ul&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=818466" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cheller/archive/tags/UAC/default.aspx">UAC</category></item><item><title>New UAC whitepaper released</title><link>http://blogs.msdn.com/cheller/archive/2006/09/26/new-uac-whitepaper-released.aspx</link><pubDate>Tue, 26 Sep 2006 18:48:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:772391</guid><dc:creator>cheller</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/cheller/comments/772391.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cheller/commentrss.aspx?PostID=772391</wfw:commentRss><description>&lt;P&gt;The UAC team just released a new whitepaper last week, with their latest guidance for developers on how to design UAC-compliant applications.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyID=ba73b169-a648-49af-bc5e-a2eebb74c16b&amp;amp;DisplayLang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyID=ba73b169-a648-49af-bc5e-a2eebb74c16b&amp;amp;DisplayLang=en"&gt;Windows Vista Application Development Requirements for User Account Control Compatibility&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;91 pages packed full of information!&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=772391" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cheller/archive/tags/UAC/default.aspx">UAC</category></item><item><title>How to embed a manifest in an assembly: let me count the ways...</title><link>http://blogs.msdn.com/cheller/archive/2006/08/24/how-to-embed-a-manifest-in-an-assembly-let-me-count-the-ways.aspx</link><pubDate>Thu, 24 Aug 2006 20:28:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:718757</guid><dc:creator>cheller</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.msdn.com/cheller/comments/718757.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cheller/commentrss.aspx?PostID=718757</wfw:commentRss><description>&lt;P&gt;With our current developer tools, there's no immediately obvious way to embed a manifest in a managed executable. There are actually a number of ways to do this, and it's really not that hard. I found the hard part was putting together all the pieces&amp;nbsp;and figuring out the options.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's how I typically describe the options. (Note that the classification scheme and taxonomy&amp;nbsp;are mine, and don't necessarily represent official Microsoft terminology) :&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;The &lt;EM&gt;“step-by-step” method&lt;/EM&gt; involves explicitly completing each step in the end-to-end process: defining a native resource script, compiling it to create a binary resource file, and embedding the binary resources into the executable during the build process&amp;nbsp; 
&lt;LI&gt;The &lt;EM&gt;“generic” method&lt;/EM&gt; involves using the &lt;A href="http://windowssdk.msdn.microsoft.com/en-us/library/ms716972.aspx" mce_href="http://windowssdk.msdn.microsoft.com/en-us/library/ms716972.aspx"&gt;mt.exe&lt;/A&gt; tool, which directly embeds an&amp;nbsp;external manifest&amp;nbsp;file into an existing executable without having to create and compile a resource script. It’s generic in that it can be used independently of the dev tools and languages used to implement and build the executable. (Mt.exe is commonly used to sign catalogue files and, maybe because that's not a task I typically do, it didn't seem very obvious to me that I could also use it for embedding manifests.) 
&lt;LI&gt;The &lt;EM&gt;“manifest tool” method&lt;/EM&gt; involves using specific project options. The only language/tool I'm aware of that provides options for specifying manifest settings is Visual C++ 2005. (Not sure if it's available in VC++ 2003)&amp;nbsp;&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;The option you use will likely depend on which programming language you’re using and how you build your executable. I have some thoughts around which method I would use for some specific scenarios, and I'll share them after describing each of the three methods.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Method #1 - The Step-By-Step Approach&lt;/STRONG&gt;&lt;BR&gt;I like to describe this method first, because it illustrates all the pieces, and steps through the entire process. I think it's easier to make sense of the "generic" method below, which provides some short-cuts, once you understand this method.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Create a resource script (.rc) file&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Create a text file (if you're&amp;nbsp;using Visual Studio, right click on the project, select &lt;EM&gt;Add-&amp;gt;New Item…&lt;/EM&gt;, and select &lt;EM&gt;Text File&lt;/EM&gt;) 
&lt;LI&gt;Save the file as &lt;FONT face="Courier New"&gt;ExeName.rc&lt;/FONT&gt;&amp;nbsp; (where &lt;FONT face="Courier New"&gt;ExeName&lt;/FONT&gt; is the name of your target executable) 
&lt;LI&gt;Add the following boilerplate text to the resource file (if you're using Visual Studio, right click on the file and select &lt;EM&gt;Open with…&lt;/EM&gt;, then select &lt;EM&gt;Source Code Editor&lt;/EM&gt;) and replace &lt;FONT face="Courier New"&gt;ExeName&lt;/FONT&gt;&lt;FONT face="Times New Roman"&gt; with the name of your target executable&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#0000ff&gt;#define&lt;/FONT&gt; RT_MANIFEST 24 &lt;BR&gt;&lt;FONT color=#0000ff&gt;#define&lt;/FONT&gt; APP_MANIFEST 1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;APP_MANIFEST RT_MANIFEST ExeName.exe.manifest&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;The line above means: take the contents of &lt;FONT face="Courier New"&gt;ExeName.exe.manifest&lt;/FONT&gt;, and include it as a resource of type &lt;FONT face="Courier New"&gt;RT_MANIFEST&lt;/FONT&gt;, whose identifier is &lt;FONT face="Courier New"&gt;APP_MANIFEST&lt;/FONT&gt;. (The value of the manifest resource for an executable should be 1.) &lt;/P&gt;
&lt;P&gt;Comments:&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;UL&gt;
&lt;UL&gt;
&lt;LI&gt;Ideally,&amp;nbsp;you would specify &lt;FONT face="Courier New"&gt;#include &amp;lt;winuser.h&amp;gt;&lt;/FONT&gt;, rather than directly defining &lt;FONT face="Courier New"&gt;RT_MANIFEST&lt;/FONT&gt;, but it requires doing some extra work to specify command line parameters to define a number of different SDK include folders as well as the VC subfolder of the SDK. 
&lt;LI&gt;Instead of having an external manifest file, you can include the contents of the manifest directly inline in the resource script. &lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;
&lt;P&gt;2. Compile the resource script file using the native resource compiler (&lt;A href="http://windowssdk.msdn.microsoft.com/en-us/library/ms776403.aspx" mce_href="http://windowssdk.msdn.microsoft.com/en-us/library/ms776403.aspx"&gt;rc.exe&lt;/A&gt;)&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P&gt;For those of you who may not be familiar with the native resource compiler, the command line for compiling a resource script is as follows:&lt;BR&gt;&lt;FONT face="Courier New"&gt;rc.exe /r ExeName.rc&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;This will produce a file named &lt;FONT face="Courier New"&gt;ExeName.res&lt;/FONT&gt; with the resulting binary native resources.&lt;/P&gt;
&lt;P&gt;For VS project types that support custom build steps (e.g. C#), you can run this as a Pre-Build step:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Open the project properties (right-click on the project and select &lt;EM&gt;Properties&lt;/EM&gt;) 
&lt;LI&gt;Select the &lt;EM&gt;Build Events &lt;/EM&gt;tab, and enter the following command into the &lt;EM&gt;Pre-build event command line&lt;/EM&gt; text box:&lt;/LI&gt;&lt;/UL&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;"$(DevEnvDir)..\..\SDK\v2.0\bin\rc.exe" /r "$(ProjectDir)$(TargetName).rc"&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The above command makes use of VS-defined macros to construct the path to the rc.exe tool (located in Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin) as well as to determine the input file path. You should be able to use this command directly (in VS 2005), without having to make any text substitutions.&amp;nbsp; (If anyone knows of a more elegant way to define these paths in a location-independent manner, I'd love to hear about it)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P dir=ltr&gt;3. Embed the binary native resources into the executable during the build process&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P dir=ltr&gt;Option A:&amp;nbsp; Build using Visual Studio 2005/MSBuild &lt;/P&gt;
&lt;UL dir=ltr&gt;
&lt;LI&gt;
&lt;DIV&gt;Open the project script in the editor&amp;nbsp;by right-clicking on the project and selecting &lt;EM&gt;Unload Project&lt;/EM&gt;, then right clicking on the project and selecting&amp;nbsp;&lt;EM&gt;Edit &amp;lt;project name&amp;gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;LI&gt;
&lt;DIV&gt;Add the following element to the project script, replacing &lt;FONT face="Courier New"&gt;ExeName&lt;/FONT&gt; with the name of the project&amp;nbsp;&lt;BR&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#a52a2a&gt;&lt;FONT color=#0000ff&gt;&amp;lt;&lt;/FONT&gt;PropertyGroup&lt;FONT color=#0000ff&gt;&amp;gt;&lt;/FONT&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; &lt;FONT color=#0000ff&gt;&amp;lt;&lt;/FONT&gt;Win32Resource&lt;FONT color=#0000ff&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color=#000000&gt;ExeName.res&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;&amp;lt;&lt;/FONT&gt;/Win32Resource&lt;FONT color=#0000ff&gt;&amp;gt;&lt;BR&gt;&amp;lt;&lt;/FONT&gt;/PropertyGroup&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;&amp;gt;&lt;/FONT&gt;&lt;BR&gt;&lt;/FONT&gt;&amp;nbsp;&lt;BR&gt;Note: You can ignore the syntax error that appears in the editor (i.e. squiggly blue line under the element name). Win32Resource is the correct element name.&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P dir=ltr&gt;Option B: Build using the command line compilers&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P dir=ltr&gt;If you build your projects using custom command line scripts, C#, VB, and J# all have command line options that enable you to specific the name of a binary native resource file that should be embedded into the resulting executable.&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT face="Courier New"&gt;csc /win32res:ExeName.res ExeName.cs&lt;BR&gt;vjc /win32res:ExeName.res ExeName.jsl&lt;BR&gt;vbc /win32resource:ExeName.res ExeName.vb&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P dir=ltr&gt;Comments:&lt;/P&gt;
&lt;UL&gt;
&lt;LI dir=ltr&gt;Shawn has a post that discusses this method, &lt;A href="http://blogs.msdn.com/shawnfa/archive/2006/04/06/568563.aspx" mce_href="http://blogs.msdn.com/shawnfa/archive/2006/04/06/568563.aspx"&gt;Adding a UAC Manifest to Managed Code&lt;/A&gt;. He includes the manifest directly inline in the .rc file, rather than pointing to an external manifest file. 
&lt;LI dir=ltr&gt;Daniel also describes this method in his &lt;A href="http://www.danielmoth.com/Blog/2006/07/vista-user-account-control.html" mce_href="http://www.danielmoth.com/Blog/2006/07/vista-user-account-control.html"&gt;Vista: User Account Control&lt;/A&gt; post 
&lt;LI dir=ltr&gt;We asked&amp;nbsp;Ian to walk through these steps on this &lt;A href="http://channel9.msdn.com/Showpost.aspx?postid=211271" mce_href="http://channel9.msdn.com/Showpost.aspx?postid=211271"&gt;Channel9 screen cast&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/BLOCKQUOTE&gt;
&lt;P dir=ltr&gt;&lt;FONT color=#808080&gt;[Updated on Feb. 16, 2007]&amp;nbsp;Since writing this,&amp;nbsp;I've learned of a couple of issues that you should be aware of before deciding to use this approach: a&lt;/FONT&gt;&lt;FONT color=#808080&gt;ssembly version information&amp;nbsp;is lost after&amp;nbsp;the binary native resources are&amp;nbsp;embedded into the executable, as are application icons. In the likely case that you care about assembly version information and your application's icon, use Method #2.&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;STRONG&gt;Method #2&amp;nbsp;- The "Generic" Approach (using mt.exe)&lt;BR&gt;&lt;/STRONG&gt;The mt.exe tool can be used to embed an input file as a native manifest resource into an already-built .exe file. The command line is as follows:&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT face="Courier New"&gt;mt.exe -manifest ExeName.exe.manifest -outputresource:ExeName.exe;#1&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;This will take a manifest file named &lt;FONT face="Courier New"&gt;ExeName.exe.manifest&lt;/FONT&gt; and embed it into &lt;FONT face="Courier New"&gt;ExeName.exe&lt;/FONT&gt; as a native resource (of type &lt;FONT face="Courier New"&gt;RT_MANIFEST&lt;/FONT&gt;, with an identifier of 1 – see Method #1 above for a description of theses elements)&lt;/P&gt;
&lt;P dir=ltr&gt;For VS project types that support custom build steps (e.g. C#), you can define this as a Post-Build step as follows:&lt;/P&gt;
&lt;UL&gt;
&lt;LI dir=ltr&gt;Open the project properties (right-click on the project and select &lt;EM&gt;Propertie&lt;/EM&gt;s) 
&lt;LI dir=ltr&gt;Select the &lt;EM&gt;Build Events &lt;/EM&gt;tab, and enter the following command into the &lt;EM&gt;Post-build event command line&lt;/EM&gt; text box:&lt;/LI&gt;&lt;/UL&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P dir=ltr&gt;&lt;FONT face="Courier New"&gt;&lt;STRIKE&gt;"$(DevEnvDir)..\..\SDK\v2.0\bin\mt.exe" -manifest "$(ProjectDir)$(TargetName).exe.manifest"&amp;nbsp; –outputresource:"$(TargetDir)$(TargetFileName)";#1&lt;/STRIKE&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT face="Courier New"&gt;"$(DevEnvDir)..\..\&lt;STRONG&gt;VC&lt;/STRONG&gt;\bin\mt.exe" -manifest "$(ProjectDir)$(TargetName).exe.manifest"&amp;nbsp; –outputresource:"$(TargetDir)$(TargetFileName)";#1&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P dir=ltr&gt;The above command makes use of VS-defined macro variables to construct the path to the mt.exe tool (located in &lt;STRIKE&gt;Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin&lt;/STRIKE&gt; Program Files\Microsoft Visual Studio 8\VC\Bin) as well as to determine the input and output file paths. You should be able to use this command directly (in VS 2005, at least), without having to make any text substitutions.&amp;nbsp; The double quotes around the file paths&amp;nbsp;enables you to use file paths that contain spaces.&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT color=#808080&gt;[Updated on Feb. 16, 2007] Since writing this post, I've learned that the version of mt.exe in the SDK folder can cause a&amp;nbsp;crash when the&amp;nbsp;resulting executable is run on&amp;nbsp;Windows XP. Use the more recent version of mt.exe in the VC\Bin folder to avoid this problem. I've modified the paths above to reflect this.&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT color=#808080&gt;Another lesson learned: running the mt.exe tool as a Post-Build step from VC++ projects replaces the manifest entries added by the project (which typically provide the necessary side-by-side info for loading comctl32.dll v6). So unless you want to provide all necessary manifest entries, the best option seems to be the one I described in a later post: &lt;A class="" href="http://blogs.msdn.com/cheller/archive/2006/12/04/quick-tip-manifests-and-vc-projects.aspx" mce_href="http://blogs.msdn.com/cheller/archive/2006/12/04/quick-tip-manifests-and-vc-projects.aspx"&gt;Quick Tip: Manifests and VC++ Projects&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;STRONG&gt;Method #3 - Using the Manifest Tool &lt;BR&gt;&lt;/STRONG&gt;Visual C++ 2005 is the only tool I'm aware of that provides project properties for specifying manifest options. To find these options, open the project properites dialog, on the left-hand pane expand the &lt;EM&gt;Configuration Properties-&amp;gt;Manifest Tool&lt;/EM&gt; node and select &lt;EM&gt;Input and Output&lt;/EM&gt;. You can enter the name of an external manifest file in the &lt;EM&gt;Additional Manifest Files&lt;/EM&gt; field.&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;STRONG&gt;Concluding Thoughts&lt;BR&gt;&lt;/STRONG&gt;I don’t see any of these methods as being particularly complicated. I think the real question is how to integrate one of these methods into your build process.&amp;nbsp; And as I mentioned above, this will likely depend on which programming language you’re using and how you build your executable.&lt;/P&gt;
&lt;P dir=ltr&gt;In general, I think I would opt for using mt.exe (the “generic” method) – as long as I could integrate it into my build process.&amp;nbsp; This means I would be using a dev tool that allows me to define a custom post-build step (like C#) or using a command line build script in which I can add an additional entry to call mt.exe at the end. &lt;STRIKE&gt;That said, I can think of at least one very common scenario that I don't believe meets this condition: compiling a VB project within Visual Studio. In this case, I would likely opt for the step-by-step method, making the call to the resource compiler externally, and including the .res file as an item in my project to keep track of it. (I haven’t been able to figure out a way to automatically include the resource compilation into the VB build process, if anyone knows a way in which this can be done I’d love to hear about it).&lt;/STRIKE&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT color=#808080&gt;[Updated on Oct. 31, 2006] &lt;/FONT&gt;&lt;FONT color=#808080&gt;Since I wrote this post, I learned that VB actually &lt;EM&gt;does &lt;/EM&gt;have a way to specify custom build steps. I was discussing the options for embedding manifests in assemblies with my colleague &lt;A href="http://blogs.msdn.com/mglehman/"&gt;Michael Lehman&lt;/A&gt;, in the context of how to include this in &lt;A href="http://www.projectglidepath.net/glidepath/default.aspx"&gt;Project Glidepath&lt;/A&gt;, and lamenting the lack of custom build options in VB. Michael&amp;nbsp;thought he remembered otherwise, and we opened the properties for a VB project in Visual Studio 2006 and took a closer look. Under the Compile tab, low and behold&amp;nbsp;- there's a Build Events button in the lower right corner!&amp;nbsp;(Michael, thanks so much for pointing this out!). &lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=718757" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cheller/archive/tags/UAC/default.aspx">UAC</category></item></channel></rss>