Rename Service Name

<< Click to Display Table of Contents >>

Navigation:  Forum >

Rename Service Name

Forum link

 

 

 


 

09-21-2023, 06:44 PM:

 

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

 

 

 


 

09-22-2023, 08:21 AM:

 

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

 

 

 


 

09-23-2023, 06:59 AM:

 

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.

 

 

 


 

09-23-2023, 08:47 AM:

 

>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 smile 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

 

 

 


 

09-25-2023, 05:32 AM:

 

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,

 

 

 


 

09-25-2023, 05:35 AM:

 

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

 

 

 


 

09-26-2023, 04:25 PM:

 

Thank you for clarify. i will try it again.