.NET Bootstrap Installation with an single MSI possible?

半世苍凉 提交于 2020-01-07 06:56:11

问题


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.



来源:https://stackoverflow.com/questions/26927736/net-bootstrap-installation-with-an-single-msi-possible

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!