Windows Service Wrapper使用说明
创始人
2026-04-16
0

WinSW 3 can run on Windows platforms with .NET Framework 4.6.1 or later versions installed. For systems without .NET Framework, the project provides native 64-bit and 32-bit executables based on .NET 7.

More executables can be added upon request.

.NET Framework system requirements
Preinstalled since Windows 10, version 1511 and Windows Server 2016.
Installable since Windows 7 SP1 and Windows Server 2008 R2 SP1.

.NET 7 system requirements
Supported since Windows 10, version 1607, Windows Server (Core) 2012 R2 and Nano Server, version 1809.

Latest release and pre-release WinSW binaries are available on GitHub Releases.

Alternative sources:

  1. Take WinSW.exe or WinSW.zip from the distribution.

  2. Write myapp.xml (see the XML config file specification and samples for more details).

  3. Run winsw install myapp.xml [options] to install the service.

  4. Run winsw start myapp.xml to start the service.

  5. Run winsw status myapp.xml to see if your service is up and running.

  1. Take WinSW.exe or WinSW.zip from the distribution, and rename the .exe to your taste (such as myapp.exe).

  2. Write myapp.xml (see the XML config file specification and samples for more details).

  3. Place those two files side by side, because that's how WinSW discovers its co-related configuration.

  4. Run myapp.exe install [options] to install the service.

  5. Run myapp.exe start to start the service.

You write the configuration file that defines your service. The example below is a primitive example being used in the Jenkins project:

<service>
  <id>jenkins</id>
  <name>Jenkins</name>
  <description>This service runs Jenkins continuous integration system.</description>
  <env name="JENKINS_HOME" value="%BASE%"/>
  <executable>java</executable>
  <arguments>-Xrs -Xmx256m -jar "%BASE%\jenkins.war" --httpPort=8080</arguments>
  <log mode="roll"></log>
</service>
<svg aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon"></svg>

The full specification of the configuration file is available here. You can find more samples here.

WinSW is being managed by the XML configuration file.

Your renamed WinSW.exe binary also accepts the following commands:

CommandDescription
installInstalls the service.
uninstallUninstalls the service.
startStarts the service.
stopStops the service.
restartStops and then starts the service.
statusChecks the status of the service.
refreshRefreshes the service properties without reinstallation.
customizeCustomizes the wrapper executable.
devExperimental commands.

Experimental commands:

CommandDescription
dev psDraws the process tree associated with the service.
dev killTerminates the service if it has stopped responding.
dev listLists services managed by the current executable.

Most commands require Administrator privileges to execute. WinSW will prompt for UAC in non-elevated sessions.


【版权声明】
本站部分内容来源于互联网,本站不拥有所有权,不承担相关法律责任。如果发现本站有侵权的内容,欢迎发送邮件至masing@13sy.com 举报,并提供相关证据,一经查实,本站将立刻删除涉嫌侵权内容。

相关内容

热门资讯

windosw2008服务器.... 方案一: windows 2008 R2 意外断电重启进入修复模式 现在出现一个问题,就是当机房停电...
此工作站和主域间的信任关系失败... 原因: 域控服务器没有客户端 的主机名(可能删除了,或重装系统后没添加到域控) 处理: 在域控上确认...
尝试解析加入域中域控制器的DN... 尝试解析加入域中域控制器的DNS名称失败,请验证已将此客户端已配置为连接到解析目标域中DNS名称的D...
在DNS中新增_ldap._t... 加入 Active Directory 域的 DNS 要求Active Directory 使用域名...
客户端不能加入域解决方法 客户端不能加入域解决方法 加入域出现以下错误,windows无法找到网络路径,请确认网络路径正确并且...
AD辅域控制器升级为主域控制器 环境介绍 Active Directory域控制器已经搭建好主域控和辅域控,主域控故障,手动升级辅域...
AD常用操作:批量更改域用户属... 这次使用的是dsquery 和dsmod 命令结合使用 dsquery还有其他不同的用处,可以参考帮...
windows2008R2更改... 网上有使用IIS管理器修改IIS端口的方法,但不适用于windows2008R2系统IIS管理器。本...
Windows Server ... Windows Server Active Directory 证书服务(AD CS)安装与部署指南...
net use命令详解及实例/... netuse命令详解及实例/删除已有的连接 WINDOWS2003(或其他的windows服务器)在...