Yochay Kiriaty has put together a series of posts to help you move your Windows XP application to Windows 7 on the Windows Team for Developers blog. The series began with Is Your Application Ready for Windows 7 RTM? and continues with User Account Control Data Redirection. Other posting are promised. But these two provide the keys to most issues.
With general availability of Windows 7 coming on October 22, now is the time to move those Windows XP applications to Windows 7. Almost all applications that run under Windows Vista will work well with Windows 7.
But what should you look for in those applications that just run on Windows XP or earlier?
The Windows Vista Application Compatibility Cookbook is still very relevant for Windows 7, as 99% of its topics apply to Windows 7. Kiriaty explains seven areas represent about a large number of the reported application compatibility problems and provides links to more in depth solutions.
- Version Checking – Application Compatibility: Operating System Versioning
- Data Redirection – Common file and registry virtualization issues in Windows Vista
- IE Protected Mode – Protected Mode in Vista IE7 (and yes this is still applicable for IE8.)
- Session 0 Isolation – Modifying the Mandatory Integrity Level for a Securable Object in Windows Vista
- Installer Detection – The Windows Vista and Windows Server® 2008 Developer Story
- User Interface Privilege Isolation – User Account Control Data Redirection
- High DPI – Ensuring your application displays properly on High-DPI Displays
For more information, see Is Your Application Ready for Windows 7 RTM?
User Account Control Data Redirection
Many XP applications are still designed to write files to the Program Files, Windows directories, or system root (typically the C drive) folders. Some applications update registry values, often in HKLM/Software. But the files or registry values are not created or updated.
Prior to Windows Vista, administrators typically ran applications. As a result, applications could freely read and write system files and registry keys. If standard users ran these applications, they would fail due to insufficient access.
Kiriaty’s posting, User Account Control Data Redirection, describes the symptoms that you’ll see in your applications when you run as a standard user in Windows Vista or Windows 7 and the remedies.
When updating existing code to run on Windows 7, you should:
- Ensure that during run-time, applications store data only in per-user locations or in computer locations within %alluserprofile% that have properly set access control list (ACL) settings. For more information about ACLs, see Access Control Lists.
- Determine the known folder to which you want to write the data files. Generic data used by all users should be written to a global public location that is shared by all users. All other data should be written to a per-user location.
- Ensure that you do not hard-code paths once you have determined the appropriate locations. Instead, use one of the following programming models and APIs to retrieve the correct paths of specific Windows known folders.
The posting goes on to explain the five tests you can use to test your application on Windows Vista or Windows 7. It also describes what you can do in your code.
For more information, see User Account Control Data Redirection. Also, you can download Data Redirection that includes a presentation describing UAC Virtualization, and two full hands on labs on this topic, one for managed code and one for native code.
ISVs in the United States can join Front Runner to declare your application is ready.
Sign up for the new Windows 7 and Windows Server 2008 R2 Front Runner program. Front Runner is an early adopter program for ISVs in the US that helps you get your applications compatible with the latest Microsoft technologies. Front Runner provides you with access to Microsoft experts who can answer your questions and to training courses on developing for Windows 7 and Windows Server 2008 R2. Once you tell us that your application is compatible, you’ll get a range of marketing benefits to help you let your customers know you’re a Front Runner, including customizable marketing and PR campaigns as well as listings in Microsoft directories that are viewed by millions of people.
For ISVs outside the United States, you can participate in ISV App Compat.
Adding Windows 7 Support
Once you have completed getting your application ready for Windows 7, you are ready to add support for Windows 7 features.
In this four-part of this series, we explored the business reasons to support Windows 7 and how you can be sure your application is compatible, three features you should incorporate right away, and how you can lead your marketplace by adopting Windows 7 features.
- Getting Ready for Windows 7 Part 1: Why Be Ready for Windows 7?
- Getting Ready for Windows 7 Part 2: Microsoft Programs to Help Get Apps Compatible
- Getting Ready for Windows 7 Part 3: Three Must Do Features For Your Users
- Getting Ready for Windows 7 Part 4: Gain Strategic Advantage Using Windows 7 Features
You can see the series of videos on MSDEV, A Developer's First Look at Windows 7.
Bruce D. Kyle
ISV Architect Evangelist | Microsoft Corporation