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
11.92k stars 396 forks source link

[BUG] Missing whitespace in command to update pip packages + dotnet path not in quotation marks #1809

Closed Girofox closed 6 months ago

Girofox commented 6 months ago

Please confirm these before moving forward

Describe your issue

WingetUI 3.0-alpha1

It seems that the python command has a missing whitespace before "-m" flag. This is the error message I get when trying to update pip packages (with or without admin):

Starting package update operation for package id=docstring-to-markdownwith Manager name=Pip
Given installation options are <InstallationOptions: SkipHashCheck=False;InteractiveInstallation=False;RunAsAdministrator=True;Version=;Architecture=;InstallationScope=;InstallationScope=;CustomParameters=;RemoveDataOnUninstall=False>
Process Executable     : C:\Program Files\WingetUI\Assets\Utilities\gsudo.exe
Process Call Arguments : "C:\Users\USER\AppData\Local\Programs\Python\Python312\python.exe"-m pip install --upgrade docstring-to-markdown --no-input --no-color --no-python-version-warning --no-cache
Working Directory      : C:\Users\USER
Process Start Time     : 21.02.2024 16:24:45
ERR | Der
ERR | Befehl
ERR | "C:\Users\USER\AppData\Local\Programs\Python\Python312\python.exe"-m
ERR | pip
ERR | install
ERR | --upgrade
ERR | docstring-to-markdown
ERR | --no-input
ERR | --no-color
ERR | --no-python-version-warning
ERR | --no-cache"
ERR | ist
ERR | entweder
ERR | falsch
ERR | geschrieben
ERR | oder
konnte
ERR | nicht
ERR | gefunden
ERR | werden.

Process Exit Code      : 1
Process End Time       : 21.02.2024 16:24:47

Another issue is that according to the package manager log the dotnet.exe is not found despite with .NET runtime installed. I definitely have Microsoft Windows .NET Runtime (6, 7 and 8) installed:

[21.02.2024 16:32:08] .NET Tool - Arguments: tool list --global
       Executable: C:\Program Files\dotnet\dotnet.exe

The command could not be loaded, possibly because:
  * You intended to execute a .NET application:
      The application 'tool' does not exist.
  * You intended to execute a .NET SDK command:
      No .NET SDKs were found.
Download a .NET SDK:
https://aka.ms/dotnet/download
Learn about SDK resolution:
https://aka.ms/dotnet/sdk-not-found

Steps to reproduce the issue

Try to update any pip package.

WingetUI Log

C:\Users\USER\AppData\Local\WingetUI\CachedLangFiles\lang_en.json
Loaded language locale: en
Lang files were updated successfully
Downloaded icons and screenshots successfully!
Waiting for manager Winget
Waiting for manager Winget
Waiting for manager Winget
Waiting for manager Winget
Waiting for manager Winget
Waiting for manager Winget
Waiting for manager Winget
Waiting for manager Winget
Waiting for manager Winget
Waiting for manager Winget
Waiting for manager Winget
Winget ready
Scoop ready
Waiting for manager Chocolatey
Waiting for manager Chocolatey
Waiting for manager Chocolatey
Waiting for manager Chocolatey
Waiting for manager Chocolatey
Waiting for manager Chocolatey
Waiting for manager Chocolatey
Waiting for manager Chocolatey
Waiting for manager Chocolatey
Waiting for manager Chocolatey
Waiting for manager Chocolatey
Waiting for manager Chocolatey
Waiting for manager Chocolatey
Waiting for manager Chocolatey
Waiting for manager Chocolatey
Waiting for manager Chocolatey
Waiting for manager Chocolatey
Waiting for manager Chocolatey
Waiting for manager Chocolatey
Waiting for manager Chocolatey
Waiting for manager Chocolatey
Waiting for manager Chocolatey
Waiting for manager Chocolatey
Waiting for manager Chocolatey
Waiting for manager Chocolatey
Waiting for manager Chocolatey
Waiting for manager Chocolatey
Waiting for manager Chocolatey
Waiting for manager Chocolatey
Waiting for manager Chocolatey
Waiting for manager Chocolatey
Waiting for manager Chocolatey
Waiting for manager Chocolatey
Waiting for manager Chocolatey
Waiting for manager Chocolatey
Chocolatey ready
Pip ready
Npm ready
.NET Tool ready
Waiting for manager PowerShell
Waiting for manager PowerShell
Waiting for manager PowerShell
Waiting for manager PowerShell
Waiting for manager PowerShell
Waiting for manager PowerShell
Waiting for manager PowerShell
Waiting for manager PowerShell
Waiting for manager PowerShell
Waiting for manager PowerShell
Waiting for manager PowerShell
Waiting for manager PowerShell
Waiting for manager PowerShell
Waiting for manager PowerShell
Waiting for manager PowerShell
Waiting for manager PowerShell
Waiting for manager PowerShell
Waiting for manager PowerShell
Waiting for manager PowerShell
Waiting for manager PowerShell
Waiting for manager PowerShell
Waiting for manager PowerShell
Waiting for manager PowerShell
Waiting for manager PowerShell
PowerShell ready
PowerShell sources took too long to load, using known sources as default
Error finding updates on manager .NET Tool: 
System.ComponentModel.Win32Exception (2): An error occurred trying to start process 'C:\ThisExe\WasNotFound\InPath\dotnet-tools-outdated.exe' with working directory 'C:\Program Files\WingetUI'. Das System kann die angegebene Datei nicht finden.
   at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at ModernWindow.PackageEngine.Managers.Dotnet.GetAvailableUpdates_UnSafe() in C:\SomePrograms\WingetUI-Store\src\wingetui-interface\PackageEngine\Managers\Dotnet.cs:line 81
   at ModernWindow.PackageEngine.Classes.PackageManager.GetAvailableUpdates() in C:\SomePrograms\WingetUI-Store\src\wingetui-interface\PackageEngine\Classes\Manager.cs:line 97

Package Managers Logs

=========================================
[21.02.2024 16:31:48] Chocolatey - Arguments:  source list
       Executable: C:\Users\USER\AppData\Local\Programs\WingetUI\choco-cli\choco.exe

Chocolatey v2.2.2
chocolatey - https://community.chocolatey.org/api/v2/ | Priority 0|Bypass Proxy - False|Self-Service - False|Admin Only - False.

[21.02.2024 16:31:48] Exit Code: 0

=========================================
=========================================
[21.02.2024 16:32:07] PowerShell - Arguments: -NoProfile -Command Get-PSRepository
       Executable: C:\Windows\system32\windowspowershell\v1.0\powershell.exe

Name                      InstallationPolicy   SourceLocation                                                          
----                      ------------------   --------------                                                          
PSGallery                 Trusted              https://www.powershellgallery.com/api/v2                                

[21.02.2024 16:32:07] Exit Code: 0

=========================================
=========================================
[21.02.2024 16:32:08] .NET Tool - Arguments: tool list --global
       Executable: C:\Program Files\dotnet\dotnet.exe

The command could not be loaded, possibly because:
  * You intended to execute a .NET application:
      The application 'tool' does not exist.
  * You intended to execute a .NET SDK command:
      No .NET SDKs were found.
Download a .NET SDK:
https://aka.ms/dotnet/download
Learn about SDK resolution:
https://aka.ms/dotnet/sdk-not-found

[21.02.2024 16:32:08] Exit Code: -2147450735

=========================================
=========================================
[21.02.2024 16:32:08] Chocolatey - Arguments:  source list
       Executable: C:\Users\USER\AppData\Local\Programs\WingetUI\choco-cli\choco.exe

Chocolatey v2.2.2
chocolatey - https://community.chocolatey.org/api/v2/ | Priority 0|Bypass Proxy - False|Self-Service - False|Admin Only - False.

[21.02.2024 16:32:08] Exit Code: 0

=========================================
=========================================
[21.02.2024 16:32:13] Pip - Arguments: -m pip list
       Executable: C:\Users\USER\AppData\Local\Programs\Python\Python311\python.exe

Package               Version
--------------------- -------
bpyutils              0.5.8
colorama              0.4.6
docstring-to-markdown 0.13
iniconfig             2.0.0
jedi                  0.19.1
matlabengine          23.2.2
numpy                 1.26.4
packaging             23.2
parso                 0.8.3
pip                   24.0
pip-autoremove        0.10.0
pipupgrade            1.12.0
pluggy                1.4.0
pyaml                 23.12.0
pytest                8.0.0
python-dateutil       2.8.2
python-lsp-jsonrpc    1.1.2
python-lsp-server     1.10.0
pytz                  2024.1
PyYAML                6.0.1
setuptools            69.1.0
six                   1.16.0
tzdata                2024.1
ujson                 5.9.0

[21.02.2024 16:32:13] Exit Code: 0

=========================================
=========================================
[21.02.2024 16:32:15] PowerShell - Arguments: -NoProfile -Command Get-PSRepository
       Executable: C:\Windows\system32\windowspowershell\v1.0\powershell.exe

Name                      InstallationPolicy   SourceLocation                                                          
----                      ------------------   --------------                                                          
PSGallery                 Trusted              https://www.powershellgallery.com/api/v2                                

[21.02.2024 16:32:15] Exit Code: 0

=========================================
=========================================
[21.02.2024 16:32:15] Pip - Arguments: -m pip list --outdated
       Executable: C:\Users\USER\AppData\Local\Programs\Python\Python311\python.exe

Package               Version Latest Type
--------------------- ------- ------ -----
docstring-to-markdown 0.13    0.15   wheel
pytest                8.0.0   8.0.1  wheel

[21.02.2024 16:32:15] Exit Code: 0

=========================================
=========================================
[21.02.2024 16:32:16] PowerShell - Arguments: -NoProfile -Command Get-PSRepository
       Executable: C:\Windows\system32\windowspowershell\v1.0\powershell.exe

Name                      InstallationPolicy   SourceLocation                                                          
----                      ------------------   --------------                                                          
PSGallery                 Trusted              https://www.powershellgallery.com/api/v2                                

[21.02.2024 16:32:16] Exit Code: 0

=========================================
=========================================
[21.02.2024 16:32:20] PowerShell - Arguments: -NoProfile -Command Get-InstalledModule
       Executable: C:\Windows\system32\windowspowershell\v1.0\powershell.exe

Version              Name                                Repository           Description                              
-------              ----                                ----------           -----------                              
1.4.8.1              PackageManagement                   PSGallery            PackageManagement (a.k.a. OneGet) is a...
0.4.7                powershell-yaml                     PSGallery            Powershell module for serializing and ...
2.2.5                PowerShellGet                       PSGallery            PowerShell module with commands for di...
2.2.1.4              PSWindowsUpdate                     PSGallery            This module contain cmdlets to manage ...
1.0.18               SpeculationControl                  PSGallery            This module provides the ability to qu...

[21.02.2024 16:32:20] Exit Code: 0

=========================================
=========================================
[21.02.2024 16:32:23] Winget - Arguments:  update --include-unknown  --accept-source-agreements
       Executable: C:\Program Files\WingetUI\PackageEngine\Managers\winget-cli_x64\winget.exe

Name                                             Id                                Version       Available    Source
--------------------------------------------------------------------------------------------------------------------
KiCad 5.1.12_1                                   KiCad.KiCad                       5.1.12_1      7.0.10       winget
Mozilla Firefox (x64 de)                         Mozilla.Firefox                   121.0         122.0.1      winget
Notepad++ (64-bit x64)                           Notepad++.Notepad++               8.6.2         8.6.4        winget
Synology Drive Client                            Synology.DriveClient              6.0.4.11112   7.4.0.15724  winget
Webex                                            Cisco.WebexTeams                  43.10.0.27753 44.2.0.28714 winget
Microsoft Windows Desktop Runtime - 8.0.2 (x64)  Microsoft.DotNet.DesktopRuntime.6 > 6.0.27      8.0.2        winget
Microsoft Windows Desktop Runtime - 7.0.16 (x64) Microsoft.DotNet.DesktopRuntime.6 > 6.0.27      7.0.16       winget
7 upgrades available.

=========================================
=========================================
[21.02.2024 16:32:32] PowerShell - Arguments: 
       Executable: C:\Windows\system32\windowspowershell\v1.0\powershell.exe

Windows PowerShell
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.
Installieren Sie die neueste PowerShell fr neue Funktionen und Verbesserungen! https://aka.ms/PSWindows
PS C:\Program Files\WingetUI> 
PS C:\Program Files\WingetUI>                 function Test-GalleryModuleUpdate {
>>                     param (
>>                         [Parameter(Mandatory,ValueFromPipelineByPropertyName)] [string] $Name,
>>                         [Parameter(Mandatory,ValueFromPipelineByPropertyName)] [version] $Version,
>>                         [Parameter(Mandatory,ValueFromPipelineByPropertyName)] [string] $Repository,
>>                         [switch] $NeedUpdateOnly
>>                     )
>>                     process {
>>                         $URLs = @{"PSGallery" = "https://www.powershellgallery.com/api/v2";}
>>                         $page = Invoke-WebRequest -Uri ($URLs[$Repository] + "/package/$Name") -UseBasicParsing -Maximum 0 -ea Ignore
>>                         [version]$latest = Split-Path -Path ($page.Headers.Location -replace "$Name." -replace ".nupkg") -Leaf
>>                         $needsupdate = $Latest -gt $Version
>>                         if ($needsupdate) {
>>                             Write-Output ($Name + "|" + $Version.ToString() + "|" + $Latest.ToString() + "|" + $Repository)
>>                         }
>>                     }
>>                 }
>>                 Get-InstalledModule | Test-GalleryModuleUpdate
>>                 exit
>>                 

[21.02.2024 16:32:32] Exit Code: 0

=========================================

Relevant information

Issue 1: pip package update failed

The full command to update pip packages should be "C:\Users\ ... \Python3xx\python.exe" -m pip install ... with a whitespace before "-m"

Issue 2: dotnet command failed

The path to executable C:\Program Files\dotnet\dotnet.exe has a whitespace and should be inside quotation marks "..."

Screenshots and videos

No response

marticliment commented 6 months ago

Hello,

what is the output of running dotnet tool on a command prompt?

Girofox commented 6 months ago

Hello,

what is the output of running dotnet tool on a command prompt?

It shows "command could not be founded". This is what happens when i launch "dotnet --list-runtimes" and "dotnet --info":

PS C:\Users\USER> dotnet --list-runtimes Microsoft.NETCore.App 6.0.27 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 8.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 6.0.27 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 7.0.16 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 8.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] PS C:\Users\USER> dotnet --info

Host: Version: 8.0.2 Architecture: x64 Commit: 1381d5ebd2 RID: win-x64

.NET SDKs installed: No SDKs were found.

.NET runtimes installed: Microsoft.NETCore.App 6.0.27 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 8.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 6.0.27 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 7.0.16 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 8.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found: None

Environment variables: Not set

global.json file: Not found

Learn more: https://aka.ms/dotnet/info

Download .NET: https://aka.ms/dotnet/download

Girofox commented 6 months ago

So it seems that .NET runtime is not enough and I would need the .NET SDK for running dotnet tool ... ?

marticliment commented 6 months ago

Yes, .NET Tool requires the .NET SDK in order to run.