.NET Bootstrap Installation with an single MSI pos

2019-09-06 02:55发布

问题:

I've written an Installer for installing my .NET application. Now I'd like to pre install .NET Framework if necessary. That is not the big deal. The big deal is, there have to be a single MSI without an EXE as a bootstrapper. Is this possible?

回答1:

Windows Installer has a couple of mutexs at play here that prevent this. The first enforces one execute sequence per machine and the second enforces one UI sequence per process.

It is technically possible to have a custom action in the UI sequence spawn a new process and install .NET in that context. However, this is not a best practice and you'll lose the ability to install your MSI silently. The best you would be able to do is a /QR (Reduced UI) installation.

I feel your pain. What I've been doing lately (wherever possible) is target my .NET application for .NET 2.0 and provide an app.config that says CLR 4.0 is supported and to use legacy activation. This gives me an app targeted for the least common denominator and beyond. I then put an launch condition in my MSI that checks for .NET 2.0 or greater.

Basically, I feel that Windows XP / Server 2003 is a dinosaur and if a customer still wants to run it they can install .NET themselves. Windows Vista and beyond has .NET 3.0 or greater.



标签: .net wix