Aaron Stebner's WebLog

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

Sample code to detect .NET Framework 1.0 and 1.1 and service packs

Sample code to detect .NET Framework 1.0 and 1.1 and service packs

  • Comments 18

Hey all,

In response to some suggestions from folks who read my blog posts describing how to detect the presence of .NET Framework 1.0 service packs and .NET Framework 1.1 service packs, I wrote up a quick sample application that shows how to implement the detection methods I recommended.  You can download the sample code here.

In this sample, I detect the presence of the .NET Framework core packages for 1.0 and 1.1, and then if I find that they are installed, I detect the service pack level also.  The sample simply pops up a message box for each version, but could be easily updated to perform some conditional action (as part of a 3rd party setup or something like that).

The code is provided as an example only....I hope it will help better explain how to implement a detection strategy for the .NET Framework and its service packs that will continue to work when future service packs are released.  Let me know if you have any problems or questions.....

<update date="6/4/2010"> Fixed broken link to the sample code. </update>

 

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

  • I attempted to access the code at

    astebner.sts.winisp.net/.../detectFX.cpp.txt

    but it always times out.

    Could you please repost and/or email me at copy at

    j (at) MoonTwist (dot) com

    Thanks,

    Casey

  • Hi BCaseyHanks - That file server no longer exists, but I hadn't have a chance to update this link yet.  You can find an updated download location for this sample code at blogs.msdn.com/.../9763379.aspx now.

Page 2 of 2 (18 items) 12
Leave a Comment
  • Please add 3 and 8 and type the answer here:
  • Post