As a publisher, you sometimes want to duplicate a merged client application to connect each of them to their dedicated 4D Server. Let’s see how to do this.
When you are a software publisher, some of your customers sometimes have many instances of your merged server application, for example, a merged server application for each company of a group. In this kind of deployment architecture, your customer’s officers often ask you to install a merged client application for each merged server application on their computer because they want to use the software for each company.
Since the merged server application address is no more stored in the EnginedServer.4DLink file inside the merged client application package (to keep it untouched), all merged client applications shared the same server address stored in the user preferences folder.
From now on, you have a new buildApp key at your disposal to make each duplicated merged client application use its own user preferences folder (based on its application path):
<BuildApp>
<CS>
<ClientUserPreferencesFolderByPath>True</ClientUserPreferencesFolderByPath>
Just remember that to bypass the automatic network broadcasting and make each merged client application connect to its last Server, you have to publish each merged server application on a port other than the 4D standard one (19813) and on a port other than the one defined during buildApp.
Of course, when this behavior is activated, the Folder and Get 4D Folder commands still return the correct folder for each merged client application.
The cherry on the top, if you use the magic star parameter of the Open form window command, the windows of each merged client application will retrieve their own size and position, fitting users’ desktop organization.
The same architecture can also be helpful for developers or testers who want to connect to a test Server, pre-production server, or production server. This way, they can have duplicated merged client applications connected to their dedicated Server.
Sample
A group uses the myCRM software to manage their companies customers. Each company has its own myCRM Server. To avoid a merged client application connecting automatically to the first server application found on the subnet, each server application is published on a port number different from 19813 and defined during buildApp.
Managers of the group can easily connect to the Server they want by duplicating the merged client applications.
At the first launch, just maintain the ALT key pressed on the keyboard to display the 4D standard connection dialog. Then enter the proper server credentials and connect the client application to the Server. The server credentials are then stored in a folder related to the merged client application path.
After that, each merged client application will connect automatically to its dedicated server application!