Search code examples
cwindowswindows-servicesinstallationnsis

Install/Uninstall C Windows Service


I have written a windows service in C. I would like to install/uninstall it without using .NET framework (installutil) or a visual studio installer (because I'm writing this in C).

I am using NSIS to install my application which contains this service among many other things. Can NSIS install/uninstall windows services, if not, how can I programatically install/uninstall a windows service in C. I have seen examples of this for C# and VB but not for C.


Solution

  • The NSIS documentation lists the various possibilities. You simply need to pick the one most suitable to your needs.

    It's much easier to get NSIS to do this than to script it yourself by calling the service control manager API.