marticliment / UniGetUI

UniGetUI: The Graphical Interface for your package managers. Could be terribly described as a package manager manager to manage your package managers
https://www.marticliment.com/unigetui/
MIT License
12.29k stars 422 forks source link

[BUG] UniGetUI no longer sees any updates. #2444

Closed hspindel closed 2 months ago

hspindel commented 3 months ago

Please confirm these before moving forward

UniGetUI Version

3.1.0

Windows version, edition, and architecture

Win 10

Describe 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:

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

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

Steps to reproduce the issue

Run UniGetUI.

UniGetUI Log

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

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

Package Managers Logs

No data.

Relevant information

winget --info reports access denied.

Screenshots and videos

No response

marticliment commented 3 months ago

Please test this release: https://github.com/marticliment/UniGetUI/releases/tag/3.1.1-beta0

EDM115 commented 3 months ago

@marticliment on versions previous to 3.1, using system's WinGet was not recommended if the system language wasn't set to English (ex mine which is french)
I believe it's because you need to parse the outputs, but why does this changed for 3.1 ? I see that you re-bundle WinGet again on latest beta but I'm curious to see why you decided to remove this requirement in the first place

marticliment commented 3 months ago

The full WinGet on WingetUI story:

  1. To parse outputs, WinGet-Cli does not provide an "easily" parseable output, so the headers must be used to understand where each piece of information starts and where it ends. Then, until languages were introduced, System WinGet was used. (we are talking a long time ago, versions 0.X).
  2. However, when languages were introduced, I had to provide a stripped version of WinGet without languages (the bundled WinGet) so the output could be parsed. The issue is that WinGet is not really designed to have multiple versions running in parallel, and this led to issues with Database Corruption. (see #1721 and the related issues). Furthermore, WinGet would need to be updated with WingetUI manually. A parameter for WinGet to disable localization was asked for, but it is not a thing yet. (https://github.com/microsoft/winget-cli/issues/3581). Furthermore, issues with long package names and ids being cut out also caused errors when it came to installing and uninstalling packages, and getting exact package details
  3. Then, Microsoft started developing the WinGet COM APIs. I got helped by someone from the WinGet team with integrating the COM APIs into WingetUI. Basically, you can connect to WinGet natively via COM (an inter-process comunication system on Windows). Using the COM APIs is more reliable (no parsing errors nor broken encodings) and faster (no need to analyze CLI output, a very cpu-intensive task) method of retrieving packages. They are, in fact, great. Searching packages is very fast, and retrieving package details is even faster. However, WinGet COM APIs are not yet polished enough to be used on certain parts of WingetUI/UniGetUI (see https://github.com/microsoft/winget-cli/issues/4320 and https://github.com/microsoft/winget-cli/issues/4377). Therefore, an alternative had to be found.
  4. Then, I attempted to implement those missing pieces that wouldn't work with the COM APIs (retrieving updates and installed packages) with the Microsoft.WinGet.Client PowerShell Module. The module is great, and with a little bit of PS scripting packages can be easily extracted and then parsed from C#. However, the PowerShell module needs to be installed on the user's system, and this can be sometimes an issue (company policies about Powershell scripting, broken/modified windows installs, PowerShell 5 and 7 interfiering with eachother, etc.).
  5. So I had to resort to reintroducing the less-reliable bundled WinGet as a last resort. The idea is to move towards a fully-COM integration, but meanwhile, PowerShell parsing will be the default method, and if it fails, the bundled WinGet will kick in.
EDM115 commented 3 months ago

thanks for these infos, really cool to see the thought process behind this ❤️
also good luck, this really doesn't seem easy

hspindel commented 3 months ago

Please test this release: https://github.com/marticliment/UniGetUI/releases/tag/3.1.1-beta0

Thank you. The results are the same with that version as previously reported.

marticliment commented 3 months ago

@hspindel , please share package manager logs with the new version

hspindel commented 3 months ago

UniGetUI log:

[7/6/2024 5:12:44 PM]    __  __      _ ______     __  __  ______
                        / / / /___  (_) ____/__  / /_/ / / /  _/
                       / / / / __ \/ / / __/ _ \/ __/ / / // /  
                      / /_/ / / / / / /_/ /  __/ /_/ /_/ // /   
                      \____/_/ /_/_/\____/\___/\__/\____/___/   
                          Welcome to UniGetUI Version 3.11
[7/6/2024 5:12:44 PM]
[7/6/2024 5:12:44 PM] Version Code:  3.109
[7/6/2024 5:12:45 PM] Encoding Code Page set to 437
[7/6/2024 5:12:45 PM] Using bundled GSudo at D:\Program Files\UniGetUI\Assets\Utilities\gsudo.exe
[7/6/2024 5:12:45 PM] Loaded language locale: en
[7/6/2024 5:12:46 PM] Randomly-generated background API auth token for the current session: oeexmai1ywx2somyhzirxpoiorg2ub9q7mllc3674ls7t9p5zolw1nu1znsur7k4
[7/6/2024 5:12:47 PM] Api running on http://localhost:7058
[7/6/2024 5:12:48 PM] Lang files were updated successfully from GitHub
[7/6/2024 5:12:48 PM] UniGetUI is up to date
[7/6/2024 5:12:48 PM] Downloaded new icons and screenshots successfully!
[7/6/2024 5:12:48 PM] Could not initialize Package Manager Winget
[7/6/2024 5:12:48 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 522
                         at UniGetUI.PackageEngine.ManagerClasses.Manager.PackageManager.InitializeAsync() in C:\SomePrograms\WingetUI-Store\src\UniGetUI.PackageEngine.PackageManagerClasses\Manager\PackageManager.cs:line 76
[7/6/2024 5:12:48 PM] Command npm was not found on the system
[7/6/2024 5:12:48 PM] ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
                      █▀▀▀▀▀▀▀▀▀▀▀▀▀ MANAGER LOADED ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
                      █ Name: Npm
                      █ Enabled: False
                      █ THE MANAGER IS DISABLED
                      ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
[7/6/2024 5:12:49 PM] ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
                      █▀▀▀▀▀▀▀▀▀▀▀▀▀ MANAGER LOADED ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
                      █ Name: Pip
                      █ Enabled: False
                      █ THE MANAGER IS DISABLED
                      ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
[7/6/2024 5:12:49 PM] Command scoop was not found on the system
[7/6/2024 5:12:49 PM] ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
                      █▀▀▀▀▀▀▀▀▀▀▀▀▀ MANAGER LOADED ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
                      █ Name: Scoop
                      █ Enabled: False
                      █ THE MANAGER IS DISABLED
                      ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
[7/6/2024 5:12:49 PM] ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
                      █▀▀▀▀▀▀▀▀▀▀▀▀▀ MANAGER LOADED ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
                      █ Name: .NET Tool
                      █ Enabled: True
                      █ Found: True
                      █ Fancye exe name: dotnet tool
                      █ Executable path: C:\Program Files\dotnet\dotnet.exe
                      █ Call arguments: tool
                      █ Version: 
                      █   8.0.302
                      ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
[7/6/2024 5:12:52 PM] ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
                      █▀▀▀▀▀▀▀▀▀▀▀▀▀ MANAGER LOADED ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
                      █ Name: Chocolatey
                      █ Enabled: True
                      █ Found: True
                      █ Fancye exe name: choco.exe
                      █ Executable path: C:\Users\howard\AppData\Local\UniGetUI\Chocolatey\choco.exe
                      █ Call arguments: 
                      █ Version: 
                      █   2.2.2
                      ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
[7/6/2024 5:12:52 PM] ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
                      █▀▀▀▀▀▀▀▀▀▀▀▀▀ MANAGER LOADED ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
                      █ Name: PowerShell
                      █ Enabled: True
                      █ Found: True
                      █ Fancye exe name: powershell.exe
                      █ Executable path: C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe
                      █ Call arguments:  -NoProfile -Command
                      █ Version: 
                      █   Name                           Value                                                                                   
                      █   ----                           -----                                                                                   
                      █   PSVersion                      5.1.19041.4522                                                                          
                      █   PSEdition                      Desktop                                                                                 
                      █   PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                 
                      █   BuildVersion                   10.0.19041.4522                                                                         
                      █   CLRVersion                     4.0.30319.42000                                                                         
                      █   WSManStackVersion              3.0                                                                                     
                      █   PSRemotingProtocolVersion      2.3                                                                                     
                      █   SerializationVersion           1.1.0.1
                      ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
[7/6/2024 5:12:54 PM] Dependency .NET Tools Outdated for manager .NET Tool is present
[7/6/2024 5:12:54 PM] LoadComponentsAsync finished executing. All managers loaded. Proceeding to interface.
[7/6/2024 5:12:55 PM] Found 1 installed packages from .NET Tool
[7/6/2024 5:12:56 PM] Found 0 available updates from .NET Tool
[7/6/2024 5:12:56 PM] Found 6 installed packages from Chocolatey
[7/6/2024 5:12:57 PM] Found 0 available updates from Chocolatey
[7/6/2024 5:12:57 PM] Found 1 installed packages from PowerShell
[7/6/2024 5:12:59 PM] Found 0 available updates from PowerShell

Package manager log:

`No content at all.`
marticliment commented 3 months ago

[7/6/2024 5:12:48 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 522 at UniGetUI.PackageEngine.ManagerClasses.Manager.PackageManager.InitializeAsync() in C:\SomePrograms\WingetUI-Store\src\UniGetUI.PackageEngine.PackageManagerClasses\Manager\PackageManager.cs:line 76

Hello @hspindel, do you have a running antivirus? The issue here id your system not allowing UniGetUI to execute WinGet. What happens if you run C:\Users\howard\AppData\Local\Microsoft\WindowsApps\winget.exe on a command prompt?

hspindel commented 3 months ago

Hello @hspindel, do you have a running antivirus? The issue here id your system not allowing UniGetUI to execute WinGet. What happens if you run C:\Users\howard\AppData\Local\Microsoft\WindowsApps\winget.exe on a command prompt?

Thank you for the response. I do have a running antivirus - Norton. I tried disabling it and still get Access is Denied.

I tried running C:\Users\howard\AppData\Local\Microsoft\WindowsApps\winget.exe with the antivirus still disabled and still get Access is Denied.

apoklyps3 commented 2 months ago

I'm getting 0 updates ever since I have updated to unigetui 3.1.0 no issues running winget in the said path

hspindel commented 2 months ago

In the related thread on winget-cli, marticliment mentioned that the new UniGetUI uses a system version of winget instead of previously using a bundled winget.

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.

marticliment commented 2 months ago

I will improve forcing the usage of bundled WinGet

hspindel commented 2 months ago

I will improve forcing the usage of bundled WinGet

Thank you!