Zach Johnson
Zach Johnson

Reputation: 24222

.Net 2.0 Prerequisite Installer

What is the best way to ensure that a user who wants to install my application has .Net 2.0 installed on their computer? I don't really want to use a normal setup project created using Visual Studio, because my application is a portable application and does not use the registry or need an Add and Remove Programs entry. It needs to be as simple as possible for the users to use (because some might not be very computer literate).

Edit: I accepted MusiGenesis's answer because it is the simplest for both me and the users. I am going to add a link to the .Net 2.0 installer from the web site where they download my application.

In the future, I might combine all three answers and write a simple C++ prerequisite checking app that the users could run before they install my application.

Upvotes: 3

Views: 686

Answers (3)

Yakeen
Yakeen

Reputation: 2215

You have to do the checks in registry or in filesystem. In registry you can enumerate keys under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP, the keys are versions installed. Or you can explore folder names in c:\Windows\Microsoft.NET\Framework. But for more sophisticated detection I would use this code.

Upvotes: 1

MusiGenesis
MusiGenesis

Reputation: 75296

If you're distributing your application from a web site, include a link to the .Net 2.0 redistributable installer (it's "only" about 23 MB). If you're distributing it from a CD or something, include the redistributable on the disk.

You can also create an MSI that includes the .Net redistributable, but then your MSI would be 23+ MB, and most users already have .Net 2.0 installed, so it would be useless.

Upvotes: 4

Jaimal Chohan
Jaimal Chohan

Reputation: 8645

I don't see how. Being a .NET application, it would require .NET to run, thus you couldn't check for .NET prerequisites unless you coded a boot strap in C++. But then that would have to run as a separate application to boot up your .NET application.

Upvotes: 2

Related Questions