After installing Service Pack 2 ‘SV1’ is added to Internet Explorers HTTP User Agent, so should you want to display certain content only to SP2 users they can be filtered out as long as they use IE.
Here’s some sample PHP I have created to do this, which first looks for Windows XP, then Internet Explorer, then SV1. Transferring this to other languages should be pretty simple.
<?php
if (strstr($_SERVER["HTTP_USER_AGENT"], "Windows NT 5.1"))
{
if(strstr($_SERVER["HTTP_USER_AGENT"],"MSIE")) {
if(strstr($_SERVER["HTTP_USER_AGENT"],"SV1"))
{
echo "Your system may have Windows XP Service Pack 2 installed";
}
else
{
echo "Your system was identified as a Windows XP system using Microsoft Internet Explorer that does not currently have Service Pack 2 installed. Service Pack 2 is an important update which can greatly increase the security of your system, please see http://www.microsoft.com/windowsxp/sp2 for more details.";
}
}
else
{echo "Sorry we cannot accurately tell which Service Pack is currently installed due to the limited information disclosed by your browser. This is the expected result if you are not using Microsoft Internet Explorer to view this page.";
}
}
else
{echo "This page is designed for use only with Microsoft Windows XP and Microsoft Internet Explorer";
}
?>
Although not an entirly fool proof solution, its good to have an idea without installing components on the visiting machine.
http://mvps.org/marksxp/WindowsXP/sp2detect.php