Version check is wrong. It happens to work correctly only because no minor versions of Windows 5 were released after 5.1 (AFAIK... are Windows Server 2003 and Embedded XP and Media Center XP still 5.1?). A theoretical version 5.2 would fail the check. I submit the following fix:
if(System.Environment.OSVersion.Version.Major > 5 ||
(System.Environment.OSVersion.Version.Major >= 5 && System.Environment.OSVersion.Version.Minor >= 1))