1

I have a WiX Custom Bootstrapper that install several msi packages, let’s say package A, B, C, D and E. Now I want to distribute a new Bootstrapper that upgrade package A and B but no longer install package C, D and E. The problem is that I want to leave package C, D and E on the machine (if already there).

When upgrading, the Bootstrapper will install/upgrade package A and B, then uninstall the old Bootstrapper to clean up. That will uninstall package C, D and E because they are no longer a part of the product.

Question: How can I prevent that package C, D and E being uninstalled?

3
  • Have you looked at the Permanent attribute of MsiPackage in your Bundle.wxs? Commented Nov 12, 2019 at 14:15
  • Thank you for your comment, but yes, we have looked into the Permanent attribute that that would have had to be set on the installation that we already have in the market in order to prevent uninstallation when we remove the packages. Commented Nov 15, 2019 at 16:57
  • If you have a WiX Custom Bootstrapper you can add a OnPlanPackageBegin to your BootstrapperApplication.PlanPackageBegin event. Here you can identify a package with .packageID and compare it to the ones you dont want to be uninstalled (C, D and E). Set the State property of that package to RequestState.None Commented Nov 18, 2019 at 9:03

1 Answer 1

1

@Shique: If the packages (C, D and E) are no longer included in the Bootstrapper, you will never hit OnPlanPackageBegin on those packages and can therefore not set the State property to RequestState.None.

This is not a direct answer to the question but a way to remove packages, that you no longer want to distribute, from you bootstrapper without uninstalling the packages.

We created a second Bootstrapper containing package C, D and E. In our original Bootstrapper, now only containing package A and B, we added the second Bootstrapper as an ExePackage with the Permanent attribute on. When running the original Bootstrapper it will upgrade package A and B, run the second Bootstrapper, that will increment the reference count on package C, D and E. When the Bootstrapper comes to the cleanup, it will of course leave package A and B, but also package C, D and E due to the reference from the second Bootstrapper.

If the package C, D and E are not embedded (compressed) in the second Bootstrapper remember to add them as Payload to the ExePackage.

In this way we still have a handle to package C, D and E through Apps & features and the user can choose the time to uninstall the packages.

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

Comments

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.