KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Command Line Interface Directory Usage and Automatic Remote Client Updates
PRODUCT: 4D | VERSION: 19 | PLATFORM: Mac & Win
Published On: March 6, 2023

A recent feature of 4D is the ability to run the applications in headless mode. By running the application using a command line with the headless parameter "--headless" the application will run without a UI. Headless mode has been implemented to address most if not all of the potential blocking dialogs and events.

One event is the automatic updates of remote clients. In the scenario in which a headless mode remote client's version does not match the server and the automatic updater has been implemented, the remote client will procede with the update and restart automatically.
A potential issue that can prevent the update is if the current directory of the command line is set to the client application's directory.

The update process, modifies the directory and renames it to allow the new directory to replace it before deleting it. If the current directory is set to the client directory, it cannot be renamed and deleted preventing the update to complete.

As such, when running the application in headless mode, it may be more beneficial to run the entire path relative to the base root directory and not change directories to the client directory:

This will prevent the 4DClient Folder from being renamed

> cd C:\4D_Application\4DClient
> "4D_Application Client.exe" --headless
Since the command line is using the 4DClient directory as the current directory it cannot be renamed.

The following will work assuming the command prompt was opened and the current dirrectory was not changed and defaults to a drive like "C:":
> "C:\4D_Application\4DClient\4D_Application Client.exe" --headless

or the directory can be changed to the directory containing the client directory, as long as the client directory itself is not accessed:
> cd C:\4D_Application
> "4DClient\4D_Application Client.exe" --headless