AnkiIO 1.0.2
Build, validate, import, and export Anki-compatible decks from .NET
Loading...
Searching...
No Matches
AnkiIO.AnkiInstallationDetector Class Reference

Discovers a local Anki executable and reports conservative profile-presence metadata. More...

Static Public Member Functions

static ? AnkiInstallation Detect ()
 Locates the first existing Anki executable using overrides and platform conventions.

Detailed Description

Discovers a local Anki executable and reports conservative profile-presence metadata.

Detection is read-only with respect to Anki. It never starts the application, loads an add-on, opens a collection database, or changes profile data. It checks candidate executable paths, reads Windows uninstall metadata when applicable, enumerates only immediate profile directories, and performs existence checks for known paths.

Set ANKI_EXECUTABLE to prioritize an explicit executable, ANKI_VERSION to supply its version text, and ANKI_DATA_DIRECTORY to override the conventional profile root. These variables are process-wide; applications and tests that temporarily change them must serialize those changes with concurrent detection.

Detection answers where Anki appears to be installed, not whether AnkiIO supports its formats. Pass the returned AnkiInstallation.Version to AnkiCompatibilityRegistry.Resolve for that separate check.

Definition at line 22 of file AnkiInstallationDetector.cs.

Member Function Documentation

◆ Detect()

? AnkiInstallation AnkiIO.AnkiInstallationDetector.Detect ( )
inlinestatic

Locates the first existing Anki executable using overrides and platform conventions.

Returns
A point-in-time installation snapshot, or null when no candidate executable exists.

Candidate precedence is ANKI_EXECUTABLE, Windows uninstall metadata where applicable, and conventional platform paths. On Windows, file product metadata is a version fallback; on other platforms an unavailable or unparseable version is represented by 0.0. No executable code is run during detection.

Exceptions
ArgumentExceptionAn environment override contains an invalid path.
IOExceptionA candidate data directory cannot be enumerated.
UnauthorizedAccessExceptionInstallation or profile metadata cannot be accessed.

Definition at line 34 of file AnkiInstallationDetector.cs.


The documentation for this class was generated from the following file: