概述
WinSW is an executable binary, which can be used to wrap and manage a custom process as a Windows service. Once you download the installation package, you can rename WinSW.exe to any name, e.g. MyService.exe.
翻译:
WinSW是一个可执行的二进制文件,可用于将自定义进程包装和管理为Windows服务。下载安装包后,可以重命名WinSW.exe文件任何名字,例如。MyService.exe.
需要注意的是,上面的下载包圈错了,应该是下载第一个,然后下载xml文件
密码: brsg
使用
将打包的SpringBoot项目和下载的XML文件/server.exe文件存放在一个目录下
修改配置文件ZJDYService.xml
ZJDY
ZJDY
这是winsw生成的服务
java
-jar ZJDY.jar
启动
当前目录下打开命令行,执行如下命令
# 安装Windows服务
$ ZJDYService.exe install
# 卸载服务
$ ZJDYService.exe uninstall
# 启动服务
$ net start 项目名称
# 关闭服务
$ net stop 项目名称
# 重启服务
$ net restart 项目名称
# 寻找帮助
$ 项目名称 /?
# 查看版本
$ 项目名称 version
# 检查服务是否可以启动然后停止
$ 项目名称 test
# 检查服务状态
$ net status ZJDY
其他-配置文件详细说明
myapp
MyApp Service (powered by WinSW)
This service is a service cratead from a sample configuration
%BASE%\myExecutable.exe
Normal
15 sec
false
Automatic
15 sec
1 sec