.netinstallationregistrywise

How to consistently detect 4.5.1 is installed from registry


My .net app is built using 4.5.1. Currently I am working on the installer project, and using symantec wise script for it. I added a per-requisite to continue installation only if .net 4.5.1 is installed.

The registry keys to detect this is explained in http://msdn.microsoft.com/en-us/library/hh925568%28v=vs.110%29.aspx.

As per above I either detect 378758 or 378675 for release key in the registry path.

However, Microsoft released another in place update 4.5.2 (key:379893) which replaces the earlier registry key. So my check does not allow the app to be installed in system with 4.5.2. However since it's an in place update for 4.5.1, logically it should. I can add additional release version of 379893. That would satisfy the per-requisite.

However if Microsoft releases another in-place update, as say 4.5.3, my check will fail again.

Since it is an installer project, I can not change the per-requisite logic, once it goes out the release door.

So, I come to my question, Is there a robust way to detect the .net 4.5.1 and all it's later in place updates, and can that be done through registry only?

I'm attaching the screenshot of the registry how it looks when updated to 4.5.2. enter image description here


Solution

  • I figured out that existence of registry path till Full as shown in screenshot should ensure that all in place updates of 4.0 are included. Checking if release > 378675 will ensure that all updates greater than 4.5.1 are included.

    Took cue from another similar stackoverflow solved problem related to wix installer. Detect .NET Framework 4.5.1 using WiX

    This solution seems to be working.