Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

winget does not respond on fresh Windows 10 installations in system context, works on existing installations #4321

Closed
rbrannath opened this issue Mar 28, 2024 · 2 comments
Milestone

Comments

@rbrannath
Copy link

rbrannath commented Mar 28, 2024

Brief description of your issue

I use winget for distributing and updating software across various computers and VMs. Since the scripts are distributed and executed via an RMM, they run in the system context. Normally, winget is executed in the user context, making the simple execution of the "winget" command impossible. Therefore, in the script, I directly call winget.exe located in the path C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller**. This method works flawlessly on computers that were newly installed in October 2023 and before. However, it does not work on newer installations. When calling "winget -v", I correctly get the version output on older installations, but I get no output (not even an error message) on new installations. I have performed basic debugging, such as checking the path, etc., and could not find any differences. All Windows updates and Windows Store updates are current.

Additionally, although this might not be directly related, I used the Sysinternals tool ProcMon to compare the processes on two computers. On the new installations, I noticed that a process is started, but then its process ID changes. This does not happen on existing installations, where the process ID remains the same.

Steps to reproduce

  1. Perform a fresh installation of Windows 10.
  2. Install all Windows updates and Windows Store updates
  3. Execute the test script in system context:
$wingetloc=(Get-Childitem -Path "C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller*" -Include winget.exe -Recurse -ErrorAction SilentlyContinue | Select-Object -Last 1 | %{$_.FullName} | Split-Path)
cd $wingetloc
.\winget.exe -v

Expected behavior

The version should be output.

Actual behavior

No output is produced.

Environment

winget --info] on a fresh installation:

PS C:\WINDOWS\system32> winget --info
Windows Package Manager v1.7.10661
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.19045.4170
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.22.10661.0

WinGet Directories
-----------------------------------------------------------------------------------------------------------------------
Logs                                        %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\Local…
User settings                               %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\Local…
Directory for portable links (User)         %LOCALAPPDATA%\Microsoft\WinGet\Links
Portable Link Directory (Machine)           C:\Program Files\WinGet\Links
Portable Package Root (User)                %LOCALAPPDATA%\Microsoft\WinGet\Packages
Portable Package Root                       C:\Program Files\WinGet\Packages
Portable Package Root (x86)                 C:\Program Files (x86)\WinGet\Packages
Installer downloads                         %USERPROFILE%\Downloads

Links
-----------------------------------------------------------------------------------------
Privacy Statement                https://aka.ms/winget-privacy
License Agreement                https://aka.ms/winget-license
Third Party Notices              https://aka.ms/winget-3rdPartyNotice
Homepage                         https://aka.ms/winget
Windows Store Terms of Use       https://www.microsoft.com/en-us/storedocs/terms-of-sale

Administrator Settings                  Status
-----------------------------------------------------
LocalManifestFiles                        Disabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride                     Disabled
LocalArchiveMalwareScanOverride           Disabled

[winget --info] on an existing installation:

PS C:\Windows\system32> winget --info
Windows Package Manager v1.7.10661
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.19045.4170
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.22.10661.0

WinGet Directories
-----------------------------------------------------------------------------------------------------------------------
Logs                                        %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\Local…
User settings                               %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\Local…
Directory for portable links (User)         %LOCALAPPDATA%\Microsoft\WinGet\Links
Portable Link Directory (Machine)           C:\Program Files\WinGet\Links
Portable Package Root (User)                %LOCALAPPDATA%\Microsoft\WinGet\Packages
Portable Package Root                       C:\Program Files\WinGet\Packages
Portable Package Root (x86)                 C:\Program Files (x86)\WinGet\Packages
Installer downloads                         %USERPROFILE%\Downloads

Links
-----------------------------------------------------------------------------------------
Privacy Statement                https://aka.ms/winget-privacy
License Agreement                https://aka.ms/winget-license
Third Party Notices              https://aka.ms/winget-3rdPartyNotice
Homepage                         https://aka.ms/winget
Windows Store Terms of Use       https://www.microsoft.com/en-us/storedocs/terms-of-sale

Administrator Settings                  Status
-----------------------------------------------------
LocalManifestFiles                        Disabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride                     Disabled
LocalArchiveMalwareScanOverride           Disabled

Copy link

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Triage Issue need to be triaged label Mar 28, 2024
@rbrannath
Copy link
Author

Missing Microsoft Visual C++ Redistributable was the issue...
Solution was already here: #2748

@microsoft-github-policy-service microsoft-github-policy-service bot removed the Needs-Triage Issue need to be triaged label Mar 28, 2024
@denelon denelon added this to the 1.8 Client milestone May 28, 2024
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

No branches or pull requests

2 participants