You should be able to check the User Agent to determine what versions are installed, e.g. this script checks for version of the framework - you could modify for version 4.0
http://msdn.microsoft.com/en-us/library/ms749404.aspx[
^]
My user agent in IE is
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E; InfoPath.2).
The agent you're interested in are
.NET4.0C .NET framework
Version : 4.0 Client Profile
.NET4.0E .NET framework
Version : 4.0 Extended
You'll get these in IE, but not definitely in all browsers....e.g
http://www.hanselman.com/blog/TheNETFrameworkAndTheBrowsersUserAgentString.aspx[
^]