Embedded WizardEmbedded Wizard

Working with Embedded Wizard: Running ChoraC in a Docker container

The CHORAC.EXE command line compiler lets you generate code from the command line without opening Embedded Wizard Studio. Because ChoraC is a Windows application, running it on Linux, macOS or inside a continuous integration (CI) pipeline normally requires either a Windows machine or a manually prepared WINE environment.

This chapter describes a Docker based approach that packages ChoraC together with WINE inside a container. With it you can generate code on any machine that runs Docker - including Linux servers, WSL and CI build agents - without installing Embedded Wizard Studio or configuring WINE yourself. The container reads your Embedded Wizard project, runs ChoraC against a selected profile and writes the generated code back to your host machine.

You can download the ready-to-use Docker package here:

EmbeddedWizard-ChoraC-Docker.zip

Unpack the archive on the machine where you want to generate code. It contains the Dockerfile, the launcher scripts and a small example project - you only need to add your license key, the ChoraC setup and, optionally, your own project as described below.

What you need

Docker - Docker Desktop (Windows or macOS) or Docker Engine (Linux / WSL). On Linux make sure your user is allowed to run docker commands.

An Embedded Wizard license key. The container activates the license at runtime, so a valid license key is mandatory - the same key you use to activate Embedded Wizard.

The ChoraC installer (the .msi setup). It is not bundled with the package and is provided to licensed Embedded Wizard customers only. Using ChoraC always requires a valid license key. To obtain the ChoraC installer and a license key, please contact us at support@embedded-wizard.de.

How it works

The container is built once from the ChoraC setup and then executed for every code generation run. The license key is never baked into the image - it is passed in at runtime and written into the WINE registry by the container, keeping the image free of any license material:

Host machine Docker container ------------ ---------------- .env (EW_LICENSE_KEY) -----------> injected at runtime -> WINE registry .env (EW_CHORAC_MSI) --build---> selects which ChoraC .msi to install ChoraC setup (.msi) --build---> ChoraC installed into the image (via WINE) your project folder --mount---> project source GeneratedCode folder <--mount--- generated code, copied out per profile

A WINE environment inside the image emulates Windows so the native Windows ChoraC executable can run. The WINE state is kept in a persistent Docker named volume so the license activation survives between runs (see Persisting the license activation below).

Prepare the project and license

Configure the .env file. Copy the supplied .env.example to .env and set two values - your license key in flat format without dashes (the key on your license certificate contains dashes, e.g. ABCDE-FGHIJ-KLMNO-PQRST-UVWXY, so strip them) and the exact file name of your ChoraC .msi:

EW_LICENSE_KEY=ABCDEFGHIJKLMNOPQRSTUVWXY EW_CHORAC_MSI=EmbeddedWizard_ChoraC_x64-V15.03.msi

Add the ChoraC setup. Place the ChoraC .msi into the package's installer directory (data/Installer/). Its file name must match EW_CHORAC_MSI from the previous step. You do not need to edit the Dockerfile - the launcher writes the file name into it automatically. The launcher refuses to build if the setup is missing.

TIP

To switch to another ChoraC version later, drop the new .msi into data/Installer/ and update EW_CHORAC_MSI in .env - nothing else needs to change.

Provide your project. Put your Embedded Wizard project - the project file (the .ewp file) together with its units and resources - into the package's project directory. A small example project is bundled so you can try the workflow immediately.

TIP

Custom fonts travel with the project (for example via the project's FontConversion=FreeType setting), so no separate fonts directory is needed inside the container.

Build and run

The package provides a launcher for each host system: start.bat for Windows and start.sh for Linux / WSL. Both take two arguments - the .ewp file (relative to the project directory) and the name of the profile to build:

Windows: start.bat HelloWorld.ewp Win32 Linux / WSL: ./start.sh HelloWorld.ewp Win32

The launcher can be started from any directory. It verifies the arguments, checks that Docker is running and that .env, the ChoraC setup and the requested project are present, writes the .msi file name into the Dockerfile, builds the image, and finally runs the container with your project mounted and the license injected at runtime.

After a successful run the generated code is copied out into a subfolder named after the selected profile, under the data/GeneratedCode/ directory. For the bundled example built with profile Win32 you get:

data/GeneratedCode/Win32/ Application.c, Application.h, Core.c, Core.h, ... build_report.html

The per-profile output folder is replaced on every run, so it always reflects the latest build. ChoraC additionally leaves its native output inside the project itself, following the default output convention - data/EmWiGuiProject/Win32/ for the example.

Persisting the license activation

The WINE environment is stored in a Docker named volume so that the license activation state survives across runs. Without this persistence every fresh container would look like a new machine to the Embedded Wizard license server, which can trigger a license in use by another user error.

If you ever need to start from a clean state - for example after changing the ChoraC version or to resolve a stuck activation - remove the named volume and run again. Docker re-populates it automatically on the next run.

Known issues and limitations

Reported version mismatch: ChoraC may report a slightly different installed Embedded Wizard version than the setup you provided. This is a cosmetic mismatch only and can be ignored.

Slow bind mounts on WSL: when the project folder lives on the Windows file system, the bind mount can be noticeably slower under WSL. For faster builds, move the package into your WSL home directory and run it from there.

IMPORTANT

Running ChoraC under WINE in a container is intended for automated and headless code generation. The interactive Embedded Wizard Studio still runs best on a native Windows system, or under WINE as described in Run Embedded Wizard with WINEHQ on Linux or macOS.