4D Blog

Home Product Create a standalone application with the Build4D component

Create a standalone application with the Build4D component

July 13, 2023

Product

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

$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/"
$settings.obfuscated:=True
$settings.packedProject:=False
$settings.useSDI:=False
$settings.startElevated:=False
$settings.lastDataPathLookup:="ByAppPath"

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

// Specify the components required for compilation
$componentFolder:=Folder(fk documents folder).folder("4D v20.0/4D.app/Contents/Components")
$components:=[]
$components.push($componentFolder.file("4D WritePro Interface.4dbase/4D WritePro Interface.4DZ"))
$settings.compilerOptions:={components: $components}

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

// Include the folders and files
$settings.includePaths:=[] 
$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 
$settings.deletePaths:=[] 
$settings.deletePaths.push("Resources/Dev/")

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

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

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

// Sign the macOS appplication
$settings.signApplication:={} 
$settings.signApplication.macSignature:=True
$settings.signApplication.macCertificate:="xxxxxx"

// Launch the build
$build:=cs.Build4D.Standalone.new($settings)
$success:=$build.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.

Next…

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.

Discuss

Tags Build application, Build4D, CI with 4D, CI/CD, Component, tool4D, 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 Listbox Logs Mail Microsoft 365 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 Listbox Logs Mail Microsoft 365 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