Monday, August 25, 2008
Making 64-bit Vista SP1 Say It's Vista SP1
Making a 64-bit copy of Windows Vista Service Pack 1 confirm that it is actually Vista SP1 might require a minimum amount of effort on behalf of the end user, such as right-clicking My Computer and selecting Properties, but things are a tad different when an application is programmed to identify the operating system versions or the service pack releases. According to Scott McArthur, Support Escalation engineer with the Setup & Cluster team, Microsoft Corporation Enterprise Support, application compatibility problems can emerge when a program will look for the service pack version in the wrong location in the registry. The example given involved an application designed especially for Vista SP1 failing to install on an x64 copy of Vista SP1.
"The application was checking for the OS version in a registry value, specifically: HKLM – SOFTWARE – Wow6432Node – Microsoft - Windows NT – CurrentVersion - CSDVersion. On the x64 version of Windows Vista Service Pack 1, however this value does not exist. The correct value does show up under HKEY_LOCAL_MACHINE – SOFTWARE – Microsoft - Windows NT – CurrentVersion - CSDVersion however. This highlights an inherent problem with relying on the registry method to capture this information. As operating systems evolve, there is no guarantee that registry information will persist between operating systems, or in some cases there may be changes between service packs for the same operating system," McArthur explained.
In this context, there are additional methods that can be used in order to avoid such a problem. WMI queries or application programming interfaces are excellent alternatives to make an application installer dig through the registry only to find nothing, even if the right operating system and service pack are in place. McArthur advised developers to turn to the GetVersionEx function in order to test the platform version. At the same time, there are additional functions designed especially for service packs.
McArthur enumerated, "szCSDVersion: A null-terminated string, such as "Service Pack 3", that indicates the latest Service Pack installed on the system. If no Service Pack has been installed, the string is empty. wServicePackMajor: The major version number of the latest Service Pack installed on the system. For example, for Service Pack 3, the major version number is 3. If no Service Pack has been installed, the value is zero. wServicePackMinor: The minor version number of the latest Service Pack installed on the system. For example, for Service Pack 3, the minor version number is 0."