diff options
author | Kai Koehne <kai.koehne@theqtcompany.com> | 2015-06-04 12:42:24 +0200 |
---|---|---|
committer | Kai Koehne <kai.koehne@theqtcompany.com> | 2015-06-04 13:02:42 +0200 |
commit | 1be5082af805e71ce2ca6ed04ff5de0f069da770 (patch) | |
tree | 55d89790592f7391c7587e1432ae462cd58e9c5a /doc | |
parent | 8482b4da46505c725d93a1e0478ded99bcbde4d2 (diff) | |
parent | 09b8632d301ffa865bf717c5497b6b7a17e86b53 (diff) |
Merge remote-tracking branch 'origin/2.0'
Conflicts:
src/libs/installer/packagemanagercore.cpp
Change-Id: Ie3d94fe3a633e189c260bf20682c00a2bb901bc8
Diffstat (limited to 'doc')
-rw-r--r-- | doc/images/ifw-settings-network.png | bin | 34324 -> 8607 bytes | |||
-rw-r--r-- | doc/images/ifw-settings-repositories.png | bin | 35322 -> 11796 bytes | |||
-rw-r--r-- | doc/installerfw-getting-started.qdoc | 7 | ||||
-rw-r--r-- | doc/installerfw.qdoc | 51 | ||||
-rw-r--r-- | doc/noninteractive.qdoc | 8 | ||||
-rw-r--r-- | doc/operations.qdoc | 10 | ||||
-rw-r--r-- | doc/scripting-api/buttons.qdoc | 2 | ||||
-rw-r--r-- | doc/scripting-api/component.qdoc | 79 | ||||
-rw-r--r-- | doc/scripting-api/packagemanagercore.qdoc | 737 | ||||
-rw-r--r-- | doc/scripting.qdoc | 4 |
10 files changed, 853 insertions, 45 deletions
diff --git a/doc/images/ifw-settings-network.png b/doc/images/ifw-settings-network.png Binary files differindex e1d300f92..25e1c9266 100644 --- a/doc/images/ifw-settings-network.png +++ b/doc/images/ifw-settings-network.png diff --git a/doc/images/ifw-settings-repositories.png b/doc/images/ifw-settings-repositories.png Binary files differindex 0c9a265d9..df533fd98 100644 --- a/doc/images/ifw-settings-repositories.png +++ b/doc/images/ifw-settings-repositories.png diff --git a/doc/installerfw-getting-started.qdoc b/doc/installerfw-getting-started.qdoc index 044fd2ed3..8934e6350 100644 --- a/doc/installerfw-getting-started.qdoc +++ b/doc/installerfw-getting-started.qdoc @@ -71,11 +71,12 @@ \section3 Configuring Qt for Windows - Before running configure you should tweak Qt to statically link in the C + Usually, you want to tweak Qt to statically link in the C runtime library. This can be done by changing the default mkspec of - your compiler. + your compiler (Qt 5.4) or by passing \c{-static-runtime} to configure (Qt 5.5 + and newer). - If you are using e.g. the Microsoft Visual Studio 2013 compiler, you edit + For Qt 5.4, you need to edit \c{mkspecs\win32-msvc2013\qmake.conf} and replace in the CFLAGS sections '-MD' with '-MT': diff --git a/doc/installerfw.qdoc b/doc/installerfw.qdoc index 0ca6e5b5e..31a180caa 100644 --- a/doc/installerfw.qdoc +++ b/doc/installerfw.qdoc @@ -716,6 +716,8 @@ \li \l archivegen + \li \l devtool + \endlist \section1 installerbase @@ -737,7 +739,7 @@ ###TODO insert link here. For information about how to implement data integration into the - installer binary, see \c QInstaller::BinaryContent ###TODO insert link here. + installer binary, see QInstaller::BinaryContent. \note If you change this configuration, you must recompile the \c installerbase tool. @@ -936,6 +938,53 @@ Where \e <name.7z> is the path and file name of the archive to create and \e <data> contains the paths and names of the files or directories to package into the archive, separated by spaces. + + \section1 devtool + + You can use \c devtool to update an existing installer or maintenance tool + with a new installer base, to dump binary content from an installer or + maintenance tool to a target, and to execute operations. For a summary of + available operations, see \l {Operations}. + + \c devtool expects the following parameters in the following order: + + \code + devtool [options] binary + \endcode + + Where \e binary is the path and name of an existing installer or maintenance + tool. + + \section2 Summary of devtool Parameters + + \table + \header + \li Parameter + \li Use + \row + \li -?, -h, --help + \li Display help. + \row + \li -v, --version + \li Display version information. + \row + \li --verbose + \li Display additional information. + \row + \li --update <file> + \li Update an existing installer or maintenance tool with a new + installer base. + \row + \li --dump <folder> + \li Dump the binary content that belongs to an installer or + maintenance tool into the target. + \row + \li --operation <mode,name,args,...> + \li Execute an operation with a list of arguments. + + \c mode can be \c DO or \c UNDO, depending on whether the step + contains instructions for the installer or uninstaller. + \endtable */ /*! diff --git a/doc/noninteractive.qdoc b/doc/noninteractive.qdoc index deba297c6..5485d2cbd 100644 --- a/doc/noninteractive.qdoc +++ b/doc/noninteractive.qdoc @@ -34,7 +34,11 @@ \title Controller Scripting For each installer, you can specify a control script that interacts with certain parts of - the installer's UI or functionality. The script format has to be compatible with QJSEngine. + the installer's UI or functionality. The control script can add and remove pages to the + wizard, change existing pages, do additional checks, and interact with the UI by + simulating user clicks. This allows for example unattended installations. + + The script format has to be compatible with QJSEngine. This section describes the functions that are called to implement such a control script. It also gives an overview of installer pages and the widgets that are available on each @@ -63,7 +67,7 @@ { var widget = gui.currentPageWidget(); // get the current wizard page if (widget != null) { - widget.setColoredTitle("New title."); // set the page title + widget.title = "New title."; // set the page title widget.MessageLabel.setText("New Message."); // set the welcome text } } diff --git a/doc/operations.qdoc b/doc/operations.qdoc index f2b8c5531..ab760bb28 100644 --- a/doc/operations.qdoc +++ b/doc/operations.qdoc @@ -114,10 +114,8 @@ In addition, a special argument, UNDOEXECUTE, separates the DO step of the operation from the UNDO step. - example: - \code - component.addOperation("Execute", "touch", "test.txt", "UNDOEXECUTE", "rm", "test.txt") - \endcode + Example: + \c{component.addOperation("Execute", "touch", "test.txt", "UNDOEXECUTE", "rm", "test.txt")} \row \li CreateShortcut \li "CreateShortcut" \c filename \c linkname [\c arguments] @@ -127,7 +125,7 @@ \c arguments. On Unix, this creates a symbolic link. \row \li CreateDesktopEntry - \li "CreateDesktopEntry" \c filename \c "key=value[\nkey2=value2[\nkey3=value3]]]" + \li "CreateDesktopEntry" \c {filename "key=value[ key2=value2[ key3=value3]]]"} \li Creates a .desktop initialization file, as specified by freedesktop.org. @@ -173,7 +171,7 @@ registry) or by \c application and \c company name. Set \c scope to "SystemScope" to create an entry in the system scope. - \note: The operation is using QSettings to store the key value pair. QSettings + \note The operation is using QSettings to store the key value pair. QSettings always treats backslash as a special character and provides no API for reading or writing such entries. Do not use slashes ('/' and '\') in section or key names; the backslash character is used to separate sub keys. On windows, '\' are converted diff --git a/doc/scripting-api/buttons.qdoc b/doc/scripting-api/buttons.qdoc index 5fb130f1e..ab05d7159 100644 --- a/doc/scripting-api/buttons.qdoc +++ b/doc/scripting-api/buttons.qdoc @@ -59,4 +59,6 @@ A custom button. \value buttons.CustomButton3 A custom button. + + \sa {Controller Scripting} */ diff --git a/doc/scripting-api/component.qdoc b/doc/scripting-api/component.qdoc index 110831cd3..8e38c7e92 100644 --- a/doc/scripting-api/component.qdoc +++ b/doc/scripting-api/component.qdoc @@ -157,15 +157,10 @@ */ /*! - \qmlsignal component::selectedChanged(boolean isSelected) - - Emitted when the component selection has changed to \a isSelected. -*/ - -/*! \qmlsignal component::valueChanged(string key, string value) - Emitted when the variable with name \a key has changed to \a value. + Emitted when the value of the variable with the name \a key changes to + \a value. \sa setValue */ @@ -180,8 +175,9 @@ \qmlmethod string component::value(string key, string value = "") Returns the value of variable name \a key. If \a key is not known yet, \a defaultValue is returned. - Note: If a component is virtual and you ask for the component value with key "Default", it will always - return \c false. + + \note If a component is virtual and you ask for the component value with the + key "Default", it will always return \c false. */ /*! @@ -199,7 +195,8 @@ /*! \qmlmethod QWidget component::userInterface(string name) - Returns the QWidget created for \a name or 0 if the widget already has been deleted or cannot be found. + Returns the QWidget created for \a name or \c 0 if the widget has been + deleted or cannot be found. */ /*! @@ -207,11 +204,12 @@ Creates all operations needed to install this component's \a path. \a path is a full qualified filename including the component's name. This method gets called from - component::createOperationsForArchive. You can override it by providing a method with + createOperationsForArchive. You can override it by providing a method with the same name in the component script. \note RSA signature files are omitted by this method. - \note If you call this method from a script, it won't call the scripts method with the same name. + \note If you call this method from a script, it will not call the script's + method with the same name. The default implementation is recursively creating Copy and Mkdir operations for all files and folders within \a path. @@ -221,10 +219,11 @@ \qmlmethod void component::createOperationsForArchive(string archive) Creates all operations needed to install this component's \a archive. This method gets called - from component::createOperations. You can override this method by providing a method with the + from createOperations. You can override this method by providing a method with the same name in the component script. - \note If you call this method from a script, it won't call the scripts method with the same name. + \note If you call this method from a script, it will not call the script's + method with the same name. The default implementation calls createOperationsForPath for everything contained in the archive. If \a archive is a compressed archive known to the installer system, an Extract operation is @@ -251,11 +250,20 @@ \qmlmethod void component::createOperations() Creates all operations needed to install this component. - You can override this method by providing a method with the same name in the component script. + You can override this method by providing a method with the same name in the component script: - \note If you call this method from a script, it won't call the scripts method with the same name. + \code + Component.prototype.createOperations = function() + { + // call default implementation + component.createOperations(); + // ... add custom operations + } + \endcode The default implementation calls createOperationsForArchive for all archives in this component. + + \sa component::addOperation() */ /*! @@ -288,8 +296,8 @@ /*! \qmlmethod void component::addStopProcessForUpdateRequest(string process) - Adds a request for quitting the process \a process before installing/updating/uninstalling the - component. + Adds a request for quitting the process \a process before installing, + updating, or uninstalling the component. */ /*! @@ -301,13 +309,9 @@ /*! \qmlmethod void component::setStopProcessForUpdateRequest(string process, boolean requested) - Convenience: Add/remove request depending on \a requested (add if \c true, remove if \c false). -*/ - -/*! - \qmlmethod boolean component::addOperation(string operation, string parameter1 = "", string parameter2 = "", ..., string parameter10 = "") - - Convenience method for calling addOperation(string, stringlist) with up to 10 arguments. + A convenience method for adding or removing the request for stopping + \a process depending on whether \a requested is \c true (add) or \c false + (remove). */ /*! @@ -316,6 +320,14 @@ Creates and adds an installation operation for \a operation. Add any number of parameters. The contents of the parameters get variables like "@TargetDir@" replaced with their values, if contained. + + The method is typically called from within \l component::createOperations(). +*/ + +/*! + \qmlmethod boolean component::addOperation(string operation, string parameter1 = "", string parameter2 = "", ..., string parameter10 = "") + + Convenience method for calling addOperation(string, stringlist) with up to 10 arguments. */ /*! @@ -355,7 +367,7 @@ /*! \qmlmethod boolean component::isAutoDependOn(QSet<string> componentsToInstall) - Determines if the component comes as an auto dependency. Returns \c true if the component needs + Determines whether the component comes as an auto dependency. Returns \c true if the component needs to be installed. */ @@ -372,31 +384,32 @@ /*! \qmlmethod boolean component::isInstalled() - Determines if the component is installed. + Determines whether the component is installed. */ /*! \qmlmethod boolean component::installationRequested() - Determines if the user wants to install the component + Determines whether the user wants to install the component. */ /*! \qmlmethod void component::setUpdateAvailable(boolean isUpdateAvailable) - Sets a flag that the core found an update + Sets a flag that the core found an update. */ /*! \qmlmethod boolean component::updateRequested() - Determines if the user wants to install the update for this component + Determines whether the user wants to install the update for this component. */ /*! \qmlmethod boolean component::componentChangeRequested() - Returns \c true if that component will be changed (update/installation/uninstallation). + Returns \c true if this component will be changed (update, installation, or + uninstallation). */ /*! @@ -408,13 +421,13 @@ /*! \qmlmethod boolean component::isUninstalled() - Determines if the component is uninstalled. + Determines whether the component is uninstalled. */ /*! \qmlmethod boolean component::uninstallationRequested() - Determines if the user wants to uninstall the component. + Determines whether the user wants to uninstall the component. */ /*! diff --git a/doc/scripting-api/packagemanagercore.qdoc b/doc/scripting-api/packagemanagercore.qdoc new file mode 100644 index 000000000..c65ddce58 --- /dev/null +++ b/doc/scripting-api/packagemanagercore.qdoc @@ -0,0 +1,737 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Installer Framework. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \qmltype installer + \inqmlmodule scripting + + \brief Provides access to core functionality of the Qt Installer Framework. +*/ + +/*! + \qmlmethod array installer::components() + + Returns an array of all available components. + + \sa component +*/ + +/*! + \qmlsignal installer::aboutCalculateComponentsToInstall() + + Emitted before the ordered list of components to install is calculated. +*/ + +/*! + \qmlsignal installer::finishedCalculateComponentsToInstall() + + Emitted after the ordered list of components to install was calculated. +*/ + +/*! + \qmlsignal installer::aboutCalculateComponentsToUninstall() + + Emitted before the ordered list of components to uninstall is calculated. +*/ + +/*! + \qmlsignal installer::finishedCalculateComponentsToUninstall() + + Emitted after the ordered list of components to uninstall was calculated. +*/ + +/*! + \qmlsignal installer::componentAdded(Component component) + + Emitted when a new root component is added. + + \sa rootComponentsAdded, updaterComponentsAdded +*/ + +/*! + \qmlsignal installer::rootComponentsAdded(list<Component> components) + + Emitted when a new list of root components is added. + + \sa componentAdded, updaterComponentsAdded +*/ + +/*! + \qmlsignal installer::updaterComponentsAdded(list<Component> components) + + Emitted when a new list of updater components is added. + + \sa componentAdded, rootComponentsAdded +*/ + +/*! + \qmlsignal installer::valueChanged(string key, string value) + + Emitted when a value changes. + + \sa setValue +*/ + +/*! + \qmlsignal installer::statusChanged(Status status) + + Emitted when the installer status changes. +*/ + +/*! + \qmlsignal installer::currentPageChanged(int page) + + Emitted when the current page changes. +*/ + +/*! + \qmlsignal installer::finishButtonClicked() + + Emitted when the user clicks the \uicontrol Finish button of the installer. +*/ + +/*! + \qmlsignal installer::metaJobProgress(int progress) + + Triggered with progress updates of the communication with a remote + repository. Progress ranges from 0 to 100. +*/ + +/*! + \qmlsignal installer::metaJobInfoMessage(string message) + + Triggered with informative updates of the communication with a remote repository. +*/ + +/*! + \qmlsignal installer::startAllComponentsReset() + + Triggered when the list of components starts to get updated. + + \sa finishAllComponentsReset +*/ + +/*! + \qmlsignal installer::finishAllComponentsReset(list<Component> rootComponents) + + Triggered when the list of new root components has been updated. + + \sa startAllComponentsReset +*/ + +/*! + \qmlsignal installer::startUpdaterComponentsReset() + + Triggered when components start to get updated during a remote update. +*/ + +/*! + \qmlsignal installer::finishUpdaterComponentsReset(list<Component> componentsWithUpdates) + + Triggered when the list of available remote updates has been updated. +*/ + +/*! + \qmlsignal installer::installationStarted() + + Triggered when installation has started. + + \sa installationFinished installationInterrupted +*/ + +/*! + \qmlsignal installer::installationInterrupted() + + Triggered when installation has been interrupted (cancelled). + + \sa interrupt installationStarted installationFinished +*/ + +/*! + \qmlsignal installer::installationFinished() + + Triggered when installation has finished. + + \sa installationStarted installationInterrupted +*/ + +/*! + \qmlsignal installer::updateFinished() + + Triggered when an update has finished. +*/ + +/*! + \qmlsignal installer::uninstallationStarted() + + Triggered when uninstallation has started. + + \sa uninstallationFinished +*/ + +/*! + \qmlsignal installer::uninstallationFinished() + + Triggered when uninstallation has finished. + + \sa uninstallationStarted +*/ + +/*! + \qmlsignal installer::titleMessageChanged(string title) + + Emitted when the text of the installer status (on the PerformInstallation page) changes to + \a title. +*/ + +/*! + \qmlsignal installer::wizardPageInsertionRequested(Widget widget, WizardPage page) + + Emitted when a custom \a widget is about to be inserted into \a page by addWizardPage. +*/ + +/*! + \qmlsignal installer::wizardPageRemovalRequested(Widget widget) + + Emitted when a \a widget is removed by removeWizardPage. +*/ + +/*! + \qmlsignal installer::wizardWidgetInsertionRequested(Widget widget, WizardPage page) + + Emitted when a \a widget is inserted into \a page by addWizardPageItem. +*/ + +/*! + \qmlsignal installer::wizardWidgetRemovalRequested(Widget widget) + + Emitted when a \a widget is removed by removeWizardPageItem. +*/ + +/*! + \qmlsignal installer::wizardPageVisibilityChangeRequested(bool visible, int page) + + Emitted when the visibility of the page with id \a page changes to \a visible. + + \sa setDefaultPageVisible +*/ + +/*! + \qmlsignal installer::setValidatorForCustomPageRequested(Component component, string name, + string callbackName) + + Triggered when setValidatorForCustomPage is called. +*/ + +/*! + \qmlsignal installer::setAutomatedPageSwitchEnabled(bool request) + + Triggered when the automatic switching from PerformInstallation to InstallationFinished page + is enabled (\a request = \c true) or disabled (\a request = \c false). + + The automatic switching is disabled automatically when for example the user expands or unexpands + the \gui Details section of the PerformInstallation page. +*/ + +/*! + \qmlsignal installer::coreNetworkSettingsChanged() + + Emitted when the network settings are changed. +*/ + +/*! + \qmlmethod void installer::setCompleteUninstallation(bool complete) + + Sets the uninstallation to be \a complete. If \a complete is false, only components deselected + by the user will be uninstalled. This option applies only on uninstallation. +*/ + +/*! + \qmlmethod void installer::cancelMetaInfoJob() + + Cancels the retrieval of meta information from a remote repository. +*/ + +/*! + \qmlmethod void installer::componentsToInstallNeedsRecalculation() + + Ensures that component dependencies are re-calculated. +*/ + +/*! + \qmlmethod void installer::autoAcceptMessageBoxes() + + Automatically accept all user message boxes. + + \sa autoRejectMessageBoxes, setMessageBoxAutomaticAnswer +*/ + +/*! + \qmlmethod void installer::autoRejectMessageBoxes() + + Automatically reject all user message boxes. + + \sa autoAcceptMessageBoxes, setMessageBoxAutomaticAnswer +*/ + +/*! + \qmlmethod void installer::setMessageBoxAutomaticAnswer(string identifier, int button) + + Automatically close the message box with ID \a identifier as if the user had pressed \a button. + + This can be used for unattended (automatic) installations. + + \sa QMessageBox, autoAcceptMessageBoxes, autoRejectMessageBoxes +*/ + +/*! + \qmlmethod float installer::requiredDiskSpace() + + Returns the additional estimated amount of disk space in bytes required after installation. + + \sa requiredTemporaryDiskSpace +*/ + +/*! + \qmlmethod float installer::requiredTemporaryDiskSpace() + + Returns the estimated required disk space during installation in bytes. + + \sa requiredDiskSpace +*/ + +/*! + \qmlmethod boolean installer::isFileExtensionRegistered(string extension) + + Returns whether a file extension is already registered in the Windows registry. Returns \c false + on all other platforms. +*/ + +/*! + \qmlmethod boolean installer::fileExists(string filePath) + + Returns \c true if the \a filePath exists; otherwise returns \c false. + + \note If the file is a symlink that points to a non existing + file, \c false is returned. +*/ + +/*! + \qmlmethod boolean installer::addWizardPage(Component component, string name, int page) + + Adds the widget with objectName() \a name registered by \a component as a new page + into the installer's GUI wizard. The widget is added before \a page. + + See \l{Controller Scripting} for the possible values of \a page. + + Returns \c true if the operation succeeded. + + \sa removeWizardPage, setDefaultPageVisible +*/ + +/*! + \qmlmethod boolean installer::removeWizardPage(Component component, string name) + + Removes the widget with objectName() \a name previously added to the installer's wizard + by \a component. + + Returns \c true if the operation succeeded. + + \sa addWizardPage, setDefaultPageVisible, wizardPageRemovalRequested +*/ + +/*! + \qmlmethod boolean installer::setDefaultPageVisible(int page, boolean visible) + + Sets the visibility of the default page with the ID \a page to \a visible. That is, + removes it from or adds it to the wizard. This works only for pages that were + in the installer when it was started. + + Returns \c true. + + \sa addWizardPage, removeWizardPage +*/ + +/*! + \qmlmethod void installer::setValidatorForCustomPage(Component component, string name, + string callbackName) + + \sa setValidatorForCustomPageRequested +*/ + +/*! + \qmlmethod boolean installer::addWizardPageItem(Component component, string name, int page) + + Adds the widget with objectName() \a name registered by \a component as a GUI element + into the installer's GUI wizard. The widget is added on \a page. + + See \l{Controller Scripting} for the possible values of \a page. + + \sa removeWizardPageItem, wizardWidgetInsertionRequested +*/ + +/*! + \qmlmethod boolean installer::removeWizardPageItem(Component component, string name) + + Removes the widget with objectName() \a name previously added to the installer's wizard + by \a component. + + \sa addWizardPageItem +*/ + +/*! + \qmlmethod void installer::addUserRepositories(stringlist repositories) + + Registers additional \a repositories. + + \sa setTemporaryRepositories +*/ + +/*! + \qmlmethod void installer::setTemporaryRepositories(stringlist repositories, boolean replace) + + Sets additional \a repositories for this instance of the installer or updater. + Will be removed after invoking it again. + + \sa addUserRepositories +*/ + +/*! + \qmlmethod boolean installer::calculateComponentsToInstall() + + Calculates an ordered list of components to install based on the current run mode. Also auto + installed dependencies are resolved. The aboutCalculateComponentsToInstall() signal is emitted + before the calculation starts, the finishedCalculateComponentsToInstall() signal once all + calculations are done. +*/ + +/*! + \qmlmethod boolean installer::calculateComponentsToUninstall() + + Calculates a list of components to uninstall based on the current run mode. Auto installed + dependencies are not yet resolved. The aboutCalculateComponentsToUninstall() signal is emitted + before the calculation starts, the finishedCalculateComponentsToUninstall() signal once all + calculations are done. Always returns \c true. +*/ + +/*! + \qmlmethod boolean installer::gainAdminRights() + + Tries to gain admin rights. On success, it returns \c true. + + \sa dropAdminRights +*/ + +/*! + \qmlmethod void installer::dropAdminRights() + + Drops admin rights gained by gainAdminRights. + + \sa gainAdminRights +*/ + +/*! + \qmlmethod boolean installer::isProcessRunning(string name) + + Returns \c true if a process with \a name is running. On Windows, the comparison + is case-insensitive. +*/ + +/*! + \qmlmethod boolean installer::killProcess(string absoluteFilePath) + + Returns \c true if a process with \a absoluteFilePath could be killed or is + not running. + + \note This is implemented in a semi blocking way (to keep the main thread to paint the UI). +*/ + +/*! + \qmlmethod void installer::setDependsOnLocalInstallerBinary() + + Makes sure the installer runs from a local drive. Otherwise the user will get an + appropriate error message. + + \note This only works on Windows. + + \sa localInstallerBinaryUsed +*/ + +/*! + \qmlmethod boolean installer::localInstallerBinaryUsed() + + Returns \c false if the installer is run on Windows, and the installer has been started from + a remote file system drive. Otherwise returns \c true. + + \sa setDependsOnLocalInstallerBinary +*/ + +/*! + \qmlmethod array installer::execute(string program, stringlist arguments = undefined, + string stdin = "") + + Starts the program \a program with the arguments \a arguments in a + new process and waits for it to finish. + + \a stdin is sent as standard input to the application. + + Returns an empty array if the program could not be executed, otherwise + the output of command as the first item, and the return code as the second. + + \note On Unix, the output is just the output to stdout, not to stderr. + + \sa executeDetached +*/ + +/*! + \qmlmethod boolean installer::executeDetached(string program, stringlist arguments = undefined, + string workingDirectory = "") + + Starts the program \a program with the arguments \a arguments in a + new process, and detaches from it. Returns \c true on success; + otherwise returns \c false. If the installer exits, the + detached process will continue to live. + + \note Arguments that contain spaces are not passed to the + process as separate arguments. + + \b{Unix:} The started process will run in its own session and act + like a daemon. + + \b{Windows:} Arguments that contain spaces are wrapped in quotes. + The started process will run as a regular standalone process. + + The process will be started in the directory \a workingDirectory. +*/ + +/*! + \qmlmethod string installer::environmentVariable(string name) + + Returns the content of the environment variable \a name. An empty string is returned if the + environment variable is not set. +*/ + +/*! + \qmlmethod boolean installer::performOperation(string name, stringlist arguments) + + Instantly performs the operation \a name with \a arguments. +*/ + +/*! + \qmlmethod boolean installer::versionMatches(string version, string requirement) + + Returns \c true when \a version matches the \a requirement. + \a requirement can be a fixed version number or it can be prefixed by the comparators '>', '>=', + '<', '<=' and '='. +*/ + +/*! + \qmlmethod string installer::findLibrary(string name, stringlist paths = []) + + Finds a library named \a name in \a paths. + If \a paths is empty, it gets filled with platform dependent default paths. + The resulting path is returned. + + This method can be used by scripts to check external dependencies. + + \sa findPath +*/ + +/*! + \qmlmethod string installer::findPath(string name, stringlist paths = []) + + Tries to find a file name \a name in one of \a paths. + The resulting path is returned. + + This method can be used by scripts to check external dependencies. + + \sa findLibrary +*/ + +/*! + \qmlmethod void installer::setInstallerBaseBinary(string path) + + Sets the \c installerbase binary to use when writing the maintenance tool. + Set the path if an update to the binary is available. + + If not set, the executable segment of the running installer or uninstaller + will be used. +*/ + +/*! + \qmlmethod string installer::value(string key, string defaultValue = "") + + Returns the installer value for \a key. If \a key is not known to the system, \a defaultValue is + returned. Additionally, on Windows, \a key can be a registry key. + + \sa setValue, containsValue, valueChanged +*/ + +/*! + \qmlmethod stringlist installer::values(string key, stringlist defaultValue = []) + + Returns the installer value for \a key. If \a key is not known to the system, \a defaultValue is + returned. Additionally, on Windows, \a key can be a registry key. + + \sa value +*/ + +/*! + \qmlmethod void installer::setValue(string key, string value) + + Sets the installer value for \a key to \a value. + + \sa value, containsValue, valueChanged +*/ + +/*! + \qmlmethod boolean installer::containsValue(string key) + + Returns \c true if the installer contains a value for \a key. + + \sa value, setValue, valueChanged +*/ + +/*! + \qmlmethod void installer::setSharedFlag(string key, boolean value) + + Sets a shared flag with name \a key to \a value. This is one option + to share information between scripts. + + Deprecated since 2.0.0. Use setValue instead. +*/ + +/*! + \qmlmethod boolean installer::sharedFlag(string key) + + Returns shared flag with name \a key. This is one option + to share information between scripts. + + Deprecated since 2.0.0. Use \l value or \l values instead. +*/ + +/*! + \qmlmethod void installer::interrupt() + + Cancels an ongoing installation. + + \sa installationInterrupted +*/ + +/*! + \qmlmethod void installer::setCanceled() + + Cancels the installation. +*/ + +/*! + \qmlmethod boolean installer::isInstaller() + + Returns \c true if the application, binary, or executable is executed in + installer mode. + + \sa isUninstaller, isUpdater, isPackageManager +*/ + +/*! + \qmlmethod boolean installer::isOfflineOnly() + + Returns \c true if this is an offline-only installer. +*/ + +/*! + \qmlmethod void installer::setUninstaller() + + Forces an uninstaller context. + + \sa isUninstaller, setUpdater, setPackageManager +*/ + +/*! + \qmlmethod boolean installer::isUninstaller() + + Returns \c true if the the application, binary, or executable is executed in + uninstaller mode. + + \sa setUninstaller, isInstaller, isUpdater, isPackageManager +*/ + +/*! + \qmlmethod void installer::setUpdater() + + Forces an updater context. + + \sa isUpdater, setUninstaller, setPackageManager +*/ + +/*! + \qmlmethod boolean installer::isUpdater() + + Returns \c true if the the application, binary, or executable is executed in + updater mode. + + \sa setUpdater, isInstaller, isUninstaller, isPackageManager +*/ + +/*! + \qmlmethod void installer::setPackageManager() + + Forces a package manager context. +*/ + +/*! + \qmlmethod boolean installer::isPackageManager() + + Returns \c true if the the application, binary, or executable is executed in + package manager mode. + + \sa setPackageManager, isInstaller, isUninstaller, isUpdater +*/ + +/*! + \qmlmethod boolean installer::runInstaller() + + Runs the installer. Returns \c true on success, \c false otherwise. +*/ + +/*! + \qmlmethod boolean installer::runUninstaller() + + Runs the uninstaller. Returns \c true on success, \c false otherwise. +*/ + +/*! + \qmlmethod boolean installer::runPackageUpdater() + + Runs the package updater. Returns \c true on success, \c false otherwise. +*/ + +/*! + \qmlmethod void installer::languageChanged() + + Calls languangeChanged on all components. +*/ diff --git a/doc/scripting.qdoc b/doc/scripting.qdoc index 9199d40e0..f4fc344e5 100644 --- a/doc/scripting.qdoc +++ b/doc/scripting.qdoc @@ -121,6 +121,10 @@ component::addOperation(). If you need to run an operation that requires administrative rights, use component::addElevatedOperation() instead. + Operations need to be added before the actual installation step. Override + \l component::createOperations() to register custom operations for a + component. + Each operation has a unique key used for identification and can take up to five parameters. In the parameter values, you can use variables as set in installer::setValue(). For more information, see \l{Predefined Variables}. |