fast-down-gui 0.1.45

超级快的下载器图形化界面
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use auto_launch::{AutoLaunch, AutoLaunchBuilder};
use color_eyre::eyre::{Context, ContextCompat};
use std::env;

pub fn get_auto_start() -> color_eyre::Result<AutoLaunch> {
    let app_name = "fast-down";
    let app_path = env::current_exe().context("无法获取当前程序路径")?;
    let app_path = app_path.to_str().context("无法获取当前程序路径")?;
    AutoLaunchBuilder::new()
        .set_app_name(app_name)
        .set_app_path(app_path)
        .set_args(&["--hidden"])
        .build()
        .context("不支持在当前系统上实现开机自启动")
}