feat(uploader): settings, DPAPI token, single instance and startup registration

uploader.json (server, user, DPAPI CurrentUser-protected token, trusted
fingerprints, options, watch folders) written atomically; command line
(paths, --tray, --capture); named mutex plus a current-user named pipe
that hands a second launch's paths to the running instance; HKCU Run
key for "Start with Windows"; coalescing background writer for state
files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
Claude committed 2026-10-02 10:27:36 +00:00
1 parent 27f0d73f05
commit ad5c3e0f37
10 files changed
+540

No files matched your search

@@ -0,0 +1,27 @@
namespace Titano.Uploader.Infrastructure;
/// <summary>
/// <c>Titano.Uploader.exe [--tray] [--capture &lt;dir&gt;] [files or folders…]</c>: paths are enqueued, <c>--tray</c>
/// starts hidden (used by the Run key), <c>--capture</c> renders screenshots and exits.
/// </summary>
public sealed record CommandLine(IReadOnlyList<string> Paths, bool StartInTray, string? CaptureDirectory)
{
public const string TrayOption = "--tray";
public const string CaptureOption = "--capture";
public static CommandLine Parse(IReadOnlyList<string> args)
{
var paths = new List<string>();
var tray = false;
string? capture = null;
for (var i = 0; i < args.Count; i++)
{
var a = args[i];
if (a.Equals(TrayOption, StringComparison.OrdinalIgnoreCase)) tray = true;
else if (a.Equals(CaptureOption, StringComparison.OrdinalIgnoreCase))
capture = i + 1 < args.Count && !args[i + 1].StartsWith("--", StringComparison.Ordinal) ? args[++i] : "screenshots";
else if (!a.StartsWith("--", StringComparison.Ordinal) && a.Length > 0) paths.Add(a);
}
return new CommandLine(paths, tray, capture);
}
}