microsoft / microsoft/winget-cli

Winget doesnt run as system on fresh windows installs, even after running windows update and store updates

Open
#4,798 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Brief description of your issue

Winget not running as system on a fresh install of Windows

This means it cannot be used with Intune to roll out software

Steps to reproduce

Install a fresh copy of Windows (I did mine as a VM) Windows 11 pro and Windows 11 enterprise tested, 23H2 and 22H2
SW_DVD9_Win_Pro_11_22H2.24_64BIT_English_Pro_Ent_EDU_N_MLF_X23-81095
Download PSexec
From an admin command prompt, Run PSexec -s CMD
run whoami to confirm you are NT\system.
cd c:\program files\windowsapps
dir to get the path, something like Microsoft.DesktopAppInstaller_8wekyb3d8bbwe
CD to that directory
Run winget.exe
No output will be displayed nor logs appear in the diagoutput directory, it should go to c:\windows\temp if run as system.
No install commands work, or viewing version of winget

image

Drop out to a normal command prompt as admin user and it works fine.

Expected behavior

Packages should install - blogs from 2023 as discussed on this site, report it is working, with the only issue of the exe not being in a PATH system variable
Logs should appear for every run

Actual behavior

Fails to run without any errors reported

Environment
Windows Package Manager v1.8.1911
Windows: Windows.Desktop v10.0.22631.4037
Package: Microsoft.DesktopAppInstaller v1.23.1911.0

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

Reproduce the issue on the listed Windows 11 22H2 or 23H2 environments by launching winget.exe from a PsExec system command prompt, then compare it with an administrator prompt. Check whether output or logs appear in the WindowsApps diagnostic location or c:\windows\temp. Done means system-context execution reports a version and supports package installation with logs.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.