• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 840
  • Last Modified:

Problem with ServiceAddService function in Installshield


Hi,

I have a console application and I want to put it in windows service. I use ServiceAddService to add and start the service.

However, the application just sit there and doing nothing. I try to run it as console and it's working.

So, in resume, my application does not do anything if it is started as service.

Maybe there is an error in my call to ServiceAddService?


Thanks
0
TungVan
Asked:
TungVan
  • 2
1 Solution
 
nayernaguibCommented:
Check the command syntax on the following page from the InstallScript Language Reference:

  http://helpnet.installshield.com/robo/projects/installshield11langref/ServiceAddService.htm

You can also check for the return value to determine if the ServiceAddService function has finished successfully or not.

_______________

  Nayer Naguib
0
 
cookreCommented:
By default, services have no visible console and are not associated with a visible desktop.

To be able to get visible output from a service, it must run under the SystemLocal security context and be typed as ownprocess and interactive.  That will cause the service to be associated with the default interactive desktop (i.e., it will have access most Window's messages if you start a message pump), allowing you display message boxes.  Even then, you'll have no console outout and no shell messages.
0
 
nayernaguibCommented:
That's right. I misunderstood the question. I thought the authour could not "use" the service, and thought that this might be due to failure to install or start the service. But after re-reading the question, I can see that the author expects the service to output something to the console. cookre has the answer.

_______________

  Nayer Naguib
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now