From 941e0df99f7f8fe90b6e5f85afb59010e929acc2 Mon Sep 17 00:00:00 2001 From: Ednunp <29843396+Ednunp@users.noreply.github.com> Date: Mon, 13 Jul 2026 09:30:55 +0100 Subject: [PATCH] Service: log install/uninstall/start/stop/configure to the RemSound log Local checkpoint - NOT for public release. ServiceAction and ConfigureServiceProfile now write to the main app's log (gated on RemSound logging), so turning on logs in RemSound captures the install request + result code and profile saves. (Windows also records the install itself in the System Event Log, Event 7045, always.) Gate 27/27. Co-Authored-By: Claude Opus 4.8 --- src/RemSound.App/MainForm.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/RemSound.App/MainForm.cs b/src/RemSound.App/MainForm.cs index 82a9039..f37bb7b 100644 --- a/src/RemSound.App/MainForm.cs +++ b/src/RemSound.App/MainForm.cs @@ -2244,6 +2244,7 @@ public sealed class MainForm : Form { ServiceStore.SaveProfile(dlg.Result); ServiceStore.SaveLoggingEnabled(dlg.ServiceLoggingEnabled); + logFile.Event($"service: profile saved (service logging {(dlg.ServiceLoggingEnabled ? "on" : "off")})"); // Remove any stray copy the old design left in the user's profiles folder. try { profileStore?.Delete(ServiceControl.ServiceProfileTitle); } catch { /* best-effort */ } if (ServiceControl.Query() == ServiceState.Running) @@ -2268,7 +2269,9 @@ public sealed class MainForm : Form : "Uninstall the RemSound service?\n\nWindows will ask for administrator permission."; if (MessageBox.Show(this, msg, AppName, MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes) return; } + logFile.Event($"service: {label} requested (elevated)"); var rc = ServiceControl.RunElevated(verb); + logFile.Event($"service: {label} finished with code {rc} ({(rc == 0 ? "success" : rc == -1 ? "cancelled/declined" : "failed")})"); if (rc == 0) MessageBox.Show(this, $"Service {label} succeeded.", AppName, MessageBoxButtons.OK, MessageBoxIcon.Information); else if (rc == -1)