ebacci 0 Newbie Poster

Hello,
I need to create a service application which can be started X times as a service.
I used the following code:

procedure TMyService.ServiceBeforeInstall(Sender: TService);
begin
if ParamStr(1)='-install' then IHotel := ParamStr(2) else IHotel :=ParamStr(1);
IHotel := TRIM(AnsiReplaceText(Copy(IHotel,2), ' ', ''));
if Length(IHotel) = 0 then
begin
Showmessage('Hotel name not specified.' + #13 + 'Service can not beinstalled');
Abort;
end;
DisplayName := 'Opera IFC8 AliveCheck for ' + IHotel; Name := 'MyServiceAliveCheckfor' + IHotel;
end;

Problem is that service freeze on startup when I change service name with last line of the above procedure. If I comment last line service works perfectly but then I can install only one service as the second one will have same name then the first one.

Is there anyone who can help please?

Regards
Elena

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.