Repository navigation
Prefs tab: one policy line, a Services accordion, and UAC at Save instead of Unlock - #33
Open
rodchristiansen wants to merge 4 commits into
Open
rodchristiansen wants to merge 4 commits into
rodchristiansen wants to merge 4 commits into
Conversation
Settings that policy sets lose their per-field "Managed by policy" caption and lock; their controls stay disabled in the default gray, and one line at the top of the tab says what gray means, shown only when policy sets at least one value. A Services card at the bottom of the tab lists the StartSet service the installer creates, with its state, last exit code and start type in plain words, read through WMI so it needs no elevation.
… Save The Prefs tab no longer has a read-only mode with an Unlock button that relaunched the whole app elevated. Every setting policy does not set can be edited straight away, and edits are held until Save or Discard. Save writes machine settings directly when the app is already elevated; otherwise it writes the edits to a JSON file in the user's temp folder and starts the app's own executable elevated with --apply-settings. That run starts no window: it reads policy again, skips every setting policy sets, checks each value with the Prefs tab's rules, writes the rest and exits. The temp file is deleted afterwards. A declined UAC prompt keeps the edits pending.
… temp file Save no longer writes the pending edits to a JSON file in %TEMP%. The app opens a named pipe with a random name, created as the first instance so nothing can hold the name first, and with an ACL that admits only the current user, Administrators and SYSTEM. It passes the pipe name to the elevated --apply-settings run, writes the JSON when that run connects, and closes the pipe. Nothing touches disk, and the pipe also reaches an administrator who approves UAC under a different account. Save stops waiting after 60 seconds if nothing connects, or as soon as the writer exits without connecting.
The Services card is now an accordion. Each row is collapsed by default and shows the friendly name, one summary line (kind, start type and account), and a state dot and word on the right, coloured from theme brushes only. The Expander's header spans the whole row, so a click anywhere on it, or Space or Enter, opens and closes it. Expanded, the row lists Name, Start type, Status, Account, Path and arguments, Triggers and, once the service has stopped, Last result, the labels ReportMate's Windows System module uses. A value that cannot be read is left out rather than shown empty.
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.
Closes #32
Policy line
HasPolicySettings).Services card
StartSetservice. The installer creates no scheduled tasks.Expander, collapsed by default. It shows the friendly name, one summary line (Service · Automatic · LocalSystem), and a state dot and word on the right. The dot colours come from theme brushes only: success for Running, attention for Ready, neutral otherwise.ToggleButtonin the WinUI template, so a click anywhere on the row, or Space or Enter, toggles it.Win32_Service, read off the UI thread with no elevation and no new package. A failed query shows "Unknown".StartSet.Infrastructure.Gui.InstalledServices.No Unlock mode
PrefsElevation.CanEdit(isPolicyManaged)).runasand--apply-settings <pipe name>.FirstPipeInstance, so nothing can hold the name first, and its ACL admits only the current user, Administrators and SYSTEM. The JSON is written when the elevated run connects, then the pipe closes. Nothing touches disk, and this also works when a different administrator approves UAC.Program.Main, which replaces the XAML-generated one, handles--apply-settingsbefore WinUI starts, so that run creates no window. It reads policy again, skips every setting policy sets (and policy-only ones), checks each value with the same rules the tab uses (SettingsPayload.Normalize), writes the rest and exits 0 or non-zero.Tests
dotnet buildanddotnet teston StartSet.sln: 429 passed.Risk: medium