Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>There are at least two ways: one of these is the 'right' way, and one is 'wrong' (but works.)</p> <h2>The wrong-but-works way</h2> <p>You can run any application as a service through (host) helper utilities, such as:</p> <ul> <li><a href="http://serviceex.com/" rel="noreferrer">ServiceEx</a>, "a freeware Windows application that allows a normal program to run as a Windows service". I have never used this, I just found it through Googling.</li> <li><a href="http://support.microsoft.com/kb/137890" rel="noreferrer">One of two utilities Microsoft provides</a> (Since it's from MS, I would use this one.)</li> </ul> <p>Why is this the wrong way? Because if you want your application to run as a service, you should create a service app. And it just so happens that that's very easy with Delphi. This is the right way:</p> <h2>The right way: create a service app</h2> <p><a href="http://delphi.about.com/od/windowsshellapi/a/delphi-windows-service-applications.htm" rel="noreferrer">This delphi.about.com article has a lot of information about service applications</a>. However, it's fairly simple: create a new service application through File > New > [perhaps Other >] Service Application. Set the display name etc. To install it, run with the command line switch <code>/install</code>; to uninstall run with <code>/uninstall</code>.</p> <p>If the reason you want your command-line app to run as a service is because you don't want to write two applications, with good design you can minimise the extra work. In your project group have two applications, your command-line app and your service app. Then share the code in other files - i.e. write the code to do your app's work once, and include / call it from both projects.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload