FindMyFiles

FindMyFiles.Services

AppPaths Class

Resolves where the app keeps its state — <b>portable by default</b> (ADR-0024). On first access it picks one data root, once, in this order:

  1. --data-dir=<path> when given (tests, scratch, power users);
  2. <exe>\data when it can be created and written — the default, so a copied/unzipped build keeps everything in its own folder and touches neither the user profile nor the registry ("just drop it / just delete it");
  3. the per-user profile (%APPDATA% / %LOCALAPPDATA%) only when the app folder is read-only (e.g. installed under Program Files).

The machine-scope service index (%ProgramData%) and the admin in-proc index are intentionally <i>not</i> redirected — that path is an install by nature, the opposite of portable.

Resolution is silent: it must not call FileLog, because FileLog's directory comes from here (a cycle otherwise).

public static class AppPaths

Inheritance System.Object → AppPaths

Properties

AppPaths.IsPortable Property

True when state lives next to the exe (or --data-dir), not in the user profile.

public static bool IsPortable { get; }

Property Value

System.Boolean

AppPaths.LogDir Property

App + scope-engine log directory — portable <data>\logs, else %APPDATA%\find-my-files\logs.

public static string LogDir { get; }

Property Value

System.String

AppPaths.PortableRoot Property

The portable data root, or null when falling back to the per-user profile. Surfaced for the setup screen / diagnostics ("running portable from …").

public static string? PortableRoot { get; }

Property Value

System.String

AppPaths.ScopeIndexDir Property

Scope-mode (ADR-0024) index directory — portable <data>\index, else %LOCALAPPDATA%\find-my-files\index.

public static string ScopeIndexDir { get; }

Property Value

System.String

AppPaths.SettingsFile Property

User-scope settings file — portable <data>\settings.json, else %APPDATA%\find-my-files\settings.json.

public static string SettingsFile { get; }

Property Value

System.String