Use RaiDrive to mount Alibaba cloud disk to local and start automatically after booting

foreword

There are many ways to mount Alibaba Cloud disks to the local network, which are similar to each other. Here is just one way I recommend. This method is to use RaiDrive and webdav-aliyundriver to install it into the service and start it automatically without feeling any pop-up window. Personally, the experience of using Ali's network disk is not bad. With 100M mobile broadband, you can play 100M video directly after buffering for a while.

Step 1: Prepare the software

First of all, we have to prepare three software. The author has already packaged the basic configuration, which is convenient for direct download.

  1. Click here to download the package and unzip it to skip steps 2, 3, and 4. The package contains the following

webdav-aliyundriver-2.4.2.exe corresponds to WinSW
webdav-aliyundriver-2.4.2.xml corresponds to WinSW configuration file
webdav-aliyundriver-2.4.2.jar corresponds to webdav-aliyundriver
Here for your convenience, please modify it in advance Ok, the name
raiddrive-2021-10-9.exe, after double-clicking the installation, you can delete the installation package, and the rest cannot be deleted

insert image description here

  1. RaiDrive click here to download the latest version from the official website and install it
  2. webdav-aliyundriver Click here to go to Github to download the latest version and install it
  3. WinSW click here to go to Github to download the latest version and install it

Step 2: Install the software

If you have downloaded the software package prepared by the author, you can skip Step install and configure webdav-aliyundriver and WinSW, and go directly to Step 3 : Configuration and Startup

1. RaiDrive installation

Double-click to select the language and installation directory, and install it directly.

2. Install and configure webdav-aliyundriver and WinSW

Create a folder in any directory, and create a folder named aliyundriver in the D drive for demonstration
Create aliyundriver folder
. Put the downloaded webdav-aliyundriver and WinSW in the aliyundriver directory, as shown in the figure:

webdav-aliyundriver is a jar file
, WinSW is an exe executable file
, as shown here, keep the names of the two files the same

Place webdav-aliyundriver and WinSW files

Step 3: Configuration and Startup

If you use the software package, modify the webdav-aliyundriver-2.4.2.xml file in the software package and modify
the value of --aliyundrive.refresh-token. For the method of token acquisition, see Obtaining the refreshToken of your own account in Aliyun Drive in this section.
Modify TOKEN

1. Obtain the refreshToken of your own account in Alibaba Cloud Disk

Click here to log to your Alibaba Cloud Disk account

After successful login, press F12 to open the developer tool, find the token as shown in the figure,
find token
and copy your refreshToken value
refreshToken

2. Create and configure xml (if you use a package, you don't need to do this step)

In the aliyundriver directory created by yourself, create a file with the same name as other files. After opening, copy the code below into the file and modify the value of --aliyundrive.refresh-token.
create and configure xml

<service>
  
  <!-- ID of the service. It should be unique across the Windows system-->
  <id>webdav-aliyundriver</id>
  <!-- Display name of the service -->
  <name>webdav-aliyundriver</name>
  <!-- Service description -->
  <description>webdav-aliyundriver</description>
  
  <!-- Path to the executable, which should be started -->
  <executable>java</executable>

  <!-- 
       aliyundrive.refresh-token 填写TOKEN
       server.port 填写端口
       这里出于避免与其它服务冲突将其默认8080修改为8181,当然你也可以修改成自己的端口 
  -->
  <arguments>-jar webdav-aliyundriver-2.4.2.jar --aliyundrive.refresh-token="填写TOKEN"  --server.port="8181" --aliyundrive.auth.enable=true --aliyundrive.auth.user-name="admin" --aliyundrive.auth.password="admin"</arguments>
   <!--
    OPTION: onfailure
    Defines a sequence of actions, which should be performed if the managed executable fails.
    Supported actions: restart, reboot, none
  -->
  <onfailure action="restart" delay="10 sec"/>
  <onfailure action="restart" delay="20 sec"/>
  <!--
    OPTION: resetfailure
    Time, after which the Windows service resets the failure status.
    Default value: 1 day
  -->
  <resetfailure>1 hour</resetfailure>
  <!--
    OPTION: priority
    Desired process priority.
    Possible values: Normal, Idle, High, RealTime, BelowNormal, AboveNormal
    Default value: Normal
  -->
  <priority>Normal</priority>
  
  <!-- 
    OPTION: stoptimeout
    Time to wait for the service to gracefully shutdown the executable before we forcibly kill it
    Default value: 15 seconds
  -->
  <stoptimeout>15 sec</stoptimeout>
    
  <!--
    OPTION: stopparentprocessfirst
    If set, WinSW will terminate the parent process before stopping the children.
    Default value: false
  -->
  <stopparentprocessfirst>false</stopparentprocessfirst>
 
    <!--
      OPTION: startmode
      Defines start mode of the service.
      Supported modes: Automatic, Manual, Boot, System (latter ones are supported for driver services only)
      Default mode: Automatic
    -->
    <startmode>Automatic</startmode>
    <waithint>15 sec</waithint>
    <sleeptime>1 sec</sleeptime>

    <log mode="roll-by-size">
        <sizeThreshold>10240</sizeThreshold>
        <keepFiles>8</keepFiles>
    </log>
</service>

3. Install the service and start

Open a command line window as administrator
CMD

Use the cd command to enter the aliyundriver directory created by yourself or enter the location where the downloaded software package is decompressed. For example, it is placed in the D:\Program Files\aliyundriver directory under the D drive.
enter the directory
After making sure to enter in management mode, execute the following command:

webdav-aliyundriver-2.4.2 Remember to match the name you modified here

webdav-aliyundriver-2.4.2.exe install

This has been executed once, so the prompt already exists, the first installation will prompt the installation to be successful,
install service
and then execute the following command to start the service

net start webdav-aliyundriver

start the service

4. Start the RaiDrive connection to mount the Alibaba Cloud disk to the local

1. Open the RaiDrive software and click Add
Open the software

2. Check the configuration as shown in the figure

The account and password are both admin
8181 is
the option behind the port address to be removed, otherwise it will fail.
Select and fill in the drive letter and name according to your own preferences

add mount
After the final configuration is completed, click Connect to complete, and the subsequent startup will also automatically connect.

If one day you don't want to use it and want to uninstall it, just uninstall the RaiDrive software

After uninstalling the service using the command

webdav-aliyundriver-2.4.2.exe uninstall

Out of service

webdav-aliyundriver-2.4.2.exe stop

Guess you like

Origin blog.csdn.net/weixin_42795002/article/details/121864236