Fix "Uninstall package, then update it" failing on WinGet packages#5077
Merged
Gabriel Dufresne (GabrielDuf) merged 2 commits intoJul 13, 2026
Merged
Conversation
4 tasks
Marc-André Moreau (mamoreau-devolutions)
approved these changes
Jul 13, 2026
Gabriel Dufresne (GabrielDuf)
deleted the
fix/uninstall-then-update-double-run
branch
July 13, 2026 15:05
| uninstallOp.OperationFailed += (_, _) => TelemetryHandler.UninstallPackage(package, TEL_OP_RESULT.FAILED); | ||
| var updateOp = new UpdatePackageOperation(package, updateOpts, req: uninstallOp); | ||
| // Once uninstalled the package is gone, so the second step must install the new version fresh; a plain update would fail with "no installed package found". | ||
| var updateOp = new InstallPackageOperation(package, updateOpts, req: uninstallOp); |
There was a problem hiding this comment.
Since you're now changing the process to instead install the package, shouldn't we be renaming the menu option to reflect the changes too in order to avoid confusion? For example, changing "Uninstall package, then update it" to "Uninstall package, then install latest".
|
I can confirm this is now working correctly. Thank you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request makes important corrections to the uninstall-then-reinstall and uninstall-then-update workflows for package management, ensuring operations are not executed twice and that updates after uninstall are handled correctly.
Bug fixes and workflow corrections:
InstalledPackagesPage.cs, removed the direct launch ofuninstallOpinLaunchUninstallThenReinstallto prevent running the uninstall operation twice concurrently, since it's already a prerequisite for the reinstall operation.SoftwareUpdatesPage.cs, changed the second step ofLaunchUninstallThenUpdatefrom an update to a fresh install operation, because after uninstalling, the package must be installed anew rather than updated. Also removed the direct launch ofuninstallOpto avoid concurrent execution, as it's now a prerequisite for the install operation.