Crate takecrate

Source
Expand description

Add installer functionality to standalone binaries.

This crate enables CLI applications to be distributed as standalone binaries that can install and uninstall themselves.

§Overview

To get started:

  1. Create a unique ID for your application using AppId.
  2. Create the listing of input files using PackageManifest.
  3. Based on context, run install_interactive() or uninstall_interactive(), or continue normally in your binary.
  4. If you need a included data file in a installation, use manifest() to get a DiskManifest.

§Example

let app_id = AppId::new("com.example.my-app")?;
let manifest = PackageManifest::new(&app_id).with_self_exe()?;

if exe_name.ends_with("_installer") {
    takecrate::install_interactive(&manifest)?;
}

§Further reading

More information

Modules§

error
Common error types.
i18ni18n
Internationalization and localization (globalization) support.
inst
Installer functionality.
lib_doc
Documentation further reading.
manifest
Describing the contents an installed package.
os
OS specific functionalities.
path
Describing where files are located.
tuiui
Terminal user interface.
uninst
Uninstaller functionality.

Functions§

install
Installs the binary to the device with the given configuration.
install_interactiveui
Starts the installer with a interactive interface.
manifest
Returns the disk manifest when the binary is installed.
uninstall
Uninstalls the binary from the device with the given application ID.
uninstall_interactiveui
Starts the uninstaller with a interactive interface.