Skip to main content

Module install_method

Module install_method 

Source
Expand description

Detect how Smriti was installed, so the update UI can take the right action when the user clicks “Download”.

We deliberately avoid self-replacing package-manager-managed binaries (apt, Homebrew, winget, Flatpak, Snap) — that path is the package manager’s job, and stomping on it would confuse the system. Instead, for those users the update banner shows the matching upgrade command.

Detection is path-based because it’s cheap and robust. False negatives map to Unknown, which the update handler turns into an “open release page in browser” fallback, so a wrong answer here fails safely rather than corrupting an install.

Enums§

InstallMethod
How Smriti was installed on this machine.

Functions§

detect
Detect the install method for the currently-running executable. Uses std::env::current_exe internally.