|
1 | 1 | # Install as a Windows Service |
2 | 2 |
|
3 | | -> Thanks to BeiChen℃ for providing the tutorial, and dawn-lc for providing the one-click install/uninstall script |
| 3 | +After EasyTier is installed as a Windows service, it can run in the background and start automatically with the system. This is useful for long-running or unattended deployments. |
4 | 4 |
|
5 | | -On Windows systems, installing certain applications as services allows them to run automatically in the background without manual intervention, greatly improving the stability and convenience of the application. |
| 5 | +The recommended approach is to use the official `install.cmd` script for installation, updates, and removal. You no longer need to prepare NSSM manually. |
6 | 6 |
|
7 | | -This tutorial will use NSSM (Non-Sucking Service Manager) to install the EasyTier application as a Windows service as an example, and provide a detailed explanation of the entire operation process. |
| 7 | +> Thanks to BeiChen℃ for the original tutorial and dawn-lc for the one-click install/uninstall script. |
8 | 8 |
|
9 | | -## 1. Preparation |
| 9 | +## Quick Start |
10 | 10 |
|
11 | | -**Download EasyTier Application**: |
| 11 | +Open PowerShell in the directory where you want to install EasyTier and run: |
12 | 12 |
|
13 | | -Download the latest version of the `Windows` operating system `command line program` compressed package. |
| 13 | +```PowerShell |
| 14 | +iwr "https://raw.githubusercontent.com/EasyTier/EasyTier/main/script/install.cmd" -OutFile "install.cmd"; .\install.cmd |
| 15 | +``` |
14 | 16 |
|
15 | | -After downloading, extract the compressed package to a local directory, such as `D:\EasyTier`. |
| 17 | +If GitHub is not accessible, use the mirror proxy command instead: |
16 | 18 |
|
17 | | -The current directory should contain at least the following files: |
| 19 | +```PowerShell |
| 20 | +iwr "https://ghfast.top/https://raw.githubusercontent.com/EasyTier/EasyTier/main/script/install.cmd" -OutFile "install.cmd"; .\install.cmd -ughp |
| 21 | +``` |
18 | 22 |
|
19 | | -- `easytier-core.exe` (core program) |
20 | | -- `easytier-cli.exe` (command line tool) |
21 | | -- `Packet.dll` (runtime library) |
22 | | -- `wintun.dll` (runtime library) |
| 23 | +The script will guide you through the setup and start the service automatically after installation succeeds. |
23 | 24 |
|
24 | | -**Download NSSM**: |
| 25 | +## Installation Steps |
25 | 26 |
|
26 | | -Open your browser and visit the NSSM official website [https://nssm.cc/](https://nssm.cc/download). |
| 27 | +1. Open PowerShell in the directory where you want to install EasyTier. |
| 28 | +2. Run the install script: |
27 | 29 |
|
28 | | -On the official website page, find the version suitable for your system (usually the latest version), click the download link to download it locally. |
| 30 | + ```PowerShell |
| 31 | + .\install.cmd |
| 32 | + ``` |
29 | 33 |
|
30 | | -After downloading, find the version corresponding to your device architecture (such as: `win64`), and extract the `nssm.exe` from it to the local directory where `EasyTier` is located. |
| 34 | +3. Choose a configuration mode and provide the required values when prompted. |
| 35 | +4. After the script finishes, the Windows service is created and started automatically. |
31 | 36 |
|
32 | | -**Download Install/Uninstall Script**: |
| 37 | +## Configuration Modes |
33 | 38 |
|
34 | | -Start PowerShell in the current directory and execute the following commands: |
| 39 | +- `File`: use a local configuration file. Best when you already have a config file prepared. |
| 40 | +- `Remote`: use centralized management from a remote server. Best for managing multiple devices. |
| 41 | +- `CLI`: pass parameters directly on the command line. Best for quick testing or custom startup arguments. |
35 | 42 |
|
36 | | -`iwr "https://github.com/EasyTier/EasyTier/raw/refs/heads/main/script/install.cmd" -OutFile "install.cmd"` |
| 43 | +## Common Commands |
37 | 44 |
|
38 | | -`iwr "https://github.com/EasyTier/EasyTier/raw/refs/heads/main/script/uninstall.cmd" -OutFile "uninstall.cmd"` |
| 45 | +- Install the service: |
39 | 46 |
|
40 | | -## 2. Preparation Work |
| 47 | + ```PowerShell |
| 48 | + .\install.cmd |
| 49 | + ``` |
41 | 50 |
|
42 | | -1. Ensure the current directory contains the following files: |
| 51 | +- Uninstall the service: |
43 | 52 |
|
44 | | - - `easytier-core.exe` (core program) |
45 | | - - `easytier-cli.exe` (command line tool) |
46 | | - - `nssm.exe` (service management tool) |
47 | | - - `Packet.dll` (runtime library) |
48 | | - - `wintun.dll` (runtime library) |
49 | | - - `install.cmd` (install script) |
50 | | - - `uninstall.cmd` (uninstall script) |
| 53 | + ```PowerShell |
| 54 | + .\install.cmd -Uninstall |
| 55 | + ``` |
51 | 56 |
|
52 | | -2. Place the entire folder in a fixed location. |
| 57 | +- Update EasyTier: |
53 | 58 |
|
54 | | -## 3. Install Service |
| 59 | + ```PowerShell |
| 60 | + .\install.cmd -Update |
| 61 | + ``` |
55 | 62 |
|
56 | | -1. Run `install.cmd` |
57 | | -2. Follow the prompts to enter configuration information. |
58 | | -3. After installation is complete, the service will start automatically. |
| 63 | +## Parameter Reference |
59 | 64 |
|
60 | | -## 4. Uninstall Service |
| 65 | +### Basic |
61 | 66 |
|
62 | | -1. Run `uninstall.cmd` |
63 | | -2. The script will automatically stop and delete the service. |
| 67 | +- `-H` / `-?` / `-Help`: show help information and exit. |
64 | 68 |
|
65 | | -## 5. Notes |
| 69 | +### Service Actions |
66 | 70 |
|
67 | | -1. Do not move the program file location after installation |
| 71 | +- `-U` / `-Update`: update EasyTier to the latest version. |
| 72 | +- `-X` / `-Uninstall`: uninstall the EasyTier service. |
68 | 73 |
|
69 | | -## 6. Common Questions |
| 74 | +### Download Proxies |
70 | 75 |
|
71 | | -**Q: How to modify service configuration?** |
| 76 | +- `-UGHP` / `-UseGitHubProxy`: download through a GitHub mirror proxy. Default: `$false`. |
| 77 | +- `-GHP` / `-GitHubProxy <proxy>`: specify the GitHub mirror proxy address. Default: `https://ghfast.top/`. |
| 78 | +- `-UP` / `-UseProxy`: use a custom proxy. Default: `$false`. |
| 79 | +- `-P` / `-Proxy <proxy>`: specify the custom proxy address. Default: `http://127.0.0.1:7890`. |
72 | 80 |
|
73 | | -A: First uninstall the service, then reinstall it |
| 81 | +### Configuration and Service Name |
| 82 | + |
| 83 | +- `-C` / `-ConfigType <type>`: set the configuration mode. Supported values: `File`, `Remote`, `CLI`. |
| 84 | +- `-N` / `-ServiceName <name>`: set the installed service name. Default: `EasyTierService`. |
| 85 | +- `<other arguments...>`: when `CLI` mode is used, any remaining arguments are passed to EasyTier. |
| 86 | + |
| 87 | +## FAQ |
| 88 | + |
| 89 | +**Q: How do I change the service configuration?** |
| 90 | + |
| 91 | +A: First run `.\install.cmd -Uninstall`, then install the service again with the new configuration. |
| 92 | + |
| 93 | +**Q: Why should I keep the directory in the same place after installation?** |
| 94 | + |
| 95 | +A: The Windows service stores the paths to the EasyTier executables and script. If the directory moves, the service may fail to start. |
0 commit comments