Skip to main content

detect_installed_version

Function detect_installed_version 

Source
pub fn detect_installed_version(
    app_dir: &Path,
    exec_path_inside_app: &Path,
    command_name: &str,
    app_id: &str,
    app_name: &str,
) -> Result<Option<VersionProbeResult>>
Expand description

Detect version after the archive has been copied into the final app dir.

Order:

  1. Metadata files: product-info.json, package.json, VERSION, etc.
  2. Runtime command probes: –version, -version, -v, version, -V, then no args.

Important: runtime probes execute code from the extracted tarball. Only call this after the user has decided to install the package, and expose a way to disable it.