Installer - Auto Update Options

## Installer - Auto Update Options |

| Please see the help topic on auto-updates for a general discussion on how to implement auto-update functionality in your project.

| All settings on this tab are returned at runtime by instances of `UpdateDescriptorEntry` objects that are returned by the `UpdateDescriptor` object. There are two different scenarios for working with these objects: In updater installer applications If you have added an updater installer application on the screens & actions tab, the updater uses a "Check for update" action to download `updates.xml`, instantiate an `UpdateDescriptor` object and save it to the installer variable named "updateDescriptor". A "Set a variable" action is used to save the appropriate `UpdateDescriptorEntry` object to te installer variable named "updateDescriptorEntry" You can use the above installer variables directly in your updater application. From the API If you want to check updates from your own code, you can call `com.install4j.api.update.UpdateChecker.getUpdateDescriptor(...)` to obtain an instance of `UpdateDescriptor`.

| The URL for updates.xml setting sets the contents of the `sys.updatesUrl` compiler variable. When you insert an updater on the screens & actions tab, it contains a "Check for updates" action, that will have its "Update descriptor URL" property set to `${compiler:sys.updatesUrl}`. If there are any "Check for updates" actions in your project that use this compiler variable, you have to define it in this text field. Note that this must be the full URL to which you will upload the update descriptor file `updates.xml`, for example `http://www.server.com/donwload/updates.xml`. You do not have to name the file `updates.xml` on the server, it can have any name. The base URL setting controls how the download URL of a new installer is constructed by an auto-updater. By default, new installers have to be located in the same directory as the `updates.xml` update descriptor file. If they should be downloaded from another source, activate the `base URL` setting and specify the base URL. The URK should start with `http://` and point to a directory where the installers are located, not to a particular installer. The configured value is returned by `UpdateDescriptor#getBaseUrl()`. It is not possible to set different base URLs for different media files by using a compiler variable.

| The minimum and maximum updatable versions control if updater applications of already installed applications should recognize the current version as a possible update. For example, if the installed version is 1.0 and a minimum updatable version of 2.0 is specified, the return value of `UpdateDescriptor#getPossibleUpdateEntry()` will be `null` and the updater application will not detect a new version. The configured values are returned by `UpdateDescriptorEntry#getUpdatableVersionMin()` and `UpdateDescriptorEntry#getUpdatableVersionMax()`. They can be overridden for each media file in the "Customize project defaults->Auto-update options" step of the media file wizard.

| The files with comments setting allows you to embed an comment in text or HTML format in the update descriptor. You can configure a file for each language that is supported by the installer. If you configure a comment file for at least the principal language, a hyperlink that shows the comment in the appropriate language will be added to the "New version available" screen in updaters that perform a version check. The comment in the user-selected language is returned by `UpdateDescriptorEntry#getComment()`. Comment files can be overridden for each media file in the "Customize project defaults->Auto-update options" step of the media file wizard. The files with comments must be encoded in UTF-8.

| Additional attributes can be used for custom logic in updaters. Attributes are simple key-value pairs. The configured attributes are returned by `UpdateDescriptorEntry#getAdditionalAttribute(...)`. They can be overridden for each media file in the "Customize project defaults->Auto-update options" step of the media file wizard.