I have been building a service manager through the WinSvc unit in Delphi7. I have almost everything done, start/stop/pause/continue/restart/get config/set config/uninstall - everything except for Install. I know you need to use CreateService to install it, but it seems as if the function presumes you already know the information about it (Name, Display Name, etc.) when all I have available is a Filename (to the EXE service). In the past, I have intalled using ShellExecuteEx calling the filename with /install. Now I need to use WinSvc entirely.
How can I install a service using WinSvc when all I have is a filename, and no info?
JD Solutions
How can I install a service using WinSvc when all I have is a filename, and no info?
Code:
function ServiceInstall(sMgr: SC_Handle; sFilename: String): SC_Handle;
begin
Result:= 0;
if sMgr > 0 then begin
Result:= CreateService(sMgr, ...... sFilename, ....);
end;
end;
JD Solutions