Rename Service Name - Printable Version +- Atozed Forums (https://www.atozed.com/forums) +-- Forum: Atozed Software Products (https://www.atozed.com/forums/forum-1.html) +--- Forum: IntraWeb (https://www.atozed.com/forums/forum-3.html) +---- Forum: English (https://www.atozed.com/forums/forum-16.html) +----- Forum: IntraWeb General Discussion (https://www.atozed.com/forums/forum-4.html) +----- Thread: Rename Service Name (/thread-3500.html) |
Rename Service Name - svenheuer - 09-21-2023 Hi, I knew, there was an old discussion about this. On a server farm I want to install several intraWeb server (for load balancing). The app should running as a service on each server as Node.1 - using port 81 Node.2 - using port 82 Each has it own folder and should have the service name node.1, node.2 The config should be read out a ini file. Running as stand alone work nice but as a service seemed to complicated. in IWServerControllerBaseConfig i try AppName := inifile('main', 'nodename', 'node'); but nothing happen. Appname /install - nothing happens (exception?). If I remove the line I can install the service What would be the right way to install as service with different service name? Thanks Sven RE: Rename Service Name - svenheuer - 09-22-2023 Ok. node.1 is not a good name. but renaming it to node1 does not help. The service installer code uses the compiled name from AppName RE: Rename Service Name - Alexandre Machado - 09-23-2023 HI Sven, how is it going? I have to check but I think that the service name during installation is not affected by the ServerController.OnConfig event. I mean the installation happens way before the ServerController is created and have a chance to set the ServiceName. I'll check that and let you know. RE: Rename Service Name - svenheuer - 09-23-2023 >I have to check but I think that the service name during installation is not affected by the ServerController.OnConfig event. Yes. nothing happens here. I think an OnServiceInstall / onServiceResume ... would be very helpful to control the installation/processes as a service. The TService-Objekt already have these events. In the past I used the FireDaemon but this means always runningn an IntraWeb-GUI. For production environments semiprofessionel. It would be very helpful to install severel services without renaming the project At least we need 6 running services on three servers to be on the safe side. To clarify. Your are right: The ServerController.onConfig will be called but after the installation code of the service RE: Rename Service Name - Alexandre Machado - 09-25-2023 Actually I was wrong :-) OnConfig event fires first and then the Service code responsible for the installation of the service runs later. You can configure both the ServerController.AppName (this will be the Service Name), ServerController.DisplayName (the service display name) and the ServiceController.Description (the service description) during the OnConfig event and it should be honored while installing the service. Cheers, RE: Rename Service Name - Alexandre Machado - 09-25-2023 BTW, if your executable is named YourApplication.exe and you have an YourApplication.ini file in the same directory, the ServerController will load all properties from it automatically, as long as ServerController.AutoLoadIniSettings = True and the property exists. The format for it would be: [ServerController] AppName=MyApp Description=My IntraWeb Application DisplayName=IntraWeb Application RE: Rename Service Name - svenheuer - 09-26-2023 Thank you for clarify. i will try it again. |