Skip to content

Fix WinGet activation order and repair false positives#4605

Draft
Marc-André Moreau (mamoreau-devolutions) wants to merge 1 commit intomainfrom
issue-4602-investigation
Draft

Fix WinGet activation order and repair false positives#4605
Marc-André Moreau (mamoreau-devolutions) wants to merge 1 commit intomainfrom
issue-4602-investigation

Conversation

@mamoreau-devolutions
Copy link
Copy Markdown
Contributor

Summary

Fixes #4602.

This restores the intended WinGet native activation order and closes the false-positive path that kept prompting users to repair WinGet even when UniGetUI could continue working.

Root cause

A recent WinGet change made bundled in-proc COM the default native activation path. Older behavior preferred the system WinGet COM registration first and only fell back when needed.

That change left bundled activation in an awkward state:

  • update detection already had a CLI fallback
  • installed package detection did not
  • a bundled COM failure during installed-package enumeration set NO_PACKAGES_HAVE_BEEN_LOADED
  • the Installed Packages page then reopened the WinGet repair banner on reloads

What changed

  1. Restored native WinGet activation priority to:
    • packaged/system COM
    • lower-trust COM
    • bundled in-proc COM
  2. Added bundled CLI fallback for installed package detection when bundled COM is active, matching the existing update-path safeguard.
  3. Tightened the repair warning flow so the banner closes again after successful loads instead of lingering after recovery.
  4. Re-exposed the existing WinGet troubleshooter toggle in Settings so users can disable the warning path when necessary.
  5. Added WinGet tests covering activation order and bundled installed-package fallback behavior.

Files changed

  • src/UniGetUI.PackageEngine.Managers.WinGet/ClientHelpers/NativeWinGetHelper.cs
  • src/UniGetUI.PackageEngine.Tests/WinGetManagerTests.cs
  • src/UniGetUI/Pages/SettingsPages/ManagersPages/PackageManager.xaml.cs
  • src/UniGetUI/Pages/SoftwarePages/InstalledPackagesPage.cs

Validation

  • dotnet test .\\src\\UniGetUI.PackageEngine.Tests\\UniGetUI.PackageEngine.Tests.csproj --verbosity q --nologo --tl:off
  • dotnet build .\\src\\UniGetUI\\UniGetUI.csproj -p:Platform=x64 --verbosity q --nologo --tl:off

The WinUI build still reports existing analyzer warnings outside this change set, but completed successfully.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] UniGetUI still asks me to repair

1 participant