Check .NET Version updated for 4.6

After a long hiatus, I reinstalled Visual Studio since the 2015 Community edition is finally both free and reasonably feature-complete. I’ll go through my various Microsoft-related pages to see if anything needs updating, and today I start with my popular .NET version checker utility.

Check .NET Version with Inno Setup now supports all .NET Framework versions released since 4.5 – namely 4.5.1, 4.5.2, and 4.6. All of these versions keep installing as in-place updates for 4.0, just with different release codes. Fortunately the official MSDN page How to: Determine Which .NET Framework Versions Are Installed already includes the codes associated with each version through 4.6.

Version Specifics

Versions 4.5.1 and 4.6 introduce an additional complication: each has two possible release codes, depending on the installed Windows version! I simplified the script by treating all queries for versions 4.5 or newer as minimum requirements, i.e. they will succeed if the discovered code is equal to or greater than the specified version’s minimum value on any system.

Note that queries for .NET 4.0 are also fulfilled by .NET 4.5 or newer, due to the latter installing as in-place updates. Queries for older versions require exact matches, i.e. they are not fulfilled by .NET 4.0 or newer even if the application would be compatible. I’ve added these clarifications to the project page.

Finally, I now allow supplying 'v1.1' and 'v2.0' for the corresponding .NET versions. Previously the caller had to append the exact release codes as they were embedded in the registry key names for these versions. Now the script appends these codes automatically if they are not supplied. Old-style calling with the complete key names should continue to work, though.

2018-05-05: Supported .NET 4.6.1 through 4.7.2, all once again with two different version codes.

2 thoughts on “Check .NET Version updated for 4.6”

  1. This is great thank you for updating!. I’m hoping to use this and modify it to check for Silverlight and SQL Express versions and instance name. Deploying a Lightswitch app and have no way of knowing what the target machines have installed.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.