<p>A similar question was asked <a href="https://stackoverflow.com/questions/198931/how-do-i-tell-if-net-35-sp1-is-installed">here</a>, but it was specific to .NET 3.5. Specifically, I'm looking for the following:</p>

<ol>
<li>What is the correct way to determine which .NET Framework versions and service packs are installed?</li>
<li>Is there a list of registry keys that can be used?</li>
<li>Are there any dependencies between Framework versions?</li>
</ol>

Enumerate the subkeys of
```
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP
```
. Each subkey is a
.NET
version. It should have
```
Install=1
```
value if it's present on the machine, an SP value that shows the service pack and an
```
MSI=1
```
value if it was installed using an MSI. (.NET 2.0 on Windows Vista doesn't have the last one for example, as it is part of the OS.)