Windows开机自动启动中间件

WinSW(Windows Service Wrapper 是一个开源的 Windows 服务包装器,它可以帮助你将应用程序打包成系统服务,并实现开机自启动的功能。

一、下载 WinSW

下载 WinSW-x64.exe v2.12.0 (⬇️ 更多版本下载) 和 sample-minimal.xml

二、配置 WinSW

下面以nacos举例

  • 重命名 WinSW-x64.exe 为 nacos-service.exe , sample-minimal.xm 为nacos-service.xml ,将重命名后的文件放置在对应中间件的bin目录下(如D:\Program Files\nacos\bin
  • 修改 seata-service.xml 文件的配置如下:

    XML 复制代码
    <service>
      <!-- 唯一服务ID-->
      <id>nacos</id>
      <!-- 显示服务名称 -->
      <name>Nacos Service</name>
      <!-- 服务描述 -->
      <description>Nacos server</description>
      <!-- 日志路径 -->
      <logpath>D:\Program Files\nacos\logs</logpath>
      <!-- 日志模式 -->
      <logmode>roll</logmode>
      <!-- 指定启动可执行文件 -->
      <executable>D:\Program Files\nacos\bin\start-up.bat</executable>
      <!-- 开机启动 -->
      <startmode>Automatic</startmode>
    </service>

三、安装和启动服务

CMD 切换此.exe目录下,执行以下命令完成服务的安装和启动

XML 复制代码
# 安装服务
seata-service.exe install
# 启动服务
seata-service.exe start
# 查看服务状态
seata-service.exe status

其他命令

XML 复制代码
# 卸载服务
seata-service.exe uninstall
# 重启服务
seata-service.exe restart
相关推荐
cpsvps_net11 小时前
美国服务器环境下Windows容器工作负载智能弹性伸缩
windows
甄超锋12 小时前
Java ArrayList的介绍及用法
java·windows·spring boot·python·spring·spring cloud·tomcat
cpsvps14 小时前
美国服务器环境下Windows容器工作负载基于指标的自动扩缩
windows
网硕互联的小客服17 小时前
Apache 如何支持SHTML(SSI)的配置方法
运维·服务器·网络·windows·php
etcix17 小时前
implement copy file content to clipboard on Windows
windows·stm32·单片机
许泽宇的技术分享18 小时前
Windows MCP.Net:基于.NET的Windows桌面自动化MCP服务器深度解析
windows·自动化·.net
非凡ghost19 小时前
AMS PhotoMaster:全方位提升你的照片编辑体验
windows·学习·信息可视化·软件需求
mortimer20 小时前
一次与“顽固”外部程序的艰难交锋:subprocess 调用exe踩坑实录
windows·python·ai编程
gameatp1 天前
从 Windows 到 Linux 服务器的全自动部署教程(免密登录 + 压缩 + 上传 + 启动)
linux·服务器·windows
穷人小水滴1 天前
在 windows 运行 flatpak 应用 (WSL)
linux·windows·ubuntu