Repository navigation
Add auto-elevate package updates through Devolutions Agent - #5898
Draft
Marc-André Moreau (mamoreau-devolutions) wants to merge 1 commit into
Draft
Marc-André Moreau (mamoreau-devolutions) wants to merge 1 commit into
Marc-André Moreau (mamoreau-devolutions) wants to merge 1 commit into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If the same issue can be reproduced outside UniGetUI with the relevant package manager or with the package itself, please report it there first. UniGetUI should only be used to track issues that are specific to UniGetUI's behavior or integration.
Summary
Adds an opt-in Windows Administrator setting to automatically elevate updates of already-installed packages through Devolutions Agent without repeated UAC prompts, while keeping new package installations and uninstallations on the normal local UAC flow.
Changes
Settings.K.UseAgentBrokerForUpdates("UseAgentBrokerForUpdates", defaultfalse) insrc/UniGetUI.Core.Settings/SettingsEngine_Names.cs.BrokerRequestValidator.ManagerRejectsElevation/ManagerRejectsMachineScopeand added shared routing helpers (IsStrictlyBrokered,IsBrokerEligible,CanRouteToBroker,RequestsBrokerElevation) inBrokerRequestBuilder.PackageOperations.csso strictUseAgentBrokerbehavior is unchanged, whileUseAgentBrokerForUpdatescallsApplyElevationRequirementsbefore deciding eligibility and routes only elevated or machine-scopeUpdateoperations for elevation-capable non-virtual managers (Install,Uninstall, reinstall-on-update steps, non-elevated updates, global non-admin.NET Toolupdates, and user-only managers stay on the local path; explicit policyDenyfails closed).WinGetPkgOperationHelper.OperationIsBrokeredandInstallOptionsViewModel.IsBrokeredoperation- and elevation-aware while keepingNativeWinGetHelperreinstall suppression scoped to strictUseAgentBroker.AutoElevateUpdatesPolicyService(InspectAsync,EnableAsync,DisableAsync) overIBrokerPolicyManagementService,IPolicyWriteElevator, andIPolicyWriteElevationEligibility.Priority: 1000,Decision: Allow,Operations: [Update],ExecutionElevation: [Elevated], strictPolicyConstraintswith allAllow*flagsfalse):unigetui.auto-elevate-updates.winget,unigetui.auto-elevate-updates.chocolatey,unigetui.auto-elevate-updates.powershell,unigetui.auto-elevate-updates.powershell7(split becausePolicySerializerrequiresManagers.Count == 1whenSourceNamesis set), andunigetui.auto-elevate-updates.dotnet.DefaultDecision: Denypolicy when missing, idempotently upserts/removes onlyunigetui.auto-elevate-updates.*rules while preserving existing rules, and handles UAC cancellation, stale store tokens, read-only/invalid/ineligible states, and unavailable/unsupported Agents.AutoElevateUpdatesCardtoggle with inline status/error feedback and async UAC rollback inAdministrator.axaml,Administrator.axaml.cs, andAdministratorViewModel.cs.SettingsSearchIndex.cs,src/Languages/lang_en.json, and TUI fake-data reset guards (FakeDataEnvironment.cs,SettingsPage.cs).AutoElevateUpdatesRoutingTests,AutoElevateUpdatesPolicyServiceTests, andAdministratorViewModelTests.Validation
dotnet format whitespace src --folder --verify-no-changes --verbosity minimal— passed (exit 0)dotnet format style src\UniGetUI.Windows.slnx --no-restore --verify-no-changes --verbosity minimal— passed (exit 0)dotnet build src\UniGetUI.Windows.slnx /p:Platform=x64 -v q --nologo— passed (exit 0)dotnet build src\UniGetUI.Avalonia.slnx -v q --nologo— passed (exit 0)dotnet test src\UniGetUI.PackageEngine.Tests\UniGetUI.PackageEngine.Tests.csproj --no-build /p:Platform=x64 --filter "FullyQualifiedName~AutoElevateUpdates|FullyQualifiedName~BrokerRequestBuilderTests|FullyQualifiedName~BrokerPolicyManagementServiceTests|FullyQualifiedName~PackageOperationsTests|FullyQualifiedName~WinGetManagerTests|FullyQualifiedName~CargoManagedOperationRoutingTests" --verbosity minimal --nologo— passed (465/465 onnet10.0, 847/847 onnet10.0-windows10.0.26100.0)dotnet test src\UniGetUI.Tests\UniGetUI.Tests.csproj --no-build /p:Platform=x64 --filter "FullyQualifiedName~AdministratorViewModelTests|FullyQualifiedName~SettingsSearchIndexTests|FullyQualifiedName~AgentPolicyInspectorViewModelTests|FullyQualifiedName~InstallOptions" --verbosity minimal --nologo— passed (64/64)