Aaron Stebner's WebLog

Thoughts about setup and deployment issues, WiX, XNA, the .NET Framework and Visual Studio

Updated sample code that detects .NET Framework 2.0

Updated sample code that detects .NET Framework 2.0

  • Comments 6

A while back I posted some sample code in C++ that can be used to detect whether or not the .NET Framework 1.0 or 1.1 is installed, and if so, what service pack is installed.  I've been meaning to update the code to detect 2.0.  Now that the final version number for the .NET Framework 2.0 has been locked to v2.0.50727, I don't have any excuse to put this work off any longer.  Plus I got an email from a customer asking about this detection, and that finally provided the motivation I needed to do this.  :-)  You can find updated detection code for the .NET Framework that includes 2.0 at this location.  Hope this helps!

 

  • Hi Aaron, just tried the sample.

    As is, it won't work correctly if you're running as a normal user instead of an Administrator.

    The RegistryGetValue() function asks for (unneeded) KEY_WRITE access; removing this (leaving just KEY_READ) makes everything OK.

    Regards, John Bates.
  • So the August CTP contains the final version of .NET 2.0 Framework?
  • John - thank you for finding that issue. I will update the sample code accordingly.

    Sven - no, the August CTP does not have the final version of the .NET Framework 2.0, but the major/minor version number is locked starting then. That means that the final version will be 2.0.50727.XX, and only the XX will change. But the version folder and registry key for the .NET Framework 2.0 does not use the XX part of the version, so the detection code will continue to work on the final release of .NET 2.0.
  • I've received a few questions recently about how to programmatically detect whether or not the .NET Framework

  • PingBack from http://www.keyongtech.com/482664-how-do-i-tell-if

  • I previously posted some sample code to detect the version(s) and service pack levels of the .NET Framework

Page 1 of 1 (6 items)
Leave a Comment
  • Please add 2 and 2 and type the answer here:
  • Post