Overview
Features
Download
Documentation
Community
Add-Ons & Services

Register app as Windows Service with given commandline?

A general discussion forum.

Register app as Windows Service with given commandline?

Postby Soho » 07 Nov 2012, 11:55

Hello,

Suppose I want to register my app as Windows Service. For that I have to inherit the class of my app from the Poco::Util::ServerApplication. Right? That's ok.
But how can I register service to start with the given commandline? For instance, I need to start my app as service with commandline:
Code: Select all
app.exe config.xml

How can I do that?

Thanks in advance
Soho
 
Posts: 6
Joined: 08 Sep 2012, 15:49

Re: Register app as Windows Service with given commandline?

Postby alex » 07 Nov 2012, 15:05

If you rename your config file to the same basename as the executable (e.g. app.xml), it will be loaded automatically by Application::loadConfiguration(). If you must have it named differently, fire up regedit, navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\app and change the command line (ImagePath key) accordingly.
alex
 
Posts: 1105
Joined: 11 Jul 2006, 16:27
Location: United_States

Re: Register app as Windows Service with given commandline?

Postby Soho » 08 Nov 2012, 12:52

Well, the way with registry is known. Just I thought there is some special "poco way" to do that... :?
Anyhow, thanks for reply!
Soho
 
Posts: 6
Joined: 08 Sep 2012, 15:49


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron