cancel
Showing results for 
Search instead for 
Did you mean: 
Ken_Alverson
Pilgrim

BasicMSI How to stop an existing windows service using the events - is this possible?

Hello,

Is it possible to add windows service to System configuration, Services that already exists. During an uninstall, I need to stop two Window services. I have a custom action that does this for me, but not enough time is allowed during the uninstall for the services to be stopped and deleted before hand. I usually end up with the reboot message which I'd like to avoid if possible. The reboot does work to clean up the window services, but it also leaves behind many files that could not be accessed during the uninstall process (files not installed by the original install). The uninstall works well if the services are stopped ahead of time. One other minor item, the product install folder never gets deleted either on an uninstall.

Thanks in advance for any reply.
Labels (1)
0 Kudos
3 Replies
Not applicable

Re: BasicMSI How to stop an existing windows service using the events - is this possible?

I was faced with a similar scenario during one of my product upgrade sequences where we had a particularly stubborn service to shut down. In the end I had to author custom actions to stop the service with various timeouts and ultimately even kill the service process in a 'dirty' shutdown if the stop timeouts were triggered.

I don't know of any other method - sorry.
0 Kudos
Highlighted
Ken_Alverson
Pilgrim

DirectEditor - added an entry to ServiceControl - solved my problem

Hysteresis wrote:
I was faced with a similar scenario during one of my product upgrade sequences where we had a particularly stubborn service to shut down. In the end I had to author custom actions to stop the service with various timeouts and ultimately even kill the service process in a 'dirty' shutdown if the stop timeouts were triggered.

I don't know of any other method - sorry.


I was able to use DirectEditor to add a record to table ServiceControl that resolved my uninstall issues. The two services involved had built in dependencies, so I only had to stop one of them to get them both stopped. I defined the record name in field s72, the service name in field s255, the stop service during uninstall event value of decimal 32 in field i2, the wait an additional 30 seconds (value 1) in field I2, and finally the component name in field s72 (the executable for the service).

The uninstall did not require a reboot after that and all the files got removed on an uninstall (clean uninstall). Well the product folder was left behind, but everything else is gone which is probably as good as it is going to get.Smiley Happy
0 Kudos
Not applicable

Re: BasicMSI How to stop an existing windows service using the events - is this possible?

Glad you got it working. Thanks for the heads-up on your use of direct edit.
0 Kudos