views:

432

answers:

5

I would like to avoid redistributing .NET runtime if possible with my application since it will increase the size of the application, download time, development time & will possibly introduce many different deployment errors. Does Microsoft force users to update .NET runtime via Windows update? If not, what are some of the options to redistributing .NET runtime? Has Microsoft made it any easier to re-dstribute runtime with .NET appliactions? Also, is .NET runtime gauranteed to be backward compatible?

I am just summarizing the answers here. Looks like we have to have a bootstrapper to at the least check for the existence of the .NET run time. The alternative option is to package the runtime and deploy it if it does not exist. There are multiple options for packaging & Visual stduio does provide an option to build installer project with the runtime. There are also other packaging options like InnoSetup, WIX etc (not sure which option is better and free). Runtime installation requires a reboot and the chosen installation option should resume application installation post reboot.

+1  A: 

When you create your installer package, it will only install the runtime if it is required. i.e. not already on the system (or wrong version)

Edit: Yes you should create this package, it makes your life a lot easier for this exact thing. The way that you would do this in VS is File->Project and select intstaller project. The wizard will guide you through the options.

Tim Jarvis
msvcyc
+3  A: 
Chap
+1  A: 

Also, you should worry about that. Without the runtime your application will mysteriously not work. You should never assume that some particular version of the runtime is pre-installed.

As noted above, the installer project wizard in VS will create a setup file that only downloads it if needed. NSIS and Inno Setup have scripts that will do the same thing. Note that you will need to handle reboot-and-continue-setup when you install the runtime. I believe the installer wizard handles this for you.

Christopher
+1 for providing additional options like NCIS and Inno setup
msvcyc
A: 

It depends. Where I work, we include it in the installer as a prerequisite because we have some customers who may not have an internet connection to download the runtime.

A few things you can do:

  1. Include a test for the version of .NET on the target machine and exit out of the install if it not there.
  2. Make a version of the install that includes the .NET runtime and will install it if needed.
  3. Make a version of the install that will download the .NET runtime and install it if needed.

If I knew my customers were all online, I'd do option 3 for .NET as well as any other prerequisites like Crystal Reports or SQL Express. I have installs where I have that included and the install is over 100MB. 70MB+ is prerequisites.

Jeff Cuscutis
+1  A: 

Using a bootstrapper of some sort, you can check if .NET is installed and then download it if necessary.

For example, with the MSI Factory bootstrapper (I'm not advocating MSI Factory, it's an ugly program. But the bootstrapper it comes with is alone well worth the license cost if you're developing commercial software like we do) there's scripts you can simply include to perform this function. We're using WiX + the MSI Factory bootstrapper to distribute both a single compressed EXE (30Mb), and a small 1Mb "downloader" EXE that downloads an MSI. Both EXE's check for the presence of .NET 2.0 and then download it if necessary. We also distribute a standalone MSI which also checks for .NET and blocks installation if it's not present.

Basically you've got the following:

  • Windows XP - doesn't ship with .NET. Customer needs to install it manually (it appears as an optional Windows Update component)
  • Vista - ships with .NET 2.0 (but not 1.1)
  • Server 2003 - ships with .NET 1.1

Ignore .NET 1.1, just ignore it. Vista users and beyond will only have it installed for legacy application support, or if they're a developer.

.NET 2.0 is the most commonly installed version, from our user base we've found that less than 10% of users have .NET 3.5 installed. If your application is targeting a technical, geeky audience then I'd say that ~50% of people will have .NET 3.0. If you're targeting a consumer/retail/non-tech market, you can probably estimate around 30% with .NET 2.0 and 10% with .NET 3.0 or above.

The above figures are based on browser traffic to our websites, a mostly non-technical audience. This is probably the best way to get an idea for your market. IE always reports the .NET version in the User-agent string so break out the weblogs and start analyzing :)

sascha
+1 for giving some idea on the runtime availability statistics
msvcyc