I need to port our RO9 Delphi server to a Windows Service and would like to get some guidance here.
Currently, our project creates all components ( TROIndyHTTPServer, TROBinMessage, etc ) and hooks them up in a class at runtime:
TServerHttp = class private ... FRoServer: TRoIndyHttpServer; FRoMessage: TRoBinMessage; constructor TServerHttp.Create(iniFileName: string); begin FRoServer := TRoIndyHttpServer.Create(nil); FRoMessage := TRoBinMessage.Create(nil); TROMessageDispatcher(FROServer.Dispatchers.Add).Message := FROMessage; FRoServerControl := TRoIndyHttpServer.Create(nil); FRoMessageControl := TRoBinMessage.Create(nil); TROMessageDispatcher(FROServerControl.Dispatchers.Add).Message := FROMessageControl; FenvAESEnvelope := TROAESEncryptionEnvelope.Create(nil); FenvAESEnvelope.EnvelopeMarker := 'AES'; end;
And it works well starting as a normal executable file in Windows.
After doing some research ( didn’t find anything in the documentation but created an example using IDE > Create new project > Other > Windows Service (CodeFirst) ) , I noticed that the only thing different from our project is that it creates all components wrapped in a class inherited by TService (defined in the unit Vcl.SvcMgr), hooks some properties and that’s it. Is that correct?
Should I have to install it using nameexe /install after that? Or should I have to go to any other direction in order to port to Windows Service?