Skip to content

Verify installed version matches upgrade target after installer success#6097

Open
AMDphreak wants to merge 1 commit intomicrosoft:masterfrom
AMDphreak:fix/verify-upgrade-installed-version
Open

Verify installed version matches upgrade target after installer success#6097
AMDphreak wants to merge 1 commit intomicrosoft:masterfrom
AMDphreak:fix/verify-upgrade-installed-version

Conversation

@AMDphreak
Copy link

@AMDphreak AMDphreak commented Mar 21, 2026

Summary

Follow-up to misleading success output when an upgrade exits 0 but Windows still reports an older installed version (see #4550 and related reports).

Behavior

After a successful installer return code, if the operation is an upgrade (InstallerExecutionUseUpdate):

  • ARP path: After ARP correlation finds the installed package, compare Utility::Version of the correlated installed version to the manifest package version. If the installed version sorts less than the expected (manifest) version, fail with APPINSTALLER_CLI_ERROR_UPGRADE_INSTALLED_VERSION_MISMATCH (0x8A15008F).
  • MSIX path: When the manifest provides a package family name and the package is registered, compare using Deployment::GetInstalledVersionStringForFamilyName where applicable.
  • Skip verification when reboot is required to finish, when versions are unknown, or when correlation does not yield a reliable installed version string.

Notes

Portable/zip flows that do not correlate to ARP/MSIX are unchanged.

Testing

CI / AppInstallerCLITests as usual.

Made with Cursor

Microsoft Reviewers: Open in CodeFlow

When upgrading, compare the version reported by Windows (ARP correlation or
MSIX package family registration) to the manifest package version after the
installer exits successfully. If the installed version is still lower, emit
APPINSTALLER_CLI_ERROR_UPGRADE_INSTALLED_VERSION_MISMATCH.

Skips verification when reboot is required to finish (version may not update
until restart) or when either version is unknown.

Does not cover installers that do not participate in ARP/MSIX correlation
(e.g. some portable flows); those remain unchanged.

Related: microsoft#4550
@AMDphreak AMDphreak marked this pull request as ready for review March 21, 2026 09:55
@AMDphreak AMDphreak requested a review from a team as a code owner March 21, 2026 09:55
@JohnMcPMS
Copy link
Member

Two things:

  1. Building another PR on top of the changes in the first makes reviewing it independently difficult. Please create a new branch for each change off of the mainline. Yes, if you are adding errors you are very likely to create a conflict with yourself.
  2. I don't know that we can take this change with it producing an error. Some installers are not well behaved and will not update the installed version number in an update. Those usually get tagged in the manifest to prevent repeated upgrades, but I don't want to start treating updates to them as failures. I would be more accepting of a warning message that indicates that the upgrade did this, but if the process produces success we have to treat it as such.

@JohnMcPMS JohnMcPMS added the Needs-Author-Feedback Issue needs attention from issue or PR author label Mar 27, 2026
@Trenly
Copy link
Contributor

Trenly commented Mar 27, 2026

I don't know that we can take this change with it producing an error. Some installers are not well behaved and will not update the installed version number in an update. Those usually get tagged in the manifest to prevent repeated upgrades, but I don't want to start treating updates to them as failures. I would be more accepting of a warning message that indicates that the upgrade did this, but if the process produces success we have to treat it as such.

I appreciate you callimg this out - The community repository just surpassed 12,000 packages that are available which means that any changes to reporting an error here would be breaking in my opinion; especially when you consider the automations and integrations enterprises and independent developers have built around the existing behavior of the CLI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs-Author-Feedback Issue needs attention from issue or PR author

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants