Files
Explorer-Workbench/src/Explorer.Windows/WindowsElevatedScanService.cs
netquick 7c23bc2474 Extract a per-user background host so indexing can later run outside the window.
Keep the GUI as the index writer for now; mutex, named pipe, and opt-in logon autostart prepare Explorer.Host.exe without two SQLite writers.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-24 17:10:49 +02:00

29 lines
764 B
C#

using System.Security.Principal;
using Explorer.Application;
namespace Explorer.Windows;
public sealed class WindowsElevatedScanService : IElevatedScanService
{
public bool IsElevated
{
get
{
try
{
using var identity = WindowsIdentity.GetCurrent();
return new WindowsPrincipal(identity).IsInRole(WindowsBuiltInRole.Administrator);
}
catch
{
return false;
}
}
}
// Queue, index writer, and watchers stay in the user session. Elevation is never requested.
public bool CanRequestElevation => false;
public string ProtectedContentHint => "Protected content requires administrator privileges.";
}