核心提示:procedureTMyService.ServiceAfterInstall(Sender:TService); var reg:TRegistry; begin reg:=TRegistry.Cr...
procedure TMyService.ServiceAfterInstall(Sender: TService); var
reg: TRegistry;
begin
reg := TRegistry.Create;
try
with reg do begin
RootKey := HKEY_LOCAL_MACHINE;
if OpenKey('SYSTEM\CurrentControlSet\Services\'+Name,false) then
begin
WriteString('Description','This is the service description');
end;
CloseKey;
end;
finally
reg.Free;
end;
end;