I have two binaries and have to create a service for them. I tried a solution using \"sc create\" from How to install a Windows service with Inno Setup?
But it did n
Is there any reason you're trying to run it through {cmd}
?
Either add the /C
parameter and quote the rest as required, or just run sc.exe
with the required parameters.
[Run]
Filename: "sc.exe"; Parameters: "create srvname start= auto DisplayName= mysrv binPath= {app}\mybinary.exe" ; Flags: runhidden
Note that the correct way to install the service is the API as mentioned in this answer that will allow you to detect and handle errors.