Create a standalone application with the Build4D component

A new build4D component has been available on GitHub for a few months. It empowers you to effortlessly create a compiled project or a component. Things are getting even better; this new component version will enable you to generate a single-user application, expanding the possibilities for your development workflow.

So with tool4D available since v20, integrating the application generation process into your CI (Continuous Integration) tools has become remarkably convenient.

Let’s delve into the details!

Build4D component

What does the component do?

Here is a non-exhaustive list of what the component allows you to do:

  • compile the project,
  • merge the 4D Volume Desktop with your project,
  • add the information of the application like the Copyright, Company…,
  • add the icon,
  • choose the folders to add, like Documentation, WebFolder, Default Data…,
  • select the folders to remove, like a Dev folder in the Resources,
  • choose the modules to remove, like CEF, Mecab, php…,
  • generate the deployment license,
  • and sign the application.

What is the difference with the Build application command?

In both cases, you can generate a perfectly usable single-user application. The Build Application command is monolithic. If you want to customize a file or add or remove a folder, you must do it after building the application. And for a macOS application, you have to sign the application again.

The Build4D component is composed of several classes and functions coded in 4D. So if your application is very particular and different from others. You can easily add a new function or improve an existing one.

How to do it?

The code below is an example of generating a standalone application from an external project. 

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

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

// Configure the application

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

// Specify the components required for compilation
$componentFolder:=Folder(fk documents folder).folder("4D v20.0/")
$components.push($componentFolder.file("4D WritePro Interface.4dbase/4D WritePro Interface.4DZ"))

// Delete the unnecessary module
$settings.excludeModules:=["CEF"; "MeCab"] 

// Include the folders and files
$settings.includePaths.push({source$componentFolder.folder("4D WritePro Interface.4dbase").path; destination: "../Components/"})
$settings.includePaths.push({source$componentFolder.folder("4D SVG.4dbase").path; destination: "../Components/"})

// Delete the folders and files 

// Add the application icon

// Add the application information

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

// Sign the macOS appplication

// Launch the build

For more details on each attribute, read the documentation for each component class.

For macOS applications, you need to notarize them in order to distribute them. For more details, please refer to Apple’s documentation.


Go to GitHub to download the “Build4D” component. Moreover, to stay informed about all the new features of the component, click on the “Watch” button or put 4D Depot or Build 4D in your favorites. If you need help, you can read this blog post, which details all the 4D organizations and how to use all the Github features.

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.