I have a service application built in Delphi that works great. It does exactly what I want it to do and all is happy. All is fine until I want to run two (or more) instanc
You haven't made it clear what you have tried to change in the TService subclass.
Have you added a "BeforeInstall" handler?
Something like:
procedure TServiceMain.ServiceLoadInfo(Sender : TObject);// new method, not an override
begin
Name := ParamStr(2);
DisplayName := ParamStr(3);
end;
procedure TServiceMain.ServiceBeforeInstall(Sender: TService);
begin
ServiceLoadInfo(Self);
end;
procedure TServiceMain.ServiceCreate(Sender: TObject);
begin
ServiceLoadInfo(Self);
end;
If you do this regularly, subclass TService to do thie in the Constructor instead.
You should do the same in the BeforeUninstall as well - point both events at the same method.
C:\>servicename /install MyService "My Service Description"