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. | |
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.
|
inlinestatic |
Locates the first existing Anki executable using overrides and platform conventions.
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.
| ArgumentException | An environment override contains an invalid path. |
| IOException | A candidate data directory cannot be enumerated. |
| UnauthorizedAccessException | Installation or profile metadata cannot be accessed. |
Definition at line 34 of file AnkiInstallationDetector.cs.