{"id":21233656,"url":"https://github.com/bdr-pro/auto_downloader","last_synced_at":"2025-06-15T09:34:46.769Z","repository":{"id":228436168,"uuid":"774027159","full_name":"BDR-Pro/auto_downloader","owner":"BDR-Pro","description":"👋 Welcome to auto_downloader, the coolest Rust project for automatically updating your app with zero hassle.","archived":false,"fork":false,"pushed_at":"2024-03-18T20:17:38.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-22T13:31:54.087Z","etag":null,"topics":["automation","crates","downloader","rust"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/auto_downloader","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BDR-Pro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","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}},"created_at":"2024-03-18T20:17:36.000Z","updated_at":"2024-03-18T20:20:28.000Z","dependencies_parsed_at":"2024-03-18T21:03:40.206Z","dependency_job_id":null,"html_url":"https://github.com/BDR-Pro/auto_downloader","commit_stats":null,"previous_names":["bdr-pro/auto_downloader"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BDR-Pro/auto_downloader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BDR-Pro%2Fauto_downloader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BDR-Pro%2Fauto_downloader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BDR-Pro%2Fauto_downloader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BDR-Pro%2Fauto_downloader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BDR-Pro","download_url":"https://codeload.github.com/BDR-Pro/auto_downloader/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BDR-Pro%2Fauto_downloader/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259952457,"owners_count":22936956,"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":["automation","crates","downloader","rust"],"created_at":"2024-11-20T23:59:50.763Z","updated_at":"2025-06-15T09:34:46.755Z","avatar_url":"https://github.com/BDR-Pro.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚀 Auto Downloader 🚀\n\nHey there, fellow Rustacean! 👋 Welcome to `auto_downloader`, the coolest Rust project for automatically updating your app with zero hassle. Whether you're looking to keep your application up-to-date without lifting a finger or just dabbling in Rust, you've come to the right place!\n\n## What's This Project All About? 🤔\n\nIn the digital world, staying updated is the name of the game. That's why `auto_downloader` is here to save the day! It checks for updates, downloads the new version, and gets your app running the latest and greatest version in no time. It's like having a little robot 🤖 inside your computer, making sure you're always at the cutting edge.\n\n## Getting Started 🚀\n\n### Prerequisites\n\n- Rust installed on your machine (duh! 😜). If you don't have it yet, visit [the official Rust website](https://www.rust-lang.org/tools/install) to get set up!\n\n### Installation\n\nadd this to your `Cargo.toml` file:\n\n```toml\n[dependencies]\nauto_downloader = \"0.2.0\"\n```\n\nVoilà! You're now running `auto_downloader`. Watch it work its magic! ✨\n\n## Features 🌟\n\n- **Automatic Updates**: Checks for updates and downloads them without you having to move a muscle.\n- **Secure**: Verifies download integrity to keep the nasties away. 🛡️\n- **Cross-Platform Goodness**: Works on all your favorite platforms. 🖥️ 🍏 🪟\n\n## How to Use 🛠️\n\nHonestly? Just let it do its thing! `auto_downloader` works in the background, ensuring your application is always up to date. For those who like to tinker, dive into the `src` folder to see how the magic happens. Who knows, you might find some cool ideas for your next Rust project!\n\n## Contributing 🤝\n\nWant to contribute? Awesome! Feel free to fork the repo, make your changes, and submit a pull request. All ideas and contributions are welcome. Let's make `auto_downloader` even better together!\n\n## License 📜\n\nThis project is proudly licensed under the MIT License. See the [LICENSE](LICENSE.md) file for details.\n\n## Final Words 📢\n\nThanks for checking out `auto_downloader`! If you like what you see, give it a star ⭐, and share it with your friends. Happy coding, and may your applications always be up-to-date!\n\n## Example\n\n```json\n{\n    \"version\": \"1.0.1\",\n    \"download_url\": \"https://example.com/your_application_1.0.1.exe\",\n    \"sha256_checksum\": \"d73d56b328d5a8ffdf27430edb4d9d68e1e2a8f2c3e2656c672e4f6b76153a2b\",\n    \"app_name\": \"your_application.exe\"\n}\n```\n\n## Code\n\n- **in updater.rs**\n\n```rust\nuse auto_downloader;\nuse std::{env, fs, process::Command, thread::sleep, time::Duration};\n\nfn main() {\n    let info_url = \"https://example.com/version_info.json\";\n\n    let Ok(version_info) = common::get_version_info(info_url) else {\n        eprintln!(\"Failed to get update info.\");\n        return;\n    };\n\n    let temp_path = env::temp_dir().join(\"update_new.bin\");\n    println!(\"⬇️ Downloading new version...\");\n    if let Err(e) = common::download_new_version(\u0026version_info.download_url, \u0026temp_path) {\n        eprintln!(\"Download failed: {}\", e);\n        return;\n    }\n\n    println!(\"🔒 Verifying checksum...\");\n    match common::compute_file_sha256(\u0026temp_path) {\n        Ok(hash) if hash != version_info.sha256_checksum =\u003e {\n            eprintln!(\"❌ Checksum mismatch. Aborting update.\");\n            return;\n        }\n        Ok(_) =\u003e println!(\"✅ Checksum verified.\"),\n        Err(e) =\u003e {\n            eprintln!(\"Error computing checksum: {}\", e);\n            return;\n        }\n    }\n\n    let app_path = env::current_dir().unwrap().join(\u0026version_info.app_name);\n\n    // Wait for the main app to exit\n    println!(\"⏳ Waiting for app to close...\");\n    sleep(Duration::from_secs(1));\n\n    if cfg!(target_os = \"windows\") {\n        fs::remove_file(\u0026app_path).ok();\n    }\n\n    println!(\"🔄 Replacing binary...\");\n    fs::rename(\u0026temp_path, \u0026app_path).expect(\"Failed to replace binary\");\n\n    println!(\"🚀 Launching new version...\");\n    Command::new(\u0026app_path)\n        .spawn()\n        .expect(\"Failed to launch new version\");\n}\n\n\n```\n\n- **in main.rs**\n\n```rust\n\nuse auto_downloader::get_version_info;\nuse std::process::Command;\n\nfn main() {\n    let current_version = \"1.0.0\";\n    let info_url = \"https://example.com/version_info.json\";\n\n    match get_version_info(info_url) {\n        Ok(info) if info.version != current_version =\u003e {\n            println!(\"Update available. Launching updater...\");\n            Command::new(\"updater\")\n                .spawn()\n                .expect(\"Failed to launch updater\");\n            std::process::exit(0);\n        }\n        Ok(_) =\u003e println!(\"✅ You're up to date!\"),\n        Err(e) =\u003e eprintln!(\"Failed to check version: {}\", e),\n    }\n\n    // Your real app logic goes here\n    println!(\"🧠 Main app is running...\");\n}\n\n\n\n/*\n\n\n{\n    \"version\": \"1.0.1\",\n    \"download_url\": \"https://example.com/your_application_1.0.1.exe\",\n    \"sha256_checksum\": \"d73d56b328d5a8ffdf27430edb4d9d68e1e2a8f2c3e2656c672e4f6b76153a2b\",\n    \"app_name\": \"your_application.exe\"\n}\n\n\n\n\n*/\n\n```\n\n## Authors\n\n👤 **Bader alotaibi** @ *\u003cbaderalotaibi3@gmail.com\u003e*\n\n## Show your support\n\nGive a ⭐️ if you like this project!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbdr-pro%2Fauto_downloader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbdr-pro%2Fauto_downloader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbdr-pro%2Fauto_downloader/lists"}