microsoft / microsoft/winget-cli

Day 0 Update: Self-update on first command when client is outdated

Open
#6,298 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue-Feature
Dominant language
C++
Stars
26.4k
Forks
1.8k
Avg merge
1d 11h
Merged PRs (30d)
15

Description

Relevant area(s)

WinGet CLI

Description of the new feature / enhancement

Day 0 Update — When the first command requiring the source index is executed (e.g., winget install, winget upgrade, winget search, or winget configure), WinGet should check whether a newer stable version of the client is available and prompt the user to update before proceeding.

This addresses several chicken-and-egg problems:

  • A user installs WinGet (or gets it via Windows) but the version is already outdated by the time they first use it.
  • New features (e.g., winget configure) require a recent client, but users don't know they need to update first.
  • The winget configure enable step should be unnecessary if the first command executed is winget configure on a client that supports it natively — but today users hit "unrecognized command" errors because their client is too old.

Proposed behavior:

  1. The preIndexed package source includes metadata indicating the "latest stable" client version.
  2. On first command execution requiring the index, WinGet compares its own version against the advertised latest.
  3. If outdated, WinGet informs the user in the current terminal window that an update is needed.
  4. WinGet shuts down, updates itself, then relaunches in a new window with the original command (using --wait so the new window doesn't close immediately).
  5. The user sees their original command execute on the updated client.

This eliminates the "install WinGet, then immediately need to update WinGet" friction and removes barriers to new functionality adoption.

Proposed technical implementation details
  • Add a latestStableVersion field to the preIndexed package source metadata.
  • Client version comparison on first index access per session.
  • Self-update flow: notify user → close current process → trigger update (via Microsoft Store or direct package) → relaunch with original arguments + --wait.
  • Group Policy controls: EnableDay0Update (toggle), Day0UpdateSource (Store vs. direct).
  • Settings: day0Update.enabled, day0Update.dismissCount (allow N dismissals before suppressing).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the preIndexed package source metadata and the first index access path for commands such as winget install, upgrade, search, and configure. Trace the proposed version comparison, update source and policy/settings controls; done means an outdated client informs the user, updates, relaunches with the original arguments and --wait, and executes the command.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.