#package-manager #linux #user-service #self-contained #installer #system #setup

service-install

Easily provide users an install method on Linux systems

9 unstable releases (3 breaking)

0.4.4 Oct 15, 2024
0.4.3 Aug 4, 2024
0.4.2 Apr 21, 2024
0.3.0 Apr 9, 2024
0.1.1 Apr 7, 2024

#272 in Operating systems

Download history 73/week @ 2024-07-29 48/week @ 2024-08-05 9/week @ 2024-08-12 22/week @ 2024-08-26 25/week @ 2024-09-16 14/week @ 2024-09-23 29/week @ 2024-09-30 2/week @ 2024-10-07 170/week @ 2024-10-14 8/week @ 2024-10-21 4/week @ 2024-10-28

186 downloads per month

MIT license

125KB
3K SLoC

** Easily provide users an install method**

Crates.io Crates.io API License

Note this is an early release, there might be bugs

This crate provides the building blocks to build an installer for self contained binaries without runtime dependencies. Such an installer provides less technical users with an easy way to set up your program. It is not a full alternative for integrating with a package manager. For example there is no way to provide updates. Building your own installer is however significantly less work then trying to get your application in all the linux package managers. It is also ideal for tools that are not public.

Features

  • Set up a service to run the application on boot or a schedule
  • Perform the install step by step or in one go
  • Print each step or all at once (or make a tui/prompt!)
  • Roll back on failure
  • Configure the install location or find a suitable one automatically
  • Specify which user the service should run as
  • Undo the installation tearing down the service and removing the files

Example

Installing the current program as a user service named cli that should run at 10:42 every day. This does not need superuser/admin permissions.

use service_install::{install_user, schedule::Schedule};
use time::Time;

fn main() {
    let schedule = Schedule::Daily(Time::from_hms(10, 42, 00).unwrap());
    let done = install_user!()
        .current_exe()
        .unwrap()
        .name("cli")
        .on_schedule(schedule)
        .prepare_install()
        .unwrap()
        .install()
        .unwrap();
}

For more detailed examples (such as a working Tui/Prompt) see

Future work

  • Make the pre build TUI/Prompt more customizable.
  • Windows support (could use some help here, not a big windows user myself)

Contribution

Please let me know if there is anything you would like to see! PR's and issues are very welcome!

Dependencies

~2–28MB
~419K SLoC