3

我在 vs2010 中创建了一个 .MSI 安装程序项目。此 .MSI 包含许多 *.msm(合并模块文件)。有没有办法在安装过程中根据不同的windows平台(例如:xp、win7、vista..)选择特定的*.msm?

例如,如果安装此.MSI 的目标平台是winXP,我的.MSI 将知道选择哪个.msm,而不是在安装过程中选择所有.msm。

顺便说一句,.MSI 有没有办法访问驻留在 .msm 中的特定 *.dll ?同样,例如,如果 .MSI 项目包含一个 .msm 并且此 .msm 包含许多 *.dll,是否有办法在安装此 .MSI 时选择 .msm 中的特定 *.dll ?

我的主要目的是让我的 .MSI 在安装我的 .MSI 期间知道在不同的 Windows 平台下使用什么.dll/ .msm。

4

2 回答 2

0

您基本上需要将每个合并模块分配给一个新功能并设置该功能的安装条件。但是,我认为 VS 2010 不可能做到这一点,但有一些商业设置创作工具可以做到这一点。

于 2012-11-20T07:21:05.163 回答
0

Merge modules (.msm) are similar in structure to a simplified Windows Installer file (.msi). A merge module cannot be installed alone, it must be merged into a .msi file. The best alternative is to obtain a freely distributed merge tool or purchase one of the merging tools available from independent software vendors. You can then use the functionality provided by Mergemod.dll. The intended use of merge modules was to provide a standard method for developers to deliver shared Windows Installer components and setup logic to their applications. Merging is therefore something typically done by the author of the installation package prior to deployment. Trying to determine and perform the correct merge when the application is being installed does not seem like the best approach.

You could instead create a separate .msi for each target platform. Merge the appropriate .dll into each package. Then include logic in your setup application to check the user’s system and then install the correct package.

As was suggested by the previous answer, you could merge all the .dlls into a single installation package which you have authored such that the installation of certain features and components are conditional upon Operating System Property Values .

You can consider Using Transitive Components in your package. The typical use for transitive components is to prepare a product to reinstall during a system upgrade. The author of the installation package specifies those components that need to be swapped out during a system upgrade as having the transitive attribute. When the user later upgrades the system, the product must be reinstalled. Upon this reinstall, the installer removes the earlier components and installs the later components, without having to install the entire product. This might serve your scenario well if you expect your users to upgrade their systems.

于 2012-11-21T19:49:31.463 回答