I am trying to set multiple properties when creating a service using SC with Inno Setup I have not been able to get this to work 100% so far, I have got the service name, display name, dependencies and Description working correctly. It is just the Recovery settings i need to preset. (see image)
I have tried multiple ways of writing this, i have tried the failure and description part on the same line with single, double and tipple quotes non of them work i tried on a new line as below this doesn't work either. Unsure if they have to be in a specific order ?
I have look around and not found anything on setting Recovery settings an example is: Inno Setup: Installing Windows services using "sc create" Of course i have looked here too: https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/cc742069(v%3Dws.11) but i cant figure out how to translate it to inno script.
I know this is not the "correct way" to do this and its better to use pascal code or use these service scripts http://www.sandon.it/node/9 but i just want to understand this way for my own curiosity/education plus i haven't found any good examples of pascal code.
I do have the service script working with some pascal code by including it in the code section then using registry settings so set properties it does not support however i specifically want to know how to do the same just with SC.exe for my own education.
[Run]
Filename: {sys}\sc.exe; Parameters: "create SERVICENAME start= auto DisplayName= ""SERVICEDISPLAYNAME"" binPath=""{app}\SERVICEEXE.exe"" depend= mpssvc"; Flags: runhidden
Filename: {sys}\sc.exe; Parameters: "failure ""SERVICENAME"" reset= 100 actions= restart/1000/restart/1000"; Flags: runhidden
Filename: {sys}\sc.exe; Parameters: "description SERVICENAME ""SERVICE DESCRIPTION"""; Flags: runhidden
[UninstallRun]
Filename: {sys}\sc.exe; Parameters: "stop SERVICENAME" ; Flags: runhidden
Filename: {sys}\sc.exe; Parameters: "delete SRVICENAME" ; Flags: runhidden