{"id":13578914,"url":"https://github.com/mitsuhiko/self-replace","last_synced_at":"2025-10-05T00:42:44.199Z","repository":{"id":165183876,"uuid":"640549079","full_name":"mitsuhiko/self-replace","owner":"mitsuhiko","description":"Utility library that helps to implement processes that replace themselves","archived":false,"fork":false,"pushed_at":"2024-09-23T21:20:05.000Z","size":69,"stargazers_count":683,"open_issues_count":4,"forks_count":26,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-05-12T02:06:52.760Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mitsuhiko.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["mitsuhiko"]}},"created_at":"2023-05-14T13:14:47.000Z","updated_at":"2025-05-10T20:56:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"23e43a67-b294-4f3a-b460-b8968b5075b3","html_url":"https://github.com/mitsuhiko/self-replace","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitsuhiko%2Fself-replace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitsuhiko%2Fself-replace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitsuhiko%2Fself-replace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitsuhiko%2Fself-replace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mitsuhiko","download_url":"https://codeload.github.com/mitsuhiko/self-replace/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254209859,"owners_count":22032897,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T15:01:34.987Z","updated_at":"2025-10-05T00:42:44.104Z","avatar_url":"https://github.com/mitsuhiko.png","language":"Rust","readme":"# Self-Replace: A Utility For Self Replacing Executables\n\n[![Crates.io](https://img.shields.io/crates/d/self-replace.svg)](https://crates.io/crates/self-replace)\n[![License](https://img.shields.io/github/license/mitsuhiko/self-replace)](https://github.com/mitsuhiko/self-replace/blob/main/LICENSE)\n[![rustc 1.63.0](https://img.shields.io/badge/rust-1.63%2B-orange.svg)](https://img.shields.io/badge/rust-1.63%2B-orange.svg)\n[![Documentation](https://docs.rs/self-replace/badge.svg)](https://docs.rs/self-replace)\n\n`self-replace` is a crate that allows binaries to replace themselves with newer\nversions or to uninstall themselves.  On Unix systems this is a simple feat, but\non Windows a few hacks are needed which is why this crate exists.\n\nThis is a useful operation when working with single-executable utilties that\nwant to implement a form of self updating or self uninstallation.\n\nFor details about the implementation refer to the [documentation](https://docs.rs/self-replace).\n\nIf you are looking for some higher level update logic, have a look at\n[`self_update`](https://crates.io/crates/self_update) which uses `self-replace`\nunder the hood but provides automatic updating from GitHub releases or\nother distribution channels.  Note that `self_update` is maintained by\nother maintainers.\n\n## Uninstall\n\nTo uninstall a binary, use `self_delete`.\n\n```rust\nself_replace::self_delete()?;\n```\n\n## Updating\n\nTo replace a binary for updating, use `self_replace`.\n\n```rust\nlet new_binary = \"/path/to/new/binary\";\nself_replace::self_replace(\u0026new_binary)?;\nstd::fs::remove_file(\u0026new_binary)?;\n```\n\n## License and Links\n\n* [Documentation](https://docs.rs/self-replace/)\n* [Issue Tracker](https://github.com/mitsuhiko/self-replace/issues)\n* [Examples](https://github.com/mitsuhiko/self-replace/tree/main/examples)\n* License: [Apache-2.0](https://github.com/mitsuhiko/self-replace/blob/main/LICENSE)\n","funding_links":["https://github.com/sponsors/mitsuhiko"],"categories":["Rust"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitsuhiko%2Fself-replace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmitsuhiko%2Fself-replace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitsuhiko%2Fself-replace/lists"}