Community Forums
Page 3 of 3 FirstFirst 123
Results 11 to 15 of 15

Thread: ServiceAddService returns -1

  1. #11
    Join Date
    Feb 2008
    Posts
    54
    I actually use a custom dialog to collect information from user. And then install the service with specified parameters with the help of ServiceAddService function. I have not come across any other documented way to do this (except using Services view that is I cannot use).

    ServiceAddService function returns -1. And if I use GetExtendedErrInfo I get the same error number: -1. And when I try to use format function I get empty string.

  2. #12
    Join Date
    Jul 2002
    Posts
    826
    -1 is ISERR_GEN_FAILURE, FormatMessage only handles some errors, so you probably won't get any text for this error.

    Do the svScriptFile and nvLineNumber parameters return anything?

    Devin Ellingson
    Software Developer
    Acresso Software

  3. #13
    Join Date
    Feb 2008
    Posts
    54
    Here is what script file and line number values are set to:

    ---------------------------
    *** - InstallShield Wizard
    ---------------------------
    Script file: C:\CodeBases\isdev\Script\ISRT\Src\Service.rul
    Line number: 561
    ---------------------------
    OK
    ---------------------------

  4. #14
    Join Date
    Jul 2002
    Posts
    826
    This indicates that the we did not detect that the service started in the time alloted (which is INFINITE by default).

    Check the values in the public 'SERVICE_IS_STATUS' structure instance, we populate this structure with the final values that we got (check dwCurrentState especially).

    One possibility is that the service is failing to report SERVICE_START_PENDING during the startup time, in this case the service code will fail in this way.

    Devin Ellingson
    Software Developer
    Acresso Software

  5. #15
    Join Date
    Jul 2016
    Posts
    3

    My case is this one, the service is in service_start_pending state.

    Quote Originally Posted by DevinEllingson View Post
    This indicates that the we did not detect that the service started in the time alloted (which is INFINITE by default).

    Check the values in the public 'SERVICE_IS_STATUS' structure instance, we populate this structure with the final values that we got (check dwCurrentState especially).

    One possibility is that the service is failing to report SERVICE_START_PENDING during the startup time, in this case the service code will fail in this way.

    Devin Ellingson
    Software Developer
    Acresso Software
    My case is this one, the service is in service_start_pending state.

Page 3 of 3 FirstFirst 123

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •