PDA

View Full Version : Installing services/Failure Actions?



cada0310
06-15-2005, 08:32 AM
Hi there,

Is there any interface in Installshield when installing services to set up the failure actions for the service? Like, restarting on 1st failure, etc, etc? Or will I have to hit the registry directly to automatically set this up?

Thanks,

Chris

byaron
07-04-2005, 08:38 AM
You could use sc commands for that. ( I have spend many houres to understand this is the only way to do it, by registry it didnt work...).
see example :
function install_service()
STRING sc1,sc2,sc3;
NUMBER nvFileHandle;
begin
sc1 ="create " +"\"" +"Server"+"\""+ " binpath= " +"\""+TARGETDIR^"bin\\Service.exe"+"\"" + " start= auto";
sc2 ="failure " +"\"" +"Server"+"\"" + " reset= 86400 actions= restart/100000";
sc3= "description "+"\"" +"Server"+"\"" + " Enables NetXplorer Server";
LaunchAppAndWait("sc.exe",sc1,LAAW_OPTION_WAIT|LAAW_OPTION_HIDDEN);
LaunchAppAndWait("sc.exe",sc2,LAAW_OPTION_WAIT|LAAW_OPTION_HIDDEN);
LaunchAppAndWait("sc.exe",sc3,LAAW_OPTION_WAIT|LAAW_OPTION_HIDDEN);
end;