Robin
Robin

Reputation: 737

How do I define a dependency for a shared component in WIX?

The problem: Two product installers (A and B) have a set of shared components which are installed to the same path. A contains v1 shared components and B contains v2.

However, installer B also contains an additional shared component, which the v2 shared components depend on.

When both are installed the shared components have reference counts of 2, except for the new shared component which will have a count of 1. When installer B is uninstalled the new component will be removed when its count is decremented, but the other shared components are not downgraded so will fail due to the missing DLL.

Is there a way to express this dependency in WIX, or otherwise solve the problem?

I could solve this by adding the new resource to an existing component, but the scriptures dictate 'one file, one component' where I come from.

Upvotes: 0

Views: 358

Answers (1)

PhilDW
PhilDW

Reputation: 20780

A couple of things you could try, but there might be some constraints you haven't mentioned if both A and B are deployed already:

  1. You could make a patch to A that adds the missing Dll, adding it to an existing feature, using the same component id etc. You'd need to be sure to use REINSTALL=[that feature name] when installing the patch (or REINSTALL=ALL which might be the default). Any upgrade to A could fix the issue, including a major upgrade, but none of this may be unacceptable if A is a legacy product that is not being maintained.

  2. You could install that Dll as a separate new MSI, same component id etc, and perhaps use a Bundle to install B and the new MSI. Your Dll now has two ref counts, one for B and one for the new MSI. The new MSI would have logic to forbid its uninstall if A is present and B is absent. Or there might be a dependency chain that would work.

Upvotes: 1

Related Questions