.Net 安装程序 - .exe 和 .msi 之间的差异

发布于 2024-10-07 05:25:28 字数 148 浏览 0 评论 0原文

我正在使用 Visual Studio 中的安装和部署项目创建的安装程序来部署我的应用程序。当我构建安装项目时,我得到一个 .exe 和一个 .msi 文件。

我想知道它们之间的区别。

我注意到如果没有 .msi,.exe 就无法工作,但反之则不然。

I am deploying my application using the installer that i create using the Setup and Deployment project in visual studio. When i build the setup project i get a .exe and a .msi file.

I would like to know the difference between them.

I noticed that the .exe cannot work without the .msi, but the reverse is not so.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

别把无礼当个性 2024-10-14 05:25:28

该exe文件是一个引导程序,它安装任何必需的先决条件,然后调用您的setup,即 msi 文件。

您可以自行启动安装,运行 msi 文件,但如果未安装所需的先决条件,安装将会失败(可能的示例:.Net Framework、VC++ 可再发行组件、较新版本的 MSI 等)。

当您尝试运行时,安装会失败缺少引导程序(exe 文件)和您的 msi 的设置,因为基本上它将安装所有先决条件,然后它将尝试启动您的安装程序(msi 文件)。如果该文件不存在,则没有启动内容。

根据您的应用程序需求,类似的技术是使用 合并模块以满足您的应用程序先决条件。合并模块基本上会将所有必需的组件加载到主安装程序中,因此您最终只会得到一个包含所有内容的 MSI 文件。您必须确保您使用的每个组件都有可用的合并模块,如果没有,您将不得不使用引导程序。

The exe file is a bootstrapper that installs any required prerequisites and then calls your setup, which is the msi file.

You can start the setup by itself, running the msi file, but it will fail if the required prerequisites are not installed (possible examples: .Net framework, VC++ redistributable, newer version of MSI, etc.)

It fails when you try to run the setup with the bootstrapper (exe file) and your msi is missing, because basically it will install all the prerequisites and then it will try to start your installer ( the msi file). If the file is not there, it doesn't have what to start.

Depending on your application needs, a similar technique would be to use Merge Modules for your application prerequisites. A merge module would basically load all the required components into your main installer so you'll end up just with one MSI file that has everything inside. You have to be sure that every component that you use has a merge module available, if it doesn't you'll have to use a bootstrapper.

扬花落满肩 2024-10-14 05:25:28

阿德里安是对的。这可能会添加更多信息。

http://www.ghacks.net/2009/03/ 23/msi-或-exe-setup/

Adrian is correct. This might add some more info.

http://www.ghacks.net/2009/03/23/msi-or-exe-setup/

醉态萌生 2024-10-14 05:25:28

我相信 MSI 文件只是安装脚本,与 Windows Installer 相关联。可执行文件包装 MSI,创建一个加载程序,该加载程序执行几乎相同的操作,但可以安装先决条件。

I believe MSI files are just scripts for installation, with the association being the Windows Installer. Executable files wrap the MSI, creating a loader which does pretty much the same thing but can install prerequisites.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文