Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [1.20.21] - 2026-06-12
## [1.20.22] - 2026-06-12

### Fixed
- **Drive/disk health reads survive systems without the Storage WMI namespace.** Disk Health and System Info could throw an unhandled COM error on older or headless Windows where the `root\Microsoft\Windows\Storage` namespace isn't present; both now handle that case and fall back gracefully (mirrors the earlier Fixed Drives fix).
- **No leaked process handle when opening a file location.** "Open file location" in Process Manager left the launched Explorer process handle undisposed; it's now released.
- **Swallowed errors are now diagnosable.** Several silent `catch` blocks now log at Debug level with the full exception (update-file cleanup, Deep Cleanup directory deletion, Windows Update size extraction, and the Dashboard polling loop), so failures leave a trace in the log instead of vanishing.

### Changed
- **Some status/accent colors now follow the theme instead of being hardcoded.** Replaced hardcoded color values that exactly matched a theme color (success green, warning amber, danger red, accent, hover border) with theme references on the Dashboard, Network Repair, Privacy, and Uninstaller tabs. The colors render identically today but will track the theme going forward.
Expand Down
4 changes: 3 additions & 1 deletion SysManager/SysManager/Services/DeepCleanupService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,9 @@ private static CleanupResult Clean(IReadOnlyList<CleanupCategory> categories, IP
}
foreach (var dir in EnumerateDirectoriesDepthFirst(path, ct))
{
try { Directory.Delete(dir, recursive: false); } catch (IOException) { } catch (UnauthorizedAccessException) { }
try { Directory.Delete(dir, recursive: false); }
catch (IOException ex) { Log.Debug(ex, "Deep cleanup: failed to delete directory {Dir}", dir); }
catch (UnauthorizedAccessException ex) { Log.Debug(ex, "Deep cleanup: access denied deleting directory {Dir}", dir); }
}
}
catch (Exception ex)
Expand Down
5 changes: 5 additions & 0 deletions SysManager/SysManager/Services/DiskHealthService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ private static IReadOnlyList<DiskHealthReport> Collect()
{
// WMI access denied without elevation.
}
catch (System.Runtime.InteropServices.COMException)
{
// scope.Connect() can throw COMException when the Storage WMI namespace
// is unavailable (older/headless Windows). Non-fatal — return what we have.
}
return results;
}

Expand Down
3 changes: 2 additions & 1 deletion SysManager/SysManager/Services/ProcessManagerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,13 @@ public static void OpenFileLocation(string filePath)
if (string.IsNullOrWhiteSpace(filePath) || !System.IO.File.Exists(filePath)) return;
try
{
// Dispose the returned Process handle — we don't track the launched explorer.
Process.Start(new ProcessStartInfo
{
FileName = "explorer.exe",
Arguments = $"/select,\"{filePath}\"",
UseShellExecute = true
});
})?.Dispose();
}
catch (InvalidOperationException ex) { Log.Warning(ex, "Failed to open file location: {Path}", filePath); }
catch (System.ComponentModel.Win32Exception ex) { Log.Warning(ex, "Failed to open file location: {Path}", filePath); }
Expand Down
5 changes: 3 additions & 2 deletions SysManager/SysManager/Services/SystemInfoService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,10 @@ private static List<DiskInfo> QueryDisks()
}
}
}
catch (ManagementException)
catch (Exception ex) when (ex is ManagementException or System.Runtime.InteropServices.COMException)
{
// Fallback to Win32_DiskDrive if MSFT_PhysicalDisk isn't available
// Fallback to Win32_DiskDrive if MSFT_PhysicalDisk / the Storage WMI namespace
// isn't available (older/headless Windows — scope.Connect() throws COMException).
using var s = new ManagementObjectSearcher("SELECT Model,Size,Status FROM Win32_DiskDrive");
using var fallbackCollection = s.Get();
foreach (ManagementObject mo in fallbackCollection)
Expand Down
4 changes: 2 additions & 2 deletions SysManager/SysManager/Services/UpdateService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,8 @@ public static bool VerifyAuthenticode(string filePath)
private static void CleanupFile(string path)
{
try { if (File.Exists(path)) File.Delete(path); }
catch (IOException) { }
catch (UnauthorizedAccessException) { }
catch (IOException ex) { Serilog.Log.Debug(ex, "Update cleanup: could not delete {Path}", path); }
catch (UnauthorizedAccessException ex) { Serilog.Log.Debug(ex, "Update cleanup: access denied deleting {Path}", path); }
}

// ---------- internals ----------
Expand Down
4 changes: 2 additions & 2 deletions SysManager/SysManager/Services/WindowsUpdateService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ internal static UpdateEntry MapToEntry(dynamic u)
var kb = kbList.Count > 0 ? "KB" + string.Join(",", kbList) : string.Empty;
long size = 0;
try { size = (long)(decimal)u.MaxDownloadSize; }
catch (Microsoft.CSharp.RuntimeBinder.RuntimeBinderException) { }
catch (COMException) { }
catch (Microsoft.CSharp.RuntimeBinder.RuntimeBinderException ex) { Serilog.Log.Debug(ex, "Windows Update: MaxDownloadSize not exposed for {Title}", title); }
catch (COMException ex) { Serilog.Log.Debug(ex, "Windows Update: COM error reading size for {Title}", title); }
return new UpdateEntry
{
Title = title,
Expand Down
6 changes: 3 additions & 3 deletions SysManager/SysManager/SysManager.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
<RootNamespace>SysManager</RootNamespace>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<NoWarn>NU1603;NU1701</NoWarn>
<Version>1.20.21</Version>
<FileVersion>1.20.21.0</FileVersion>
<AssemblyVersion>1.20.21.0</AssemblyVersion>
<Version>1.20.22</Version>
<FileVersion>1.20.22.0</FileVersion>
<AssemblyVersion>1.20.22.0</AssemblyVersion>
<Product>SysManager</Product>
<Description>SysManager — Windows system monitoring toolkit by laurentiu021. Network, updates, health, logs, safe deep cleanup.</Description>
<PackageProjectUrl>https://github.com/laurentiu021/SystemManager</PackageProjectUrl>
Expand Down
2 changes: 1 addition & 1 deletion SysManager/SysManager/ViewModels/DashboardViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ private void StartPollingLoop()
catch (OperationCanceledException) { break; }
catch (Exception ex)
{
Log.Debug("Dashboard polling error: {Error}", ex.Message);
Log.Debug(ex, "Dashboard polling error");
await Task.Delay(1000, ct);
}
}
Expand Down
Loading