简体   繁体   English

在WiX中安装多个MSi中的功能

[英]Install features in multiple MSi in WiX

I am working on developing Windows installer for an enterprise product, that has different variants as separate MSI products. 我正在为企业产品开发Windows安装程序,它有不同的变体作为单独的MSI产品。 We have to check that, we cannot install a product, if another variant is installed already. 如果已经安装了另一个变体,我们必须检查,我们无法安装产品。 I created different WIX scripts and used to build them as separate products (MSI). 我创建了不同的WIX脚本,用于将它们构建为单独的产品(MSI)。

Each variant has a base framework, and number of modules. 每个变体都有一个基本框架和多个模块。 I created each module as a feature, and included them along with base feature (base feature must be installed as of now) based on the variant built. 我创建了每个模块作为一个功能,并根据构建的变体将它们与基本功能(基本功能必须安装到目前)一起包含在内。

I received requirements that, we have to allow installing another variant on top of any installed variant. 我收到了要求,我们必须允许在任何已安装的变体上安装另一个变体。 For Example, I installed Product1 that has 2 modules along with base framework as three features (Base, Mod1, Mod2). 例如,我安装了具有2个模块的Product1和基础框架作为三个功能(Base,Mod1,Mod2)。 Product2 built with Base and Mod3. Product2使用Base和Mod3构建。 Now, When I install Product2 in a system where Product1 is installed, only the Mod3 should be installed. 现在,当我在安装了Product1的系统中安装Product2时,只应安装Mod3。

I am using WIX 3.5. 我正在使用WIX 3.5。

Any help would be appreciated. 任何帮助,将不胜感激。

Thanks in Advance. 提前致谢。

Without testing, I would say you can do this with ComponentSearch . 没有测试,我会说你可以用ComponentSearch做到这一点。 Define such search, search for a component of product 1 and write the result to a variable. 定义此类搜索,搜索产品1的组件并将结果写入变量。 You can then check if the variable is not empty to determine if product 1 is already installed. 然后,您可以检查变量是否为空,以确定是否已安装产品1。

 <Property Id="EXISTING_PRODUCT">
      <ComponentSearch Id="SearchMyProduct" Guid="{YOUR-OWN-GUID}" Type="file"/>
</Property>

Then you can use a Condition in the Feature. 然后,您可以在要素中使用Condition

<Feature Title="Product2">
    <Condition Level="0">EXISTING_PRODUCT <> ""</Condition>
</Feature>

You can also use a CustomAction to define the desired value based on search result to disable the Feature . 您还可以使用CustomAction根据搜索结果定义所需的值以禁用该Feature (Should be a value for Level). (应该是Level的值)。

I haven't tested this way, but I think it should work. 我没有用这种方式测试,但我认为它应该可行。 Have a try and give feedback please. 请尝试并提供反馈。

Additional Link: 附加链接:

http://wix.tramontana.co.hu/tutorial/getting-started/conditional-installation http://wix.tramontana.co.hu/tutorial/getting-started/conditional-installation

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM