1

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.

1 Answer 1

3

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

Sign up to request clarification or add additional context in comments.

3 Comments

Thank you Martin. Let me check this with my WIX Project.
This is worked for me. But I have to compromise my custom actions. I am re-writing my custom actions for Install and Uninstall. Accepted the answer.
I had to use Property@Secure="yes" for the uninstall to handle the condition correctly. Otherwise the property is ignored on uninstall.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.