tags:

views:

143

answers:

3

Suppose I have an MSI, that has .NET Framework as a pre-requisite.
I know the MSI generated from VS2008 setup project will detect when that pre-req is missing and will direct the user to install it.

Q1. Is it possible, technically, to call out to dotnetredist.exe (or, I guess, any arbitrary EXE) during the run of an MSI, to handle this pre-req, and then continue installing? I mean, I think it is not, if I confine myself to a VS2008-generated setup, but what if I used WIX? What if I was willing to write a custom action? What if I could manually edit the MSI table with Orca or via script? Is it possible?

Q2. Is it legal? Is it allowed by the license?

A: 

Installing .Net may require a reboot. I don't know how you are going to handle it. Abort the install? Suppress the reboot? Terminate the install? I don't think MSI transaction works across reboots.

You must have a copy of either Visual Studio, or the freely available Windows SDK that include .Net SDK/ standalone .Net Frameword SDK and agree the license and terms in the EULA to publish dotnetredist.exe with your app.

Sheng Jiang 蒋晟
+4  A: 

The technical restriction is that one windows installer session cannot launch another one. For example, one MSI file cannot install another MSI file.

Launching executables or scripts from an MSI file is possible, as long as they don't start any windows installer sessions. This is called a custom action.

The .NET installer exe definitely cannot be launched from an MSI because it uses windows installer sessions. Instead, you must create a bootstrapper setup.exe which first installs .NET and then launches your MSI. The wix documentation has a topic which covers how to generate such a bootstrapper with msbuild. This is not really wix specific; you can use the bootstrapper generator task with any MSI file.

As for the legal aspect, I don't see a need to worry. It is called a redistributable after all.

Wim Coenen
A: 

Q1. ... or, I guess, any arbitrary EXE ...

Q2. Is it legal? Is it allowed by the license?

The legality of redistributing any arbitrary EXE is governed by the EXE's license. 'dotnetredist' is specifically licensed for redistribution, so no problem there.

MSI 4.5 will allow installer chaining, within limits.

DaveE