I am working on developing Windows installer for an enterprise product, that has different variants as separate MSI products. 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).
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). Product2 built with Base and Mod3. Now, When I install Product2 in a system where Product1 is installed, only the Mod3 should be installed.
I am using WIX 3.5.
Any help would be appreciated.
Thanks in Advance.
Without testing, I would say you can do this with ComponentSearch
. Define such search, search for a component of product 1 and write the result to a variable. You can then check if the variable is not empty to determine if product 1 is already installed.
<Property Id="EXISTING_PRODUCT">
<ComponentSearch Id="SearchMyProduct" Guid="{YOUR-OWN-GUID}" Type="file"/>
</Property>
Then you can use a Condition
in the Feature.
<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
. (Should be a value for 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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.