安装项目:添加 .NET 和 Windows Installer 先决条件会导致安装程序过大
我已经成功创建了我的程序。现在,我想发布它。我创建了一个安装项目来制作安装文件。我已添加 .NET 4.0 客户端和 Windows Installer 作为项目先决条件(通过设置项目属性 → 先决条件)。之后,我构建我的项目。
这会产生这些文件:
安装文件、.NET 4.0 客户端、Windows 安装程序
但是.NET 4.0 客户端和 Windows Installer 使我的项目最大。所以我想知道是否有办法让我的安装文件只包含所需的库,即安装程序不会在目标主机上安装.NET?
I've created my program successfully. Now, I want to publish it. I've created a Setup Project in order to make an installation file. I've added .NET 4.0 Client and Windows Installer as project prerequisites (via Setup Project Properties → Prerequisites). After that, I build my project.
This produces these files:
Setup files, .NET 4.0 Client, Windows Installer
But .NET 4.0 Client and Windows Installer make my project most biggest. So I would like to know if there is a way to make my setup file contain just the required libraries, i.e. the setup program won't install .NET on the target host?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不,我不这么认为——如果没有 .net 框架,你就完蛋了。
No I don't think so - without the .net framework your are screwed here.
当您执行此操作时,.NET 框架不会包含在 MSI 包中,并且不会使文件变得更大。这只是成功安装的先决条件。因此,当您在客户端计算机上运行安装程序时,如果它已经安装了框架,它将不会执行任何操作。如果没有,它将要求客户端下载。您当然可以删除此先决条件,但因为您的应用程序是使用 .NET 构建的,如果客户端计算机没有安装正确的版本,您的应用程序将无法运行。因此,我建议您将这个先决条件保留在您的安装项目中。
When you do this the .NET framework is not included in the MSI package and doesn't make the file any bigger. It is only a pre-requisite for the successful installation. So when you run the setup on the client computer if it already has the framework installed it won't do anything. If it doesn't it will ask the client to download it. You could of course remove this prerequisite but because your application is built with .NET if the client computer doesn't have the correct version installed your application won't run. So I would suggest you to leave this prerequisite in your setup project.