Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Support MSI transactions #5386

Closed
nirbar opened this issue Aug 29, 2016 · 2 comments
Closed

Feature request: Support MSI transactions #5386

nirbar opened this issue Aug 29, 2016 · 2 comments
Assignees
Milestone

Comments

@nirbar
Copy link

nirbar commented Aug 29, 2016

Feature request: Support MSI transactions

MSI transactions allow multiple MSI packages to be installed or removed in a batch such that failure in any of the packages will rollback all the preceding packages in the transaction.
See more on MSDN Multiple-Package Installations

The main benefit of MSI transactions is that they can properly rollback packages that installed a major upgrade. Consider the following scenraio:

  1. A bundle contains 2 packages- A and B
  2. During an upgrade:
    1. Package A-v1 performs a major upgrade on package A-v0.
    2. Package B-v1 fails

With current WiX rollback implementation, package B will properly rollback to preceding state. Package A however, will be removed leaving the system with package B-v0 and without package A.

Now consider the same scenario with MSI transaction: Once package B has failed, both packages- B and A-v1 would rollback restoring the state of the system to what it was.

A possible workaround for the same problem would be to detect bundle v0 and repair it. This however, is not always feasible- for example when v0 was deployed as distinct MSI packages rather than a bundle, or if one of the packages was patched at some point.

Implementation suggestion:

  • Add a 'Transaction' attribute to Chain and RollbackBoundary elements. Possible values would be Yes/No
  • During ApplyExecute, whenever a rollback boundary is executed (as well as the chain):
    1. If we're in a transaction, commit it.
    2. If the new boundary wants transactions, start a new transaction
  • At the end of the chain:
    1. If we're in a transaction, commit it.
  • At any point, if an error occurs:
    1. If we're in a transaction, roll it back.
    2. Otherwise, keep current rollback behavior.

Cavets:

  • When using MSI transactions, packages can't be Permanent.
  • If an ExePackage internally starts a new transaction, it would fail
  • If an ExePackage installs another MSI, it will install as part of the transaction.
  • Care should be taken to properly handle other bundle (probably a BundlePackage element could come in handy here)
@barnson barnson added this to the v4.0 milestone Sep 27, 2016
@rseanhall
Copy link
Contributor

Hi @nirbar. I merged wixtoolset/wix#215 with the expectation that you would eventually address my comments but I haven't seen any new pull requests. Are you using this feature, and is it working for you?

@nirbar
Copy link
Author

nirbar commented Dec 13, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

3 participants