### startInstall() Source: https://skycoder42.github.io/QtAutoUpdater/functions_func.html Starts the installation using the UpdateInstaller. ```APIDOC ## startInstall() ### Description Starts the installation using the UpdateInstaller. ### Method startInstall ### Class QtAutoUpdater::UpdateInstaller ``` -------------------------------- ### startInstallImpl() Source: https://skycoder42.github.io/QtAutoUpdater/functions_func.html Starts the installation implementation using the UpdateInstaller. ```APIDOC ## startInstallImpl() ### Description Starts the installation implementation using the UpdateInstaller. ### Method startInstallImpl ### Class QtAutoUpdater::UpdateInstaller ``` -------------------------------- ### startInstall virtual slot Source: https://skycoder42.github.io/QtAutoUpdater/class_qt_auto_updater_1_1_update_installer.html Virtual slot called to start the actual installation with the current components. Call this to start an installation. Do not reimplement this method yourself unless you have a custom progressModel. Instead, implement startInstallImpl(), as that method is called directly from this one. ```APIDOC ## startInstall ### Description Virtual slot called to start the actual installation with the current components. Call this to start an installation. Do not reimplement this method yourself unless you have a custom progressModel. Instead, implement startInstallImpl(), as that method is called directly from this one. ### Slot startInstall() ### See Also - UpdateInstaller::startInstallImpl - UpdateInstaller::progressModel ``` -------------------------------- ### showInstaller(QtAutoUpdater::UpdateInstaller *installer, QPrivateSignal) Source: https://skycoder42.github.io/QtAutoUpdater/class_qt_auto_updater_1_1_updater.html Signal emitted when a started installation requires an installer to be shown. ```APIDOC ## showInstaller(QtAutoUpdater::UpdateInstaller *installer, QPrivateSignal) ### Description Will be emitted when a started installation requires an installer to be shown. ### Method Signal ### Signature void showInstaller(QtAutoUpdater::UpdateInstaller *installer, QPrivateSignal) ### Parameters - **installer** (QtAutoUpdater::UpdateInstaller *) - The installer instance to show. - **QPrivateSignal** - Private signal parameter. ### Returns void ``` -------------------------------- ### UpdateInstaller::startInstallImpl() Source: https://skycoder42.github.io/QtAutoUpdater/class_qt_auto_updater_1_1_update_installer.html Pure virtual method that must be implemented by subclasses to actually start the installation process. This is an internal method called by the framework. ```APIDOC ## UpdateInstaller::startInstallImpl() ### Description Internal method to actually start the installation. This is a pure virtual method that must be implemented by subclasses to perform the actual installation steps. ### Method Pure virtual function ### Parameters None ### Returns void ``` -------------------------------- ### installDone(bool success, QPrivateSignal) Source: https://skycoder42.github.io/QtAutoUpdater/class_qt_auto_updater_1_1_updater.html Signal emitted when a started parallel installation has finished. ```APIDOC ## installDone(bool success, QPrivateSignal) ### Description Will be emitted when a started parallel installation has finished. ### Method Signal ### Signature void installDone(bool success, QPrivateSignal) ### Parameters - **success** (bool) - Whether the installation succeeded. - **QPrivateSignal** - Private signal parameter. ### Returns void ``` -------------------------------- ### installerInfo() Source: https://skycoder42.github.io/QtAutoUpdater/class_qt_auto_updater_1_1_process_backend.html Protected pure virtual method called to get information about the tool to be run as external installer. Returns an optional install process information if supported, or nullopt to indicate no installer support. ```APIDOC ## installerInfo() ### Description Is called to get information about the tool to be run as external installer. This method is called from this classes triggerUpdates() implementation to get information about the process to be launched as external installer. If your backend does support launching an installer, return a valid information here. If it does not, return `nullopt` to communicate this to the library. ### Method protected pure virtual ### Signature `QtAutoUpdater::ProcessBackend::installerInfo(const QList &_infos_, bool _track_)` t ### Parameters - **infos** (QList) - The list of update infos to be updated - **track** (bool) - Specifies if the installers execution should be tracked ### Returns An optional install process information, if supported ### Notes - For this method to ever be called from the library, features() must have the UpdaterBackend::Feature::TriggerInstall flag set. - Track can only be true if features() has the UpdaterBackend::Feature::ParallelTrigger flag set. - The launching, monitoring and handling of stdin/stderr/stdout is done automatically and triggerInstallDone() will also be emitted completely automatically if the process is tracked and did finish. - After this method was called, you don't have to do anything regaring the triggered install anymore. ### See Also - UpdaterBackend::triggerUpdates - ProcessBackend::InstallProcessInfo - UpdaterBackend::features() - UpdaterBackend::Feature ``` -------------------------------- ### Using UpdateInstallerComponent with StackView Source: https://skycoder42.github.io/QtAutoUpdater/classde_1_1skycoder42_1_1_qt_auto_updater_1_1_quick_1_1_update_installer_component.html Example showing how to integrate UpdateInstallerComponent within a StackView to manage the update installation UI. ```qml StackView { id: stackView anchors.fill: parent // parent should be the root window ... } UpdateInstallerComponent { id: component updater: QtAutoUpdater.createUpdater(...) useAsComponent: true goBackCallback: stackView.pop onShowItem: stackView.push(item) } ``` -------------------------------- ### start(DisplayLevel displayLevel) Source: https://skycoder42.github.io/QtAutoUpdater/class_qt_auto_updater_1_1_update_controller.html Sets the display level and then starts the update controller. Returns true if the controller started successfully, false otherwise. ```APIDOC ## start(DisplayLevel displayLevel) ### Description Sets the display level and then starts the update controller. Returns true if the controller started successfully, false otherwise. ### Method Slot ### Parameters - **displayLevel** (DisplayLevel) - Required - The display level to set before starting. ### Returns bool - True if the controller started successfully, false otherwise. ``` -------------------------------- ### start(DisplayLevel) Source: https://skycoder42.github.io/QtAutoUpdater/class_qt_auto_updater_1_1_update_controller.html Slot that sets the display level and starts the controller. Returns true if the controller started, false if unable to start. ```APIDOC ## start(DisplayLevel) ### Description Sets the display level and then starts the controller. Returns true if the controller started, false if unable to start. Start will fail if the updater is already running, or if the user rejects the ask dialog, in case the AskLevel was set. Otherwise, it will always succeed and run Updater::checkForUpdates. All further dialogs will then be shown automatically, according to the displayLevel. ### Method slot ### Parameters - **displayLevel** (DisplayLevel) - Required - The DisplayLevel to be set as displayLevel property before starting. ### Returns - `true` if the controller started, `false` if unable to start. ### See Also - UpdateController::displayLevel - Updater::running - Updater::checkForUpdates ``` -------------------------------- ### start() Source: https://skycoder42.github.io/QtAutoUpdater/functions_func.html Starts the update process using the UpdateController. ```APIDOC ## start() ### Description Starts the update process using the UpdateController. ### Method start ### Class QtAutoUpdater::UpdateController ``` -------------------------------- ### ProcessBackend::InstallProcessInfo Source: https://skycoder42.github.io/QtAutoUpdater/processbackend_8h_source.html Structure that collects information about an installation process to be started. This is a protected structure. ```APIDOC ## ProcessBackend::InstallProcessInfo ### Description Structure that collects information about an installation process to be started. This is a protected structure. ### Fields - **runAsAdmin** (std::optional) - Whether to run the process as administrator. Default is nullopt. ``` -------------------------------- ### autoRunUpdater Source: https://skycoder42.github.io/QtAutoUpdater/classde_1_1skycoder42_1_1_qt_auto_updater_1_1_quick_1_1_update_result_dialog.html Specifies if the dialog should automatically start an installation. If set to true, on a successful update, an installation will automatically be started. ```APIDOC ### Property: autoRunUpdater **Type:** bool **Default:** false **Access:** MEMBER **Description:** Specifies if the dialog should automatically start an installation. If set to true, on a successful update, an installation will automatically be started. The autoInstallMode and installScope properties are used as arguments for QtAutoUpdater::Updater::runUpdater() and thus determine how the installer is started. **Behavior:** If a parallel installation is launched, the dialog itself will not show anything. If an installation is planned to be run on exit, an information is shown to the user, but only if the showOnSuccess property was set to true. If the dialog fails to start the installer and showOnFailure is set to true, an error message is shown informing the user that updates are available, but could not be installed. **See also:** UpdateResultDialog::showOnSuccess, UpdateResultDialog::showOnFailure, UpdateResultDialog::autoInstallMode, UpdateResultDialog::installScope, QtAutoUpdater::Updater::runUpdater ``` -------------------------------- ### InstallProcessInfo Struct Source: https://skycoder42.github.io/QtAutoUpdater/struct_qt_auto_updater_1_1_process_backend_1_1_install_process_info.html Public struct that collects information about an installation process to be started. It inherits from ProcessInfoBase and provides attributes for configuring the process execution. ```APIDOC ## InstallProcessInfo Struct ### Description Structure that collects information about an installation process to be started. Inherits from QtAutoUpdater::ProcessBackend::ProcessInfoBase. ### Header #include ### Public Attributes #### runAsAdmin - Type: std::optional - Default: std::nullopt - Description: Specify, if the process should be run as admin. If set to nullopt, the backend tries to figure this out by using AdminAuthoriser::needsAdminPermission(const QString &). #### program - Type: QString - Description: The path or name of the executable. #### arguments - Type: QStringList - Description: The arguments that should be passed to the process. #### workingDir - Type: std::optional - Default: std::nullopt - Description: The working directory. If set to nullopt, the programs path is used. ### Detailed Description Structure that collects information about an installation process to be started. Definition at line 48 of file processbackend.h. The documentation for this struct was generated from the following file: - processbackend.h ``` -------------------------------- ### start() Source: https://skycoder42.github.io/QtAutoUpdater/class_qt_auto_updater_1_1_update_controller.html Slot that starts the controller. It fails if the updater is already running or if the user rejects the ask dialog when AskLevel is set. ```APIDOC ## start() ### Description Starts the controller. It will fail if the updater is already running, or if the user rejects the ask dialog when AskLevel is set. Otherwise, it will always succeed and run Updater::checkForUpdates. All further dialogs will then be shown automatically according to the displayLevel. ### Method slot ### Returns `true` if the controller started, `false` if unable to start. ### See Also UpdateController::displayLevel, Updater::running, Updater::checkForUpdates ``` -------------------------------- ### UpdateButton::allowInstall Source: https://skycoder42.github.io/QtAutoUpdater/classde_1_1skycoder42_1_1_qt_auto_updater_1_1_quick_1_1_update_button.html The allowInstall property specifies whether the button makes it possible for the user to install updates. When set to true and updates are available, the button shows 'Install' and starts the update installation when clicked. When set to false, it shows that updates are available and clicking starts another update check. ```APIDOC ## Property: allowInstall ### Description Specifies if the button makes it possible for the user to install updates. ### Type bool ### Default `true` ### Accessors - **MEMBER**: allowInstall ### Behavior - If set to true and after an update check there are new updates, the button will show "Install" as text and when clicked start the update installation, according to the installMode and installScope properties via QtAutoUpdater::Updater::runUpdater(). - If set to false, the button will instead show the information that updates are available. If clicked again, the button simply starts another updater check. ### See Also - UpdateButton::installMode - UpdateButton::installScope - QtAutoUpdater::Updater::runUpdater ``` -------------------------------- ### ProcessBackend::installerInfo Source: https://skycoder42.github.io/QtAutoUpdater/processbackend_8h_source.html Returns information about the installer process. This is a protected pure virtual method. ```APIDOC ## ProcessBackend::installerInfo ### Description Returns information about the installer process. This is a protected pure virtual method. ### Method virtual std::optional installerInfo(const QList &infos, bool track) = 0 ### Parameters - **infos** (QList) - Required - The list of update information. - **track** (bool) - Required - Whether to track the update process. ### Returns std::optional - The installer process information, or nullopt if not applicable. ``` -------------------------------- ### triggerUpdates(const QList &infos, bool track) Source: https://skycoder42.github.io/QtAutoUpdater/class_qt_auto_updater_1_1_process_backend.html Launches an installer application to install updates. This method is an override of the UpdaterBackend interface and is used to trigger the installation of the provided updates. ```APIDOC ## triggerUpdates(const QList &infos, bool track) ### Description Launches an installer application to install updates. This method is an override of the UpdaterBackend interface. ### Method triggerUpdates ### Parameters - **infos** (const QList &) - Required - The list of update information objects. - **track** (bool) - Required - Indicates whether to track the installation progress. ### Returns bool ``` -------------------------------- ### showInstaller() Source: https://skycoder42.github.io/QtAutoUpdater/functions_func.html Shows the installer using the Updater. ```APIDOC ## showInstaller() ### Description Shows the installer using the Updater. ### Method showInstaller ### Class QtAutoUpdater::Updater ``` -------------------------------- ### triggerUpdates(const QList &_infos_, bool _track_) Source: https://skycoder42.github.io/QtAutoUpdater/class_qt_auto_updater_1_1_updater_backend.html Pure virtual method that launches an external installer application to install updates. Returns true if an installer was launched, false otherwise. The track parameter specifies whether the installer execution should be tracked. ```APIDOC ## triggerUpdates(const QList &_infos_, bool _track_) ### Description Launches an installer application to install updates. This method should launch some kind of external installer application and report whether it could be launched successfully. The infos parameter can be seen as hint for what updates should be installed, but can be ignored if the external installer cannot be given that information. ### Method Pure virtual method (C++) ### Signature `bool triggerUpdates(const QList &_infos_, bool _track_)` ### Parameters - **infos** (const QList&) - Required - A list of update infos to be updated. - **track** (bool) - Required - Specifies if the installer's execution should be tracked. ### Returns - **bool** - `true` if an installer was launched, `false` if not. ### Notes - For this method to ever be called from the library, `features()` must have the `UpdaterBackend::Feature::TriggerInstall` flag set. - The `track` parameter specifies whether the execution of the external installer should be tracked. If `true`, the backend should track the launched installer and emit `triggerInstallDone()` once the installer has completed the installation. If `false`, it should only be launched and then forgotten. - `track` can only be `true` if `features()` has the `UpdaterBackend::Feature::ParallelTrigger` flag set. In that case, an installer might be run in parallel to the calling application. If that flag is not set, this method will only ever be called with `track` set to `false` and the calling application will exit immediately after the installer was launched successfully. However, even if the feature is supported, it is still possible for `track` to be `false` and the application to exit. ### See Also - `UpdaterBackend::features()` - `UpdaterBackend::Feature` - `UpdaterBackend::triggerInstallDone` - `UpdaterBackend::createInstaller` ### Implemented In - `QtAutoUpdater::ProcessBackend` ``` -------------------------------- ### runUpdater(InstallMode mode = InstallModeFlag::Parallel, InstallScope scope = InstallScope::PreferInternal) Source: https://skycoder42.github.io/QtAutoUpdater/class_qt_auto_updater_1_1_updater.html Launches an update installer based on the given mode and scope. Returns true if the update installer was started, false if not. ```APIDOC ## runUpdater(InstallMode mode = InstallModeFlag::Parallel, InstallScope scope = InstallScope::PreferInternal) ### Description Launches an update installer based on the given mode and scope. The method launches the installer based on the given mode, scope, and the features that the backend supports. It can either launch the internal installer ("perform") by emitting showInstaller(), launch a parallel external install process immediately ("trigger") and track its execution, or mark an external installer to be executed as soon as the application quits ("onExit"). The behavior is determined by the combination of mode, scope, and backend features as described in the table below. ### Method runUpdater ### Parameters - **mode** (InstallMode) - Optional, default `InstallModeFlag::Parallel`. The preferred mode to start the updater in. - **scope** (InstallScope) - Optional, default `InstallScope::PreferInternal`. The preferred scope to use for the updater. ### Returns - **bool** - `true` if the update installer was started, `false` if not. ### Behavior Table The flags are evaluated in the order seen in the table; if multiple flags are set, the ones displayed first decide what happens. | Mode | Scope | Flags | Result | |---|---|---|---| | `Parallel` | `PreferInternal` | `PerformInstall` | perform | | | | `ParallelTrigger` | trigger | | | | `TriggerInstall` | onExit | | `Parallel` | `PreferExternal` | `ParallelTrigger` | trigger | | | | `PerformInstall` | perform | | | | `TriggerInstall` | onExit | | `Parallel | Force` | `PreferInternal` | `PerformInstall` | perform | | | | `ParallelTrigger` | trigger | | | | `TriggerInstall` | - | | `Parallel | Force` | `PreferExternal` | `ParallelTrigger` | trigger | | | | `PerformInstall` | perform | | | | `TriggerInstall` | - | | `OnExit` | `PreferInternal` | `TriggerInstall` | onExit | | | | `ParallelTrigger` | onExit | | | | `PerformInstall` | perform | | `OnExit` | `PreferExternal` | _Same as_ `PreferInternal` | | | `OnExit | Force` | `PreferInternal` | `TriggerInstall` | onExit | | | | `ParallelTrigger` | onExit | | | | `PerformInstall` | - | | `OnExit | Force` | `PreferExternal` | _Same as_ `PreferInternal` | | For some force configurations, `-` is specified, meaning no updater can be run and `false` is returned instead. To find out whether an installation was launched immediately (Parallel) or delayed (OnExit), query the `runOnExit` property. ### See Also - Updater::state - Updater::installDone - Updater::showInstaller - Updater::runOnExit ``` -------------------------------- ### UpdateController::start() Source: https://skycoder42.github.io/QtAutoUpdater/updatecontroller_8h_source.html Starts the update process using the current settings. Returns true if the process was started successfully. ```APIDOC ## UpdateController::start() ### Description Starts the update process using the current settings. Returns true if the process was started successfully. ### Method Slot ### Returns - **bool** - True if the update process was started, false otherwise. ``` -------------------------------- ### UpdateController::start Source: https://skycoder42.github.io/QtAutoUpdater/class_qt_auto_updater_1_1_update_controller.html Starts the update process by showing the update GUI to the user. ```APIDOC ## UpdateController::start ### Description Starts the update process by showing the update GUI to the user. ### Method start ### Parameters None ### Return Value None ### Notes This method is part of the UpdateController class and is used to initiate the update process. ``` -------------------------------- ### triggerInstallDone(bool success) Source: https://skycoder42.github.io/QtAutoUpdater/class_qt_auto_updater_1_1_updater_backend.html Signal that should be emitted when a tracked triggered installation finishes. Reports whether the installation was successful. ```APIDOC ## triggerInstallDone(bool success) ### Description Signal that should be emitted once an external installer, started with track set to true, finishes its execution. Use the parameter to report whether the installer was successful. It is up to the backend developer to decide whether updates not installed due to user action are considered an error. ### Method signal ### Parameters - **success** (bool) - Required - Reports whether the installation was successful or not. ### Note For this signal to be caught by the library, features() must have the UpdaterBackend::Feature::ParallelTrigger flag set, as only then triggerUpdates() can be called with track set to true. ### See Also - UpdaterBackend::triggerUpdates - UpdaterBackend::features() - UpdaterBackend::Feature ``` -------------------------------- ### triggerInstallDone() Source: https://skycoder42.github.io/QtAutoUpdater/functions_func.html Triggers the install done event in the UpdaterBackend. ```APIDOC ## triggerInstallDone() ### Description Triggers the install done event in the UpdaterBackend. ### Method triggerInstallDone ### Class QtAutoUpdater::UpdaterBackend ``` -------------------------------- ### UpdateController::start(DisplayLevel displayLevel) Source: https://skycoder42.github.io/QtAutoUpdater/updatecontroller_8h_source.html Starts the update process with the specified display level. Returns true if the process was started successfully. ```APIDOC ## UpdateController::start(DisplayLevel displayLevel) ### Description Starts the update process with the specified display level. Returns true if the process was started successfully. ### Method Slot ### Parameters - **displayLevel** (DisplayLevel) - Required - The display level to use for the update dialog. ### Returns - **bool** - True if the update process was started, false otherwise. ``` -------------------------------- ### triggerUpdates(const QList &_infos_, bool _track_) Source: https://skycoder42.github.io/QtAutoUpdater/class_qt_auto_updater_1_1_process_backend.html Override virtual method that launches an installer application to install updates. Returns true if an installer was launched, false if not. ```APIDOC ## triggerUpdates(const QList &_infos_, bool _track_) ### Description Launches an installer application to install updates. This method should launch some kind of external installer application and report whether it could be launched successfully. The infos parameter can be seen as hint for what updates should be installed, but can be ignored if the external installer cannot be given that information. ### Method overridevirtual ### Parameters - **infos** (const QList &) - Required - A list of update infos to be updated - **track** (bool) - Required - Specifies if the installers execution should be tracked ### Returns - **bool** - `true` if an installer was launched, `false` if not ### Notes - For this method to ever be called from the library, features() must have the UpdaterBackend::Feature::TriggerInstall flag set. - The track parameter specifies whether the execution of the external installer should be tracked. If true, the backend should track the launched installer and emit triggerInstallDone() once the installer has completed the installation. If set to false, it should only be launched and then forgotten. - track can only be true if features() has the UpdaterBackend::Feature::ParallelTrigger flag set. In that case, an installer might be run in parallel to the calling application. If that flag is not set, this method will only ever be called with track set to false and the calling application will exit immediately after the installer was launched successfully. However, even if the feature is supported, it is still possible for track to be false and the application to exit. ### See Also - UpdaterBackend::features() - UpdaterBackend::Feature - UpdaterBackend::triggerInstallDone - UpdaterBackend::createInstaller ### Implements QtAutoUpdater::UpdaterBackend ``` -------------------------------- ### createInstaller() =0 Source: https://skycoder42.github.io/QtAutoUpdater/class_qt_auto_updater_1_1_process_backend.html Creates an update installer to internally install updates. This is a pure virtual method that must be implemented by subclasses. ```APIDOC ## createInstaller() =0 ### Description Creates an update installer to internally install updates. This is a pure virtual method that must be implemented by subclasses. ### Method createInstaller ### Parameters None ### Returns UpdateInstaller * ``` -------------------------------- ### enum InstallScope Source: https://skycoder42.github.io/QtAutoUpdater/class_qt_auto_updater_1_1_updater.html Defines the different installation scopes. Values: PreferInternal, PreferExternal. ```APIDOC ## enum QtAutoUpdater::Updater::InstallScope ### Description Defines the different installation scopes. ### Enumerator - **PreferInternal** - Prefer the installer to be run as internal window of this application. - **PreferExternal** - Prefer the installer to be run as external tool. ### Definition Definition at line 67 of file updater.h. ``` -------------------------------- ### setInstallScope() Source: https://skycoder42.github.io/QtAutoUpdater/functions_func.html Sets the install scope for the UpdateButton and UpdateController. ```APIDOC ## setInstallScope() ### Description Sets the install scope for the UpdateButton and UpdateController. ### Method setInstallScope ### Classes QtAutoUpdater::UpdateButton, QtAutoUpdater::UpdateController ``` -------------------------------- ### runUpdater() Source: https://skycoder42.github.io/QtAutoUpdater/class_qt_auto_updater_1_1_updater.html Launches an update installer based on the given mode and scope. ```APIDOC ## runUpdater() ### Description Launches an update installer based on the given mode and scope. ### Method Run ### Signature Q_INVOKABLE bool runUpdater(InstallMode mode=InstallModeFlag::Parallel, InstallScope scope=InstallScope::PreferInternal) ### Parameters - **mode** (InstallMode) - Optional - The installation mode. Default is InstallModeFlag::Parallel. - **scope** (InstallScope) - Optional - The installation scope. Default is InstallScope::PreferInternal. ### Returns bool - True if the updater was launched successfully, false otherwise. ``` -------------------------------- ### initialize(QScopedPointer &&config) Source: https://skycoder42.github.io/QtAutoUpdater/class_qt_auto_updater_1_1_process_backend.html Initializes the backend with the given configuration. This method is used to set up the backend with a configuration reader. ```APIDOC ## initialize(QScopedPointer &&config) ### Description Initializes the backend with the given configuration. This method is used to set up the backend with a configuration reader. ### Method initialize ### Parameters - **config** (QScopedPointer &&) - Required - The configuration reader to use for initialization. ### Returns bool ``` -------------------------------- ### Updater::installDone(bool) Source: https://skycoder42.github.io/QtAutoUpdater/class_qt_auto_updater_1_1_updater.html Signal emitted when a started parallel installation has finished. The success parameter indicates whether the update installer succeeded. ```APIDOC ## Updater::installDone(bool) ### Description Signal emitted when a started parallel installation has finished. This signal is emitted if runUpdater() launched a parallel installation (either a performed or a triggered installation) and that installation finished. ### Signal void installDone(bool success) ### Parameters - **success** (bool) - Reports whether the update installer did succeed or not ### See Also - Updater::runUpdater - Updater::features ``` -------------------------------- ### Basic Updater Usage in C++ Source: https://skycoder42.github.io/QtAutoUpdater/index.html Demonstrates creating an updater instance, checking for updates, and scheduling the maintenance tool to run on exit. Requires a valid path to the MaintenanceTool. ```cpp #include #include #include int main(int argc, char *argv[]) { QCoreApplication a{argc, argv}; //create the updater with the application as parent -> will live long enough start the tool on exit auto updater = new QtAutoUpdater::Updater::create("qtifw", { {"path", "C:/Qt/MaintenanceTool"} //.exe or .app is automatically added on the platform }, &a); QObject::connect(updater, &QtAutoUpdater::Updater::checkUpdatesDone, [updater](QtAutoUpdater::Updater::State state) { qDebug() << "Update result:" << state; if (state == QtAutoUpdater::Updater::State::NewUpdates) { //As soon as the application quits, the maintenancetool will be started in update mode qDebug() << "Update info:" << updater->updateInfo(); updater->runUpdater(); } //Quit the application qApp->quit(); }); //start the update check updater->checkForUpdates(); return a.exec(); } ``` -------------------------------- ### create(QString, QVariantMap, QObject*) Source: https://skycoder42.github.io/QtAutoUpdater/class_qt_auto_updater_1_1_updater.html Static method that creates an updater instance using a backend key and a configuration map. The backend is loaded based on the given key; if no backend is found, nullptr is returned. The configuration is used to initialize the backend. ```APIDOC ## create(QString, QVariantMap, QObject*) ### Description Creates an updater instance using the given backend and configuration. The backend is loaded based on the given key. If no backend was found for the key, nullptr is returned. The configuration is used to initialize the backend. ### Method static ### Signature QtAutoUpdater::Updater::create(QString key, QVariantMap configuration, QObject *parent = nullptr) ### Parameters - **key** (QString) - Required - The key of the backend to be loaded. - **configuration** (QVariantMap) - Required - The configuration to be passed to the backend to configure it. - **parent** (QObject*) - Optional - The object to be set as the parent for the created updater. Defaults to nullptr. ### Returns A newly created updater instance or nullptr, if unable to create one. ### Attention For some update installations, an updater needs to be launched on exit of the running application. This only works if the updater lives long enough to catch the QCoreApplication::aboutToQuit signal. This means when creating an updater for a backend that may need to be run on exit, you should use either qApp or nullptr as parent for the updater. ### See Also - Updater::supportedUpdaterBackends - Updater Backend Plugins ``` -------------------------------- ### installScope Source: https://skycoder42.github.io/QtAutoUpdater/classde_1_1skycoder42_1_1_qt_auto_updater_1_1_quick_1_1_update_button.html The installation scope to be used when installing updates. This property is passed to Updater::runUpdater when the allowInstall flag is set and the user launches an installation via the button. ```APIDOC ## installScope ### Description The installation scope to be used to install updates. This scope is passed to Updater::runUpdater when the allowInstall flag is set and the user launches an installation via the button. ### Default `Updater::InstallScope::PreferInternal` ### Accessors - **MEMBER**: installScope ### See Also - QtAutoUpdater::Updater::runUpdater - QtAutoUpdater::Updater::InstallModeFlag - UpdateButton::installMode ``` -------------------------------- ### UpdaterBackend::initialize(QScopedPointer &&config) Source: https://skycoder42.github.io/QtAutoUpdater/class_qt_auto_updater_1_1_updater_backend.html Initializes the backend with the given configuration. This method is not pure virtual and can be called by users. ```APIDOC ## UpdaterBackend::initialize(QScopedPointer &&config) ### Description Initializes the backend with the given configuration. ### Method bool initialize(QScopedPointer &&config) ### Parameters - **config** (QScopedPointer) - Required - The configuration to initialize the backend with. ### Returns bool - True if initialization succeeded, false otherwise. ``` -------------------------------- ### initialize() Source: https://skycoder42.github.io/QtAutoUpdater/class_qt_auto_updater_1_1_updater_backend.html Protected pure virtual method to internally initialize the backend. Called by the library after creation, returns true on success and false on failure. ```APIDOC ## initialize() ### Description Internally initializes the backend. This method is called by the library immediately after the backend is created. At this point, config() returns a valid object and can be used to configure the backend. Return true if initialization is successful, false otherwise. On failure, the backend will be deleted. ### Method initialize() ### Parameters None ### Returns - **bool** - `true` if initialization was successful, `false` if not ### See Also - UpdaterBackend::initialize(QScopedPointer &&) - UpdaterBackend::config ``` -------------------------------- ### installMode Source: https://skycoder42.github.io/QtAutoUpdater/classde_1_1skycoder42_1_1_qt_auto_updater_1_1_quick_1_1_update_button.html The installation mode to be used when installing updates. This property is passed to Updater::runUpdater when the allowInstall flag is set and the user launches an installation via the button. ```APIDOC ## installMode ### Description The installation mode to be used to install updates. This mode is passed to Updater::runUpdater when the allowInstall flag is set and the user launches an installation via the button. ### Default `Updater::InstallModeFlag::Parallel` ### Accessors - **MEMBER**: installMode ### See Also - QtAutoUpdater::Updater::runUpdater - QtAutoUpdater::Updater::InstallModeFlag - UpdateButton::installScope ``` -------------------------------- ### create(QString key, QObject *parent) Source: https://skycoder42.github.io/QtAutoUpdater/class_qt_auto_updater_1_1_updater_plugin.html Pure virtual method to create a new instance of the plugin's updater backend. The implementation must return a valid backend instance for each backend declared in the plugin's JSON file, or nullptr on error. ```APIDOC ## create(QString key, QObject *parent) ### Description Create a new instance of that plugin's updater backend. The implementation must return a valid backend instance for each backend declared in the plugin's JSON file. If a key is passed that was not declared, return nullptr to indicate failure. The backend should not be set up on creation; initialization is done by the UpdaterBackend::initialize method. ### Method pure virtual ### Signature QtAutoUpdater::UpdaterPlugin::create(QString key, QObject *parent) ### Parameters - **key** (QString) - Required - The backend to be created. - **parent** (QObject *) - Required - The parent object of the backend to be created. ### Returns The newly created backend or nullptr on an error. ### See Also UpdaterBackend ``` -------------------------------- ### UpdateInstaller::setComponentEnabled(const QVariant &id, bool enabled) Source: https://skycoder42.github.io/QtAutoUpdater/class_qt_auto_updater_1_1_update_installer.html Enables or disables a component for installation. This method allows the installer to control which components are included in the installation process. ```APIDOC ## UpdateInstaller::setComponentEnabled(const QVariant &id, bool enabled) ### Description Enables or disables a component for installation. This method allows the installer to control which components are included in the installation process. ### Method Virtual function ### Parameters - **id** (const QVariant&) - Required - Identifier of the component to enable or disable. - **enabled** (bool) - Required - Boolean flag indicating whether the component should be enabled (true) or disabled (false). ### Returns void ``` -------------------------------- ### autoInstallMode Source: https://skycoder42.github.io/QtAutoUpdater/classde_1_1skycoder42_1_1_qt_auto_updater_1_1_quick_1_1_update_result_dialog.html The install mode to use for automatic update installation. This property is passed to QtAutoUpdater::Updater::runUpdater() for automatic updates, but not used if the user selects update installation manually. ```APIDOC ### Property: autoInstallMode **Type:** int **Default:** QtAutoUpdater::Updater::InstallModeFlag::Parallel **Access:** MEMBER **Description:** The install mode to use for automatic update installation. This is passed to QtAutoUpdater::Updater::runUpdater() for automatic updates, but not used if the user selects update installation manually. **See also:** UpdateResultDialog::autoRunUpdater, UpdateResultDialog::installScope, QtAutoUpdater::Updater::runUpdater, QtAutoUpdater::Updater::InstallModeFlag ``` -------------------------------- ### initialize() Source: https://skycoder42.github.io/QtAutoUpdater/class_qt_auto_updater_1_1_updater_backend.html Pure virtual method that internally initializes the backend. Must be implemented by derived classes. ```APIDOC ## initialize() ### Description Internally initializes the backend. This is a pure virtual method that must be implemented by derived classes. ### Signature `virtual bool initialize() = 0` ### Returns - **bool** - Returns true if initialization succeeded, false otherwise. ### Notes - This is a protected member function, intended for use by derived classes. ``` -------------------------------- ### installSucceeded(bool _shouldRestart_) Source: https://skycoder42.github.io/QtAutoUpdater/class_qt_auto_updater_1_1_update_installer.html Signal emitted when the installation has succeeded. Emit this from your custom installer on a successfully completed installation. If shouldRestart is true, the user will be asked if they want to restart the application, and if accepted, restartApplication() will be called. ```APIDOC ## installSucceeded(bool _shouldRestart_) ### Description Signal emitted when the installation has succeeded. Emit this from your custom installer on a successfully completed installation. If shouldRestart is true, the user will be asked if they want to restart the application, and if accepted, restartApplication() will be called. ### Parameters - **shouldRestart** (bool) - Required - Specify whether the application should be restarted ### See Also - UpdateInstaller::installFailed - UpdateInstaller::restartApplication ``` -------------------------------- ### UpdateController::installScope() const Source: https://skycoder42.github.io/QtAutoUpdater/updatecontroller_8h_source.html Returns the installation scope of the updater. The scope defines where updates are installed. ```APIDOC ## UpdateController::installScope() const ### Description Returns the installation scope of the updater. The scope defines where updates are installed. ### Method Getter ### Returns - **Updater::InstallScope** - The installation scope. ``` -------------------------------- ### installFailed(const QString &_errorMessage_) Source: https://skycoder42.github.io/QtAutoUpdater/class_qt_auto_updater_1_1_update_installer.html Signal emitted when the installation has failed. The errorMessage should be a localized string describing what went wrong to the user. ```APIDOC ## installFailed(const QString &_errorMessage_) ### Description Is emitted when the installation has failed. Emit this from your custom installer on a failed installation. ### Method signal ### Signature QtAutoUpdater::UpdateInstaller::installFailed(const QString &_errorMessage_) ### Parameters - **errorMessage** (const QString &) - Required - Specify whether the application should be restarted. The errorMessage should be a localized string to describe what went wrong to the user. Do not include technical details there, only general information. Such details should be logged instead. ### See Also - UpdateInstaller::installSucceeded ``` -------------------------------- ### enum InstallModeFlag Source: https://skycoder42.github.io/QtAutoUpdater/class_qt_auto_updater_1_1_updater.html Flags to indicate how to run the installer. Values: Parallel, OnExit, Force, ForceOnExit. ```APIDOC ## enum QtAutoUpdater::Updater::InstallModeFlag ### Description Flags to indicate how to run the installer. ### Enumerator - **Parallel** - Prefer the installation to be run in parallel to the running application. - **OnExit** - Prefer the installation to be run when the application exits. - **Force** - Force the Parallel or OnExit behaviour and fail otherwise. - **ForceOnExit** - Short for OnExit | Force. ### Definition Definition at line 55 of file updater.h. ``` -------------------------------- ### Configuration file for QtAutoUpdater updater Source: https://skycoder42.github.io/QtAutoUpdater/md__home_sky__programming__qt_libraries_build-qtautoupdater-_desktop__qt_5_13_2__g_c_c_64bit-_debug_doc_porting_guide.html Example configuration file for creating an updater with a backend and path. The 'backend' key specifies the backend type and 'path' specifies the maintenancetool path. ```ini [General] backend=qtifw path=pathToTheMaintenancetool ... ``` -------------------------------- ### createInstaller() pure virtual method Source: https://skycoder42.github.io/QtAutoUpdater/class_qt_auto_updater_1_1_updater_backend.html Pure virtual method that must be implemented to return an UpdateInstaller instance if the backend supports performed installation. Returns nullptr if not supported. Requires the PerformInstall feature flag to be set. ```APIDOC ## createInstaller() ### Description Creates an update installer to internally install updates. Implement this method to return your implementation of an UpdateInstaller, if your backend supports a performed installation. If your backend does not support this, simply return `nullptr`. ### Method Signature `virtual UpdateInstaller *createInstaller() = 0` ### Returns - **UpdateInstaller*** - An UpdateInstaller instance, if the backend supports it; otherwise `nullptr`. ### Note For this method to ever be called from the library, features() must have the UpdaterBackend::Feature::PerformInstall flag set. ### See Also - UpdateInstaller - UpdaterBackend::features() - UpdaterBackend::Feature - UpdaterBackend::triggerUpdates ``` -------------------------------- ### UpdateButton::installMode() const Source: https://skycoder42.github.io/QtAutoUpdater/class_qt_auto_updater_1_1_update_button.html Returns the current install mode. This is a READ accessor for the installMode property. ```APIDOC ## UpdateButton::installMode() const ### Description Returns the current install mode. This is a READ accessor for the installMode property. ### Method installMode ### Parameters None ### Returns Updater::InstallMode - The current install mode. ``` -------------------------------- ### Updater::runOnExit Source: https://skycoder42.github.io/QtAutoUpdater/class_qt_auto_updater_1_1_updater.html Read-only property that specifies whether an installer will be launched when the application exits. It is set when runUpdater() queues an installer to run on exit. ```APIDOC ## Property: runOnExit ### Description Specifies whether an installer will be launched automatically when the application exits. This property is read-only and is set when runUpdater() leads to an installer being queued to run on exit. ### Type bool ### Default false ### Accessors - **READ**: willRunOnExit() - **RESET**: cancelExitRun() - **NOTIFY**: runOnExitChanged() ### See Also - Updater::runUpdater ``` -------------------------------- ### createUpdater(QSettings*, QObject*) Source: https://skycoder42.github.io/QtAutoUpdater/classde_1_1skycoder42_1_1_qt_auto_updater_1_1_core_1_1_qt_auto_updater.html Creates an updater instance using the given configuration object. The backend is loaded based on the configuration, which must contain a 'backend' entry. Returns nullptr if the backend is missing or invalid. ```APIDOC ## createUpdater(QSettings*, QObject*) ### Description Creates an updater instance using the given configuration object. The backend is loaded based on the given configuration, which must contain the "backend" entry. If the backend is missing or invalid, nullptr is returned. ### Method Q_INVOKABLE ### Signature QtAutoUpdater::Updater* de::skycoder42::QtAutoUpdater::Core::QtAutoUpdater::createUpdater(QSettings* _config_, QObject* _parent_ = nullptr) const ### Parameters - **config** (QSettings*) - Required - The configuration object used to determine the backend and initialize the updater. - **parent** (QObject*) - Optional - The object to be set as the parent for the created updater. Default is nullptr. ### Returns A newly created updater instance or nullptr if unable to create one. ### Attention For some update installations, an updater needs to be launched on exit of the running application. This only works if the updater lives long enough to catch the QCoreApplication::aboutToQuit signal. Use either qApp or nullptr as parent for the updater. ### See Also - Updater::supportedUpdaterBackends - Updater Backend Plugins ``` -------------------------------- ### updateGlobalProgress signal Source: https://skycoder42.github.io/QtAutoUpdater/class_qt_auto_updater_1_1_update_installer.html Signal emitted to report the global, overall progress and status of the installation. Emit this signal to give the user feedback on the current state of the installation. ```APIDOC ## updateGlobalProgress ### Description Signal emitted to report the global, overall progress and status of the installation. Emit this signal to give the user feedback on the current state of the installation. The progress can range from 0.0 to 1.0 to present an actual percentage, or be -1.0 to represent an indeterminate progress. Status can be left empty to be unchanged/unset. Emitting this signal is optional, but recommended. ### Method signal ### Parameters - **progress** (double) - Required - The progress of the full installation. Range: 0.0 to 1.0 for percentage, or -1.0 for indeterminate. - **status** (const QString&) - Optional - The current status of the installation. Can be empty to be unchanged/unset. ### See Also - UpdateInstaller::updateComponentProgress ``` -------------------------------- ### create(QString key, QVariantMap configuration, QObject *parent = nullptr) Source: https://skycoder42.github.io/QtAutoUpdater/class_qt_auto_updater_1_1_updater.html Creates an updater instance using the given backend and configuration. The backend is identified by a key, and the configuration is provided as a map of variant values. ```APIDOC ## create(QString key, QVariantMap configuration, QObject *parent = nullptr) ### Description Creates an updater instance using the given backend and configuration. ### Method static Updater * create(QString key, QVariantMap configuration, QObject *parent = nullptr) ### Parameters - **key** (QString) - Required - Backend identifier. - **configuration** (QVariantMap) - Required - Configuration map for the backend. - **parent** (QObject*) - Optional - Parent QObject for ownership. ``` -------------------------------- ### runUpdateTool(int _id_, UpdateProcessInfo _toolInfo_) Source: https://skycoder42.github.io/QtAutoUpdater/class_qt_auto_updater_1_1_process_backend.html Protected method to start the given updater tool for the specified id. Call this from checkForUpdates() to start a tool that performs the update check. ```APIDOC ## runUpdateTool(int _id_, UpdateProcessInfo _toolInfo_) ### Description Starts the given updater tool for the id. Call this method from checkForUpdates() to start a tool that performs the update check. The toolInfo struct holds all information about the process required to run it. The id is used to identify the process when it finished via onToolDone(). ### Method protected ### Parameters - **id** (int) - Required - An internal identifier for the started process - **toolInfo** (UpdateProcessInfo) - Required - The information about how to start the process ### Notes - A process started this way will only emit onToolDone() if it executed without a crash. If it does crash, checkDone(false) is emitted automatically. If it does not crash, onToolDone() is called, even if the exit code is not 0. In that case, you are responsible for emitting that signal. ### See Also - ProcessBackend::UpdateProcessInfo - ProcessBackend::cancelUpdateTool - ProcessBackend::onToolDone - UpdaterBackend::checkDone ```