Search code examples
web-applicationswindows-servicesinno-setup

How to run non service application as a service


I have a web-based app run in windows environment, after installed the app (built by inno), it located (and its resources) under .\Program Files\

The main executable to run the WebApp is myapp.exe, so i want to run myapp.exe (normal app, non-service) as a windows service app.

Is it possible?


Solution

  • You cannot use a regular application binary as a service. Service binary must implement a special API, see:
    https://learn.microsoft.com/en-us/windows/win32/services/writing-a-service-program-s-main-function


    If you cannot or do not want to rewrite your application to support service API, there are several tools that can wrap a regular application binary as a service.

    One such tool is NSSM - the Non-Sucking Service Manager.