This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- ServiceStartService succeeds, but returns -1
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Jul 17, 2009
01:46 PM
ServiceStartService succeeds, but returns -1
Windows XP SP3, IS 2009 Premier SP2, InstallScript project
I'm registering and starting a service in the OnMoved event handler. I set SERVICE_IS_PARAMS.nStartServiceWaitCount to 20 seconds, since the service can hang in certain situations. ServiceAddService succeeds (it adds and starts the service), but returns a -1 result. If I don't specify nStartServiceWaitCount, then everything is fine.
If I tell ServiceAddService not to start the service, and call ServiceStartService separately, then the Add succeeds, while the Start returns the -1. As before, the service starts, but the function returns -1 anyway.
Calling GetExtendedErrInfo directly afterwards gives me 1060 (The specified service does not exist as an installed service). What am I doing wrong?
I'm registering and starting a service in the OnMoved event handler. I set SERVICE_IS_PARAMS.nStartServiceWaitCount to 20 seconds, since the service can hang in certain situations. ServiceAddService succeeds (it adds and starts the service), but returns a -1 result. If I don't specify nStartServiceWaitCount, then everything is fine.
If I tell ServiceAddService not to start the service, and call ServiceStartService separately, then the Add succeeds, while the Start returns the -1. As before, the service starts, but the function returns -1 anyway.
Calling GetExtendedErrInfo directly afterwards gives me 1060 (The specified service does not exist as an installed service). What am I doing wrong?
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Jul 04, 2018
12:51 AM
Hi, I have the same problem with my installshield 2016 and basicMsi project.
And my solution is call ServiceGetServiceState after calling serviceAddService, because sometimes the service will be service_start_pending state, but the serviceAddService return -1 this time, in fact the service is installed success.
Hope to help any one who is troubling with the same problem.
And my solution is call ServiceGetServiceState after calling serviceAddService, because sometimes the service will be service_start_pending state, but the serviceAddService return -1 this time, in fact the service is installed success.
Hope to help any one who is troubling with the same problem.