CHUG1008
Posts: 9
Joined: Mon Jun 22, 2009 2:08 pm

Is there a way to Stop a running service during an update?

I have a windows service that I need to update periodically. However, if the service is running when updating you get prompted to stop the service. Is there a way to Stop the service using the update?

Help is always appreciated.
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Is there a way to Stop a running service during an updat

Hello,

I'm afraid we don't have support for this. However, in order to achieve what you want you can add, in your upgraded installation package, a custom action to stop the service, scheduled before "Install Execution Stage -> Preparing" action group, using a condition like this:

Code: Select all

OLDPRODUCTS
Also, we already have an improvement regarding this (add a predefined custom action to start/stop/restart a service) on our TODO list, which will be available on a future version of Advanced Installer.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
CHUG1008
Posts: 9
Joined: Mon Jun 22, 2009 2:08 pm

Re: Is there a way to Stop a running service during an updat

Thanks for the quick response. It's always appreciated.
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Is there a way to Stop a running service during an updat

You're welcome.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Ruben
Posts: 57
Joined: Fri Apr 10, 2015 2:35 pm

Re: Is there a way to Stop a running service during an update?

We are looking for the same.
Is there a new "best practice" ?

-- Thank you --
Ruben
adamdc78
Posts: 76
Joined: Wed Mar 19, 2014 7:42 pm

Re: Is there a way to Stop a running service during an update?

Calling the service's shutdown from a custom action should do the trick. C# actions are wonderful for accomplishing such tasks and can wait/timeout very reliably.
Ruben
Posts: 57
Joined: Fri Apr 10, 2015 2:35 pm

Re: Is there a way to Stop a running service during an updat

As Daniel said in 2013:
Daniel wrote:...we already have an improvement regarding this (add a predefined custom action to start/stop/restart a service) on our TODO list...
There's also a predefined "Stop Service" action in our AdvancedInstaller edition, which identifies the service by its name. I assume this is the most convenient way, currently.

Ruben
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Is there a way to Stop a running service during an update?

Hello Ruben,

Yes, you are right. Currently you can use our predefined "Stop service" custom action.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”