Shaitan

Shaitan

  • NA
  • 2
  • 0

How to Check if the .NET Framework is installed [C#]

Nov 20 2005 6:02 PM

Before starting my application (on Form Load) I want to check and ensure that the .NET framework (1.1 or 2.0, both SHOULD work fine) are installed on the machine - if not I want to prompt the user to download and install it (simple messagebox with a INTERNET LINK to the Microsoft WebPage would be the best idea no?)
So, this actually entails two questions...

a) How do I DETERMINE IF .NET 1.1 or 2.0 are installed? (I don't trust or want to just look for the C:\Program Files\Microsoft.NET folder, seems errorprone no?)
Seeing as this is so very crusial there must be a nice way in C# to determine what version of .NET the user has running on his machine? I just have no clue how..

b) HOW do I paste an INTERNET LINK (hyperlink?) in a messagebox? So that if the user does NOT have the .NET framework (1.1 or 2.0) installed I can have them simply clikc on the link to go download it?
Along the same lines - what LINKS would you suggest/recommend for the .NET 1.1 and 2.0 Frameworks? I need a link that has a fairly simple and always consistent path so I can hardcode it in my messagebox.

Any help/hints would be greatly appreciated.
Thanks,


Answers (1)