I have a Deplhi based Windows Service that, on installation, parses some command line arguments. I want those arguments to be added to the services command line (ImagePath value on the registry) so that the service is always started with them.
How can I accomplish this?
I want the regedit look like this:
at registry key HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\MyService
ImagePath = C:\Path\to\my\service.exe -some -arguments
Thanks
Update: The installation is done with >MyService.exe /install -some -arguments
. Those arguments are the ones I want to persist in the command line.
Update: I found a solution by writing directly to the registry (see here), but I'd still like a more elegant solution, like using some TService property or something of that sort. Thanks!