Jebrew
Posts: 53
Joined: Thu Jan 18, 2007 8:53 pm

Recovery options for services

Mon Aug 20, 2007 7:48 pm

In the service control manager, you can set recovery options for the services (retry if the service fails to start properly, how long to wait before retrying, a program to launch on failure...).
I'd like to see those options in the installer (as our service has a bug in the threading whereby it will fail to start once in about 300 installs and would be fine if it could just be set to retry).

Thanks,
Jebrew

gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact:  Website

Tue Aug 21, 2007 7:43 am

Hi,

I'm afraid that what you want is not support by Windows Installer. Advanced Installer already implements all options that windows Installer supports about services.

You can read more about what options Windows Installer supports regarding services here:
http://msdn2.microsoft.com/en-us/library/aa371637.aspx
http://msdn2.microsoft.com/en-us/library/aa371634.aspx

Regards,
Gigi
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com/

otvald
Posts: 1
Joined: Sun Nov 04, 2007 4:22 pm

Sun Nov 04, 2007 4:38 pm

I second that request!

Currently, I have to instruct the end-user to manually go into the service properties and set the recovery option for the installed service, after the programmes are installed.

It is possible to extend the installer, e.g. look at:
:arrow: http://www.codeproject.com/install/serc ... lerext.asp

Here, this class extends the service installer with "FailureActions.Add" methods... Is there any way to get this functionality into Advanced Installer too?

/Thomas

Ionut
Posts: 605
Joined: Tue Nov 22, 2005 11:29 am
Contact:  Website

Mon Nov 05, 2007 2:13 pm

Hi Thomas,

As mentioned above, Windows Installer does not support setting recovery options for services. However, you can use the "sc" command line tool with the "failure" option as a Custom Action.

The Custom Action type will be "EXE with Working Dir" and it can be scheduled under Install. Use the following settings for this Custom Action:
- Execution Properties: "Synchronous execution, ignore return code"
- Execution Options: "Deferred with no impersonation"
- Execution Condition: (Not Installed)

The "Full Path" field will be set, for instance, to:

Code: Select all

"[SystemFolder]sc.exe" failure "service_name" actions=restart/60000/restart/60000/""/60000 reset=86400
Test the command outside the installer before defining the Custom Action.

Hope this helps.

Regards,
Ionut
Denis Toma
Advanced Installer Team
http://www.advancedinstaller.com/

crandom
Posts: 13
Joined: Thu Sep 29, 2011 7:18 pm

Re: Recovery options for services

Tue Apr 23, 2013 9:08 pm

I thought I'd post this here for posterity. I adapted this command to:

Code: Select all

sc.exe failure SERVICENAME actions=restart/60000 reset=0
That works fine, except on XP (and possibly Win2k3, although I didn't test there). On XP, this syntax is required:

Code: Select all

sc.exe failure SERVICENAME actions= restart/60000 reset= 0
I.e. the whitepsace is required under XP.

Serg13
Posts: 1
Joined: Sat Nov 21, 2020 3:58 pm

Re: Recovery options for services

Sat Nov 21, 2020 4:07 pm

Hi,

Do you still have any plans to add support for this to Advanced Installer?
It seems with Windows Installer 5 it became possible:
https://docs.microsoft.com/en-us/window ... ions-table

Catalin
Posts: 6506
Joined: Wed Jun 13, 2018 7:49 am

Re: Recovery options for services

Mon Nov 23, 2020 6:09 pm

Hello and welcome to our forums,

This is now possible for quite a while in Advanced Installer.

In order to implement it, please add a failure operation for your service.
failureOp.png
failureOp.png (201.9KiB)Viewed 27505 times

For more information about this, please refer to our "Service Failure Actions Properties" article.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Feature Requests”