4D Blog

Home Product Build an Application with 4D Commands

Build an Application with 4D Commands

April 29, 2023

Product

Since several versions of 4D, different features have been added to create your own build chain. For example,

  • the creation of a “.zip” folder,
  • the addition of information such as the copyright on an executable or a “dll”,
  • the creation of an “info.plist” file,
  • and the new build4D component.

 

With 4D v20, two new features allow finalizing the creation of a standalone or client/server application in 4D code:

  • the addition of an icon to an executable
  • the generation of the deployment license file for a server (OEM license only) or a standalone application.

Add icons to an exe

On Windows, the setAppInfo function of the File class allows adding some information, like the company and the copyright, to an executable. We have added a new attribute, “WinIcon,” to pass the “.ico” file to use.

Here is an example of code:

var $exeFile : 4D.File
var $iconFile : 4D.File

$exeFile:=Folder(fk desktop folder).file("myApp/myApp.exe")
$iconFile:=File("/RESOURCES/myApp.ico")

$exeFile.setAppInfo(New object("WinIcon"; $iconFile.path))

If you wonder, what about macOS? This is already possible since the creation of the setAppInfo function.

To add an icon to a “.app” file. You have to put the “.icns” file in the “Resources” folder of the application. Then add a key “CFBundleIconFile” in the “info.plist” file with the path of the icon relative to the “Resources” folder.

var $plistFile : 4D.File  
$pListFile:= Folder(fk desktop folder).file("myApp.app/Contents/Info.plist")
$pListFile.setAppInfo(New object("CFBundleIconFile";"myApp.icns"))

Generate deployment license

The new command Create deployment license allows the creation of the license for a server or a single-user application. To do this, you must pass the generated application folder and the license file as parameters to generate the deployment license.

Single-user application:

var $status : Object
var $application : 4D.File
var $license : 4D.File
$license:=Folder(fk licenses folder).file("4UUD200-xxx.license4D")
$application:=Folder(fk desktop folder).folder("myApp.app")
$status:=Create deployment license($application; $license)

Server with OEM license:

var $status : Object
var $application : 4D.File
var $serverLicense; $oemLicense : 4D.File
$serverLicense:=Folder(fk licenses folder).file("4UOS200-xxx.license4D")
$oemLicense:=Folder(fk licenses folder).file("4DOM200-xxx.license4D")
$application:=Folder(fk desktop folder).folder("myApp.app")
$status:=Create deployment license($application; $serverLicense; $oemLicense)

Next…

On Github, you have the Build4D component that allows you to create your own build chain. For now, you can customize and automate the creation of a compiled base or a component. Stay tuned for new developments coming soon.

Discuss

Tags Build application, Programming, v20

Latest related posts

  • January 9, 2026

    Session handling in 4D Qodly Pro

  • January 7, 2026

    Enhance your Desktop Interface with Web widgets using 4D Qodly Pro

  • January 7, 2026

    Embed Qodly pages in a 4D web area without extra cost

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

  • AI
  • 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 AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 Administration AI Artificial Intelligence Build application CI/CD Class Client/Server Code editor Collections Formula Listbox Logs Mail Microsoft 365 Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience vscode Web Word processor

Tags

4D-Analyzer 4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 Administration AI Artificial Intelligence Build application CI/CD Class Client/Server Code editor Collections Formula Listbox Logs Mail Microsoft 365 Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience vscode Web Word processor
Subscribe to 4D Newsletter

© 2026 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