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

3421 - Reinstall packages that were uninstalled during failed upgrade bundle #50

Merged
merged 2 commits into from Feb 11, 2022

Conversation

rseanhall
Copy link
Contributor

When rolling back a bundle failure, reinstall all upgrade related bundles.

Fixes wixtoolset/issues#3421
wixtoolset/issues#5796

Copy link
Contributor Author

@rseanhall rseanhall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we discussed in meeting 217, the plan was to automatically trigger a normal install operation for the older bundle on rollback of an upgrade. Unfortunately, things aren't that black and white for Burn. I had to make Burn install all upgrade related bundles at the end of rollback regardless of which packages were executed for the following reasons:

@@ -1487,6 +1524,39 @@ extern "C" HRESULT PlanRelatedBundlesComplete(
hr = DependencyPlanPackageComplete(&pRelatedBundle->package, pPlan);
ExitOnFailure(hr, "Failed to complete plan dependency actions for related bundle package: %ls", pRelatedBundle->package.sczId);
}

if (fInstallingAnyPackage && BOOTSTRAPPER_RELATION_UPGRADE == pRelatedBundle->relationType)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. There is no concept of "the older bundle", one bundle could have multiple bundles to uninstall as part of the Update related bundle behavior.

@@ -1487,6 +1524,39 @@ extern "C" HRESULT PlanRelatedBundlesComplete(
hr = DependencyPlanPackageComplete(&pRelatedBundle->package, pPlan);
ExitOnFailure(hr, "Failed to complete plan dependency actions for related bundle package: %ls", pRelatedBundle->package.sczId);
}

if (fInstallingAnyPackage && BOOTSTRAPPER_RELATION_UPGRADE == pRelatedBundle->relationType)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. As you can probably see from the first commit, I was planning on using the operation to only select MajorUpgrade bundles. But some bundles could support downgrading, so the bundle to install is actually newer and would have been labeled as Downgrade.

@@ -739,6 +744,9 @@ extern "C" HRESULT ApplyExecute(
IgnoreRollbackError(hrRollback, "Failed rollback actions");
}

hrRollback = DoRestoreRelatedBundleActions(pEngineState, &context, pRestart);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Identifying which upgrade bundle was responsible for each MSI that was uninstalled is not always possible. Another wrinkle here is that Exe packages could also be breaking things that the older bundles needs to repair.

@rseanhall rseanhall marked this pull request as ready for review February 11, 2022 00:14
@rseanhall
Copy link
Contributor Author

The Appveyor build was successful: https://ci.appveyor.com/project/wixtoolset/wix4/builds/42532091.

@rseanhall rseanhall merged commit 8da1c38 into wixtoolset:develop Feb 11, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Feb 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant