cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
georgiy_senenko
Level 5

How to set up Recovery in installed Service

Hello,

I have InstallShiel2012 Basic MSI project which installs service on the target PC. I would like to set Recovery options to "Restart the Service" for first, second and subsequent failures for this service.
Could you please advise how I can configure this in InstallShield project?

Thank you in advance.

Best regards, Georgiy
Labels (1)
0 Kudos
11 Replies
Janardhan_R
Level 2 Flexeran
Level 2 Flexeran

The service which is being installed will be part of any component. Go to components view(|Advanced Settings|Services) in the InstallShield project. Select the service in question, under configure settings in the right side you can see Recovery Actions.
0 Kudos
georgiy_senenko
Level 5

Thank you for response! I found such Recovery actions for the service, but I didn't manage to find proper settings that service would have following options
"Restart the Service" for first failure,
"Restart the Service" for the second
"Restart the Service" for the subsequent failures

Could you please advise how to set such options?
0 Kudos
Not applicable

To do this I create a CA and then invoke SC.EXE to set the restart parameters. Run the CA after MsiConfigureServices.
0 Kudos
georgiy_senenko
Level 5

Thank you for your advise. I found microsoft support page regarding sc.exe
http://support.microsoft.com/kb/251192

but do you know whether it's possible to set up such recovery action only in InstallShield Configure settings -> Recovery settings?
0 Kudos
Not applicable

No I don't think you can.
0 Kudos
georgiy_senenko
Level 5

Thank you! I did it as you advised, i.e. made a custom action to call
\sc.exe failure service_name reset= 30 actions= restart/60000

and execute it after MsiConfigureServices
Return Processing: Synchronous (check exit code)

Installation went fine, but got error 1722 on uninstall.
Then i changed Return Processing to Synchronous (ignore exit code) and uninstall went fine.

Could you please tell whether it's OK to have "ignore exit code" return processing? or should I have "check exit code"?
0 Kudos
Not applicable

I have mine in the Exec sequence - make sure the 'Install Exec Condition' is set to "Not Installed" so the CA doesn't get run during uninstall.

Its up to you whether you ignore the exit code. Personally I always check but that's me.
0 Kudos
georgiy_senenko
Level 5

Thanks, adding "Not Installed" exec conditions helped, and I don not have any errors during uninstall when i use "synchronous (check exit code)"

Now serice configuration works fine on Win7, but does not work on winXP.
I manually executed the same sc command on XP machine and service recovery settings were changed.

sc failure service_name reset= 30 actions= restart/60000

Could you please tell what might be wring with WinXP?
0 Kudos
Not applicable

I haven't played with XP for sometime, but a few things to check if you haven't already:

1. Make sure SC is actually installed in the expected folder.
2. Make sure the syntax is correct for the XP version of SC.
3. Make sure the service is running before applying the recovery options.
3. Can you run the command manually ?
4. Run the CA without hiding the CMD window to see if its throwing an error.
0 Kudos
georgiy_senenko
Level 5

1. Make sure SC is actually installed in the expected folder.
Yes, sc.exe is installed in C:\WINDOWS\system32 folder in both computers. I tried to call sc.exe as
\sc.exe
\System32\sc.exe
Error 1721. There is a problem with this Windows Installer package.
A programm required for this install to complete could not be run.
Contact your support personnel or package vendor. bla bla

CA is execute as the "Deferred execution in system context"
2. Make sure the syntax is correct for the XP version of SC.
The syntax is correct as I could execute this command in command prompt on XP machine after service is installed.
3. Make sure the service is running before applying the recovery options.
I tried to call this CA almost as the last step, i.e. "After Schedule Reboot" hence I guess that the service is already installed.
3. Can you run the command manually?
Yes
4. Run the CA without hiding the CMD window to see if its throwing an error.
I don't know how to do this. Could you please advise?
0 Kudos

Hello,

Can you describe all the steps to create this Custom Action ?

Thank you.

0 Kudos