From a9fba626009156be62c95268cfb2b2edc2693c4b Mon Sep 17 00:00:00 2001 From: Tig Date: Wed, 8 Jul 2026 11:33:48 -0600 Subject: [PATCH] Add diagnostic logging for DisableUpdatePopup (#312) - Log the exact settings file path at load time. - Log 'Settings: DisableUpdatePopup = ' at startup (after ApplySettings). - When an update check detects a newer version and the flag is true, log 'Update Popup is disabled (DisableUpdatePopup=true)' instead of (or before) showing the dialog. This will help confirm whether the correct mcec.settings is being loaded for installed vs side-by-side copies, and whether the guard is being reached. Refs #312 --- src/MainWindow.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/MainWindow.cs b/src/MainWindow.cs index 1d372cc..40387e7 100644 --- a/src/MainWindow.cs +++ b/src/MainWindow.cs @@ -280,10 +280,14 @@ private void mainWindow_Load(object? sender, EventArgs e) { // Load AppSettings (also configures logging; some logging already happened). // #216: SettingsStore.Load never shows UI; the GUI host (here) owns the failure dialogs // that used to live inside AppSettings.Deserialize, gated the same way (headless = no UI). - SettingsLoadResult settingsLoad = SettingsStore.Load($@"{Program.ConfigPath}{SettingsStore.SettingsFileName}"); - ShowSettingsLoadFailure(settingsLoad, $@"{Program.ConfigPath}{SettingsStore.SettingsFileName}"); + string settingsFile = $@"{Program.ConfigPath}{SettingsStore.SettingsFileName}"; + Logger.Instance.Log4.Info($"Settings: Loading from {settingsFile}"); + SettingsLoadResult settingsLoad = SettingsStore.Load(settingsFile); + ShowSettingsLoadFailure(settingsLoad, settingsFile); ApplySettings(settingsLoad.Settings); + Logger.Instance.Log4.Info($"Settings: DisableUpdatePopup = {Settings.DisableUpdatePopup}"); + // TELEMETRY: // what: Settings // why: To understand what settings get changed and which dont @@ -378,8 +382,11 @@ private void UpdateService_GotLatestVersion(object? sender, Version? version) { Logger.Instance.Log4.Info("A newer version is available at"); Logger.Instance.Log4.Info($" {UpdateService.Instance.ReleasePageUri}"); - if (!Settings.DisableUpdatePopup) + if (Settings.DisableUpdatePopup) { + Logger.Instance.Log4.Info("Update Popup is disabled (DisableUpdatePopup=true)"); + } else { UpdateDialog.Instance.ShowDialog(this); + } } else if (UpdateService.Instance.CompareVersions() > 0) { Logger.Instance.Log4.Info(