4D Blog

Home Product Create a Client/Server Application with Build4D tool

Create a Client/Server Application with Build4D tool

February 26, 2024

Product

Introducing the latest iteration of the Build4D component, now accessible on GitHub. In previous blog posts, we discussed the possibilities with a compiled project, a component, and a standalone application.

Now you can create a script for your Client/Server application from A to Z. And easily integrate it with continuous integration tools.

Let’s see how.

Build4D component

What are the possibilities?

Build4D offers two classes for generating your client/server application: the client and server classes. So, with the different parameters, every conceivable combination is possible.

You can generate:

  • a macOS and/or Windows clients,
  • a macOS and/or Windows client archives for automatic updates,
  • a macOS and/or Windows servers.

Example

Here’s a simple example of how to create a Windows server with integrated clients:

Step 1: Create a client and a client archive

Here’s a simple example of how to create a client application and a client archive.

var $build : cs.Build4D.Client
var $settings; $archive : Object
var $success : Boolean

$settings:={}

// Define the external project file
$settings.projectFile:=Folder(fk documents folder).file("Contact/Project/Contact.4DProject")

// Define the 4D Volume Desktop path
$settings.sourceAppFolder:=Folder(fk documents folder).folder("4D v20.1/4D Volume Desktop.app")
// OR
$settings.sourceAppFolder:=Folder(fk documents folder).folder("4D v20.1/4D Volume Desktop")

// Configure the application
$settings.buildName:="myApp"
$settings.destinationFolder:="Test/Client/"

// Add the application icon
$settings.iconPath:="/RESOURCES/myIcon.icns"
// OR
$settings.iconPath:="/RESOURCES/myIcon.ico"

// Add the application information
$settings.versioning:={}
$settings.versioning.version:="version"
$settings.versioning.copyright:="copyright"
$settings.versioning.companyName:="companyName"

// Sign if macOS appplication
$settings.signApplication:={}
$settings.signApplication.macSignature:=True
$settings.signApplication.macCertificate:="xxxxxx" //Certificate number found in your keyChain
// Create the client application
$build:=cs.Build4D.Client.new($settings)
$success:=$build.build()

// Create the client application archive
$archive:=$build.buildArchive()

Step2: Create a server with the integrated clients

After creating the client archive (as in the example above), you can create the server application and use the macOSClientArchive and winClientArchive attributes to pass the path to the previously created client archives.

Here’s an example of how to create a server application with client archives.

var $build : cs.Build4D.Server
var $settings : Object
var $success : Boolean

$settings:={}

// Define the external project file
$settings.projectFile:=Folder(fk documents folder).file("Contact/Project/Contact.4DProject")

// Configure the application
$settings.buildName:="myApp"
$settings.destinationFolder:="Test/Server/"

// Define the 4D Server path
$settings.sourceAppFolder:=Folder(fk documents folder).folder("4D v20.0/4D Server.app")
// OR
$settings.sourceAppFolder:=Folder(fk documents folder).folder("4D v20.0/4D Server")

// Add the application icon
$settings.iconPath:="/RESOURCES/myIcon.icns"
// OR
$settings.iconPath:="/RESOURCES/myIcon.ico"

// Add the application information
$settings.versioning:={}
$settings.versioning.version:="version"
$settings.versioning.copyright:="copyright"
$settings.versioning.companyName:="companyName"

// Add the client archives
$settings.macOSClientArchive:="...path macOS Archive..."
$settings.windowsClientArchive:="...path win Archive..."

// Create the deployment license file for OEM partner
$settings.license:=Folder(fk licenses folder).file("XXXXX.license4D")
$settings.xmlKeyLicense:=Folder(fk licenses folder).file("XXXXX.license4D")

// Sign if macOS appplication
$settings.signApplication:={}
$settings.signApplication.macSignature:=True
$settings.signApplication.macCertificate:="xxxxxx"
//Certificate number found in your keyChain
// Launch the build
$build:=cs.Build4D.Server.new($settings)
$success:=$build.build()

Next…

Explore the documentation for further insights into this new possibility!

Discuss

Tags Build application, Build4D, CI with 4D, CI/CD, Client/Server, v20

Latest related posts

  • June 16, 2025

    Generate, share and use web sessions One-Time Passcodes (OTP)

  • May 20, 2025

    Automatic Refresh of OEM Build Licenses

  • May 16, 2025

    New class to handle incoming TCP connections

Vanessa Talbot
Vanessa Talbot
• Product Owner •Vanessa Talbot joined 4D Program team in June, 2014. As a Product Owner, she is in charge of writing the user stories then translating it to functional specifications. Her role is also to make sure that the feature implementation delivered is meeting the customer need.Since her arrival, she has worked to define key features in 4D. She has worked on most of preemptive multi-threading new features and also on a very complex subject: the new architecture for engined application. Vanessa has a degree from Telecom Saint-Etienne. She began her career at the Criminal Research Institute as a developer for the audiovisual department. She has also worked in media and medical fields as expert in technical support, production as well as documenting new features.
  • Deutsch
  • Français
  • English
  • Português
  • Čeština
  • Español
  • Italiano
  • 日本語

Categories

Browse categories

  • 4D View Pro
  • 4D Write Pro
  • 4D for Mobile
  • Email
  • Development Mode
  • 4D Language
  • ORDA
  • User Interface / GUI
  • Qodly Studio
  • Server
  • Maintenance
  • Deployment
  • 4D Tutorials
  • Generic
  • 4D Summit sessions and other online videos

Tags

4D-Analyzer 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R8 20 R9 Administration Authentication Build application CI/CD Class Client/Server Code editor Collections Compatibility settings Formula Google Listbox Logs Mail Network Objects ORDA PDF Pictures Preemptive Programming Qodly Studio REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor

Tags

4D-Analyzer 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R8 20 R9 Administration Authentication Build application CI/CD Class Client/Server Code editor Collections Compatibility settings Formula Google Listbox Logs Mail Network Objects ORDA PDF Pictures Preemptive Programming Qodly Studio REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor
Subscribe to 4D Newsletter

© 2025 4D SAS - All rights reserved
Terms & Conditions | Legal Notices | Data Policy | Cookie Policy | Contact us | Write for us


Subscribe to 4D Newsletter

* Your privacy is very important to us. Please click here to view our Policy

Contact us

Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!

* Your privacy is very important to us. Please click here to view our Policy