When the .NET Framework is being installed on a computer the .NET installer writes registry keys when installation is successful. You can test whether the .NET Framework 4.5 or later is installed by checking the registry key
HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full for a
DWORD value named Release. The existence of this key indicates that the .NET Framework 4.5 or later has been installed on that computer.
Below is a chart that shows the versions number corresponding
DWORD value in the Release key. See below this chart for an example on how to use this in action. I will do my best to try and keep this page up-to-date with the latest values but you can visit this page for an updated list if the version you need isn't listed here.
Take special notice how there are two rows for
4.6. These versions require you to check for both values as the operating systems vary.
|Version||Operating System||Value of Release|
|4.7||Windows 10 Creator's Update||460798|
|4.7||All except Windows 10 Creator's Update||460805|
|4.6.2||Windows 10 Anniversary Update||394802|
|4.6.2||All except Windows 10 Anniversary Update||394806|
|4.6.1||Windows 10 November Update||394254|
|4.6.1||All except Windows 10 November Update||394271|
|4.6||All except Windows 10||393297|
|4.5.1||Windows 8.1 or Windows Server 2012 R2||378675|
|4.5.1||Windows 8 and Wiindows 7||378758|
I haven't fully tested these functions completely so if you run into problems with one of them let me know and I'll do my best to help. You can see this function working in action with SharpDevelop Portable.
Like I said above I will do my best to try and keep these up-to-date but if you need a version that these functions aren't checking for, let me know so I can revise them and update this page.