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
10.62k stars 348 forks source link

[BUG] No WinGet packages shown in Software Updates / Installed Packages tabs #2382

Closed redactedscribe closed 2 weeks ago

redactedscribe commented 3 weeks ago

Please confirm these before moving forward

UniGetUI Version

3.1.0 beta 1

Windows version, edition and architecture

Windows 11 Pro

Describe your issue

There are some similar open issues but I'm not sure if they're actually the same problem.

For some reason, no WinGet packages show in the Software Updates tab or the Installed Packages tab, even though UniGetUI says Winget is enabled and ready to go (i.e. it's found). Both tabs' Sources section list Npm, Pip, Scoop, etc, but not Winget. There are no open winget*.exe processes to quit as you suggested in another issue. Refreshing the updates/installed tabs does not reveal the WinGet packages either. I don't know any way to cause them to be shown.

Could this be related to the missing WinGet PowerShell Module as see in the screenshot from #2375?

I could run Install-Module Microsoft.WinGet.Client but then I won't be able to test the fix from the just mentioned issue when beta 2 releases (if another beta is coming).

I noticed that there's a reset sources button in the UniGetUI's WinGet settings. I ran it thinking it may help and it produced this:

The system cannot find the path specified.
Info: Elevation allowed for process Id 14320 and children.
Warning: Cache is a security risk. Use `gsudo cache off` (or `-k`) to go back to safety.
This script will reset winget sources.
. Please wait...
winget path: "C:\Program Files\UniGetUI\Assets\Utilities\..\..\winget-cli_x64\winget.exe"
Deleting Winget local data sources...
Performing reset...
Resetting bundled WinGet
Removing source: winget...
Done
Adding source:
  winget -> https://cdn.winget.microsoft.com/cache
  ██████████████████████████████  5.77 MB / 5.77 MB
Done
Resetting all sources...Done
Resetting Native WinGet
Removing source: winget...
Done
Adding source:
  winget -> https://cdn.winget.microsoft.com/cache
  ██████████████████████████████  5.77 MB / 5.77 MB
Done
Resetting all sources...Done
Info: Cache session closed.
Task completed!
You can now close this window and restart UniGetUI
Press any key to continue . . .

The The system cannot find the path specified line looks fishy.

Steps to reproduce the issue

Unsure.

UniGetUI Log

[01/07/2024 21:21:50] ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
                      █▀▀▀▀▀▀▀▀▀▀▀▀▀ MANAGER LOADED ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
                      █ Name: Winget
                      █ Enabled: True
                      █ Found: True
                      █ Fancye exe name: winget.exe
                      █ Executable path: D:\Scoop\shims\winget.exe
                      █ Call arguments: 
                      █ Version: 
                      █   Naive WinGet CLI Version: v1.7.11261
                      █   Microsoft.WinGet.Client PSModule version: 
                      █   Using Native WinGet helper (COM Api)
                      ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

Package Managers Logs

Manager Winget with version:
Naive WinGet CLI Version: v1.7.11261
Microsoft.WinGet.Client PSModule version: 
Using Native WinGet helper (COM Api)

——————————————————————————————————————————

Logged native task on manager Winget. Task type is ListSources
Process start time: 01/07/2024 21:47:37
Process end time:   01/07/2024 21:47:37

-- Task information
  Found source msstore with argument https://storeedgefd.dsx.mp.microsoft.com/v9.0
  Found source winget with argument https://cdn.winget.microsoft.com/cache

The task reported success

——————————————————————————————————————————

Logged subprocess-based task on manager Winget. Task type is RefreshIndexes
Subprocess executable: "D:\Scoop\shims\winget.exe"
Command-line arguments: " source update --disable-interactivity"
Process start time: 01/07/2024 21:47:41
Process end time:   01/07/2024 21:47:43

-- Process STDOUT
  Updating all sources...
  Updating source: msstore...
  Done
  Updating source: winget...

   - 
   \ 
   | 

Done

Return code: SUCCESS (0)

——————————————————————————————————————————

Logged subprocess-based task on manager Winget. Task type is ListPackages
Subprocess executable: "C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe"
Command-line arguments: "-ExecutionPolicy Bypass -NoLogo -NoProfile"
Process start time: 01/07/2024 21:47:41
Process end time:   01/07/2024 21:47:45

-- Process STDIN
  Write-Output (Get-Module -Name Microsoft.WinGet.Client).Version
  Import-Module Microsoft.WinGet.Client
  function Print-WinGetPackage {
      param (
          [Parameter(Mandatory,ValueFromPipelineByPropertyName)] [string] $Name,
          [Parameter(Mandatory,ValueFromPipelineByPropertyName)] [string] $Id,
          [Parameter(Mandatory,ValueFromPipelineByPropertyName)] [string] $InstalledVersion,
          [Parameter(ValueFromPipelineByPropertyName)] [string[]] $AvailableVersions,
          [Parameter(Mandatory,ValueFromPipelineByPropertyName)] [bool] $IsUpdateAvailable,
          [Parameter(ValueFromPipelineByPropertyName)] [string] $Source
      )
      process {
          Write-Output("#" + $Name + "`t" + $Id + "`t" + $InstalledVersion + "`t" + $Source)
      }
  }

  Get-WinGetPackage | Print-WinGetPackage

  exit

-- Process STDOUT
  PS C:\Program Files\UniGetUI> Write-Output (Get-Module -Name Microsoft.WinGet.Client).Version
  PS C:\Program Files\UniGetUI> Import-Module Microsoft.WinGet.Client
  PS C:\Program Files\UniGetUI> function Print-WinGetPackage {
  >>     param (
  >>         [Parameter(Mandatory,ValueFromPipelineByPropertyName)] [string] $Name,
  >>         [Parameter(Mandatory,ValueFromPipelineByPropertyName)] [string] $Id,
  >>         [Parameter(Mandatory,ValueFromPipelineByPropertyName)] [string] $InstalledVersion,
  >>         [Parameter(ValueFromPipelineByPropertyName)] [string[]] $AvailableVersions,
  >>         [Parameter(Mandatory,ValueFromPipelineByPropertyName)] [bool] $IsUpdateAvailable,
  >>         [Parameter(ValueFromPipelineByPropertyName)] [string] $Source
  >>     )
  >>     process {
  >>         Write-Output("#" + $Name + "`t" + $Id + "`t" + $InstalledVersion + "`t" + $Source)
  >>     }
  >> }
  >> 
  PS C:\Program Files\UniGetUI> Get-WinGetPackage | Print-WinGetPackage
  PS C:\Program Files\UniGetUI> 
  PS C:\Program Files\UniGetUI> 
  PS C:\Program Files\UniGetUI> exit

-- Process STDERR
  Write-Output : The term 'Write-Output' is not recognized as the name of a cmdlet, function, script file, or 
  operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try 
  again.
  At line:1 char:1
  + Write-Output (Get-Module -Name Microsoft.WinGet.Client).Version
  + ~~~~~~~~~~~~~~~
      + CategoryInfo          : ObjectNotFound: (Write-Output:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException

  Import-Module : The specified module 'Microsoft.WinGet.Client' was not loaded because no valid module file was found 
  in any module directory.
  At line:1 char:1
  + Import-Module Microsoft.WinGet.Client
  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : ResourceUnavailable: (Microsoft.WinGet.Client:String) [Import-Module], FileNotFoundExcep 
     tion
      + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

  Get-WinGetPackage : The term 'Get-WinGetPackage' is not recognized as the name of a cmdlet, function, script file, or 
  operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try 
  again.
  At line:1 char:1
  + Get-WinGetPackage | Print-WinGetPackage
  + ~~~~~~~~~~~~~~~~~
      + CategoryInfo          : ObjectNotFound: (Get-WinGetPackage:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException

Return code: SUCCESS (0)

——————————————————————————————————————————

Logged native task on manager Winget. Task type is ListSources
Process start time: 01/07/2024 21:47:42
Process end time:   01/07/2024 21:47:43

-- Task information
  Found source msstore with argument https://storeedgefd.dsx.mp.microsoft.com/v9.0
  Found source winget with argument https://cdn.winget.microsoft.com/cache

The task reported success

——————————————————————————————————————————

Logged subprocess-based task on manager Winget. Task type is ListUpdates
Subprocess executable: "C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe"
Command-line arguments: "-ExecutionPolicy Bypass -NoLogo -NoProfile"
Process start time: 01/07/2024 21:47:43
Process end time:   01/07/2024 21:47:46

-- Process STDIN
  Write-Output (Get-Module -Name Microsoft.WinGet.Client).Version
  Import-Module Microsoft.WinGet.Client
  function Print-WinGetPackage {
      param (
          [Parameter(Mandatory,ValueFromPipelineByPropertyName)] [string] $Name,
          [Parameter(Mandatory,ValueFromPipelineByPropertyName)] [string] $Id,
          [Parameter(Mandatory,ValueFromPipelineByPropertyName)] [string] $InstalledVersion,
          [Parameter(ValueFromPipelineByPropertyName)] [string[]] $AvailableVersions,
          [Parameter(Mandatory,ValueFromPipelineByPropertyName)] [bool] $IsUpdateAvailable,
          [Parameter(ValueFromPipelineByPropertyName)] [string] $Source
      )
      process {
          if($IsUpdateAvailable)
          {
              Write-Output("#" + $Name + "`t" + $Id + "`t" + $InstalledVersion + "`t" + $AvailableVersions[0] + "`t" + $Source)
          }
      }
  }

  Get-WinGetPackage | Print-WinGetPackage

  exit

-- Process STDOUT
  PS C:\Program Files\UniGetUI> Write-Output (Get-Module -Name Microsoft.WinGet.Client).Version
  PS C:\Program Files\UniGetUI> Import-Module Microsoft.WinGet.Client
  PS C:\Program Files\UniGetUI> function Print-WinGetPackage {
  >>     param (
  >>         [Parameter(Mandatory,ValueFromPipelineByPropertyName)] [string] $Name,
  >>         [Parameter(Mandatory,ValueFromPipelineByPropertyName)] [string] $Id,
  >>         [Parameter(Mandatory,ValueFromPipelineByPropertyName)] [string] $InstalledVersion,
  >>         [Parameter(ValueFromPipelineByPropertyName)] [string[]] $AvailableVersions,
  >>         [Parameter(Mandatory,ValueFromPipelineByPropertyName)] [bool] $IsUpdateAvailable,
  >>         [Parameter(ValueFromPipelineByPropertyName)] [string] $Source
  >>     )
  >>     process {
  >>         if($IsUpdateAvailable)
  >>         {
  >>             Write-Output("#" + $Name + "`t" + $Id + "`t" + $InstalledVersion + "`t" + $AvailableVersions[0] + "`t" + $Source)
  >>         }
  >>     }
  >> }
  >> 
  PS C:\Program Files\UniGetUI> Get-WinGetPackage | Print-WinGetPackage
  PS C:\Program Files\UniGetUI> 
  PS C:\Program Files\UniGetUI> exit

-- Process STDERR
  Write-Output : The term 'Write-Output' is not recognized as the name of a cmdlet, function, script file, or 
  operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try 
  again.
  At line:1 char:1
  + Write-Output (Get-Module -Name Microsoft.WinGet.Client).Version
  + ~~~~~~~~~~~~~~~
      + CategoryInfo          : ObjectNotFound: (Write-Output:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException

  Import-Module : The specified module 'Microsoft.WinGet.Client' was not loaded because no valid module file was found 
  in any module directory.
  At line:1 char:1
  + Import-Module Microsoft.WinGet.Client
  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : ResourceUnavailable: (Microsoft.WinGet.Client:String) [Import-Module], FileNotFoundExcep 
     tion
      + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

  Get-WinGetPackage : The term 'Get-WinGetPackage' is not recognized as the name of a cmdlet, function, script file, or 
  operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try 
  again.
  At line:1 char:1
  + Get-WinGetPackage | Print-WinGetPackage
  + ~~~~~~~~~~~~~~~~~
      + CategoryInfo          : ObjectNotFound: (Get-WinGetPackage:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException

Return code: SUCCESS (0)

——————————————————————————————————————————

Logged subprocess-based task on manager Winget. Task type is RefreshIndexes
Subprocess executable: "D:\Scoop\shims\winget.exe"
Command-line arguments: " source update --disable-interactivity"
Process start time: 01/07/2024 21:49:07
Process end time:   01/07/2024 21:49:09

-- Process STDOUT
  Updating all sources...
  Updating source: msstore...
  Done
  Updating source: winget...

   - 
   \ 
   | 

Done

Return code: SUCCESS (0)

——————————————————————————————————————————

Logged subprocess-based task on manager Winget. Task type is ListUpdates
Subprocess executable: "C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe"
Command-line arguments: "-ExecutionPolicy Bypass -NoLogo -NoProfile"
Process start time: 01/07/2024 21:49:09
Process end time:   01/07/2024 21:49:11

-- Process STDIN
  Write-Output (Get-Module -Name Microsoft.WinGet.Client).Version
  Import-Module Microsoft.WinGet.Client
  function Print-WinGetPackage {
      param (
          [Parameter(Mandatory,ValueFromPipelineByPropertyName)] [string] $Name,
          [Parameter(Mandatory,ValueFromPipelineByPropertyName)] [string] $Id,
          [Parameter(Mandatory,ValueFromPipelineByPropertyName)] [string] $InstalledVersion,
          [Parameter(ValueFromPipelineByPropertyName)] [string[]] $AvailableVersions,
          [Parameter(Mandatory,ValueFromPipelineByPropertyName)] [bool] $IsUpdateAvailable,
          [Parameter(ValueFromPipelineByPropertyName)] [string] $Source
      )
      process {
          if($IsUpdateAvailable)
          {
              Write-Output("#" + $Name + "`t" + $Id + "`t" + $InstalledVersion + "`t" + $AvailableVersions[0] + "`t" + $Source)
          }
      }
  }

  Get-WinGetPackage | Print-WinGetPackage

  exit

-- Process STDOUT
  PS C:\Program Files\UniGetUI> Write-Output (Get-Module -Name Microsoft.WinGet.Client).Version
  PS C:\Program Files\UniGetUI> Import-Module Microsoft.WinGet.Client
  PS C:\Program Files\UniGetUI> function Print-WinGetPackage {
  >>     param (
  >>         [Parameter(Mandatory,ValueFromPipelineByPropertyName)] [string] $Name,
  >>         [Parameter(Mandatory,ValueFromPipelineByPropertyName)] [string] $Id,
  >>         [Parameter(Mandatory,ValueFromPipelineByPropertyName)] [string] $InstalledVersion,
  >>         [Parameter(ValueFromPipelineByPropertyName)] [string[]] $AvailableVersions,
  >>         [Parameter(Mandatory,ValueFromPipelineByPropertyName)] [bool] $IsUpdateAvailable,
  >>         [Parameter(ValueFromPipelineByPropertyName)] [string] $Source
  >>     )
  >>     process {
  >>         if($IsUpdateAvailable)
  >>         {
  >>             Write-Output("#" + $Name + "`t" + $Id + "`t" + $InstalledVersion + "`t" + $AvailableVersions[0] + "`t" + $Source)
  >>         }
  >>     }
  >> }
  >> 
  PS C:\Program Files\UniGetUI> Get-WinGetPackage | Print-WinGetPackage
  PS C:\Program Files\UniGetUI> 
  PS C:\Program Files\UniGetUI> exit

-- Process STDERR
  Write-Output : The term 'Write-Output' is not recognized as the name of a cmdlet, function, script file, or 
  operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try 
  again.
  At line:1 char:1
  + Write-Output (Get-Module -Name Microsoft.WinGet.Client).Version
  + ~~~~~~~~~~~~~~~
      + CategoryInfo          : ObjectNotFound: (Write-Output:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException

  Import-Module : The specified module 'Microsoft.WinGet.Client' was not loaded because no valid module file was found 
  in any module directory.
  At line:1 char:1
  + Import-Module Microsoft.WinGet.Client
  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : ResourceUnavailable: (Microsoft.WinGet.Client:String) [Import-Module], FileNotFoundExcep 
     tion
      + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

  Get-WinGetPackage : The term 'Get-WinGetPackage' is not recognized as the name of a cmdlet, function, script file, or 
  operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try 
  again.
  At line:1 char:1
  + Get-WinGetPackage | Print-WinGetPackage
  + ~~~~~~~~~~~~~~~~~
      + CategoryInfo          : ObjectNotFound: (Get-WinGetPackage:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException

Return code: SUCCESS (0)

——————————————————————————————————————————

Logged native task on manager Winget. Task type is FindPackages
Process start time: 01/07/2024 21:50:04
Process end time:   01/07/2024 21:50:08

-- Task information
  Generating filters...
  Loading available catalogs...
  Spawning catalog fetching tasks...
  Begin search on catalog msstore
  Begin search on catalog winget
  All catalogs fetched. Fetching results for query piece Firefox
  Found package: Mozilla Firefox|9NZVDKPMR9RD|Unknown on catalog msstore
  Found package: Profile Switcher for Firefox Connector|nulldev.ProfileSwitcherforFirefox|0.1.1 on catalog winget
  Found package: Firefox Nightly|Mozilla.Firefox.Nightly|116.0a1 on catalog winget
  Found package: Mozilla Firefox ESR|Mozilla.Firefox.ESR|115.12.0 on catalog winget
  Found package: Firefox Developer Edition|Mozilla.Firefox.DeveloperEdition|128.0 on catalog winget
  Found package: Mozilla Firefox|Mozilla.Firefox|127.0.2 on catalog winget
  Found package: PWAsForFirefox|filips.FirefoxPWA|2.12.1 on catalog winget

The task reported success

——————————————————————————————————————————

Relevant information

The Write-Output : The term 'Write-Output' is not recognized from WinGet's logs above might also be part of the problem. The end of the WinGet log shows a package discovery search for Firefox. The Discover Packages tab is the only tab which lists any WinGet packages. WinGet packages are completely missing from the other tabs.

At first there was a firewall issue as WinGet packages weren't even shown in the Discover Packages tab, but now that I solved that, that tab has no WinGet issues.

Screenshots and videos

No response

marticliment commented 3 weeks ago

The Write-Output line error can be safely ignored. See here for more info: https://github.com/marticliment/WingetUI/issues/2379

It looks as if your Microsoft.WinGet.Client module is broken. Please try to

Uninstall-Module Microsoft.WinGet.Client

until it complains the module is not installed (this can take two or three times) and then

Install-Module Microsoft.WinGet.Client
redactedscribe commented 3 weeks ago
> Uninstall-Module Microsoft.WinGet.Client
Uninstall-Package: No match was found for the specified search criteria and module names 'Microsoft.WinGet.Client'.
> Uninstall-Module Microsoft.WinGet.Client
Uninstall-Package: No match was found for the specified search criteria and module names 'Microsoft.WinGet.Client'.
> Uninstall-Module Microsoft.WinGet.Client
Uninstall-Package: No match was found for the specified search criteria and module names 'Microsoft.WinGet.Client'.
> Uninstall-Module Microsoft.WinGet.Client
Uninstall-Package: No match was found for the specified search criteria and module names 'Microsoft.WinGet.Client'.
> Uninstall-Module Microsoft.WinGet.Client
Uninstall-Package: No match was found for the specified search criteria and module names 'Microsoft.WinGet.Client'.

It's simply not installed in the first place I think. Remember the missing Microsoft.WinGet.Client dependency screenshot from #2375? I can install it.

After installing, I still see the missing dependency screenshot, and there still aren't any WinGet packages listed on the updates/installed tabs. I restarted UniGetUI after installing the module.

marticliment commented 2 weeks ago

When clicking on install, presumably a command prompt window should launch. What does it say?

marticliment commented 2 weeks ago

Please try to run UniGetUI as admin and see if the dependency gets installed

redactedscribe commented 2 weeks ago

When clicking on install, presumably a command prompt window should launch. What does it say?

It says the console output Install-Module : Administrator rights are required to install modules in 'C:\Program Files\WindowsPowerShell\Modules'. etc.

UniGetUI as admin:

An admin console launches and installs the dependency correctly. Now re-running UniGetUI without admin privileges no longer shows the dependency popup. Good.

I see where the problem occurred:

  1. UniGetUI needed admin rights.
  2. When I ran Install-Module Microsoft.WinGet.Client as admin in a PowerShell console, I used PowerShell Core, not Windows PowerShell, and therefore it did not take effect, for whatever reason. I know this because running Uninstall-Module Microsoft.WinGet.Client in Windows PowerShell makes the dependency popup re-appear, and the the Install... command via Windows PowerShell makes it go away again.

When asking others to run Install-Module Microsoft.WinGet.Client make sure to specify using Windows PowerShell as admin. (apologies if you did specify Windows PowerShell specifically, I might have overlooked that detail.)

Thanks.

redactedscribe commented 2 weeks ago

Also, now WinGet packages are showing in the Software Updates and Installed Packages tabs! This has resolved the issue.

marticliment commented 2 weeks ago

Then, this issue was fixed on https://github.com/marticliment/WingetUI/commit/c6b4fbe306e7163ce88dc13d31ae34dbd478d827

redactedscribe commented 2 weeks ago

Hello @marticliment. Just to confirm that the fix has worked via this test: I closed UniGetUI, manually ran Uninstall-Module Microsoft.WinGet.Client using Windows PowerShell as admin, installed Beta 2, the dependency popup triggered again (expected), I pressed install and the WinGet module installed successfully. Restarted UniGetUI and no more dependency popup. Thanks again!

marticliment commented 2 weeks ago

Great!