1 Star 0 Fork 0

kimlong / winsw

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Windows Service Wrapper in a permissive license

Github All Releases GitHub Release NuGet Build Status Deployment Status Gitter License

WinSW wraps and manages any application as a Windows service.

We are actively developing WinSW 3. Please refer to the v2 branch for previous version documentation.

Why?

See the project manifest.

Supported platforms

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 Core.

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 5 system requirements
Supported since Windows 7 SP1, Windows Server (Core) 2012 R2 and Nano Server, version 1809.

Download

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

Alternative sources:

Get started

Use WinSW as a global tool

  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.

Use WinSW as a bundled tool

  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.

Sample configuration file

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>

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

Usage

WinSW is being managed by the XML configuration file.

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

Command Description
install Installs the service.
uninstall Uninstalls the service.
start Starts the service.
stop Stops the service.
restart Stops and then starts the service.
status Checks the status of the service.
refresh Refreshes the service properties without reinstallation.
customize Customizes the wrapper executable.
dev Experimental commands.

Experimental commands:

Command Description
dev ps Draws the process tree associated with the service.
dev kill Terminates the service if it has stopped responding.
dev list Lists services managed by the current executable.

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

Documentation

Contributing

Contributions are welcome! See the contributing guidelines for more information.

License

WinSW is licensed under the MIT license.

MIT License Copyright (c) 2008-2020 Kohsuke Kawaguchi, Sun Microsystems, Inc., CloudBees, Inc., Oleg Nenashev and other contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

暂无描述 展开 收起
C# 等 2 种语言
MIT
取消

发行版 (1)

全部

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/gkl_kimlong/winsw.git
git@gitee.com:gkl_kimlong/winsw.git
gkl_kimlong
winsw
winsw
v3

搜索帮助