Windows DevCenter    
 Published on Windows DevCenter (http://www.windowsdevcenter.com/)
 See this if you're having trouble printing code examples


Solving XP Application Compatibility Problems

by Mitch Tulloch, author of Windows Server Hacks
11/02/2004

It was 3 a.m. and the dungeon was dank and cold as I walked along the dark tunnel. I had already found several of the keys I needed, but a Giggler had stolen one of them and my health was low and I needed food before I could dare pursue him ...

Dungeon Master for the Amiga was the first computer game I ever played, and back in 1987 it was revolutionary with its 3-D view and role-playing story. I remember waiting with bated breath for the sequel, Chaos Strikes Back, and when it arrived on a Friday afternoon at the beginning of the Christmas holidays, it sealed my fate. My wife saw little of me, and it took me two weeks to finish the game.

Those were the days, and although I don't play computer games anymore, I still use many legacy applications on my company network and know other businesses that do the same. Fortunately, Windows XP has built-in technology called compatibility layers; they help support the legacy programs you just can't do without. This article takes a brief look at this feature and examines other approaches you can follow to keep those old but still critical applications running in an XP environment. In fact, this morning I just stumbled across Dungeon Master & Chaos Strikes Back Encyclopaedia, where you can download a PC version of Dungeon Master, and I'll have to see if I can get it working under XP--if my wife will agree to let me.

Application Compatibility Issues and Solutions

Related Reading

Windows Server Hacks
100 Industrial-Strength Tips & Tools
By Mitch Tulloch

Why do old applications written for Windows 95 and later often have trouble running on newer platforms like Windows XP? Often it's because these applications were hardcoded to believe they could only be installed on specific operating system versions such as Windows 95 or 98. Sometimes it's because FAT partitions are limited to 2GB, and when the legacy setup program polls an NTFS volume with 30GB of free space, an error is returned and the application can't install. Sometimes it's because of hardcoded direct calls to hardware that were supported under MS-DOS and 16-bit Windows but prohibited by the hardware abstraction layer (HAL) of Windows NT and later. And other times it's simply because of the hundreds of changes to the Windows API over the years, for despite the fact that the developers on the Windows team have bent over backwards trying to maintain down-level compatibility, sometimes an API or feature had to be sacrificed and deprecated in order for the platform to improve.

During beta testing of each version of Windows, many of these compatibility issues are identified, but so many third-party applications are available that it's no wonder many reports of broken apps arise after each new release of Windows. Windows XP has a database called Apphelp.sdb in the %SystemRoot%\AppPatch folder that contains a list of known application compatibility issues. When you try to install an older backup program or disk utility that is incompatible with XP, you'll get a dialog box warning you of a possible problem and saying "To run the program, click Continue. For more information, click Details" generated from the information in these databases.

In such a case, the best thing to do is to contact the vendor of the application to see if it has a newer version that complies with the Designed for Windows XP logo program. The best place to find such applications is the Windows Catalog on Microsoft's web site, but if you're upgrading an older version of Windows to XP and want to check whether your installed apps will be OK, you can also try running the Upgrade Advisor. Insert your XP Professional CD into your machine and select Check System Compatibility when the splash screen comes up or run winnte32 /checkupgradeonly from a command prompt if you're doing a network install. Note that Upgrade Advisor is not included on the XP Home CD, but you can download it from Microsoft's Windows XP Upgrade Advisor site.

If you must run a legacy application under Windows XP, however, you can take a series of escalating steps in an effort to make it work properly. First, you can right-click on the program executable or shortcut, select Properties, and select the Compatibility tab (see Figure 1). Select the "Run this program in compatibility mode for" check box and tweak the compatibility layers (the Windows version, the display settings, the advanced text services) until the program works properly. An alternative approach that does essentially the same thing is to use the Program Compatibility Wizard by selecting Start -> All Programs -> Accessories -> Program Compatibility Wizard.

Figure 1

Figure 1. The Compatibility tab offers a few techniques for getting a legacy program to work under Windows XP.

If you need to run your legacy app on multiple XP machines, you can use the Windows Application Compatibility Toolkit instead. This toolkit gives you more granular control over the more than 200 incompatibilities between XP and previous versions of Windows and lets you apply fixes for each of these incompatibilities, test the result, and create an updated .sdb database file that you can deploy together with your application. The Application Compatibility Toolkit can be found on your XP Professional CD as \Support\Tools\Act20.exe, but a newer version with an easier interface can be found on Microsoft's Windows Application Compatibility Toolkit 3.0 web site; you should use this version instead.

Finally, if you need to run multiple legacy applications each within their own unique temporary compatibility layer, you can use the SET __COMPAT_LAYER command in a batch file to do this. For more information about this approach, see article 286705 in the Microsoft Knowledge Base.

Postscript

Well, I got Dungeon Master for the PC running easily using a Windows 95 compatibility layer and 256-color resolution. Everything works fine except the sound, but that's OK--I don't want to alert my wife what I'm up to right now; shhh!

Figure 2

Figure 2. The quest begins--again.

Mitch Tulloch is the author of Windows 2000 Administration in a Nutshell, Windows Server 2003 in a Nutshell, and Windows Server Hacks.


Return to the Windows DevCenter.

Copyright © 2009 O'Reilly Media, Inc.