microsoft / winget-cli

WinGet is the Windows Package Manager. This project includes a CLI (Command Line Interface), PowerShell modules, and a COM (Component Object Model) API (Application Programming Interface).
https://learn.microsoft.com/windows/package-manager/
MIT License
22.6k stars 1.4k forks source link

UniGetUI doesn't see any updates #4614

Open hspindel opened 4 days ago

hspindel commented 4 days ago

Brief description of your issue

WinGetUI updated to UniGetUI. Previously WinGetUI reported numerous updates available.

Package sources include .NET Tool, Chocolatey and PowerShell. Same as WinGetUI used to show.

Probably key log entry:

[7/5/2024 5:12:03 PM] Could not initialize Package Manager Winget [7/5/2024 5:12:03 PM] System.ComponentModel.Win32Exception (5): An error occurred trying to start process 'C:\Users\howard\AppData\Local\Microsoft\WindowsApps\winget.exe' with working directory 'D:\Program Files\UniGetUI'. Access is denied. at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) at UniGetUI.PackageEngine.Managers.WingetManager.WinGet.LoadManager() in C:\SomePrograms\WingetUI-Store\src\UniGetUI.PackageEngine.Managers.WinGet\WinGet.cs:line 495 at UniGetUI.PackageEngine.ManagerClasses.Manager.PackageManager.InitializeAsync() in C:\SomePrograms\WingetUI-Store\src\UniGetUI.PackageEngine.PackageManagerClasses\Manager\PackageManager.cs:line 76

Steps to reproduce

Just run UniGetUI.

Expected behavior

List of updateable programs provided.

Actual behavior

UniGetUI says all programs up-to-date.

Environment

winget --info reports access denied.
github-actions[bot] commented 4 days ago

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!

Closed similar issues:

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

Trenly commented 4 days ago

This is an issue that needs to be filed on the UniGetUI repo, as it is not an issue with the WinGet CLI.

hspindel commented 4 days ago

This is an issue that needs to be filed on the UniGetUI repo, as it is not an issue with the WinGet CLI.

Not sure about that. The log clearly states that it is WinGet CLI that can't be executed.

Masamune3210 commented 3 days ago

Yes, but as stated, this has nothing to do with winget itself. In fact, the fact that it says that it couldn't execute winget proves this, as winget hasn't even had a chance to DO anything yet. Something on your machine is busted, permissions-wise, or UniGet has a bug in how it tries to execute winget.

hspindel commented 3 days ago

Yes, but as stated, this has nothing to do with winget itself. In fact, the fact that it says that it couldn't execute winget proves this, as winget hasn't even had a chance to DO anything yet. Something on your machine is busted, permissions-wise, or UniGet has a bug in how it tries to execute winget.

It has everything to do with winget. No matter how many times I try to reinstall it and no matter how many guides I try to follow winget always reports access denied. Yes, I agree something is busted with permissions, but I need a pointer to fix that.

mdanish-kh commented 3 days ago

Are you able to execute winget commands normally from the terminal without WingetUtil?

Does something like winget -v / winget list work for you in the terminal?

hspindel commented 3 days ago

Are you able to execute winget commands normally from the terminal without WingetUtil?

Does something like winget -v / winget list work for you in the terminal?

Attempting winget with any parameters always yields "access is denied."

mdanish-kh commented 3 days ago

Can you try re-installing WinGet from https://aka.ms/getwinget and check again?

Trenly commented 3 days ago

Attempting winget with any parameters always yields "access is denied."

Well, that is a completely different issue than "UniGetUI doesn't see any updates". That would be "WinGet always yields access is denied".

Have you tried re-installing WinGet or updating to the latest version? What version do you have installed ( Get-AppxPackage *AppInstaller*)? Are there any logs you can share from WinGet directly (%localappdata%/Packages/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe/DiagOuptuDir/LocalState)?

hspindel commented 3 days ago

Thank you for the reply.

Have you tried re-installing WinGet or updating to the latest version? What version do you have installed ( Get-AppxPackage *AppInstaller*)? Are there any logs you can share from WinGet directly (%localappdata%/Packages/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe/DiagOuptuDir/LocalState)?

Reinstalling WinGet doesn't help (multiple tries).

Get-AppxPackage "AppInstaller" reports:

Name              : Microsoft.DesktopAppInstaller
Publisher         : CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
Architecture      : X64
ResourceId        :
Version           : 1.23.1791.0
PackageFullName   : Microsoft.DesktopAppInstaller_1.23.1791.0_x64__8wekyb3d8bbwe
InstallLocation   : C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_1.23.1791.0_x64__8wekyb3d8bbwe
IsFramework       : False
PackageFamilyName : Microsoft.DesktopAppInstaller_8wekyb3d8bbwe
PublisherId       : 8wekyb3d8bbwe
IsResourcePackage : False
IsBundle          : False
IsDevelopmentMode : False
NonRemovable      : False
Dependencies      : {Microsoft.UI.Xaml.2.8_8.2310.30001.0_x64__8wekyb3d8bbwe,
                    Microsoft.VCLibs.140.00.UWPDesktop_14.0.33728.0_x64__8wekyb3d8bbwe,
                    Microsoft.DesktopAppInstaller_1.23.1791.0_neutral_split.scale-100_8wekyb3d8bbwe}
IsPartiallyStaged : False
SignatureKind     : Store
Status            : Ok
`

There is no folder named DiagOutputDir (or anything similar) under %localappdata%/Packages/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe

hspindel commented 3 days ago

Can you try re-installing WinGet from https://aka.ms/getwinget and check again?

* Related: [ResourceUnavailable: Program 'winget.exe' failed to run: An error occurred trying to start process. Access is denied.At line:1 char:1 #3057](https://github.com/microsoft/winget-cli/issues/3057)

Thank you, but it doesn't work.

Trenly commented 3 days ago

There is no folder named DiagOutputDir (or anything similar) under %localappdata%/Packages/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe

Ah, my bad; Is there one called LocalState?

hspindel commented 3 days ago

Ah, my bad; Is there one called LocalState?

No problem. Yes, there is LocalState. It has eleven log files in it. The two most recent are attached.

AppInstaller-2024-07-06-01-05-13.388.log

AppInstaller-2024-07-06-01-05-22.653.log

denelon commented 1 day ago

@marticliment, let me know if this is something that should go to UniGetUI or how we can help figure out what's going on here. 😊

denelon commented 1 day ago

@hspindel do you get any results if you run winget --info? If you do, can you share them?

marticliment commented 1 day ago

@marticliment, let me know if this is something that should go to UniGetUI or how we can help figure out what's going on here. 😊

I have seen a similar bug report on UniGetUI, but, as said previously, I can't help from UniGetUI.

The way in which the winget.exe is called is from a standard System.Diagnostics.Process instance, without anything weird going on.

My best guess is a misconfiguration with system permissions, since the only change I have done is calling the system winget.exe instead of the bundled winget.exe WingetUI used to use.

marticliment commented 1 day ago

The relevant issue on UniGetUI is https://github.com/marticliment/UniGetUI/issues/2444

hspindel commented 1 day ago

@marticliment, let The way in which the winget.exe is called is from a standard System.Diagnostics.Process instance, without anything weird going on.

My best guess is a misconfiguration with system permissions, since the only change I have done is calling the system winget.exe instead of the bundled winget.exe WingetUI used to use.

Is there any way we can get a config option for UniGetUI to call the bundled winget it used to use? When I try that winget.exe from a command line, it successfully reports a version number instead of "access is denied" with the new version.

hspindel commented 1 day ago

@hspindel do you get any results if you run winget --info? If you do, can you share them?

I get "access is denied" if I run winget from a command line. However, if I use the winget.exe that came bundled with UniGetUI from a command line it works.

D:\Program Files\UniGetUI\winget-cli_x64>winget --info
Windows Package Manager v1.8.1791
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.19045.4529
System Architecture: X64

Winget Directories
---------------------------------------------------------------------------------------------------
Logs                               %TEMP%\WinGet\defaultState
User Settings                      %LOCALAPPDATA%\Microsoft\WinGet\Settings\defaultState\settings.…
Portable Links Directory (User)    %LOCALAPPDATA%\Microsoft\WinGet\Links
Portable Links 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 https://www.microsoft.com/en-us/storedocs/terms-of-sale

Admin Setting                             State
--------------------------------------------------
LocalManifestFiles                        Disabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride                     Disabled
LocalArchiveMalwareScanOverride           Disabled
ProxyCommandLineOptions                   Disabled
DefaultProxy                              Disabled

D:\Program Files\UniGetUI\winget-cli_x64>
marticliment commented 22 hours ago

@marticliment, let The way in which the winget.exe is called is from a standard System.Diagnostics.Process instance, without anything weird going on.

My best guess is a misconfiguration with system permissions, since the only change I have done is calling the system winget.exe instead of the bundled winget.exe WingetUI used to use.

Is there any way we can get a config option for UniGetUI to call the bundled winget it used to use? When I try that winget.exe from a command line, it successfully reports a version number instead of "access is denied" with the new version.

If you add the UniGetUI bundled winget to path and temporarily remove system winget from path (you can do so from settings) you should be able to test this

hspindel commented 4 hours ago

@marticliment

If you add the UniGetUI bundled winget to path and temporarily remove system winget from path (you can do so from settings) you should be able to test this

This turned out to be more of an adventure than I expected. Documenting here in case it helps someone else.

  1. Can't remove system winget from path. Other apps in the same directory need to be in the path.
  2. Can't add path to UniGetUI's winget.exe to system path first entry (overriding existing path) because the System Path is out of space.
  3. Can't delete winget.exe from the system location. It's a special file called an app alias. Wanted to delete the system winget.exe and replace with UniGetUI's winget.exe, but no go.

Eventual solution that works:

  1. Go to PC Settings/Apps.
  2. Click on App Execution Aliases.
  3. Unselect Windows Package Manager Client. When you do this, winget.exe disappears from the system location.
  4. Open a command window and run winget. Verify that Windows reports app not found.
  5. Edit my personal environment PATH (which has plenty of free space) and add the path to UniGetUI's version of winget.exe.
  6. Open a command window and run winget. Verify that it executes properly.
  7. Run UniGetUI. All is well!