You need to read registry keys to detect versions in the granularity of the service pack. This article explains which key / value pairs to look for.
For example, you can specify 3.5from 3.5 SP1by looking at the values inside
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5
"plain" 3.5 has Install = 1, but SP1has SP >=1.
Follow the link to the bottom of the article to see the entire table.
source
share