ENGINEERING

A winget rollback is an uninstall and an install, and we got both wrong

Marc Borer 6 min
WHERE ATTESTREE FITS
winget patch management
Rings with rollback, per-user apps, and what is installed where.

In June we rolled FanControl back from version 270 to 269 on one ring in our lab, and the rollback failed on every agent cycle.

Attestree’s agent had built two winget commands that winget 1.28.240 rejects:

  • winget install … --allow-downgrade. winget has no such option. Chocolatey does, and our design had assumed the two tools shared it. winget answered 0x8A150002, invalid command-line arguments.
  • winget uninstall … --accept-package-agreements. That option belongs to install and upgrade. uninstall answers “Argument name was not recognized for the current command”.

Our unit tests checked that the agent sent --allow-downgrade. None checked that winget accepted it, so they stayed green.

Deleting the flag alone would have made things worse.

What winget does with an older version

We checked each of these against the source of winget 1.29.380, the current stable release, and against Microsoft’s command reference for install, upgrade and uninstall, last updated July 19, 2026:

You run What winget 1.29.380 does
winget install --id X --version <older>, with a newer version installed Prints “Found an existing package already installed. Trying to upgrade the installed package…”, then “No available upgrade found. No newer package versions are available from the configured sources.” Exits with 0x8A15002B. Nothing changes.
winget upgrade --id X --version <older> Runs the same version check and exits with 0x8A15002B. --force does not skip that check.
--uninstall-previous on install or upgrade Removes the old version during an upgrade. From the command line a downgrade stops at the version check first.
winget install --id X --version <older> --force Skips the lookup of what is installed and runs the older installer as a new install. What happens next is up to the installer. We have not tested this.
--allow-downgrade Not an option of any command.
winget uninstall --id X --version <v> Removes that installed version. It takes --accept-source-agreements, and not --accept-package-agreements.

One part of winget 1.29.380 does handle a downgrade. The DSC v3 Package resource that ships with winget (winget dscv3 package), asked for a version below the installed one, logs “Reinstalling package to downgrade to desired version”. It then installs the older version with the version check skipped and uninstall-previous turned on. For MSI, WiX, EXE, Inno, Nullsoft, Burn and portable installers, that runs the installed version’s uninstaller first. So it is the same uninstall and install, done inside winget. We read this in the source and have not run it.

Why 0x8A15002B is the dangerous answer

After an upgrade, 0x8A15002B means nothing newer exists, so the machine is already current. Scripts and tools typically treat it as done, and so did our agent. After a downgrade the same code means nothing happened.

Had we only deleted the bogus flag, winget install --version 269 would have answered 0x8A15002B on every machine still at 270, and each would have reported the rollback complete.

So we stopped trying to downgrade in place with winget. Since June a winget downgrade in Attestree is two steps:

  1. Uninstall the version that is installed.
  2. Install the older version, pinned with --version.

The agent refuses up front when it did not install the app itself, because a failed reinstall would leave the machine without an app we had not installed in the first place. Chocolatey keeps its real --allow-downgrade and tries in place first.

The FanControl rollback then went through in one cycle. The install exited 0, winget list showed 269, and the loop stopped.

The pair has costs that an in-place downgrade typically avoids:

  • Between the two steps the app is not installed. If the older install fails, the machine has no copy until the next try.
  • The app’s own uninstaller decides what happens to its settings and data.
  • If the uninstall answers “not found”, the agent stops and installs nothing. We have seen that answer when an app had updated itself past the version named in the uninstall. Installing the older version then would put it on top of the newer copy that is still there.

Then Edge updated itself

In August a test group in our lab had Microsoft Edge pinned at 151.0.4129.107, the version our catalog served on that ring. Edge keeps itself up to date with its own updater. By August 29 it had moved to 152.0.4191.53, a new major version our catalog did not have yet.

Our planner saw a machine ahead of its pin by a major version and planned the pair: uninstall 152, then install 151. Edge’s setup declined the uninstall, and winget answered 0x8A150030, EXEC_UNINSTALL_COMMAND_FAILED, “Running uninstall command failed”. The agent waited out a 6-hour backoff and tried again. It did that on all three machines in the group:

Machine First uninstall attempt (UTC) Attempts by Aug 30, 18:18
1 Aug 29, 12:40 5
2 Aug 29, 21:41 4
3 Aug 29, 23:53 4

Every attempt failed with 0x8A150030. Until August 28 the same three machines had been trying to take Edge from 151.0.4129.107 back to 151.0.4129.78, inside one major version, and getting the same answer.

Edge did what it was built to do. The fault was in our planner. It treated “ahead of the pin” as “must go back” for an app that updates itself, and it planned to uninstall the system browser as SYSTEM four times a day on every machine in the group. Had an uninstall ever succeeded, Edge’s updater would have brought 152 back, and six hours later the plan would have run again.

What we changed

The release of August 31 changed two things:

  • A machine that is ahead of the version its ring merely serves is now reported as “ahead of catalog”, and the agent plans nothing for it. A downgrade runs only after someone rolls the ring back, which blocks the newer version there.
  • An uninstall that fails with 0x8A150030 on an app the agent never installed now reads “cannot converge” in the console, with the two ways out: approve the new version, or take the app off the group’s list of required apps. Before, the row read “looping” and promised another try.

After the agents updated that morning, no machine tried to uninstall Edge again, and the console began listing them under “ahead of catalog”.

Rolling back on purpose still works the way it did in June. Someone chooses the older version for a ring, and the agent uninstalls and installs.

What we got wrong

  • We assumed winget and Chocolatey shared a downgrade flag, and tested only that we sent it.
  • We sent --accept-package-agreements to uninstall, which has never taken it.
  • We treated every machine ahead of its pin as one to roll back, including machines whose app updates itself.
  • The console said “looping” and promised a retry that could not succeed. Its failure count was one short, because it took the 0x8A15002B from the install half as a sign that things were working.

If you need to roll back an app with winget

These commands are for winget 1.29.380.

  1. Check what is installed. winget list --id <Id> --exact shows the installed version and the source. Roll back from that version, not the one you expect.
  2. Check that the older version is still offered. winget show --id <Id> --exact --versions lists the versions the source has.
  3. Save what the uninstaller might remove. Some uninstallers keep settings and data, and some delete them.
  4. Uninstall the current version. winget uninstall --id <Id> --exact --version <current> --silent --accept-source-agreements. Leave out --accept-package-agreements.
  5. Install the older version. winget install --id <Id> --exact --version <older> --silent --accept-package-agreements --accept-source-agreements.
  6. Check the result, not only the exit code. If step 5 answers 0x8A15002B, the older version did not install. That happens when the newer version is still there. Run winget list --id <Id> --exact again.
  7. Keep it from moving forward again. winget pin add --id <Id> --exact --blocking stops winget from upgrading it until you remove the pin. winget’s own help says a pinned package “may still upgrade on its own and be upgraded from outside the Windows Package Manager”, so an app with its own updater also needs that updater’s policy.

--force on install is the other route. It runs the older installer over the newer one, and the result depends on the installer. It may downgrade in place, refuse, or leave two copies. We have not tested it, so try it on one machine first.

In Attestree a rollback is one action per ring. Withhold, retire or roll back says what it uninstalls and what it leaves alone.

SUBSCRIBE

Get the next field note by email.

Signing up adds you to the waitlist: we send each new post, and may write to you about early access.