|new 1.3.7||Sep 19, 2023|
|1.3.6||Aug 25, 2023|
|1.3.5||Jun 3, 2023|
|1.3.3||May 19, 2023|
#247 in Filesystem
18,120 downloads per month
Used in 7 crates (2 directly)
Self-Replace: A Utility For Self Replacing Executables
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.
To uninstall a binary, use
To replace a binary for updating, use
let new_binary = "/path/to/new/binary"; self_replace::self_replace(&new_binary)?; std::fs::remove_file(&new_binary)?;
License and Links