Problem with ServiceAddService function in Installshield

Posted on 2006-03-30
Last Modified: 2013-11-14


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?

Question by:TungVan
    LVL 14

    Expert Comment

    Check the command syntax on the following page from the InstallScript Language Reference:

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


      Nayer Naguib
    LVL 23

    Accepted Solution

    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.
    LVL 14

    Expert Comment

    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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    I have been scripting applications way too long and can never remember how to create an ISS file.  So I decided to write this article to act as my own knowledge base for future reference, and hope you will also benefit. An ISS file is a response …
    Here we come across an interesting topic of coding guidelines while designing automation test scripts. The scope of this article will not be limited to QTP but to an overall extent of using VB Scripting for automation projects. Introduction Now…
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now