Jump to content
Xtreme .Net Talk

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


Recommended Posts

Posted

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,

Posted (edited)

I could be wrong, but surely if the .Net framework is not installed on the PC, your application won't get as far as the form load method. Surely you cannot use a .Net language to test for the presence of .Net.

 

Edit:- Take a look at the following...

http://www.codersource.net/csharp_installer_projects.html

Edited by Cags
Anybody looking for a graduate programmer (Midlands, England)?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...