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

[BUG] UAC sometimes appears backgrounded instead of in foreground #2500

Closed Atario closed 1 week ago

Atario commented 1 month ago

Please confirm these before moving forward

UniGetUI Version

3.1.1-beta1

Windows version, edition, and architecture

Windows 11 Pro 10.0.22631.3880 x64

Describe your issue

Some package installs/upgrades that give UAC prompts produce this prompt in the foreground as one would expect, but others pop them up in the background and I have to go find them myself to click them. Since I have UniGetUI maximized and my taskbar on auto-hide, and since some packages don't give UAC prompts at all, this can result in a lot of pointless waiting while not knowing anything's amiss.

I haven't determined much of a pattern to the behavior between whether I get foreground vs. background either.

(This issue has been going on for some time, it's not specific to the new version of UniGetUI I'm on.)

Steps to reproduce the issue

No response

UniGetUI Log

[7/16/2024 12:47:17 AM]    __  __      _ ______     __  __  ______
                          / / / /___  (_) ____/__  / /_/ / / /  _/
                         / / / / __ \/ / / __/ _ \/ __/ / / // /  
                        / /_/ / / / / / /_/ /  __/ /_/ /_/ // /   
                        \____/_/ /_/_/\____/\___/\__/\____/___/   
                            Welcome to UniGetUI Version 3.1.1-beta1
[7/16/2024 12:47:17 AM]
[7/16/2024 12:47:17 AM] Version Code:  3.1091
[7/16/2024 12:47:17 AM] Encoding Code Page set to 437
[7/16/2024 12:47:17 AM] Using bundled GSudo at C:\Program Files\WingetUI\Assets\Utilities\gsudo.exe
[7/16/2024 12:47:17 AM] Loaded language locale: en
[7/16/2024 12:47:17 AM] Randomly-generated background API auth token for the current session: p2gku0ml60zhsby2yd9fp0o8b95fubbt71ok3l5vvqoua4wsoqkwb4mkrhfytsw5
[7/16/2024 12:47:17 AM] Api running on http://localhost:7058
[7/16/2024 12:47:17 AM] Moving Bundled Chocolatey from old path to new path...
[7/16/2024 12:47:17 AM] An error occurred while migrating chocolatey
[7/16/2024 12:47:17 AM] System.ArgumentException: The path is empty. (Parameter 'relativeTo')
                           at System.IO.Path.GetRelativePath(String relativeTo, String path, StringComparison comparisonType)
                           at UniGetUI.PackageEngine.Managers.ChocolateyManager.Chocolatey.LoadManager() in C:\SomePrograms\WingetUI-Store\src\UniGetUI.PackageEngine.Managers.Chocolatey\Chocolatey.cs:line 279
[7/16/2024 12:47:17 AM] Lang files were updated successfully from GitHub
[7/16/2024 12:47:18 AM] UniGetUI is up to date
[7/16/2024 12:47:18 AM] Downloaded new icons and screenshots successfully!
[7/16/2024 12:47:20 AM] Command npm was not found on the system
[7/16/2024 12:47:20 AM] ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
                        █▀▀▀▀▀▀▀▀▀▀▀▀▀ MANAGER LOADED ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
                        █ Name: Npm
                        █ Enabled: True
                        █ Found: False
                        █ THE MANAGER WAS NOT FOUND. PERHAPS IT IS NOT 
                        █ INSTALLED OR IT HAS BEEN MISCONFIGURED 
                        ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
[7/16/2024 12:47:20 AM] Command python.exe was not found on the system
[7/16/2024 12:47:20 AM] ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
                        █▀▀▀▀▀▀▀▀▀▀▀▀▀ MANAGER LOADED ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
                        █ Name: Pip
                        █ Enabled: True
                        █ Found: False
                        █ THE MANAGER WAS NOT FOUND. PERHAPS IT IS NOT 
                        █ INSTALLED OR IT HAS BEEN MISCONFIGURED 
                        ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
[7/16/2024 12:47:20 AM] ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
                        █▀▀▀▀▀▀▀▀▀▀▀▀▀ 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.303
                        ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
[7/16/2024 12:47:20 AM] ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
                        █▀▀▀▀▀▀▀▀▀▀▀▀▀ MANAGER LOADED ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
                        █ Name: Winget
                        █ Enabled: True
                        █ Found: True
                        █ Fancye exe name: winget.exe
                        █ Executable path: C:\Users\Atario\AppData\Local\Microsoft\WindowsApps\winget.exe
                        █ Call arguments: 
                        █ Version: 
                        █   Native WinGet CLI Version: v1.8.1911
                        █   Microsoft.WinGet.Client PSModule version: 
                        █   Using Native WinGet helper (COM Api)
                        ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
[7/16/2024 12:47:21 AM] ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
                        █▀▀▀▀▀▀▀▀▀▀▀▀▀ MANAGER LOADED ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
                        █ Name: Scoop
                        █ Enabled: True
                        █ Found: True
                        █ Fancye exe name: scoop
                        █ Executable path: C:\Windows\system32\windowspowershell\v1.0\powershell.exe
                        █ Call arguments:  -NoProfile -ExecutionPolicy Bypass -Command scoop
                        █ Version: 
                        █   Current Scoop version:
                        █   716b6db3 chore(release): Bump to version 0.5.0 (#6035)
                        █   
                        █   'main' bucket:
                        █   f99126667 qsv@0.129.1: Fix hash (Closes #6021)
                        █   
                        █   'extras' bucket:
                        █   b2cca7986 clash-verge-rev@1.7.5: Fix hash (Closes #13626)
                        █   
                        █   'nirsoft' bucket:
                        █   b38031d updated manifests
                        █   
                        █   'sysinternals' bucket:
                        █   47f9751 chore(ci): Update 'psmodulecache' to 'main'
                        █   
                        █   'nerd-fonts' bucket:
                        █   6ff9aa01 LXGWNeoXiHei: Update to version 1.124
                        █   
                        █   'nonportable' bucket:
                        █   fac7adc9 powertoys@0.82.1: Fix for the tag change (#324)
                        █   
                        █   'games' bucket:
                        █   55c0f9a42 dolphin-dev: Update to version 2407-68
                        ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
[7/16/2024 12:47:21 AM] ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
                        █▀▀▀▀▀▀▀▀▀▀▀▀▀ 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.22621.3880                                                                          
                        █   PSEdition                      Desktop                                                                                 
                        █   PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                 
                        █   BuildVersion                   10.0.22621.3880                                                                         
                        █   CLRVersion                     4.0.30319.42000                                                                         
                        █   WSManStackVersion              3.0                                                                                     
                        █   PSRemotingProtocolVersion      2.3                                                                                     
                        █   SerializationVersion           1.1.0.1
                        ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
[7/16/2024 12:47:23 AM] ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
                        █▀▀▀▀▀▀▀▀▀▀▀▀▀ MANAGER LOADED ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
                        █ Name: Chocolatey
                        █ Enabled: True
                        █ Found: True
                        █ Fancye exe name: choco.exe
                        █ Executable path: C:\ProgramData\chocolatey\bin\choco.exe
                        █ Call arguments: 
                        █ Version: 
                        █   This is try 1/3. Retrying after 400 milliseconds.
                        █    Error converted to warning:
                        █    Access to the path 'C:\ProgramData\chocolatey\config\chocolatey.config.8420.update' is denied.
                        █   This is try 2/3. Retrying after 600 milliseconds.
                        █    Error converted to warning:
                        █    Access to the path 'C:\ProgramData\chocolatey\config\chocolatey.config.8420.update' is denied.
                        █   Maximum tries of 3 reached. Throwing error.
                        █   2.3.0
                        ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
[7/16/2024 12:47:26 AM] Found 12 installed packages from Scoop
[7/16/2024 12:47:26 AM] Found 1 installed packages from .NET Tool
[7/16/2024 12:47:26 AM] Dependency WinGet PowerShell Module for manager Winget is present
[7/16/2024 12:47:26 AM] Dependency Scoop-Search for manager Scoop is present
[7/16/2024 12:47:26 AM] Dependency Git for manager Scoop is present
[7/16/2024 12:47:26 AM] Dependency .NET Tools Outdated for manager .NET Tool is present
[7/16/2024 12:47:26 AM] LoadComponentsAsync finished executing. All managers loaded. Proceeding to interface.
[7/16/2024 12:47:26 AM] Found 0 available updates from .NET Tool
[7/16/2024 12:47:27 AM] Found 1 installed packages from PowerShell
[7/16/2024 12:47:28 AM] Found 3 available updates from Winget
[7/16/2024 12:47:28 AM] Found 211 installed packages from Winget
[7/16/2024 12:47:28 AM] Found 7 installed packages from Chocolatey
[7/16/2024 12:47:28 AM] Backup saved to C:\Users\Atario\Documents\UniGetUI\ATARIO-DESKTOP installed packages 2024-07-16 00-47-28.json
[7/16/2024 12:47:28 AM] Found 0 available updates from Chocolatey
[7/16/2024 12:47:28 AM] Found 0 available updates from PowerShell
[7/16/2024 12:47:32 AM] Found 12 installed packages from Scoop
[7/16/2024 12:47:32 AM] Found 0 available packages from Scoop with the query yt-dlg
[7/16/2024 12:47:32 AM] Found 2 available packages from Winget with the query yt-dlg
[7/16/2024 12:47:32 AM] Found 0 available packages from .NET Tool with the query yt-dlg
[7/16/2024 12:47:34 AM] Found 2 available packages from Chocolatey with the query yt-dlg
[7/16/2024 12:47:37 AM] Found 0 available updates from Scoop
[7/16/2024 12:47:48 AM] Found 0 available packages from PowerShell with the query yt-dlg
[7/16/2024 12:47:53 AM] Non-MSStore WinGet Native Icons have been forcefully disabled on code
[7/16/2024 12:47:53 AM] Loaded icon with URL=UniGetUI.Core.IconEngine.CacheableIcon for package Id=yt-dlg.yt-dlg
[7/16/2024 12:47:55 AM] An error occurred while retrieving the icon for package yt-dlg.yt-dlg
[7/16/2024 12:47:55 AM] System.Net.Http.HttpRequestException: Response status code does not indicate success: 404 (Not Found).
                           at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
                           at UniGetUI.Core.IconEngine.IconCacheEngine.DownloadIconOrCache(Nullable`1 _icon, String ManagerName, String PackageId) in C:\SomePrograms\WingetUI-Store\src\UniGetUI.Core.IconStore\IconCacheEngine.cs:line 166
                           at UniGetUI.PackageEngine.PackageClasses.Package.GetIconUrl() in C:\SomePrograms\WingetUI-Store\src\UniGetUI.PackageEngine.PackageManagerClasses\Packages\Package.cs:line 199

Package Managers Logs

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

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

Logged native task on manager Winget. Task type is ListSources
Process start time: 7/16/2024 12:47:20 AM
Process end time:   7/16/2024 12:47:20 AM

-- Task information
 ...

The task reported success

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

Logged subprocess-based task on manager Winget. Task type is RefreshIndexes
Subprocess executable: "C:\Users\Atario\AppData\Local\Microsoft\WindowsApps\winget.exe"
Command-line arguments: " source update --disable-interactivity"
Process start time: 7/16/2024 12:47:23 AM
Process end time:   7/16/2024 12:47:26 AM

-- Process STDOUT
 ...

Return code: SUCCESS (0)

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

Logged native task on manager Winget. Task type is ListInstalledPackages
Process start time: 7/16/2024 12:47:25 AM
Process end time:   7/16/2024 12:47:28 AM

-- Task information
 ...

The task reported success

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

Logged native task on manager Winget. Task type is ListSources
Process start time: 7/16/2024 12:47:26 AM
Process end time:   7/16/2024 12:47:26 AM

-- Task information
 ...

The task reported success

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

Logged native task on manager Winget. Task type is ListInstalledPackages
Process start time: 7/16/2024 12:47:26 AM
Process end time:   7/16/2024 12:47:28 AM

-- Task information
 ...

The task reported success

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

Logged native task on manager Winget. Task type is FindPackages
Process start time: 7/16/2024 12:47:32 AM
Process end time:   7/16/2024 12:47:32 AM

-- Task information
 ...

The task reported success

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

Relevant information

No response

Screenshots and videos

No response

llvs commented 1 month ago

I can confirm this behavior. Could be related to installing packages with administrative rights that require another account to login.

marticliment commented 1 month ago

It should not, I am investigating changes that could overcome this issue

Saibaschbeis commented 3 weeks ago

Just as an additional comment from a Windows admin: this behavior happens for other applications as well. I'm pretty sure I had this even with Microsoft apps or Windows-native processes when they ask for elevation sometimes. So I think it is more a general issue in Windows (or at least a general issue with a specific way of triggering elevation maybe?), not specific to UniGetUI

marticliment commented 3 weeks ago

As far as I have found, UAC shows in the background when the process who spawned the process showing the UAC is already on the background