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.3k stars 422 forks source link

[BUG] System winget.exe dependency used even though UniGetUI not set to do so #2375

Closed redactedscribe closed 3 months ago

redactedscribe commented 3 months 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

When running UniGetUI I get the popup:

WingetUI_2024-07-01_16-18-57

but as you can see by the logs below, it is found.

The experimental setting is not enabled to use the system WinGet. Also, the %LOCALAPPDATA%\UniGetUI dir does not contain the file which (I believe) tells UniGetUI to use the system WinGet or not.

Steps to reproduce the issue

Before installing beta 1, I uninstalled beta 0 and deleted my %LOCALAPPDATA%\UniGetUI dir to have a clean start.

UniGetUI Log

[01/07/2024 16:24:26] ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
                      █▀▀▀▀▀▀▀▀▀▀▀▀▀ 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)

...

[01/07/2024 16:24:33] Dependency Microsoft.WinGet.Client was not found for manager Winget, installing...

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 16:30:11
Process end time:   01/07/2024 16:30:11

-- Task information
 ...

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 16:30:15
Process end time:   01/07/2024 16:30:17

-- Process STDOUT
 ...

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 16:30:15
Process end time:   01/07/2024 16:30:19

-- Process STDIN
 ...

-- Process STDOUT
 ...

-- 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 16:30:16
Process end time:   01/07/2024 16:30:16

-- Task information
 ...

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 16:30:17
Process end time:   01/07/2024 16:30:20

-- Process STDIN
 ...

-- Process STDOUT
 ...

-- 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)

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

Relevant information

No response

Screenshots and videos

No response

marticliment commented 3 months ago

After installing, is the popup still showing up?

marticliment commented 3 months ago

I have just fixed the .NET Tool Outdated, this was an issue whith .net being misdetected when it is not installed.

But the WinGet one didn't appear again, right?

redactedscribe commented 3 months ago

I have not attempted to install WinGet using this dependency popup. Because 1.) The logs say winget.exe was found, 2.) I know WinGet is on my system and in my PATH. I don't need another copy of WinGet to be installed.

I can tell pressing install if you need...

marticliment commented 3 months ago

No, WinGet is not thr requirement, but the WinGet PowerShell Module

marticliment commented 3 months ago

Please try to install and check if it asks for it again

redactedscribe commented 3 months ago

Install button results in PowerShell console window with:

Install-Module : Administrator rights are required to install modules in 'C:\Program Files\WindowsPowerShell\Modules'.
Log on to the computer with an account that has Administrator rights, and then try again, or install
'C:\Users\User\Documents\WindowsPowerShell\Modules' by adding "-Scope CurrentUser" to your command. You can also try
running the Windows PowerShell session with elevated rights (Run as Administrator).
At line:1 char:4
+ & {Install-Module -Name Microsoft.WinGet.Client -Force -Confirm:$fals ...
+    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Install-Module], ArgumentException
    + FullyQualifiedErrorId : InstallModuleNeedsCurrentUserScopeParameterForNonAdminUser,Install-Module

Press Enter to continue...:

After closing the console, UniGetUI claims it was installed successfully, but it wasn't. Restarting UniGetUI shows the same dependency popup again, so at least it is still aware that it's not installed.

If you can please add a small explanation as to what these dependencies are. E.g. "UniGetUI needs the WinGet PowerShell module to be able to X, please install it". For some reason I wrongly presumed that this was winget.exe itself.

marticliment commented 3 months ago

The issues you were facing should be fixed now

redactedscribe commented 3 months ago

@marticliment Will this explain / fix why the logs (above) say winget.exe was found (D:\Scoop\shims\winget.exe), even though the option to use the system winget.exe is disabled?

WingetUI_2024-07-01_17-42-38

(I think this issue contained two issues I should've separated.)

marticliment commented 3 months ago

This option is old, and I have not removed it yet, but it has no effect currently.

redactedscribe commented 3 months ago

Does that mean a sytem winget.exe will be required in the future? Or will a system winget.exe be automatically be used if it is found. Or, only a bundled winget.exe can be used? We have the option to choose a system GSudo for example. Either way, I hope we can still use a system winget.exe in the future.

Thanks for the fixes.

marticliment commented 3 months ago

System WinGet will always be used. In fact, bundled WinGet is still present for compatibility reasons with fetching package installer details, but once I can sort this issue out UniGetUI will not bundle WinGet anymore.