cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Pilgrim

Re: ServiceAddService returns -1

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.
0 Kudos
Highlighted
Not applicable

Re: ServiceAddService returns -1

-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
0 Kudos
Highlighted
Pilgrim

Re: ServiceAddService returns -1

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
---------------------------
0 Kudos
Highlighted
Not applicable

Re: ServiceAddService returns -1

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
0 Kudos
Highlighted
Pilgrim

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

DevinEllingson wrote:
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.
0 Kudos