<?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>Pat's Application Compatibility blog</title><link>http://blogs.msdn.com/patricka/default.aspx</link><description>Tips on Windows Application Compatibility</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Tales of Application Compatibility Weirdness – Demystifying UAC Virtualization</title><link>http://blogs.msdn.com/patricka/archive/2009/12/14/tales-of-application-compatibility-weirdness-demystifying-uac-virtualization.aspx</link><pubDate>Mon, 14 Dec 2009 20:03:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9936711</guid><dc:creator>patricka</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/patricka/comments/9936711.aspx</comments><wfw:commentRss>http://blogs.msdn.com/patricka/commentrss.aspx?PostID=9936711</wfw:commentRss><description>&lt;p&gt;We had a customer in the lab recently and they were quite certain their application was Windows 7 ready. To their surprise, it had several issues in certain situations.&amp;#160; In this post, I’ll talk about one of the situations they encountered as well as other stumbling blocks you might run into with &lt;a href="http://technet.microsoft.com/en-us/magazine/2007.06.uac.aspx"&gt;UAC Virtualization&lt;/a&gt;.&lt;/p&gt;  &lt;h2&gt;Why Doesn’t my Program Work in Program Files?&lt;/h2&gt;  &lt;p&gt;For this particular application, the default install directory was a custom directory on the system drive (e.g. C:\MyApp).&amp;#160; The application performed as expected in this scenario. However, Microsoft recommends that applications be installed in Program Files. This is secured by default to reduce elevation of privilege attacks and is a known location for enterprise inventory tools. Also, installing to program files is a &lt;a href="http://msdn.microsoft.com/en-us/windows/dd203105.aspx"&gt;client logo&lt;/a&gt; requirement.&lt;/p&gt;  &lt;p&gt;We changed the install location to Program Files and the application eventually failed. Why?&lt;/p&gt;  &lt;h2&gt;User Account Control = Standard User by Default&lt;/h2&gt;  &lt;p&gt;Program Files is considered a “per machine” install location.&amp;#160; It is protected by &lt;a href="http://msdn.microsoft.com/en-us/library/bb648648(VS.85).aspx"&gt;Mandatory Integrity Control&lt;/a&gt; and only allows users read and execute rights.&amp;#160; Under UAC, processes will run as a limited standard user and are &lt;em&gt;denied write access to Program Files&lt;/em&gt;. The application was designed to store various data files in the install directory. It also stored data in the registry under under the protected HKLM\Software key as well. Here’s where it starts to get confusing… Most of the files and registry keys appeared to be able to write but others were not.&amp;#160; &lt;/p&gt;  &lt;p&gt;Why?&lt;/p&gt;  &lt;h2&gt;UAC Virtualization to the Rescue (sort of)…&lt;/h2&gt;  &lt;p&gt;There is a mitigation that is included in Vista and Windows 7 called &lt;a href="http://technet.microsoft.com/en-us/magazine/2007.06.uac.aspx"&gt;UAC Virtualization&lt;/a&gt;. This mitigation is intended for this exact scenario -- legacy applications that write to protected per-machine locations. If a legacy (&lt;a href="http://blogs.msdn.com/patricka/archive/2009/12/09/answers-to-several-application-manifest-mysteries-and-questions.aspx"&gt;non-manifested&lt;/a&gt;) application tries to write to a protected directory such as Program Files or certain keys in the HKLM hive, the “access denied” error is captured and the write is redirected to the user’s &lt;a href="http://msdn.microsoft.com/en-us/library/bb756960.aspx"&gt;UAC virtual store&lt;/a&gt;. This allows legacy applications that store state in protected directories and registry locations to continue to work in most cases. &lt;/p&gt;  &lt;p&gt;So, why did it fail?&lt;/p&gt;  &lt;h2&gt;Fuzzy Gray Area&lt;/h2&gt;  &lt;p&gt;UAC virtualization’s goal is to virtualize data. It doesn’t virtualize various executable files (exe, bat, dll, etc.). It doesn’t virtualize files that the user is explicitly denied write access. This is what occurred for the application and why it failed. &lt;/p&gt;  &lt;p&gt;Mystery solved…&lt;/p&gt;  &lt;h2&gt;…but Wait. There’s More Weirdness!!!&lt;/h2&gt;  &lt;p&gt;The scenario of a few files not being virtualized is uncommon.&amp;#160; Here are a few more common issues that can really make you scratch your head.&lt;/p&gt;  &lt;h3&gt;Weirdness Due to Multiple Users&lt;/h3&gt;  &lt;p&gt;UAC Virtualization works by catching the access denied error writing to a “per machine” location and redirecting it to a “per user” location.&amp;#160; This solves the problem of writing the data but this can change the behavior of your application. For example, if a game application is designed to store a high score file to Program Files, every user will get his/her own copy of the high score file. This isn’t the correct behavior for a high score file. There should be one file for all users.&lt;/p&gt;  &lt;h3&gt;Weirdness Due to Running an Application Elevated&lt;/h3&gt;  &lt;p&gt;If you right click an application shortcut and select “Run as Administrator”, this runs the application with the &lt;a href="http://windows.microsoft.com/en-ID/windows7/What-does-running-with-a-full-administrator-token-or-running-with-an-elevated-token-mean-in-User-Account-Control"&gt;full admin token&lt;/a&gt;. The application now has write access to protected locations. Therefore, UAC virtualization is disabled and it will read and write from the “per machine” location instead of the virtualized “per user” location. Now, you have a situation where the application is using completely different files or may not work at all. &lt;/p&gt;  &lt;h2&gt;Please, make it stop!&lt;/h2&gt;  &lt;p&gt;You may be saying “This is madness.”&amp;#160; Remember, this is a mitigation that greatly improved the ability to have legacy applications that weren’t designed to run as standard user to continue to work.&amp;#160; Without this mitigation, lots of existing applications that store state in “per machine” protected locations would fail with access denied errors.&lt;/p&gt;  &lt;h3&gt;Design for Standard User&lt;/h3&gt;  &lt;p&gt;Applications that target Vista or above should be designed to be run by standard users. This means that the application only writes data to “per user” locations in the file system or registry. Standard user was introduced in Windows XP. Vista introduced “standard user by default” with UAC. Running as standard user is here to stay but virtualization will eventually be removed in future OS releases.&lt;/p&gt;  &lt;p&gt;Ideally, you want to design your application to only write to per user locations. Sometimes, that’s not possible or it doesn’t make sense. Here are a few suggestions on how you might change your application if it needs to store per machine data.&lt;/p&gt;  &lt;p&gt;For files, you may want to write to the The programdata directory. It is intended for per machine configuration data.&amp;#160; Check out &lt;a href="http://blogs.msdn.com/cjacks/archive/2008/02/05/where-should-i-write-program-data-instead-of-program-files.aspx"&gt;Chris’ post&lt;/a&gt; on options for writing configuration data.&lt;/p&gt;  &lt;p&gt;For the registry, you may want to create your own key HKLM\Software\MyCompany\MyApp and then set the appropriate permissions at install time. Read more about &lt;a href="http://msdn.microsoft.com/en-us/library/bb530198.aspx#vistaregvirt_topic8"&gt;registry virtualization here&lt;/a&gt;.&lt;/p&gt;  &lt;h3&gt;Manifest Your Application&lt;/h3&gt;  &lt;p&gt;Once you have your application ready to run as a standard user, you will want to disable the mitigation.&amp;#160; This is done by adding an application manifest with the “trustInfo” section to your application. For more information on manifesting your application, look at &lt;a href="http://blogs.msdn.com/patricka/archive/2009/12/09/answers-to-several-application-manifest-mysteries-and-questions.aspx"&gt;my post on manifests&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9936711" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/patricka/archive/tags/UAC/default.aspx">UAC</category><category domain="http://blogs.msdn.com/patricka/archive/tags/Vista/default.aspx">Vista</category><category domain="http://blogs.msdn.com/patricka/archive/tags/Windows+7/default.aspx">Windows 7</category></item><item><title>Answers to Several Application Manifest Mysteries and Questions</title><link>http://blogs.msdn.com/patricka/archive/2009/12/09/answers-to-several-application-manifest-mysteries-and-questions.aspx</link><pubDate>Thu, 10 Dec 2009 04:12:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9934956</guid><dc:creator>patricka</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/patricka/comments/9934956.aspx</comments><wfw:commentRss>http://blogs.msdn.com/patricka/commentrss.aspx?PostID=9934956</wfw:commentRss><description>&lt;P&gt;Recently, someone asked me this question in e-mail -- “How do I get my application to run elevated when someone launches it?”&amp;nbsp;&amp;nbsp; Instinctively, I responded with a “You need to manifest it.”&amp;nbsp; I got a nice long e-mail in return. ;-) I quickly realized that application manifests appear simple but are quite confusing. Manifests are becoming very relevant as they control much more application behavior in Windows 7 and future OS’s. Any application that targets Vista or greater, should contain an application manifest.&lt;/P&gt;
&lt;H2&gt;Application Manifest Basics&lt;/H2&gt;
&lt;UL&gt;
&lt;LI&gt;An application manifest controls execution behavior of a binary and is defined in XML. &lt;/LI&gt;
&lt;LI&gt;An application may or may not have an application manifest. &lt;/LI&gt;
&lt;LI&gt;Application manifests can be embedded into an executable or can be an external file. &lt;/LI&gt;
&lt;LI&gt;Application manifests have been around since XP. We keep extending them to control more behavior and tend to create new MSDN articles: &lt;A href="http://msdn.microsoft.com/en-us/library/aa374191(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/aa374191(VS.85).aspx"&gt;XP introduced side by side assemblies&lt;/A&gt;, &lt;A href="http://msdn.microsoft.com/en-us/library/bb756929.aspx" mce_href="http://msdn.microsoft.com/en-us/library/bb756929.aspx"&gt;Vista added UAC behavior&lt;/A&gt;, &lt;A href="http://msdn.microsoft.com/en-us/library/dd371711(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/dd371711(VS.85).aspx"&gt;Windows 7 added switchback and DPIAware&lt;/A&gt;. New sections are ignored on previous OS’s.&lt;/LI&gt;
&lt;LI&gt;In XP, external manifests have priority and over embedded manifests. In Vista and beyond, embedded manifests have priority over external manifests. For example, if you have an embedded manifest and and external manifest for an application – On XP, the external one will be used; on Vista and later, the embedded one will be used. &lt;/LI&gt;
&lt;LI&gt;On Vista and Windows 7, a manifested application with a trustInfo section will control what token will be used to start the process (standard user or admin). Also, all legacy mitigations will be disabled. This includes &lt;A href="http://technet.microsoft.com/en-us/magazine/2007.06.uac.aspx" mce_href="http://technet.microsoft.com/en-us/magazine/2007.06.uac.aspx"&gt;UAC Virtualization&lt;/A&gt;, &lt;A href="http://technet.microsoft.com/en-us/library/cc709628(WS.10).aspx" mce_href="http://technet.microsoft.com/en-us/library/cc709628(WS.10).aspx"&gt;Installer Detection&lt;/A&gt;, and the &lt;A href="http://msdn.microsoft.com/en-us/library/bb756937.aspx" mce_href="http://msdn.microsoft.com/en-us/library/bb756937.aspx"&gt;Program Compatibility Assistant&lt;/A&gt;. &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://msdn.microsoft.com/en-us/windows/dd203105.aspx" mce_href="http://msdn.microsoft.com/en-us/windows/dd203105.aspx"&gt;Windows Client Logo&lt;/A&gt; requires applications to be manifested. &lt;/LI&gt;&lt;/UL&gt;
&lt;H2&gt;Checking for an Embedded Manifest&lt;/H2&gt;
&lt;P&gt;You might be wondering if your exe’s have embedded manifest and what they look like.&amp;nbsp; My favorite tool to dump a manifest is &lt;A href="http://technet.microsoft.com/en-us/sysinternals/bb897441.aspx" mce_href="http://technet.microsoft.com/en-us/sysinternals/bb897441.aspx"&gt;sigcheck&lt;/A&gt;. Use the –m switch to dump the manifest.&amp;nbsp; E.g. sigcheck.exe –m myapp.exe&lt;/P&gt;
&lt;H3&gt;Example output of a manifest with only side by side behavior:&lt;/H3&gt;
&lt;P&gt;This executable is a native C++ program.&lt;/P&gt;
&lt;TABLE border=1 cellSpacing=0 cellPadding=2 width=600&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=598&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;D:\dev\legacyUAC\Debug&amp;gt;sigcheck.exe -m legacyUAC.exe &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;sigcheck v1.60 - sigcheck &lt;BR&gt;Copyright (C) 2004-2009 Mark Russinovich &lt;BR&gt;Sysinternals - www.sysinternals.com &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;D:\dev\legacyUAC\Debug\legacyUAC.exe: &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Verified:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Unsigned &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; File date:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7:43 PM 10/26/2009 &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Strong Name:&amp;nbsp;&amp;nbsp;&amp;nbsp; Unsigned &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Publisher:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; n/a &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Description:&amp;nbsp;&amp;nbsp;&amp;nbsp; n/a &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Product:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; n/a &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Version:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; n/a &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; File version:&amp;nbsp;&amp;nbsp; n/a &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Manifest: &lt;BR&gt;∩╗┐&lt;FONT color=#008000&gt;&amp;lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&amp;gt; &lt;BR&gt;&amp;lt;assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"&amp;gt; &lt;BR&gt;&amp;nbsp; &amp;lt;dependency&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;dependentAssembly&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;assemblyIdentity type="win32" name="Microsoft.VC90.DebugCRT" version="9.0 &lt;BR&gt;.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"&amp;gt;&amp;lt;/assemblyIdentity&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/dependentAssembly&amp;gt; &lt;BR&gt;&amp;nbsp; &amp;lt;/dependency&amp;gt; &lt;BR&gt;&amp;lt;/assembly&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;H3&gt;Example output of a manifest with UAC trustInfo section:&lt;/H3&gt;
&lt;P&gt;This executable is a .NET C# program.&lt;/P&gt;
&lt;TABLE border=1 cellSpacing=0 cellPadding=2 width=600&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=598&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;D:\dev\legacyDPI\legacyDPI\bin\Debug&amp;gt;sigcheck.exe -m legacyDPI.exe &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;sigcheck v1.60 - sigcheck &lt;BR&gt;Copyright (C) 2004-2009 Mark Russinovich &lt;BR&gt;Sysinternals - www.sysinternals.com &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;D:\dev\legacyDPI\legacyDPI\bin\Debug\legacyDPI.exe: &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Verified:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Unsigned &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; File date:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3:06 PM 11/12/2009 &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Strong Name:&amp;nbsp;&amp;nbsp;&amp;nbsp; Unsigned &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Publisher:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Microsoft &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Description:&amp;nbsp;&amp;nbsp;&amp;nbsp; legacyDPI &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Product:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; legacyDPI &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Version:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.0.0.0 &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; File version:&amp;nbsp;&amp;nbsp; 1.0.0.0 &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Manifest: &lt;BR&gt;∩╗┐&lt;FONT color=#008000&gt;&amp;lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&amp;gt; &lt;BR&gt;&amp;lt;assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"&amp;gt; &lt;BR&gt;&amp;nbsp; &amp;lt;assemblyIdentity version="1.0.0.0" name="MyApplication.app"/&amp;gt; &lt;BR&gt;&amp;nbsp; &amp;lt;trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;security&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3"&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;requestedExecutionLevel level="asInvoker" uiAccess="false"/&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/requestedPrivileges&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/security&amp;gt; &lt;BR&gt;&amp;nbsp; &amp;lt;/trustInfo&amp;gt; &lt;BR&gt;&amp;lt;/assembly&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P&gt;If you are wondering what those three weird characters at the beginning of the manifest are, it is the byte order mark. I talk about it in this &lt;A title=post href="http://blogs.msdn.com/patricka/archive/2008/09/10/oem-ready-test-case-1-incorrectly-fails-with-a-utf-8-manifest.aspx" mce_href="http://blogs.msdn.com/patricka/archive/2008/09/10/oem-ready-test-case-1-incorrectly-fails-with-a-utf-8-manifest.aspx"&gt;post&lt;/A&gt;.&lt;/P&gt;
&lt;H2&gt;External Manifests&lt;/H2&gt;
&lt;P&gt;An external manifest is a text file that contains the manifest XML.&amp;nbsp; The file must exist in the same directory as the executable and have the same name with a “.manifest” extension.&amp;nbsp; For example, if the name of your executable is MyApp.exe, your manifest file would be named “MyApp.exe.manifest”.&lt;/P&gt;
&lt;P&gt;Remember, in Vista and beyond, embedded manifests have priority over external manifests. Therefore, if the executable already has an embedded manifest, the external manifest will be ignored.&lt;/P&gt;
&lt;H2&gt;Embedding a Manifest&lt;/H2&gt;
&lt;P&gt;There are two ways you can embed a manifest.&amp;nbsp; You can have the compiler embed it or you can embed it with the &lt;A href="http://msdn.microsoft.com/en-us/library/aa375649(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/aa375649(VS.85).aspx"&gt;manifest tool (mt.exe)&lt;/A&gt; included in the Platform SDK.&lt;/P&gt;
&lt;H3&gt;Embedding at Compile / Build Time&lt;/H3&gt;
&lt;P&gt;Visual Studio 2008 has functionality to embed manifest for &lt;A href="http://msdn.microsoft.com/en-us/library/ms235229.aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms235229.aspx"&gt;native&lt;/A&gt; and &lt;A href="http://msdn.microsoft.com/en-us/library/ms247046.aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms247046.aspx"&gt;managed&lt;/A&gt; projects.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;For Visual Studio 2005, Catherine Heller has a great post on &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" mce_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;how to embed manifests in your build process&lt;/A&gt;.&lt;/P&gt;
&lt;H3&gt;Embedding using &lt;A href="http://msdn.microsoft.com/en-us/library/aa375649(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/aa375649(VS.85).aspx"&gt;mt.exe&lt;/A&gt;&lt;/H3&gt;
&lt;P&gt;The manifest tool is a command line tool that lets you add or merge manifests to an executable.&amp;nbsp; For usage, check the &lt;A href="http://msdn.microsoft.com/en-us/library/aa375649(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/aa375649(VS.85).aspx"&gt;MSDN article for the Manifest Tool&lt;/A&gt;.&amp;nbsp; Here’s an example for adding a manifest to an executable: &lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;mt.exe -manifest MyApp.exe.manifest -outputresource:MyApp.exe;#1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;You will be modifying the binary when you embed the manifest. If your exe was signed, this will invalidate the signature and it will need to be re-signed.&lt;/P&gt;
&lt;H2&gt;Planning for the Future&lt;/H2&gt;
&lt;P&gt;Windows 7 introduced “switchback” into the manifest by adding a &lt;A href="http://msdn.microsoft.com/en-us/library/dd371711(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/dd371711(VS.85).aspx"&gt;&amp;lt;compatibility&amp;gt; section&lt;/A&gt; to the manifest.&amp;nbsp; This allows you to state what OS you support. So, if you insert the tag that you support Windows 7, you will get a handful of new behaviors.&amp;nbsp; Otherwise, your app will “switchback” to the Vista behavior.&amp;nbsp; The plan is to use this section to make better choices for compatibility behaviors in future OS’s.&amp;nbsp; When adding manifests to applications, consider adding the supportedOS tag.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9934956" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/patricka/archive/tags/UAC/default.aspx">UAC</category><category domain="http://blogs.msdn.com/patricka/archive/tags/Vista/default.aspx">Vista</category><category domain="http://blogs.msdn.com/patricka/archive/tags/Windows+7/default.aspx">Windows 7</category></item><item><title>Questions from the Developer Booth at TechEd Europe 2009</title><link>http://blogs.msdn.com/patricka/archive/2009/11/23/questions-from-the-developer-booth-at-teched-europe-2009.aspx</link><pubDate>Tue, 24 Nov 2009 01:15:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9927654</guid><dc:creator>patricka</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/patricka/comments/9927654.aspx</comments><wfw:commentRss>http://blogs.msdn.com/patricka/commentrss.aspx?PostID=9927654</wfw:commentRss><description>&lt;p&gt;I had the opportunity to go to Berlin for &lt;a href="http://www.microsoft.com/europe/teched/"&gt;TechEd Europe 2009&lt;/a&gt;.&amp;#160; I delivered a presentation on Application Compatibility and the rest of the time I hung out in the “Test your app on Win 7” and “Win 7 Developer drop in center”. I got some great questions from attendees.&amp;#160; I thought I’d blog some of the general Q&amp;amp;A. Thank you to all that stopped by the booth. I loved Berlin.&amp;#160; I hope I get to go back soon.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Q: Do I need to worry about anything in Windows 7 for web apps?&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;A: There are some IE8 changes that may affect web applications. The &lt;a href="http://www.microsoft.com/windows/internet-explorer/readiness/default.aspx"&gt;Internet Explorer 8 Readiness Toolkit&lt;/a&gt; is a very good reference.&amp;#160; The &lt;a href="http://www.microsoft.com/windows/internet-explorer/readiness/developers.aspx"&gt;developer checklist&lt;/a&gt; is a good place to start.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Q: What do I need to worry about for existing installers on Windows 7?&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;A: The common problems that are encountered with existing installers are the same issues encountered in Vista:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Version check criteria &lt;/li&gt;    &lt;li&gt;MSI custom actions &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Ideally, you should not check for version if possible. Version checking tends to block applications that may install and run just fine on a newer OS.&amp;#160; If you need to check version, you should display a warning rather than exiting the installation. Version checking can also cause issues after an upgrade with uninstall. If you check version, the user may not be able to uninstall your application after an upgrade to the new OS.&lt;/p&gt;  &lt;p&gt;MSI custom actions can run in a standard user context or the administrator. Sometimes the custom action is running in the wrong context.&amp;#160; Chris Jackson has a great post on the common issue with &lt;a href="http://blogs.msdn.com/cjacks/archive/2006/10/30/deferred-custom-actions-and-permissions-on-windows-vista-with-uac-enabled.aspx"&gt;deferred custom actions&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Q: Where can I find info on developing on Windows 7?&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;A: The &lt;a href="http://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=Win7DeveloperGuide&amp;amp;ReleaseId=1702"&gt;Windows 7 Developer Guide&lt;/a&gt; gives a good overview of new developer functionality.&amp;#160; If you are looking for presentations and code samples to get you started, check out the &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=1C333F06-FADB-4D93-9C80-402621C600E7&amp;amp;displaylang=en"&gt;Windows 7 Developer Jumpstart Kit&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Q: I’m a .NET Developer. What’s the guidance for developing on Windows 7? Should I use the Code Pack or wait for .NET 4.0?&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;A: The short answer is: Use the Code Pack today but think of it as free code to include in your application that wraps the native Windows 7 API’s. In .NET 4.0, you will see some of the new Windows developer features available in WPF.&amp;#160; &lt;a href="http://windowsteamblog.com/blogs/developers/archive/2009/11/18/new-windows-api-code-pack-version.aspx"&gt;Yochay Kiriaty has recently outlined guidance on this topic&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Q: .NET 1.1 SP1 support for Windows 7?&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;A: As with all older products, be sure to check the &lt;a href="http://support.microsoft.com/lifecycle/?p1=1249"&gt;support lifecycle for the product&lt;/a&gt; first. There isn’t an official statement of .NET 1.1 SP1 compatibility for Windows 7. However, because compatibility was a key goal between Vista and Windows 7, efforts were made to ensure .NET 1.1 SP1 works on Windows 7.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Q: Does &amp;lt;insert app name here&amp;gt; work on Windows 7?&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;A: The &lt;a href="http://www.microsoft.com/windows/compatibility/en-us/default.aspx"&gt;Compatibility Center&lt;/a&gt; is the best reference to get information on what applications have been reported to be compatible with Windows 7.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9927654" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/patricka/archive/tags/Installation/default.aspx">Installation</category><category domain="http://blogs.msdn.com/patricka/archive/tags/IE/default.aspx">IE</category><category domain="http://blogs.msdn.com/patricka/archive/tags/Windows+7/default.aspx">Windows 7</category></item><item><title>Windows 7 Application Compatibility Testing Guidance document</title><link>http://blogs.msdn.com/patricka/archive/2009/10/05/windows-7-application-compatibility-testing-guidance-document.aspx</link><pubDate>Mon, 05 Oct 2009 21:18:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9903365</guid><dc:creator>patricka</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/patricka/comments/9903365.aspx</comments><wfw:commentRss>http://blogs.msdn.com/patricka/commentrss.aspx?PostID=9903365</wfw:commentRss><description>&lt;p&gt;If you have an existing application, you may be wondering if it’s going to work on Windows 7.&amp;#160; If it works on Vista, you have a good shot at it working on Windows 7. &lt;/p&gt;  &lt;p&gt;As a developer or a tester, you may be wondering if you have tested your application to uncover potential issues on the new OS. We’ve worked with a lot of ISV’s over the past few years and we’ve come up with a document that focuses on the common issue areas of application compatibility with testing scenarios.&amp;#160; The &lt;a href="http://code.msdn.microsoft.com/Win7CompatTesting"&gt;Windows 7 Application Compatibility Testing Guidance&lt;/a&gt; document can be downloaded from MSDN Code Gallery.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9903365" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/patricka/archive/tags/UAC/default.aspx">UAC</category><category domain="http://blogs.msdn.com/patricka/archive/tags/Installation/default.aspx">Installation</category><category domain="http://blogs.msdn.com/patricka/archive/tags/IE/default.aspx">IE</category><category domain="http://blogs.msdn.com/patricka/archive/tags/Vista/default.aspx">Vista</category><category domain="http://blogs.msdn.com/patricka/archive/tags/Windows+7/default.aspx">Windows 7</category><category domain="http://blogs.msdn.com/patricka/archive/tags/Testing/default.aspx">Testing</category></item><item><title>Displaying the UAC consent dialog on the desktop</title><link>http://blogs.msdn.com/patricka/archive/2009/07/14/displaying-the-uac-consent-dialog-on-the-desktop.aspx</link><pubDate>Tue, 14 Jul 2009 21:39:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9833390</guid><dc:creator>patricka</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/patricka/comments/9833390.aspx</comments><wfw:commentRss>http://blogs.msdn.com/patricka/commentrss.aspx?PostID=9833390</wfw:commentRss><description>&lt;p&gt;I had written a draft of this post a while ago (last year).&amp;#160; I use &lt;a href="http://download.live.com/writer"&gt;Live Writer&lt;/a&gt; as my blog editor.&amp;#160; Between Live Writer and &lt;a href="http://technet.microsoft.com/en-us/library/bb742423.aspx"&gt;Intellimirror&lt;/a&gt;,this draft has survived multiple reloads of interim builds of Windows 7.&amp;#160; So, I think in some ways, it deserves to be resurrected and posted. :-)&amp;#160; Here’s the post with a Windows 7 update:&lt;/p&gt;  &lt;p&gt;Frequently, we need to give presentations over Live Meeting.&amp;#160; When we demonstrate UAC, the consent dialog is displayed on the secured desktop.&amp;#160; Therefore, the Live Meeting participants don't see the UAC consent dialog.&amp;#160; To solve this, we use a policy setting to allow the dialog to be displayed on the user desktop.&amp;#160; &lt;/p&gt;  &lt;p&gt;The reason I bring this up is that &lt;strong&gt;this same trick can be used if you have an automated functionality test that needs to click the consent dialog&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;You can adjust this with a policy.&amp;#160; The local security policy (Run secpol.msc) is Local Policies | Security Options | User Account Control: Switch to the secure desktop when prompting for elevation.&amp;#160; Set this policy to &amp;quot;disabled&amp;quot; to allow the consent dialog to be presented on the user desktop.&lt;/p&gt;  &lt;p&gt;On Windows 7, this setting is exposed through the UAC slider bar UI.&amp;#160; Just slide the knob to the next notch down from the default:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;a href="http://blogs.msdn.com/blogfiles/patricka/WindowsLiveWriter/DisplayingtheUACconsentdialogonthedeskto_D332/UAC%20Settings.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="UAC Settings" border="0" alt="UAC Settings" src="http://blogs.msdn.com/blogfiles/patricka/WindowsLiveWriter/DisplayingtheUACconsentdialogonthedeskto_D332/UAC%20Settings_thumb.jpg" width="644" height="476" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Chris talks all about the slider in his &lt;a href="http://blogs.msdn.com/cjacks/archive/2009/01/07/the-windows-7-uac-slider-and-what-you-can-do-on-windows-vista-today.aspx"&gt;post&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Of course, running with this policy disabled opens up some risks and isn't recommended for normal operation.&amp;#160; For more information on the secure desktop and UAC consent can be found in the UACBlog in the &lt;a href="http://blogs.msdn.com/uac/archive/2006/05/03/589561.aspx"&gt;User Account Control Prompts on the Secure Desktop&lt;/a&gt; post. &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9833390" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/patricka/archive/tags/UAC/default.aspx">UAC</category><category domain="http://blogs.msdn.com/patricka/archive/tags/Vista/default.aspx">Vista</category><category domain="http://blogs.msdn.com/patricka/archive/tags/Windows+7/default.aspx">Windows 7</category></item><item><title>Developing Compatible Applications for Windows 7 webcast</title><link>http://blogs.msdn.com/patricka/archive/2009/06/24/developing-compatible-applications-for-windows-7-webcast.aspx</link><pubDate>Wed, 24 Jun 2009 21:29:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9801854</guid><dc:creator>patricka</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/patricka/comments/9801854.aspx</comments><wfw:commentRss>http://blogs.msdn.com/patricka/commentrss.aspx?PostID=9801854</wfw:commentRss><description>&lt;P&gt;I know I could talk all day about application compatibility topics and not cover everything that can be discussed.&amp;nbsp; Here’s a one hour webcast&amp;nbsp; I did that focuses on the top issues and most confusing topics for Application Compatibility.&amp;nbsp; I do some of my favorite demos showing UAC architecture, data redirection, services isolation, and mandatory integrity control.&amp;nbsp; The target audience is for developers and testers.&lt;/P&gt;
&lt;P&gt;Here’s the webcast: &lt;A href="http://www.msdev.com/Directory/Description.aspx?eventId=1216" mce_href="http://www.msdev.com/Directory/Description.aspx?eventId=1216"&gt;Developing Compatible Applications for Windows 7&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;My main goal in this presentation is to talk about moving application from XP or Vista to Windows 7 and demystify some of common problems.&amp;nbsp; I also wanted to “plug” the Application Compatibility Cookbooks.&amp;nbsp; These documents are some of the best resources for understanding what breaking changes have occurred and how to mitigate them.&lt;/P&gt;
&lt;P&gt;Make sure to reference both cookbooks. Most of the breaking changes are in the original XP to Vista cookbook.&lt;/P&gt;
&lt;P&gt;Moving from XP-&amp;gt; Vista/2008 –&amp;gt; Win7: &lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyID=69C63073-FE3F-47C3-BAA5-B37943AFE227&amp;amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyID=69C63073-FE3F-47C3-BAA5-B37943AFE227&amp;amp;displaylang=en"&gt;“Application Compatibility Cookbook&lt;/A&gt;”&lt;/P&gt;
&lt;P&gt;Moving from Vista -&amp;gt; Win 7: &lt;A href="http://code.msdn.microsoft.com/Windows7AppQuality" mce_href="http://code.msdn.microsoft.com/Windows7AppQuality"&gt;“Windows 7 Application Quality Cookbook&lt;/A&gt;” &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9801854" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/patricka/archive/tags/UAC/default.aspx">UAC</category><category domain="http://blogs.msdn.com/patricka/archive/tags/Service+Isolation/default.aspx">Service Isolation</category><category domain="http://blogs.msdn.com/patricka/archive/tags/Vista/default.aspx">Vista</category><category domain="http://blogs.msdn.com/patricka/archive/tags/Windows+7/default.aspx">Windows 7</category></item><item><title>OEM Ready Test Case 1 Incorrectly Fails with a UTF-8 manifest</title><link>http://blogs.msdn.com/patricka/archive/2008/09/10/oem-ready-test-case-1-incorrectly-fails-with-a-utf-8-manifest.aspx</link><pubDate>Wed, 10 Sep 2008 23:08:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8941865</guid><dc:creator>patricka</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/patricka/comments/8941865.aspx</comments><wfw:commentRss>http://blogs.msdn.com/patricka/commentrss.aspx?PostID=8941865</wfw:commentRss><description>&lt;p&gt;I haven't posted in a while.&amp;#160; I've been helping out with a couple other programs we have going on in the labs these days.&amp;#160; &lt;a href="http://msdn.microsoft.com/en-us/windowsvista/cc315067.aspx"&gt;OEM Ready&lt;/a&gt; is a subset of Certified for Windows Vista targeted at applications that ship on new PC's.&lt;/p&gt;  &lt;p&gt;If you are using the automation in the OEM Ready Certification Test Tool, you can get a false failure if your application has a &lt;a href="http://en.wikipedia.org/wiki/Utf-8"&gt;UTF-8&lt;/a&gt; embedded manifest that has the &lt;a href="http://en.wikipedia.org/wiki/Byte_Order_Mark"&gt;byte order mark (BOM)&lt;/a&gt; included.&amp;#160; Visual Studio 2008 includes the BOM if you use it to embed the manifest.&amp;#160; &lt;/p&gt;  &lt;p&gt;The error in the log looks something like this:&lt;/p&gt;  &lt;table&gt;&lt;tbody&gt;     &lt;tr class="Information"&gt;       &lt;td&gt;2008-09-06T01:56:32.4030000Z&lt;/td&gt;        &lt;td class="severity"&gt;Information&lt;/td&gt;        &lt;td&gt;INFO: Embedded manifest exists: &amp;#239;&amp;#187;&amp;#191;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt; &amp;lt;assembly xmlns=&amp;quot;urn:schemas-microsoft-com:asm.v1&amp;quot; manifestVersion=&amp;quot;1.0&amp;quot;&amp;gt; &amp;lt;trustInfo xmlns=&amp;quot;urn:schemas-microsoft-com:asm.v3&amp;quot;&amp;gt; &amp;lt;security&amp;gt; &amp;lt;requestedPrivileges&amp;gt; &amp;lt;requestedExecutionLevel level=&amp;quot;asInvoker&amp;quot; uiAccess=&amp;quot;false&amp;quot;&amp;gt;&amp;lt;/requestedExecutionLevel&amp;gt; &amp;lt;/requestedPrivileges&amp;gt; &amp;lt;/security&amp;gt; &amp;lt;/trustInfo&amp;gt; &amp;lt;dependency&amp;gt; &amp;lt;dependentAssembly&amp;gt; &amp;lt;assemblyIdentity type=&amp;quot;win32&amp;quot; name=&amp;quot;Microsoft.VC90.DebugCRT&amp;quot; version=&amp;quot;9.0.21022.8&amp;quot; processorArchitecture=&amp;quot;x86&amp;quot; publicKeyToken=&amp;quot;1fc8b3b9a1e18e3b&amp;quot;&amp;gt;&amp;lt;/assemblyIdentity&amp;gt; &amp;lt;/dependentAssembly&amp;gt; &amp;lt;/dependency&amp;gt; &amp;lt;/assembly&amp;gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr class="Warning"&gt;       &lt;td&gt;2008-09-06T01:56:32.4040000Z&lt;/td&gt;        &lt;td class="severity"&gt;Warning&lt;/td&gt;        &lt;td&gt;EXCEPTION: Data at the root level is invalid. Line 1, position 1../n at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.Throw(String res, String arg) at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace() at System.Xml.XmlTextReaderImpl.ParseDocumentContent() at System.Xml.XmlTextReaderImpl.Read() at System.Xml.XPath.XPathDocument.LoadFromReader(XmlReader reader, XmlSpace space) at System.Xml.XPath.XPathDocument..ctor(TextReader textReader) at Microsoft.LogoTest.Tests.Common.ManifestChecker.VerifyManifest(String manifest)&lt;/td&gt;     &lt;/tr&gt;      &lt;tr class="Warning"&gt;       &lt;td&gt;2008-09-06T01:56:32.4040000Z&lt;/td&gt;        &lt;td class="severity"&gt;Warning&lt;/td&gt;        &lt;td&gt;WARNING: Intermediate result: C:\Program Files\Microsoft\OEM Ready Demo\OEMReadyDemo.exe FAILED the test. It does not have manifest that is compliant with UAC guidelines.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr class="Error"&gt;       &lt;td&gt;2008-09-06T01:56:32.4050000Z&lt;/td&gt;        &lt;td class="severity"&gt;Error&lt;/td&gt;        &lt;td&gt;ASSERT: The test failed because one or more of the executable did not comply with the UAC guidelines&lt;/td&gt;     &lt;/tr&gt;      &lt;tr class="Information"&gt;       &lt;td&gt;2008-09-06T01:56:32.4100000Z&lt;/td&gt;        &lt;td class="severity"&gt;Information&lt;/td&gt;        &lt;td&gt;INFO: Test result: Failed&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&lt;a href="http://technet.microsoft.com/en-us/sysinternals/bb897441.aspx"&gt;Sigcheck&lt;/a&gt; is used by the test tool to dump the manifest.&amp;#160; Sigcheck outputs the BOM as garbage characters (&amp;#239;&amp;#187;&amp;#191;).&amp;#160; This throws off the test tool and it gives an incorrect result.&amp;#160; This is a known bug with the tools and will be fixed.&amp;#160; For now, if you run into this problem, you can submit this test case as a pass.&lt;/p&gt;  &lt;p&gt;Pat&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8941865" width="1" height="1"&gt;</description></item><item><title>Registering ATL Performance Counters on Vista and Server 2008</title><link>http://blogs.msdn.com/patricka/archive/2008/04/09/registering-atl-performance-counters-on-vista-and-server-2008.aspx</link><pubDate>Wed, 09 Apr 2008 19:33:24 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8372689</guid><dc:creator>patricka</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/patricka/comments/8372689.aspx</comments><wfw:commentRss>http://blogs.msdn.com/patricka/commentrss.aspx?PostID=8372689</wfw:commentRss><description>&lt;p&gt;If you use the ATL Server performance counter libraries, you may run into a problem on Vista and WS08.&amp;nbsp; The ATL libraries don't play well with the updates to Windows Resource Protection.&amp;nbsp; WRP enforces restrictions on the registry to prevent corruption of performance counters.&amp;nbsp; ATL breaks these rules and tries to update the registry directly.&lt;/p&gt; &lt;p&gt;There is a workaround to the issue that is outlined in &lt;a href="http://support.microsoft.com/kb/933241"&gt;Q933241&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;To avoid this problem, the recommended way to add counters is through the lodctr tool or the API LoadPerfCounterTextStrings.&amp;nbsp; See &lt;a href="http://msdn2.microsoft.com/en-us/library/aa371881(VS.85).aspx"&gt;Adding Performance Counters&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;If you are really ambitious, ATL Server code has been released as shared source.&amp;nbsp;&amp;nbsp; I haven't looked at the code or the project but there may be an opportunity to change the way ATL loads perf counters in the future:&amp;nbsp; &lt;a href="http://blogs.msdn.com/vcblog/archive/2007/01/19/atl-server-visual-c-shared-source-software.aspx"&gt;http://blogs.msdn.com/vcblog/archive/2007/01/19/atl-server-visual-c-shared-source-software.aspx&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Pat&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8372689" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/patricka/archive/tags/Windows+Server+2008/default.aspx">Windows Server 2008</category><category domain="http://blogs.msdn.com/patricka/archive/tags/Vista/default.aspx">Vista</category></item><item><title>Windows Server 2008 Application Compatibility presentation</title><link>http://blogs.msdn.com/patricka/archive/2008/04/07/windows-server-2008-application-compatibility-presentation.aspx</link><pubDate>Tue, 08 Apr 2008 01:01:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8366643</guid><dc:creator>patricka</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/patricka/comments/8366643.aspx</comments><wfw:commentRss>http://blogs.msdn.com/patricka/commentrss.aspx?PostID=8366643</wfw:commentRss><description>&lt;p&gt;In the compatibility labs, we always give an big overview presentation about Windows application compatibility.&amp;nbsp; There's a lot of overlap between Vista and WS08 AppCompat but we call out some specific areas that mostly affect WS08.&amp;nbsp; We've recorded the WS08 specific section of the presentation and posted it to &lt;a href="http://channel9.msdn.com/Showpost.aspx?postid=395847"&gt;Channel 9&lt;/a&gt;.&amp;nbsp; I hope you find this useful in preparing your applications for WS08.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8366643" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/patricka/archive/tags/Windows+Server+2008/default.aspx">Windows Server 2008</category></item><item><title>Detecting what Server Roles are installed on Windows Server 2008</title><link>http://blogs.msdn.com/patricka/archive/2008/03/05/detecting-what-server-roles-are-installed-on-windows-server-2008.aspx</link><pubDate>Wed, 05 Mar 2008 09:35:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8040496</guid><dc:creator>patricka</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/patricka/comments/8040496.aspx</comments><wfw:commentRss>http://blogs.msdn.com/patricka/commentrss.aspx?PostID=8040496</wfw:commentRss><description>&lt;P&gt;I think there is always a nugget of information that inspires a blog.&amp;nbsp; This is the idea that inspired my blog.&lt;/P&gt;
&lt;P&gt;By default, Windows Server 2008 has no server roles installed.&amp;nbsp; This isn't intended to make you do more work (it's a feature).&amp;nbsp; The goal is to be secure by default.&amp;nbsp; After the OS installed, you add the roles and features that that are needed.&lt;/P&gt;
&lt;P&gt;So, from an application compatibility point of view, your application may require a role that isn't installed by default.&amp;nbsp; There are two ways to programmatically query what roles and features are installed.&lt;/P&gt;
&lt;H5&gt;
&lt;P&gt;&lt;STRONG&gt;Using &lt;A href="http://technet2.microsoft.com/WindowsVista/en/library/10c24c6a-44e0-4226-89f5-c2a0cec7d0111033.mspx?mfr=true" mce_href="http://technet2.microsoft.com/WindowsVista/en/library/10c24c6a-44e0-4226-89f5-c2a0cec7d0111033.mspx?mfr=true"&gt;ServerManagerCmd&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/H5&gt;
&lt;P mce_keep="true"&gt;UPDATE: ServerManagerCmd is being deprecated.&amp;nbsp; It is recommended to use &lt;A href="http://technet.microsoft.com/en-us/library/cc732757.aspx#BKMK_wps" target=_blank mce_href="http://technet.microsoft.com/en-us/library/cc732757.aspx#BKMK_wps"&gt;PowerShell cmdlets for Server Manager&lt;/A&gt; starting with R2 forward.&lt;/P&gt;
&lt;P&gt;There's a cool command line utility that has been added to Window Server 2008 called &lt;A href="http://technet2.microsoft.com/WindowsVista/en/library/10c24c6a-44e0-4226-89f5-c2a0cec7d0111033.mspx?mfr=true" mce_href="http://technet2.microsoft.com/WindowsVista/en/library/10c24c6a-44e0-4226-89f5-c2a0cec7d0111033.mspx?mfr=true"&gt;ServerManagerCmd&lt;/A&gt;.&amp;nbsp; ServerManagerCmd allows you to add, remove, and query roles and features.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;If you execute the following command:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;gt; servermanagercmd.exe -query roles.xml&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;An XML file of all the roles and features installed will be created.&amp;nbsp; You could then parse that file to determine what roles and features are installed.&amp;nbsp; I was hoping to find something in the scripting repository to do this but couldn't find anything.&amp;nbsp; Powershell would be a good option but remember... no features are installed by default.&amp;nbsp; Powershell and .NET 3.0 would need to be installed.&amp;nbsp; You could do that with servermanagercmd as well. &lt;/P&gt;
&lt;P&gt;For example:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;gt; servermanagercmd.exe -install Powershell&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;ServerManagerCmd is great for scripting but what if you want to do determine installed roles in your application's installer? ...or avoid lots of parsing in a script? ..or needing to install .NET and Powershell?&amp;nbsp; WMI is probably a better choice.&lt;/P&gt;
&lt;H5&gt;Using WMI&lt;/H5&gt;
&lt;P&gt;With Windows Server 2008, there is a new class in the WMI namespace &lt;STRONG&gt;\Root\cimv2&lt;/STRONG&gt; called &lt;A href="http://msdn2.microsoft.com/en-us/library/cc280268(VS.85).aspx" mce_href="http://msdn2.microsoft.com/en-us/library/cc280268(VS.85).aspx"&gt;&lt;STRONG&gt;Win32_ServerFeature&lt;/STRONG&gt;&lt;/A&gt;&lt;STRONG&gt;.&lt;/STRONG&gt;&amp;nbsp; This will allow you to use WMI to iterate through what roles and features are installed.&amp;nbsp; WMI is a very good option for determining in your installer if a prerequisite role is installed.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8040496" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/patricka/archive/tags/Installation/default.aspx">Installation</category></item><item><title>Where do I start?</title><link>http://blogs.msdn.com/patricka/archive/2008/02/28/where-do-i-start.aspx</link><pubDate>Thu, 28 Feb 2008 10:08:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7930421</guid><dc:creator>patricka</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/patricka/comments/7930421.aspx</comments><wfw:commentRss>http://blogs.msdn.com/patricka/commentrss.aspx?PostID=7930421</wfw:commentRss><description>&lt;p&gt;When you work on a given subject for a while, you tend to jump right in and forget to start at the beginning.&amp;nbsp;&amp;nbsp; In the Application Compatibility lab, we kick off the week with an overview presentation and cover the basics of common compatibility issues.&amp;nbsp; Those topics are probably a good place to start with this blog.&lt;/p&gt; &lt;p&gt;The first thing to mention is the &lt;a href="http://msdn2.microsoft.com/en-us/library/aa480152.aspx"&gt;Application Compatibility Cookbook&lt;/a&gt;.&amp;nbsp; &lt;strong&gt;This is the primer of Application Compatibility.&lt;/strong&gt;&amp;nbsp; I was going to call it the &lt;a href="http://en.wikipedia.org/wiki/The_C_Programming_Language_%28book%29"&gt;K&amp;amp;R&lt;/a&gt; of of Application Compatibility but I don't want to date myself ;-).&amp;nbsp; I highly recommend reading the cookbook or at least keep it handy for a reference.&lt;/p&gt; &lt;p&gt;Now that you've looked at the cookbook (Go look at it now if you haven't), you are probably saying, "Whew, that's a lot of stuff.&amp;nbsp; Can you just tell me the top issues with Application Compatibility?"&amp;nbsp; So, let's start with a list of the top areas of issues:&lt;/p&gt; &lt;p&gt;&lt;strong&gt;User Account Control (UAC):&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;UAC is intended to run applications as standard user by default.&amp;nbsp; Even if you are a member of the administrators group, applications that are not marked to run with administrator privileges will run with reduced "standard user" rights.&amp;nbsp; Applications may not be designed to run as a standard user and may not have rights or privileges to certain resources.&lt;/p&gt; &lt;p&gt;Next steps if you have an issue:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/aa480152.aspx#appcomp_topic4"&gt;UAC in the Cookbook&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/aa905330.aspx"&gt;Windows Vista Application Development Requirements for User Account Control (UAC)&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;Installation&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Installation issues usually revolve around UAC.&amp;nbsp; Almost all installers need to run with admin rights because they usually write to Program Files or HKLM in the registry.&amp;nbsp; MSI issues usually revolve around custom actions being run in the wrong context (user or admin).&lt;/p&gt; &lt;p&gt;Next steps if you have an issue:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;MSI Installer issues - See &lt;a href="http://blogs.msdn.com/rflaming/archive/2006/10/01/uac-in-msi-notes-answers-to-questions-in-comments-from-earlier-blog-posts.aspx"&gt;rflaming's blog&lt;/a&gt;&lt;/li&gt; &lt;li&gt;Custom installer issues with UAC - See installer topics under &lt;a href="http://msdn2.microsoft.com/en-us/library/aa480152.aspx#appcomp_topic4"&gt;UAC in the Cookbook&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;Service Isolation&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;On Vista and Windows Server 2008, only services run in session 0.&amp;nbsp; Desktop applications run in sessions 1+n.&amp;nbsp; This blocks Windows messages between services and desktop apps.&amp;nbsp; This also blocks services from displaying UI on the desktop.&lt;/p&gt; &lt;p&gt;Next steps if you have and issue:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/aa480152.aspx#appcomp_topic12"&gt;Session 0 Isolation&lt;/a&gt; in the cookbook&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;Internet Explorer Protected Mode&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;IE in protected mode is sometimes called "Low Rights IE".&amp;nbsp; When protected mode is on, IE runs at a low integrity level.&amp;nbsp; This isolates IE from the rest of the processes and resources on the system.&amp;nbsp; ActiveX controls and browser objects may not have appropriate rights running in protected mode.&lt;/p&gt; &lt;p&gt;Next steps if you have an issue:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/aa480152.aspx#appcomp_topic8"&gt;IE protected mode&lt;/a&gt; in the cookbook&lt;/li&gt; &lt;li&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/bb250462.aspx"&gt;Understanding and Working in Protected Mode Internet Explorer&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;That's it for now.&amp;nbsp; One final note, the area for all things regarding Application Compatibility can be found on &lt;a href="http://technet.microsoft.com/en-us/windowsvista/aa905066.aspx"&gt;Technet&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;Pat&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7930421" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/patricka/archive/tags/UAC/default.aspx">UAC</category><category domain="http://blogs.msdn.com/patricka/archive/tags/Service+Isolation/default.aspx">Service Isolation</category><category domain="http://blogs.msdn.com/patricka/archive/tags/Installation/default.aspx">Installation</category><category domain="http://blogs.msdn.com/patricka/archive/tags/IE/default.aspx">IE</category><category domain="http://blogs.msdn.com/patricka/archive/tags/Vista/default.aspx">Vista</category></item><item><title>Welcome to my blog</title><link>http://blogs.msdn.com/patricka/archive/2008/02/27/welcome-to-my-blog.aspx</link><pubDate>Wed, 27 Feb 2008 22:12:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7921546</guid><dc:creator>patricka</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/patricka/comments/7921546.aspx</comments><wfw:commentRss>http://blogs.msdn.com/patricka/commentrss.aspx?PostID=7921546</wfw:commentRss><description>&lt;p&gt;I'm Pat Altimore an Application Developer Consultant who spends most of my time working in the Application Compatibility Labs at Microsoft.  I'm planning on posting stuff of interest that we find in the lab.  I hope the posts here will be helpful to developers that are getting their apps ready for Vista or Windows Server 2008 (and beyond).
&lt;/p&gt;&lt;p&gt;There are a lot of great blogs by other AppCompat consultants out there.  Please check out: &lt;a href="http://blogs.msdn.com/maartenb"&gt;MaartenB&lt;/a&gt;, &lt;a href="http://blogs.msdn.com/cjacks"&gt;CJacks&lt;/a&gt;, and &lt;a href="http://blogs.msdn.com/Aaron_Margosis/"&gt;Aaron_Margosis&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7921546" width="1" height="1"&gt;</description></item></channel></rss>