Interface UpdateDescriptor

All Superinterfaces:
Serializable

public interface UpdateDescriptor extends Serializable
Contains information about available updates.

Please see the "Auto-Update" help topic in the documentation for a detailed discussion on updaters.

When building the installers, install4j creates a file updates.xml in the media file output directory. The data in that file is exposed by this class. When you place the updates.xml on a web server, the "Check for update" action can download it and save an instance of this class to an installer variable. You can also download an update descriptor programmatically in your application by using the UpdateChecker class.

  • Method Details

    • getEntries

      UpdateDescriptorEntry[] getEntries()
      Returns all descriptor entries for the different media files of the available version.
      Returns:
      the descriptor entries
    • getPossibleUpdateEntry

      UpdateDescriptorEntry getPossibleUpdateEntry()
      An entry that has been identified as a match for the current installation and should be used for choosing an update installer.

      This is only non-null if the following conditions are fulfilled:

      • there is indeed a newer version available
      • the conditions for the maximum and minimum updatable version are satisfied by the current installation
      • an entry is available whose target media set ID is equal to the media file ID of the current installation. Media file IDs can be shown in the media section by invoking "Media->Show IDs" from the main menu.
      Returns:
      the descriptor entry suitable for updating or null if no such entry can be found
    • getEntryForCurrentMediaFileId

      UpdateDescriptorEntry getEntryForCurrentMediaFileId()
      Return an entry that has the same media file ID as the current installation.

      This is useful if the logic in getPossibleUpdateEntry() is not what you are looking for and you need to implement your own logic while retaining the match in the media file ID. No version checks will be performed for the returned entry. If getPossibleUpdateEntry() return a non-null value, this method will return the same value.

      Returns:
      the descriptor entries or null if no entry with the same media file ID can be found
      See Also:
    • getBaseUrl

      String getBaseUrl()
      Returns the base URL from which update installers will be downloaded.

      The base URL determines the value of UpdateDescriptorEntry.getURL() which returns the URL an update installer will be downloaded from. By default, the base URL is the empty string, and the update installers will be downloaded from the same directory as the updates.xml file. If updates.xml and the update installers are not placed into the same directory on the web server, you have to change the baseUrl attribute in the updateDescriptor element in updates.xml to the appropriate URL.

      Returns:
      the base URL