SET UPDATE FOLDER can be used to prepare an application for an automatic update. SET UPDATE FOLDER can be used in the context of a built client/server application and a built stand alone application. The command will only run under these environments and will return the following error if executed in interpreted mode:
Error 82: This command cannot be executed on 4D.
SET UPDATE FOLDER should point to the folder containing the executable file (.exe on windows, .app on mac).
SET UPDATE FOLDER should also be followed by RESTART 4D. This will start the automatic update process and re-open the application once the update is performed.
Furthermore, in client/server setup, the method should be ran on the server (using execute on server or checking the “execute on server property”). This will prompt all connected clients to first disconnect before the server is updated.
Notes:
- The application name should not contain the word “update” in it for the automatic update to perform properly.
- Update logs are located in the following location:
Win: C:\Users\<username>\AppData\Roaming\<Application name>\4D\Updater\Logs
Mac: Macintosh HD:Users:<username>:Library:Application Support:<Application name>:4D:Updater:Logs - After the update, the last data file opened will be re-opened. The “Open data file” dialog should not come up unless no data file was previously opened.
- The automatic update will still work if the application updates 4D versions (e.g. v14 to v15). If the server upgrades to a newer version of 4D, clients will be prompted to upgrade once connected. The upgrade will perform automatically once the user accepts.