.. _object_UpdateManager: :index:`UpdateManager` ---------------------- Description *********** The UpdateManager object provides functions and properties for querying and installing system updates. :**› Inherits**: :ref:`Object ` Overview ******** Properties ++++++++++ .. hlist:: :columns: 3 * :ref:`autoDownload ` * :ref:`autoInstall ` * :ref:`autoReboot ` * :ref:`checkInterval ` * :ref:`downloadStorage ` * :ref:`error ` * :ref:`errorData ` * :ref:`errorString ` * :ref:`installStepMessage ` * :ref:`pendingUpdates ` * :ref:`progress ` * :ref:`repositories ` * :ref:`targets ` * :ref:`updatesAvailable ` * :ref:`updatesReady ` * :ref:`Object.objectId ` * :ref:`Object.parent ` Methods +++++++ .. hlist:: :columns: 1 * :ref:`check() ` * :ref:`download() ` * :ref:`install() ` * :ref:`Object.deserializeProperties() ` * :ref:`Object.fromJson() ` * :ref:`Object.serializeProperties() ` * :ref:`Object.toJson() ` Signals +++++++ .. hlist:: :columns: 1 * :ref:`errorOccurred() ` * :ref:`repositoriesDataChanged() ` * :ref:`targetsDataChanged() ` * :ref:`updatesInstalled() ` * :ref:`Object.completed() ` Enumerations ++++++++++++ .. hlist:: :columns: 1 * :ref:`Error ` Properties ********** .. _property_UpdateManager_autoDownload: .. _signal_UpdateManager_autoDownloadChanged: .. index:: single: autoDownload autoDownload ++++++++++++ This property holds whether to automatically download available updates. :**› Type**: Boolean :**› Default**: ``false`` :**› Signal**: autoDownloadChanged() :**› Attributes**: Writable .. _property_UpdateManager_autoInstall: .. _signal_UpdateManager_autoInstallChanged: .. index:: single: autoInstall autoInstall +++++++++++ This property holds whether to automatically install downloaded updates. :**› Type**: Boolean :**› Default**: ``false`` :**› Signal**: autoInstallChanged() :**› Attributes**: Writable .. _property_UpdateManager_autoReboot: .. _signal_UpdateManager_autoRebootChanged: .. index:: single: autoReboot autoReboot ++++++++++ This property holds whether to automatically reboot the system after installing updates. :**› Type**: Boolean :**› Default**: ``false`` :**› Signal**: autoRebootChanged() :**› Attributes**: Writable .. _property_UpdateManager_checkInterval: .. _signal_UpdateManager_checkIntervalChanged: .. index:: single: checkInterval checkInterval +++++++++++++ This property holds the interval in milliseconds in which to check the configured repositories for updates. The minimum value is ``5000``. :**› Type**: SignedInteger :**› Default**: ``0`` :**› Signal**: checkIntervalChanged() :**› Attributes**: Writable .. _property_UpdateManager_downloadStorage: .. _signal_UpdateManager_downloadStorageChanged: .. index:: single: downloadStorage downloadStorage +++++++++++++++ This property holds a storage location for storing downloaded update files. :**› Type**: :ref:`Storage ` :**› Signal**: downloadStorageChanged() :**› Attributes**: Readonly .. _property_UpdateManager_error: .. _signal_UpdateManager_errorChanged: .. index:: single: error error +++++ This property holds the most recently occurred error or :ref:`UpdateManager.NoError ` if no error occurred. If the same error occurs multiple times this property does not change. Use the :ref:`errorOccurred() ` signal to detect multiple occurrences of the same error. :**› Type**: :ref:`Error ` :**› Signal**: errorChanged() :**› Attributes**: Readonly .. _property_UpdateManager_errorData: .. _signal_UpdateManager_errorDataChanged: .. index:: single: errorData errorData +++++++++ This property holds additional information on errors occurred while checking, downloading or installing updates. :**› Type**: String :**› Signal**: errorDataChanged() :**› Attributes**: Readonly .. _property_UpdateManager_errorString: .. _signal_UpdateManager_errorStringChanged: .. index:: single: errorString errorString +++++++++++ This property holds the current human readable error string corresponding to the current value in the :ref:`error ` property. It may include additional information such as failure reasons or locations. :**› Type**: String :**› Signal**: errorStringChanged() :**› Attributes**: Readonly .. _property_UpdateManager_installStepMessage: .. _signal_UpdateManager_installStepMessageChanged: .. index:: single: installStepMessage installStepMessage ++++++++++++++++++ This property holds a message providing information about the current step of an update installation. This property was introduced in InCore 2.5. :**› Type**: String :**› Signal**: installStepMessageChanged() :**› Attributes**: Readonly .. _property_UpdateManager_pendingUpdates: .. _signal_UpdateManager_pendingUpdatesChanged: .. index:: single: pendingUpdates pendingUpdates ++++++++++++++ This property holds the list of available updates pending for installation. This list usually is populated by the :ref:`download() ` method but also can be written manually for installing a custom update bundle via the :ref:`install() ` method. :**› Type**: StringList :**› Signal**: pendingUpdatesChanged() :**› Attributes**: Writable .. _property_UpdateManager_progress: .. _signal_UpdateManager_progressChanged: .. index:: single: progress progress ++++++++ This property holds the percentage progress of the update installation operation. :**› Type**: SignedInteger :**› Signal**: progressChanged() :**› Attributes**: Readonly .. _property_UpdateManager_repositories: .. _signal_UpdateManager_repositoriesChanged: .. index:: single: repositories repositories ++++++++++++ This property holds a list of repositories where to retrieve update bundles from. :**› Type**: :ref:`List `\<:ref:`Repository `> :**› Signal**: repositoriesChanged() :**› Attributes**: Readonly .. _property_UpdateManager_targets: .. _signal_UpdateManager_targetsChanged: .. index:: single: targets targets +++++++ This property holds a list of targets which to install updates for. :**› Type**: :ref:`List `\<:ref:`UpdateTarget `> :**› Signal**: targetsChanged() :**› Attributes**: Readonly .. _property_UpdateManager_updatesAvailable: .. _signal_UpdateManager_updatesAvailableChanged: .. index:: single: updatesAvailable updatesAvailable ++++++++++++++++ This property holds whether any updates are available in the configured repositories. :**› Type**: Boolean :**› Signal**: updatesAvailableChanged() :**› Attributes**: Readonly .. _property_UpdateManager_updatesReady: .. _signal_UpdateManager_updatesReadyChanged: .. index:: single: updatesReady updatesReady ++++++++++++ This property holds whether any updates have been downloaded and are ready to install. :**› Type**: Boolean :**› Signal**: updatesReadyChanged() :**› Attributes**: Readonly Methods ******* .. _method_UpdateManager_check: .. index:: single: check check() +++++++ This method checks the configured repositories for updates by fetching corresponding update file lists. Returns ``true`` if at least one repository could be checked successfully. If :ref:`autoDownload ` is set to ``true`` downloads will be started afterwards automatically. Otherwise call :ref:`download() ` manually. :**› Returns**: Boolean .. _method_UpdateManager_download: .. index:: single: download download() ++++++++++ This method initiates the download of available updates to the storage specified by :ref:`downloadStorage `. Returns ``true`` if the downloads could be started successfully. Once all downloads are finished the :ref:`updatesReady ` property changes to ``true`` and :ref:`pendingUpdates ` is updated accordingly. If :ref:`autoInstall ` is set to ``true`` all downloaded updates will be installed afterwards automatically. Otherwise call :ref:`install() ` manually. :**› Returns**: Boolean .. _method_UpdateManager_install: .. index:: single: install install() +++++++++ This method initiates the installation of the downloaded updates. Returns ``true`` if at least one update is available for installation. Once all updates have been installed the :ref:`updatesInstalled() ` signal is emitted. If :ref:`autoReboot ` is set to ``true`` the system is rebooted afterwards automatically. :**› Returns**: Boolean Signals ******* .. _signal_UpdateManager_errorOccurred: .. index:: single: errorOccurred errorOccurred() +++++++++++++++ This signal is emitted whenever an error has occurred, regardless of whether the :ref:`error ` property has changed or not. In contrast to the change notification signal of the :ref:`error ` property this signal is also emitted several times if a certain error occurs several times in succession. .. _signal_UpdateManager_repositoriesDataChanged: .. index:: single: repositoriesDataChanged repositoriesDataChanged(SignedInteger index) ++++++++++++++++++++++++++++++++++++++++++++ This signal is emitted whenever the :ref:`List.dataChanged() ` signal is emitted, i.e. the item at ``index`` in the :ref:`repositories ` list itself emitted the dataChanged() signal. .. _signal_UpdateManager_targetsDataChanged: .. index:: single: targetsDataChanged targetsDataChanged(SignedInteger index) +++++++++++++++++++++++++++++++++++++++ This signal is emitted whenever the :ref:`List.dataChanged() ` signal is emitted, i.e. the item at ``index`` in the :ref:`targets ` list itself emitted the dataChanged() signal. .. _signal_UpdateManager_updatesInstalled: .. index:: single: updatesInstalled updatesInstalled() ++++++++++++++++++ This signal is emitted when one or multiple updates have been installed succesfully. This can be used to trigger further actions when :ref:`autoReboot ` is set to ``false`` and the device keeps running after the update. Enumerations ************ .. _enum_UpdateManager_Error: .. index:: single: Error Error +++++ This enumeration describes all errors which can occur in UpdateManager objects. The most recently occurred error is stored in the :ref:`error ` property. .. index:: single: UpdateManager.NoError .. index:: single: UpdateManager.MissingRepositories .. index:: single: UpdateManager.InvalidUpdateFile .. index:: single: UpdateManager.InstallationError .. index:: single: UpdateManager.InvalidDownloadStorage .. index:: single: UpdateManager.InsufficientDownloadStorage .. index:: single: UpdateManager.NoUpdatesAvailable .. index:: single: UpdateManager.NoUpdatesDownloaded .. index:: single: UpdateManager.DownloadFailed .. list-table:: :widths: auto :header-rows: 1 * - Name - Value - Description .. _enumitem_UpdateManager_NoError: * - ``UpdateManager.NoError`` - ``0`` - No error occurred or was detected. .. _enumitem_UpdateManager_MissingRepositories: * - ``UpdateManager.MissingRepositories`` - ``1`` - No repositories specified. .. _enumitem_UpdateManager_InvalidUpdateFile: * - ``UpdateManager.InvalidUpdateFile`` - ``2`` - Update file is invalid or incompatible. .. _enumitem_UpdateManager_InstallationError: * - ``UpdateManager.InstallationError`` - ``3`` - An error occurred while installing an update. .. _enumitem_UpdateManager_InvalidDownloadStorage: * - ``UpdateManager.InvalidDownloadStorage`` - ``4`` - None or invalid download storage set. .. _enumitem_UpdateManager_InsufficientDownloadStorage: * - ``UpdateManager.InsufficientDownloadStorage`` - ``5`` - Insufficient space available on the download storage. .. _enumitem_UpdateManager_NoUpdatesAvailable: * - ``UpdateManager.NoUpdatesAvailable`` - ``6`` - Updates have not been checked or no updates are available for the configured targets. .. _enumitem_UpdateManager_NoUpdatesDownloaded: * - ``UpdateManager.NoUpdatesDownloaded`` - ``7`` - No updates have been downloaded for installation. .. _enumitem_UpdateManager_DownloadFailed: * - ``UpdateManager.DownloadFailed`` - ``8`` - Failed to download one or multiple updates. .. _example_UpdateManager: Example ******* .. code-block:: qml import InCore.Foundation 2.5 import InCore.Http 2.5 Application { id: app name: "update-manager-example" version: "0.1.0" UpdateManager { id: updateManager autoInstall: true onCompleted: check() repositories: [ LocalRepository { storage: LocalStorage { } }, UsbDriveRepository { storage.onAvailableChanged: updateManager.check() }, HttpRepository { url: "http://download.inhub.de/siineos/updates/" } ] UpdateTarget { bundlePrefix: "siineos" currentVersion: system.osVersion } UpdateTarget { bundlePrefix: "example-app" currentVersion: app.version } } }