How to specify application parameters to .NET service installer

D

Dave

I have a Console app, a related Service Project and Service Setup /
Installer Project. I would like to have the result of running the
installer.msi file register the service to run with certain
parameters.

How do i specify parameters that the application needs to start up /
run with?
is it in the properties of the ServiceProcessInstaller or
ServiceInstaller objects?
is it in the properties of the Service Setup project?

Background info:
1) I've noticed Windows Services specify parameters after the
executable in the "Path to executable" so getting the installer to put
application parameters to this config setting would probably work
also?
2) the app runs with syntax: "MyApp.exe /f MyApp_ConfigFile.txt"

i hope i've provided enough information to be clear.

thanks, dave
 
S

Samuel R. Neff

The only way we could find to do it is to modify the registry after
the service is installed (which of course makes the built-in installer
stuff pointless since all it really does for services is make the
registry entry).

Our services run in either console mode or service mode (helpful for
debugging) and we use a command line switch to determine which to use.

If you find a better way I'd love to hear it...

Sam
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top