Welcome to MSDN Blogs Sign in | Join | Help

Developing Compatible Applications for Windows 7 webcast

I know I could talk all day about application compatibility topics and not cover everything that can be discussed.  Here’s a one hour webcast  I did that focuses on the top issues and most confusing topics for Application Compatibility.  I do some of my favorite demos showing UAC architecture, data redirection, services isolation, and mandatory integrity control.  The target audience is for developers and testers.

Here’s the webcast: Developing Compatible Applications for Windows 7

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.  I also wanted to “plug” the Application Compatibility Cookbooks.  These documents are some of the best resources for understanding what breaking changes have occurred and how to mitigate them.

Make sure to reference both cookbooks. Most of the breaking changes are in the original XP to Vista cookbook.

Moving from XP-> Vista/2008 –> Win7: “Application Compatibility Cookbook

Moving from Vista -> Win 7: “Windows 7 Application Quality Cookbook

Posted by patricka | 0 Comments

OEM Ready Test Case 1 Incorrectly Fails with a UTF-8 manifest

I haven't posted in a while.  I've been helping out with a couple other programs we have going on in the labs these days.  OEM Ready is a subset of Certified for Windows Vista targeted at applications that ship on new PC's.

If you are using the automation in the OEM Ready Certification Test Tool, you can get a false failure if your application has a UTF-8 embedded manifest that has the byte order mark (BOM) included.  Visual Studio 2008 includes the BOM if you use it to embed the manifest. 

The error in the log looks something like this:

2008-09-06T01:56:32.4030000Z Information INFO: Embedded manifest exists: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"> <security> <requestedPrivileges> <requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel> </requestedPrivileges> </security> </trustInfo> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.VC90.DebugCRT" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity> </dependentAssembly> </dependency> </assembly>
2008-09-06T01:56:32.4040000Z Warning 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)
2008-09-06T01:56:32.4040000Z Warning 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.
2008-09-06T01:56:32.4050000Z Error ASSERT: The test failed because one or more of the executable did not comply with the UAC guidelines
2008-09-06T01:56:32.4100000Z Information INFO: Test result: Failed

Sigcheck is used by the test tool to dump the manifest.  Sigcheck outputs the BOM as garbage characters ().  This throws off the test tool and it gives an incorrect result.  This is a known bug with the tools and will be fixed.  For now, if you run into this problem, you can submit this test case as a pass.

Pat

Posted by patricka | 1 Comments

Registering ATL Performance Counters on Vista and Server 2008

If you use the ATL Server performance counter libraries, you may run into a problem on Vista and WS08.  The ATL libraries don't play well with the updates to Windows Resource Protection.  WRP enforces restrictions on the registry to prevent corruption of performance counters.  ATL breaks these rules and tries to update the registry directly.

There is a workaround to the issue that is outlined in Q933241.

To avoid this problem, the recommended way to add counters is through the lodctr tool or the API LoadPerfCounterTextStrings.  See Adding Performance Counters.

If you are really ambitious, ATL Server code has been released as shared source.   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:  http://blogs.msdn.com/vcblog/archive/2007/01/19/atl-server-visual-c-shared-source-software.aspx

Pat

Posted by patricka | 0 Comments

Windows Server 2008 Application Compatibility presentation

In the compatibility labs, we always give an big overview presentation about Windows application compatibility.  There's a lot of overlap between Vista and WS08 AppCompat but we call out some specific areas that mostly affect WS08.  We've recorded the WS08 specific section of the presentation and posted it to Channel 9.  I hope you find this useful in preparing your applications for WS08.

Posted by patricka | 0 Comments
Filed under:

Detecting what Server Roles are installed on Windows Server 2008

I think there is always a nugget of information that inspires a blog.  This is the idea that inspired my blog.

By default, Windows Server 2008 has no server roles installed.  This isn't intended to make you do more work (it's a feature).  The goal is to be secure by default.  After the OS installed, you add the roles and features that that are needed.

So, from an application compatibility point of view, your application may require a role that isn't installed by default.  There are two ways to programmatically query what roles and features are installed.

Using ServerManagerCmd

There's a cool command line utility that has been added to Window Server 2008 called ServerManagerCmd.  ServerManagerCmd allows you to add, remove, and query roles and features. 

If you execute the following command:

> servermanagercmd.exe -query roles.xml

An XML file of all the roles and features installed will be created.  You could then parse that file to determine what roles and features are installed.  I was hoping to find something in the scripting repository to do this but couldn't find anything.  Powershell would be a good option but remember... no features are installed by default.  Powershell and .NET 3.0 would need to be installed.  You could do that with servermanagercmd as well.

For example:

> servermanagercmd.exe -install Powershell

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?  WMI is probably a better choice.

Using WMI

With Windows Server 2008, there is a new class in the WMI namespace \Root\cimv2 called Win32_ServerFeature.  This will allow you to use WMI to iterate through what roles and features are installed.  WMI is a very good option for determining in your installer if a prerequisite role is installed.

Posted by patricka | 2 Comments
Filed under:

Where do I start?

When you work on a given subject for a while, you tend to jump right in and forget to start at the beginning.   In the Application Compatibility lab, we kick off the week with an overview presentation and cover the basics of common compatibility issues.  Those topics are probably a good place to start with this blog.

The first thing to mention is the Application Compatibility CookbookThis is the primer of Application Compatibility.  I was going to call it the K&R of of Application Compatibility but I don't want to date myself ;-).  I highly recommend reading the cookbook or at least keep it handy for a reference.

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.  Can you just tell me the top issues with Application Compatibility?"  So, let's start with a list of the top areas of issues:

User Account Control (UAC):

UAC is intended to run applications as standard user by default.  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.  Applications may not be designed to run as a standard user and may not have rights or privileges to certain resources.

Next steps if you have an issue:

Installation

Installation issues usually revolve around UAC.  Almost all installers need to run with admin rights because they usually write to Program Files or HKLM in the registry.  MSI issues usually revolve around custom actions being run in the wrong context (user or admin).

Next steps if you have an issue:

Service Isolation

On Vista and Windows Server 2008, only services run in session 0.  Desktop applications run in sessions 1+n.  This blocks Windows messages between services and desktop apps.  This also blocks services from displaying UI on the desktop.

Next steps if you have and issue:

Internet Explorer Protected Mode

IE in protected mode is sometimes called "Low Rights IE".  When protected mode is on, IE runs at a low integrity level.  This isolates IE from the rest of the processes and resources on the system.  ActiveX controls and browser objects may not have appropriate rights running in protected mode.

Next steps if you have an issue:

That's it for now.  One final note, the area for all things regarding Application Compatibility can be found on Technet.

Pat

Welcome to my blog

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).

There are a lot of great blogs by other AppCompat consultants out there. Please check out: MaartenB, CJacks, and Aaron_Margosis.

Posted by patricka | 0 Comments
 
Page view tracker