Windows MSI 可以安装多个软件包吗?
我在 MFC 中有一段代码正在调用 MsiInstallProduct(installerFullPath, commandLine);
是否可以同时安装 2 个 MSI 产品? 只要他们都是独立的。
是否可以调用 Windows 函数并将我的所有 MSI 组件提供给它,然后它会一一安装它们?
i have a code in MFC that is calling MsiInstallProduct(installerFullPath, commandLine);
is it possible to install 2 MSI products at the same time?
as long as they are both independent.
is it possible to call a windows function and give it ALL of my MSI components and it will install them one by one?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Windows Installer 不允许同时安装多个 MSI 软件包。您需要依次触发安装,等待第一个安装完成后再启动第二个安装。在一次调用中安装它们的唯一选择是创建另一个 MSI 包(一个主包),您可以在其中将两个包添加为链接包。
Windows Installer does not allow installing multiple MSI packages at same time.You need to trigger the installations one after another, waiting for the first one to finish before you launch the second one. The only option to install them in a single call is to create another MSI package, a main one, in which you add the two ones as chained packages.
在 Windows Installer 4.5 之前,Bogdan 的答案是正确的。但是,由于使用 Windows Installer 4.5 及更高版本,您可以执行多个-包安装。通过调用 MsiBeginTransaction 来执行此操作,这是一些 API 组合,例如作为 MsiInstallProduct、MsiApplyPatch a> 或 MsiConfigureProduct,最后 MsiEndTransaction。
从技术上讲,这些仍然没有完全同时安装(并且需要调用多个函数),但这使它们成为一个事务的一部分。如果所有参与的包都正确编写,它们将全部被安装、修补或配置(修改或删除),或者全部回滚到其起始状态。
Before Windows Installer 4.5, Bogdan's answer was correct. However since with Windows Installer 4.5 and later, you can perform a Multiple-Package Installation. Do this by callling MsiBeginTransaction, some combination of APIs such as MsiInstallProduct, MsiApplyPatch, or MsiConfigureProduct, and then finally MsiEndTransaction.
Technically these are still not exactly installed at the same time (and it will require calling multiple functions), but this makes them all part of one transaction. If all the participating packages are correctly authored, they will either all be installed, patched, or configured (modified or removed), or all rolled back to their starting state.
Michael 提到的多包安装正是链接包使用的支持,正如他也提到的,这需要目标计算机上至少有 Windows Installer 4.5。
要创建一个 MSI 包,在其中添加两个链接的包,您可以使用不同的安装创作工具(免费的和商业的),具体取决于您的可用时间。以下是工具列表:
http://en.wikipedia.org/wiki/List_of_installation_software
The multiple-package installation mentioned by Michael is exactly the support used by chained packages, and as he also mentioned this requires at least Windows Installer 4.5 on the target machines.
To create an MSI package in which you add the two ones as chained you can use different setup authoring tools, free and commercial, depending on the time you have available. Here is a list of tools:
http://en.wikipedia.org/wiki/List_of_installation_software