View Full Version : Long Delays Stopping Services

05-11-2005, 12:42 PM
InstallShield Professional 11 (InstallShield Script) running on a freshly Ghosted test machine running Windows-2000 Professional (SP4):

There is a long delay after making calls to ServiceStopService. For example, I stopped a service (one of ours) in the Service Control Manager and it took 2 secs. to go to a STOPPED state. In IS Pro 11 it took 58 secs. This is causing long delays in the execution of the install.

I then picked a couple other "standard" services such as the Microsoft Messenger Service and the Remote Registry service. I got the same results.

As a workaround, I called ServiceInitParams() followed by setting SERVICE_IS_PARAMS.nStopServiceWaitCount=1. The ServiceStopService then returns after a 1 second delay, and I immediately drop into a While loop monitoring the service state through ServiceGetServiceState() and a Timeout counter. Breakout happens on ServiceGetServiceState() returning SERVICE_STOPPED. That works. I tried other (MS) services with similar results.

Is this a defect in IS Pro 11?

05-11-2005, 04:05 PM
It appears that ServiceStopService is timing out rather than returning when service stop is achieved.

05-13-2005, 06:32 PM

Thank you for the feedback, however I am unable to reproduce the problem.

I noticed that you tried this with some standard services, can you provide the exact script code that you used via Email (devin@installshield.com)

Devin Ellingson
InstallShield, A Macrovision Company

05-18-2005, 05:04 PM

I'm getting the same sort of thing. I'm just starting to convert a 5.5 script that does a lot of service stops and starts.

One thing that may be a clue, is dependent services.

For example, if I try to stop IISADMIN, it seems to just hang unless I stop W3SVC, MSFTPSVC and SMTPSVC first.

I tried your SERVICE_IS_PARAMS trick, but it seems to abort almost immediately inside the service.rul module.


05-24-2005, 10:16 AM
Make that 3 people with the problem. I actually work with dstmartin and will use his workaround, but it sure would be nice to get this fixed.

If this helps, I think we are both on XP Pro. I'm on SP1 and he's on SP2.