Flatten Windows publish layout and fix restart handoff by mamoreau-devolutions · Pull Request #4719 · Devolutions/UniGetUI · GitHub
Skip to content

Flatten Windows publish layout and fix restart handoff - #4719

Merged
Gabriel Dufresne (GabrielDuf) merged 7 commits into
mainfrom
unigetui-package-size
May 7, 2026
Merged

Gabriel Dufresne (GabrielDuf) merged 7 commits into
mainfrom
unigetui-package-size

Conversation

@mamoreau-devolutions

Copy link
Copy Markdown
Contributor

Summary

  • flatten the Windows publish output so UniGetUI.exe, UniGetUI.Avalonia.exe, and pinget.exe ship side by side
  • publish the bundled Avalonia app and pinget once, then merge them into the final Windows publish output
  • extract a shared pre-UI startup dispatcher and split Avalonia startup into a dedicated host path
  • fix classic/modern restart handoff by relaunching only after the current process exits
  • make Avalonia resolve UniGetUI Elevator.exe correctly in the flat side-by-side layout, with fallback for the older subfolder layout

Validation

  • dotnet build UniGetUI.Avalonia/UniGetUI.Avalonia.csproj -c Debug -p:Platform=x64 -r win-x64

@GabrielDuf
Gabriel Dufresne (GabrielDuf) merged commit e137dc6 into main May 7, 2026
3 checks passed
@GabrielDuf
Gabriel Dufresne (GabrielDuf) deleted the unigetui-package-size branch May 7, 2026 20:47
Gabriel Dufresne (GabrielDuf) added a commit that referenced this pull request Oct 19, 2026
On Windows, CoreTools.Which searched Environment.CurrentDirectory before
any PATH entry, and blank, quoted-empty or relative PATH entries also
resolved against the current directory. Starting UniGetUI from a folder
holding a planted gsudo.exe, winget.exe, choco.exe or python.exe made
that file win over the real one. This was the root of the gsudo concern
on the elevator fallback, and it still applied to the ForceUserGSudo
opt-in and to every manager executable lookup. The search now covers only
fully qualified PATH entries.

The Windows elevator decision moves into ResolveWindowsElevatorPathAsync,
which takes the executable directory and the two gsudo switches as
inputs. The release no-fallback guarantee is no longer hidden behind
#if !DEBUG and is now covered by tests. The DEBUG branch also stops
logging "Using system GSudo" when gsudo is not installed.

The parent-directory lookup in ResolveBundledElevatorPath is kept: #4719
added it for the nested publish layout. Its parent is admin-only on a
Program Files install, and on a user-writable install whoever can plant
there can already replace UniGetUI.exe. The Linux sudo/pkexec/SSH_ASKPASS
resolution is unchanged for the same reason: PATH and environment are the
user's own, and a fixed /usr/bin path would break NixOS's
/run/wrappers/bin/sudo.
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.

2 participants