8000 GitHub - ferama/wsw at refs/tags/0.8.1
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
/ wsw Public

๐Ÿฅช A tiny, practical tool that lets any executable run as a real Windows service, with zero boilerplate.

License

Notifications You must be signed in to change notification settings

ferama/wsw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

WSW - Windows Service Wrapper

๐Ÿ’ก A tiny, practical tool that lets any executable or script run as a real Windows service, with zero boilerplate.

๐Ÿš€ What is WSW?

Running background applications or daemons as Windows services should be easy โ€” but in reality, Windows makes it tricky.

If you've ever tried to:

  • Wrap a custom binary as a service
  • Automatically restart a tool on failure
  • Avoid writing a Windows service in C++ or wrestling with the Windows API
  • Escape painful sc.exe syntax and quoting errors

Then WSW is for you.

โœ… Features

  • ๐Ÿง  Simple CLI interface: one command installs and starts your service
  • โš™๏ธ Wraps any executable โ€” even with arguments
  • ๐Ÿ’ฅ Automatic restart if the wrapped process crashes
  • ๐Ÿงผ Clean install/uninstall without needing sc.exe
  • ๐Ÿ“œ Logs every restart attempt and failure
  • ๐Ÿ’ผ Built with pure Rust

๐Ÿ”ง Usage

๐Ÿ› ๏ธ Install

# using cargo
cargo install --git https://github.com/ferama/wsw

or download a prebuilt binary from github release page

๐Ÿ› ๏ธ Install your executable as a Windows service:

wsw.exe install --name myapp --cmd "C:\MyApp\app.exe --arg1 --arg2"

This will:

  • Install wsw.exe as a Windows service named myapp
  • Configure it to launch app.exe --arg1 --arg2
  • Automatically start it

๐Ÿงน Uninstall the service:

wsw.exe uninstall --name myapp

Stops and removes the service cleanly.

๐Ÿงช Run manually (for testing):

You can also run it directly without installing as a service:

wsw.exe run --cmd "C:\MyApp\app.exe --arg1 --arg2"

This is how the Windows Service Manager internally starts it โ€” useful for debugging.

๐Ÿ” How it works

WSW installs itself as a service and monitors a child process (your actual app).
If the child process exits or crashes, WSW logs the event and restarts it after a short delay.

This makes your app:

  • Service-friendly
  • Resilient to crashes
  • Easy to deploy

๐Ÿ“ฆ Use case examples

  • Running a Go, Rust, Net, any other runnable app as a service
  • Auto-starting a CLI tool with logging on boot
  • Running off-the-shelf tools like Python or Powershell scripts in the background
  • Easy service wrapping in CI setups or cloud VMs

๐Ÿ“บ Prevent Windows Defender complaints

Windows Defender or other antivirus software might incorrectly flag wsw as a virus. This is because it uses low-level Windows APIs to install itself as a service, which can be interpreted as malicious behavior by some security tools.

To prevent this you can exlude the directory where wsw is installed from Windows Defender using a command like this:

Add-MpPreference -ExclusionPath "C:\Path\To\wsw"

Replace C:\Path\To\wsw with the actual installation path.

๐Ÿ“„ License

MIT

โค๏ธ Contribute

Got an idea or edge case? Open an issue or pull request โ€” it's a tiny project, but it loves real-world use!

About

๐Ÿฅช A tiny, practical tool that lets any executable run as a real Windows service, with zero boilerplate.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •  
0