Skip to content

feat: add upgrade delay setting for upgrade --all#6179

Draft
mdevolde wants to merge 1 commit intomicrosoft:masterfrom
mdevolde:feature/upgrade_delay
Draft

feat: add upgrade delay setting for upgrade --all#6179
mdevolde wants to merge 1 commit intomicrosoft:masterfrom
mdevolde:feature/upgrade_delay

Conversation

@mdevolde
Copy link
Copy Markdown

@mdevolde mdevolde commented Apr 25, 2026


This pull request contains the full implementation of the feature, but is under "draft" status until a maintainer agreed with my related issue (and potentially with a spec to write).

feat: add upgrade delay setting for upgrade --all

Summary

Add a new user setting installBehavior.upgradeDelayInDays (default: 0) to delay winget upgrade --all until an update is at least N days old, and permit to reduce risks to download a very recent release that could be part of a supply chain attack or contains bugs.

Changes

  • During winget upgrade --all, winget reads ReleaseDate (preferred: selected applicable installer, fallback: manifest.DefaultInstallerInfo.ReleaseDate).
  • If the update is newer than the configured delay, it is skipped and a summary message is shown indicating how many upgrades were skipped due to the upgrade delay (upgrades with missing ReleaseDate are also skipped if installBehavior.upgradeDelayInDays > 0).
  • Users can still upgrade a specific package individually to bypass the “--all” delay behavior.

Testing

  • Added/updated AppInstallerCLITests coverage for eligible vs too recent upgrades and verified UpdateFlow_UpdateAllApplicable_UpgradeDelay passes.

Closes #6178

Microsoft Reviewers: Open in CodeFlow

@github-actions

This comment has been minimized.

@mdevolde mdevolde force-pushed the feature/upgrade_delay branch from 65fed58 to 32cf37d Compare April 26, 2026 00:01
@mdevolde
Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Comment thread doc/Settings.md
},
```

> Note: If the package manifest does not include a valid `ReleaseDate`, the upgrade will be skipped when this setting is enabled. To upgrade anyway, use `winget upgrade <package>` which does not consider this setting.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this would likely prevent the upgrade of most applications with --all, as a majority of manifests don’t specify a release date and it isn’t a mandatory field. Although you've made this as an opt-in feature, I'm not sure this makes sense for most users. I'd suggest having --force bypass the check for installer dates so users don’t have to specify every single package if there are several without release dates

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade delay setting for 'winget upgrade --all'

2 participants