Description
When a ServerApplication is registered as a Windows Service with command-line
arguments in the ImagePath registry entry (e.g. "app.exe" --config-file "path\to\config.properties"),
those arguments are NOT forwarded to ServiceMain when the service is started
by the Windows SCM (Service Control Manager).
Reproduction
- Create a ServerApplication-based app with a
--config-file option handler
- Register as Windows service with arguments in binPath:
sc create MyService binPath= "\"C:\path\app.exe\" --config-file \"C:\path\config.properties\""
- Start the service via SCM (net start / Services MMC)
- Observe that --config-file argument is never processed — option callback is not invoked
Expected behavior
Arguments present in the ImagePath registry entry should be available in
ServiceMain just as they are when the application is launched from the command line.
Description
When a ServerApplication is registered as a Windows Service with command-line
arguments in the ImagePath registry entry (e.g.
"app.exe" --config-file "path\to\config.properties"),those arguments are NOT forwarded to ServiceMain when the service is started
by the Windows SCM (Service Control Manager).
Reproduction
--config-fileoption handlersc create MyService binPath= "\"C:\path\app.exe\" --config-file \"C:\path\config.properties\""Expected behavior
Arguments present in the ImagePath registry entry should be available in
ServiceMain just as they are when the application is launched from the command line.