alexhua / Aria2-Explorer

An aria2 download task management extension for chromium based browser
https://www.aria2e.com/
BSD 3-Clause "New" or "Revised" License
783 stars 66 forks source link

推荐一个将aria2c安装为服务实现开机自启的方案 #104

Closed nkh0472 closed 1 year ago

nkh0472 commented 1 year ago

Motivation 本插件需要一个在后台运行的aria2c,而关于实现方式仅提供了命令行前台运行及谷歌搜索的方案,并不利于用户快速上手。 因此,我将自己实现aria2c开机自启的方案在此分享,并希望能以某种形式加入readme中

Feature Description

  1. 下载开源程序WinSW,使用v2.x.x版本或v3.x.x版本皆可,对于Windows 10及之后版本的用户,可优先选择NET461版本。(eg. WinSW-net461.exe
  2. 将下载得到的文件WinSW.NET461.exe重命名为aria2-winsw.exe
  3. 新建aria2-winsw.xml文件(文件名需与第2步文件名一致),将下列内容粘贴入内(注意修改字段的文件位置,若无配置文件,请清空字段):
    <service>
    <id>aria2</id>
    <name>Aria2 Service by WinSW</name>
    <description>aria2 is a lightweight multi-protocol and multi-source command-line download utility. </description>
    <executable>D:\Libraries\aria2c.exe</executable>
    <arguments>--conf-path=D:/Software/Aria2/aria2.conf</arguments>
    <priority>Normal</priority>
    <stoptimeout>15 sec</stoptimeout>
    <stopparentprocessfirst>false</stopparentprocessfirst>
    <startmode>Automatic</startmode>
    <delayedAutoStart>true</delayedAutoStart>
    <waithint>15 sec</waithint>
    <sleeptime>1 sec</sleeptime>
    <log mode="none"></log>
    </service>
  4. 在文件所在目录下,运行命令aria2-winsw.exe install && aria2-winsw.exe start,此时完成服务的安装与启动。(若需卸载,在文件所在目录下,运行命令aria2-winsw.exe stop && aria2-winsw.exe uninstall。)
  5. 在浏览器中确认aria2已连接,若未连接请先检查连接配置是否正确、其次检查服务是否启动。目录下的aria2-winsw.wrapper.log文件将提供一些关于服务启动过程中的日志,若服务未成功启动可供参考。

Is the solution code ready No

Willing to maintain the related code in the future No

alexhua commented 1 year ago

挺好的方案,不过我已经准备了一个更简单的程序,会适时提供。