Skip to content

Utility library that helps to implement processes that replace themselves

License

Notifications You must be signed in to change notification settings

systeminit/self-replace

This branch is 19 commits behind mitsuhiko/self-replace:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

60dd10a · Jun 3, 2023

History

40 Commits
May 18, 2023
May 14, 2023
May 19, 2023
May 20, 2023
May 19, 2023
May 14, 2023
Jun 3, 2023
Jun 3, 2023
Jun 3, 2023
May 14, 2023
May 18, 2023
May 16, 2023
May 17, 2023
May 17, 2023

Repository files navigation

Self-Replace: A Utility For Self Replacing Executables

Build Status Crates.io License rustc 1.48.0 Documentation

self-replace is a crate that allows binaries to replace themselves with newer versions or to uninstall themselves. On Unix systems this is a simple feat, but on Windows a few hacks are needed which is why this crate exists.

This is a useful operation when working with single-executable utilties that want to implement a form of self updating or self uninstallation.

For details about the implementation refer to the documentation.

Uninstall

To uninstall a binary, use self_delete.

self_replace::self_delete()?;

Updating

To replace a binary for updating, use self_replace.

let new_binary = "/path/to/new/binary";
self_replace::self_replace(&new_binary)?;
std::fs::remove_file(&new_binary)?;

License and Links

About

Utility library that helps to implement processes that replace themselves

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 94.2%
  • Batchfile 2.1%
  • Shell 2.0%
  • Makefile 1.7%