Skip to main content
Version: Next

SET UPDATE FOLDER

SET UPDATE FOLDER ( folderPath {; silentErrors} )

ParameterTypeDescription
folderPathTextPathname of folder (package under OS X) containing updated application
silentErrorsBooleanFalse (default) = report errors visibly,
True = do not report them

This command is not thread-safe, it cannot be used in preemptive code.

Description

The SET UPDATE FOLDER command specifies the folder containing the update of the current merged 4D application. This information is stored in the 4D session until the RESTART 4D method is called. If the application is exited manually, this information is not kept.

This command is intended to be used in an automatic update process for a merged application (server or single-user). For more information, refer to the Finalizing and deploying final applications section in the Design Reference manual.

Note: This command only works with 4D Server or a single-user application merged with 4D Volume Desktop.

In the folderPath parameter, pass the complete pathname for the folder of the new version of the merged application (folder containing the my4DApp.exe application under Windows or the my4DApp .app package under OS X), created by the 4D application builder.

Note: We recommend that you use the same names for the files in the new version of the application as the ones in the original, since the application folder is replaced during the update. If you use different names for these files, any stored shortcuts and/or paths will no longer work.

If the parameters are valid, the update is placed "on hold" in the session until the RESTART 4D command is called. If you executed SET UPDATE FOLDER several times before calling RESTART 4D, the last valid call is taken into account.

In case of anomaly, an error is generated; the silentErrors parameter determines whether or not these errors are displayed (see below).

You can pass an empty string ("") in the folderPath parameter to reset the update information for the current session.

The optional silentErrors parameter specifies how errors are reported during the update:

  • When you pass False or when this parameter is omitted, errors are recorded in the update journal and displayed in a warning dialog box.
  • If you pass True, errors are simply recorded in the update journal.

Exception: if the journal file cannot be created, a warning dialog box is displayed, regardless of the value of the silentErrors parameter. For more information, refer to the description of the Get last update log path command.

If the command is executed correctly, the OK system variable is set to 1; otherwise, it is set to 0. You can intercept any errors generated by the command using a method installed using the ON ERR CALL command.

Example

You created a "MyUpdates" folder on your disk, where you placed a new version of the "MyApp" application. You do not want to display errors. To prepare the update, you write:

  // Windows syntax
 SET UPDATE FOLDER("C:\\MyUpdates"+Folder separator+"MyApp"+Folder separator;True)
 
  // OS X syntax
 SET UPDATE FOLDER("MacHD:MyUpdates"+Folder separator+"MyApp.app"+Folder separator;True)

See also

Get last update log path
RESTART 4D