views:

339

answers:

1

We use Wix to build an installer for our .NET application and are just in the process of porting to Wix 3.0.

Our application includes several .NET assemblies (as is the way with .NET applications) and the final installer step is to ngen these. This is important as our application takes about twice as long to startup with non-ngen'ed assemblies.

Unfortunately the ngening step takes several minutes and we would like to give users some visual feedback that the installer is still working (at least one user thought the installer had crashed!). We don't want to just move the ngening into the background as that makes the initial user experience much worse - our application will be very slow to start.

What we would like to do is to ngen the assemblies individually and report to the user in the installer (via a message and the progress bar) as each one completes. Whilst getting Wix to do the ngening is easy, and moving it onto the background would be easy, we can't see a straightforward way to achieve what we want. Any good ideas or techniques?

(Our application is compatible with .NET 2.0 SP1, so we don't want to depend on anything in .NET 3+ to achieve this.)

+1  A: 

I was not aware that NGen provided a feedback mechanism such that progress could be reported file by file (or otherwise). Even if it did, the fact that the Windows Installer commits assemblies to the GAC during InstallFinalize means there is no opportunity for a CustomAction (like the WiX NGen CustomAction) to send progress. Essentially the progress bar is already "100%" (although progress bars in Windows Installer are anything but exact).

So, ultimately, I think the answer is this is a great feature request for the WiX NGen CustomActions but I'm not sure its possible to fulfill.

[Update]: Silly, me I suppose I should look at the code first. Progress messages are sent although the file name is not posted via ActionText. That seems like a reasonable thing to request. However, what I said above probably still applies for assemblies that are GAC'd.

Rob Mensching
So Wix doesn't use the progress messages that are being posted. Conceivably could we write our own custom action that does?We aren't GACing our assemblies.
fuzzyman
I don't know what you mean by "So WiX doesn't use the progress messages that are being posted." The WiX toolset adds cost for each file being NGen'd and sends progress for them when processing them. You can see it in the code.And yes, you could write your own code. Or just enhance the NGen custom action a little bit to get exactly what you want. It's 98% of the way there.
Rob Mensching
You said "Progress messages are sent although the file name is not posted via ActionText". I took this to mean that messages were being sent ("Progress messages are sent") but not being used.Enhancing the NGen custom action would be how we would do it (actually what I meant by write our own - building on what is there already of course).
fuzzyman