Annie Wang (PM on our setup team) has written a detailed white paper that just got posted on MSDN.  This paper outlines how to detect which version of the .NET FX you have on your machine both through the registry and browser caps (depending on your application type)...