sue_impact
Posts: 6
Joined: Fri Feb 03, 2006 3:07 pm

Java service recovery

Is it possible to set the recovery options for a Java service? If the service fails at any time I want it to automatically restart.
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

You can set the recovery options for a service with a "Exe With Worthing Dir" custom action. Here how to do this in Advanced Installer:

1. Switch to "Custom Actions" page and add new "Exe With Worthing Dir" custom action under the "InstallServices" standard action. You can make visible the "InstallServices" standard action by right clicking on "InstallExecuteSequance" and choosing "Show Standard Action->Before Finalization->InstallServices".
2. Use following options for the custom action:
2.1. Full Path:

Code: Select all

sc failure servicename reset= 90000 actions= restart/240000
2.2. Execution Properties: Synchronous execution, ignore return code.
2.3. Execution Options: Deferred.
2.4. Scheduling Options: Always Execute.
2.5. Execution Condition: Not Installed

The sc tool sets control information for a service. You can learn more about how to use the sc tool from the following link: http://www.microsoft.com/resources/docu ... x?mfr=true

Regards,
Gigi
_________________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
sue_impact
Posts: 6
Joined: Fri Feb 03, 2006 3:07 pm

Service recovery on Windows 2000

This custom action works fine on XP but I can't find an equivalent to sc for Windows 2000. Is it possible to set the recovery options for Window 2000?

Thanks

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

Hi Sue,

I think that Sc.exe is not installed by default on Windows 2000. You need to install it separately (it comes with the Resource Kit).

http://support.microsoft.com/kb/251192#top

So in your package you can create a launch condition to avoid installing the package if Sc.exe is not present on the target computer. Use the "Launch Condition" wizard to do that.

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

Return to “Common Problems”