summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@theqtcompany.com>2015-06-04 12:42:24 +0200
committerKai Koehne <kai.koehne@theqtcompany.com>2015-06-04 13:02:42 +0200
commit1be5082af805e71ce2ca6ed04ff5de0f069da770 (patch)
tree55d89790592f7391c7587e1432ae462cd58e9c5a
parent8482b4da46505c725d93a1e0478ded99bcbde4d2 (diff)
parent09b8632d301ffa865bf717c5497b6b7a17e86b53 (diff)
Merge remote-tracking branch 'origin/2.0'
Conflicts: src/libs/installer/packagemanagercore.cpp Change-Id: Ie3d94fe3a633e189c260bf20682c00a2bb901bc8
-rw-r--r--Changelog5
-rw-r--r--INSTALL11
-rw-r--r--LICENSE.LGPLv34
-rw-r--r--dist/packages/org.qtproject.ifw/meta/LICENSE.LGPLv34
-rw-r--r--doc/images/ifw-settings-network.pngbin34324 -> 8607 bytes
-rw-r--r--doc/images/ifw-settings-repositories.pngbin35322 -> 11796 bytes
-rw-r--r--doc/installerfw-getting-started.qdoc7
-rw-r--r--doc/installerfw.qdoc51
-rw-r--r--doc/noninteractive.qdoc8
-rw-r--r--doc/operations.qdoc10
-rw-r--r--doc/scripting-api/buttons.qdoc2
-rw-r--r--doc/scripting-api/component.qdoc79
-rw-r--r--doc/scripting-api/packagemanagercore.qdoc737
-rw-r--r--doc/scripting.qdoc4
-rw-r--r--examples/doc/dynamicpage.qdoc4
-rw-r--r--examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage/meta/installscript.js7
-rw-r--r--src/libs/installer/component.cpp96
-rw-r--r--src/libs/installer/component.h1
-rw-r--r--src/libs/installer/init.cpp3
-rw-r--r--src/libs/installer/lib7z_facade.cpp13
-rw-r--r--src/libs/installer/packagemanagercore.cpp814
-rw-r--r--src/libs/installer/packagemanagercore_p.cpp9
-rw-r--r--src/libs/installer/packagemanagergui.cpp37
-rw-r--r--src/libs/installer/protocol.cpp2
-rw-r--r--src/libs/installer/remoteobject.cpp1
-rw-r--r--src/libs/installer/remoteobject.h1
-rw-r--r--src/libs/installer/remoteserverconnection.cpp2
-rw-r--r--src/libs/installer/scriptengine.cpp4
-rw-r--r--src/sdk/commandlineparser.cpp2
-rw-r--r--src/sdk/main.cpp13
-rw-r--r--tests/auto/installer/packagemanagercore/tst_packagemanagercore.cpp6
31 files changed, 1503 insertions, 434 deletions
diff --git a/Changelog b/Changelog
index e3c0c087f..51eb2d129 100644
--- a/Changelog
+++ b/Changelog
@@ -5,7 +5,12 @@
- Fix --checkupdates mode.
- Prevent disabled component to be selected using the Select All button. (QTIFW-635)
- Windows: Fix crashes in elevated installation. (QTIFW-6656, QTIFW-659)
+- OS X: Fix problems with writing settings in elevated installation (QTIFW-709)
- Fix crash on exit for Windows XP, Vista. (QTIFW-652)
+- Re-add handling of zero compression level files supported by 7z.
+- Improve Proxy Credentials dialog.
+- Make component checker warning optional (set QT_LOGGING_RULES=ifw.componentChecker=true to enable).
+- Make code ready to be compiled with Qt 5.5.
- Documentation updates.
2.0.0
diff --git a/INSTALL b/INSTALL
index 66ff4682f..bef28a32c 100644
--- a/INSTALL
+++ b/INSTALL
@@ -26,13 +26,13 @@ See the Qt documentation for the prerequisites and steps to build Qt from source
### Windows
-Adjust the qmake.conf to have a real stand alone working installer:
-Replace -MD, -MDd with -MT, -MTD in the CFLAGS lines
+For Qt 5.4, you need to adjust the respective qmake.conf to have a real stand alone
+working installer. Replace -MD, -MDd with -MT, -MTD in the CFLAGS lines.
'git diff' should show you something like:
---- a/mkspecs/win32-msvc20XX/qmake.conf
-+++ b/mkspecs/win32-msvc20XX/qmake.conf
+--- a/mkspecs/win32-msvc2013/qmake.conf
++++ b/mkspecs/win32-msvc2013/qmake.conf
QMAKE_CFLAGS = -nologo -Zm200 -Zc:wchar_t -FS
QMAKE_CFLAGS_WARN_ON = -W3
QMAKE_CFLAGS_WARN_OFF = -W0
@@ -46,6 +46,9 @@ Replace -MD, -MDd with -MT, -MTD in the CFLAGS lines
QMAKE_CFLAGS_LTCG = -GL
QMAKE_CFLAGS_MP = -MP
+From Qt 5.5 onwards, you can achieve the same by passing -static-runtime to
+configure.
+
Recommended configuration options for Microsoft Windows:
configure -prefix %CD%\qtbase -release -static -target xp -accessibility -no-opengl -no-icu -no-sql-sqlite -no-qml-debug -nomake examples -nomake tests -skip qtactiveqt -skip qtenginio -skip qtlocation -skip qtmultimedia -skip qtserialport -skip qtquick1 -skip qtquickcontrols -skip qtscript -skip qtsensors -skip qtwebkit -skip qtwebsockets -skip qtxmlpatterns
diff --git a/LICENSE.LGPLv3 b/LICENSE.LGPLv3
index 8fbb74390..488f27d53 100644
--- a/LICENSE.LGPLv3
+++ b/LICENSE.LGPLv3
@@ -1,9 +1,9 @@
GNU LESSER GENERAL PUBLIC LICENSE
- The Qt Toolkit is Copyright (C) 2015 The Qt Company Ltd.
+ The Qt Installer Famework is Copyright (C) 2015 The Qt Company Ltd.
Contact: http://www.qt.io/licensing/
- You may use, distribute and copy the Qt GUI Toolkit under the terms of
+ You may use, distribute and copy the Qt Installer Famework under the terms of
GNU Lesser General Public License version 3, which is displayed below.
-------------------------------------------------------------------------
diff --git a/dist/packages/org.qtproject.ifw/meta/LICENSE.LGPLv3 b/dist/packages/org.qtproject.ifw/meta/LICENSE.LGPLv3
index 8fbb74390..488f27d53 100644
--- a/dist/packages/org.qtproject.ifw/meta/LICENSE.LGPLv3
+++ b/dist/packages/org.qtproject.ifw/meta/LICENSE.LGPLv3
@@ -1,9 +1,9 @@
GNU LESSER GENERAL PUBLIC LICENSE
- The Qt Toolkit is Copyright (C) 2015 The Qt Company Ltd.
+ The Qt Installer Famework is Copyright (C) 2015 The Qt Company Ltd.
Contact: http://www.qt.io/licensing/
- You may use, distribute and copy the Qt GUI Toolkit under the terms of
+ You may use, distribute and copy the Qt Installer Famework under the terms of
GNU Lesser General Public License version 3, which is displayed below.
-------------------------------------------------------------------------
diff --git a/doc/images/ifw-settings-network.png b/doc/images/ifw-settings-network.png
index e1d300f92..25e1c9266 100644
--- a/doc/images/ifw-settings-network.png
+++ b/doc/images/ifw-settings-network.png
Binary files differ
diff --git a/doc/images/ifw-settings-repositories.png b/doc/images/ifw-settings-repositories.png
index 0c9a265d9..df533fd98 100644
--- a/doc/images/ifw-settings-repositories.png
+++ b/doc/images/ifw-settings-repositories.png
Binary files differ
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}.
diff --git a/examples/doc/dynamicpage.qdoc b/examples/doc/dynamicpage.qdoc
index 1549b49f6..c066b36d2 100644
--- a/examples/doc/dynamicpage.qdoc
+++ b/examples/doc/dynamicpage.qdoc
@@ -91,6 +91,10 @@
\printuntil }
\dots
+ \l installer::addWizardPage() registers a new page to the installer. \l gui::pageWidgetByObjectName()
+ is then used to retrieve the root widget of the new page, with its name being \c "Dynamic" + the object
+ name of the root widget as set in the .ui file.
+
\section1 Generating the Example Installer
To create the example installer, switch to the example source directory on
diff --git a/examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage/meta/installscript.js b/examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage/meta/installscript.js
index 66fc7de18..8b7da2dd0 100644
--- a/examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage/meta/installscript.js
+++ b/examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage/meta/installscript.js
@@ -162,9 +162,10 @@ Component.prototype.readyToInstallWidgetEntered = function () {
var widget = gui.pageWidgetByObjectName("DynamicReadyToInstallWidget");
if (widget != null) {
var html = "<b>Components to install:</b><ul>";
- for (i = 0; i < installer.components.length; ++i) {
- if (installer.components[i].installationRequested())
- html = html + "<li>" + installer.components[i].displayName + "</li>"
+ var components = installer.components();
+ for (i = 0; i < components.length; ++i) {
+ if (components[i].installationRequested())
+ html = html + "<li>" + components[i].displayName + "</li>"
}
html = html + "</ul>";
widget.showDetailsBrowser.html = html;
diff --git a/src/libs/installer/component.cpp b/src/libs/installer/component.cpp
index 8a4ec36c2..217e41eea 100644
--- a/src/libs/installer/component.cpp
+++ b/src/libs/installer/component.cpp
@@ -133,7 +133,7 @@ static const QLatin1String scForcedInstallation("ForcedInstallation");
The URLs are prefixed with \c {installer://}.
- \sa addDownloadableArchive, removeDownloadableArchive
+ \sa addDownloadableArchive(), removeDownloadableArchive()
*/
/*!
@@ -185,13 +185,7 @@ static const QLatin1String scForcedInstallation("ForcedInstallation");
/*!
\fn Component::loaded()
- Emitted when the component has been loaded.
-*/
-
-/*!
- \fn Component::selectedChanged(bool selected)
-
- Emitted when the component selection changes to \a selected.
+ \sa {component::loaded}{component.loaded}
*/
/*!
@@ -199,13 +193,13 @@ static const QLatin1String scForcedInstallation("ForcedInstallation");
Emitted when the value of the variable with the name \a key changes to \a value.
- \sa setValue
+ \sa {component::valueChanged}{component.valueChanged}, setValue()
*/
/*!
\fn Component::virtualStateChanged()
- Emitted when the virtual state of the component changes.
+ \sa {component::virtualStateChanged}{component.virtualStateChanged}
*/
@@ -384,7 +378,9 @@ QString Component::value(const QString &key, const QString &defaultValue) const
}
/*!
- Sets the value of the variable \a key to \a value.
+ Sets the value of the variable with \a key to \a value.
+
+ \sa {component::setValue}{component.setValue}
*/
void Component::setValue(const QString &key, const QString &value)
{
@@ -653,6 +649,8 @@ QHash<QString, QPair<QString, QString> > Component::licenses() const
/*!
Returns the QWidget created for \a name or \c 0 if the widget has been deleted or cannot
be found.
+
+ \sa {component::userInterface}{component.userInterface}
*/
QWidget *Component::userInterface(const QString &name) const
{
@@ -662,7 +660,7 @@ QWidget *Component::userInterface(const QString &name) const
/*!
Creates all operations needed to install this component's \a path. \a path is a fully 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.
@@ -671,6 +669,8 @@ QWidget *Component::userInterface(const QString &name) const
The default implementation is recursively creating Copy and Mkdir operations for all files
and folders within \a path.
+
+ \sa {component::createOperationsForPath}{component.createOperationsForPath}
*/
void Component::createOperationsForPath(const QString &path)
{
@@ -715,6 +715,8 @@ void Component::createOperationsForPath(const QString &path)
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
created, instead.
+
+ \sa {component::createOperationsForArchive}{component.createOperationsForArchive}
*/
void Component::createOperationsForArchive(const QString &archive)
{
@@ -741,18 +743,7 @@ void Component::createOperationsForArchive(const QString &archive)
}
/*!
- Starts the component installation.
- You can override this method by providing a method with the same name in the component script.
-
- \code
- Component.prototype.beginInstallation = function()
- {
- // call default implementation
- component.beginInstallation();
- // ...
- }
- \endcode
-
+ \sa {component::beginInstallation}{component.beginInstallation}
*/
void Component::beginInstallation()
{
@@ -761,14 +752,8 @@ void Component::beginInstallation()
}
/*!
- 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.
-
- \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 createOperationsForArchive() for all archives in this
- component.
+ \sa {component::createOperations}{component.createOperations}
+ \sa createOperationsForArchive()
*/
void Component::createOperations()
{
@@ -789,6 +774,8 @@ void Component::createOperations()
Registers the file or directory at \a path for being removed when this component gets uninstalled.
In case of a directory, this will be recursive. If \a wipe is set to \c true, the directory will
also be deleted if it contains changes made by the user after installation.
+
+ \sa {component::registerPathForUninstallation}{component.registerPathForUninstallation}
*/
void Component::registerPathForUninstallation(const QString &path, bool wipe)
{
@@ -822,7 +809,8 @@ QStringList Component::archives() const
downloaded from an online repository. When adding \a path, it will be downloaded from the
repository when the installation starts.
- \sa removeDownloadableArchive, fromOnlineRepository, archives
+ \sa {component::addDownloadableArchive}{component.addDownloadableArchive}
+ \sa removeDownloadableArchive(), fromOnlineRepository, archives
*/
void Component::addDownloadableArchive(const QString &path)
{
@@ -836,7 +824,8 @@ void Component::addDownloadableArchive(const QString &path)
Removes the archive \a path previously added via addDownloadableArchive() from this component.
This can only be called if this component was downloaded from an online repository.
- \sa addDownloadableArchive, fromOnlineRepository, archives
+ \sa {component::removeDownloadableArchive}{component.removeDownloadableArchive}
+ \sa addDownloadableArchive(), fromOnlineRepository, archives
*/
void Component::removeDownloadableArchive(const QString &path)
{
@@ -855,6 +844,8 @@ QStringList Component::downloadableArchives() const
/*!
Adds a request for quitting the process \a process before installing, updating, or uninstalling
the component.
+
+ \sa {component::addStopProcessForUpdateRequest}{component.addStopProcessForUpdateRequest}
*/
void Component::addStopProcessForUpdateRequest(const QString &process)
{
@@ -863,6 +854,8 @@ void Component::addStopProcessForUpdateRequest(const QString &process)
/*!
Removes the request for quitting the process \a process again.
+
+ \sa {component::removeStopProcessForUpdateRequest}{component.removeStopProcessForUpdateRequest}
*/
void Component::removeStopProcessForUpdateRequest(const QString &process)
{
@@ -872,6 +865,8 @@ void Component::removeStopProcessForUpdateRequest(const QString &process)
/*!
A convenience function for adding or removing the request for stopping \a process depending on
whether \a requested is \c true (add) or \c false (remove).
+
+ \sa {component::setStopProcessForUpdateRequest}{component.addStopProcessForUpdateReques}
*/
void Component::setStopProcessForUpdateRequest(const QString &process, bool requested)
{
@@ -1006,6 +1001,8 @@ Operation *Component::createOperation(const QString &operationName, const QStrin
Convenience method for calling the operation \a operation with up to ten parameters:
\a parameter1, \a parameter2, \a parameter3, \a parameter4, \a parameter5, \a parameter6,
\a parameter7, \a parameter8, \a parameter9, and \a parameter10.
+
+ \sa {component::addOperation}{component.addOperation}
*/
bool Component::addOperation(const QString &operation, const QString &parameter1, const QString &parameter2,
const QString &parameter3, const QString &parameter4, const QString &parameter5, const QString &parameter6,
@@ -1039,6 +1036,8 @@ bool Component::addOperation(const QString &operation, const QStringList &parame
Convenience method for calling the elevated operation \a operation with up to ten parameters:
\a parameter1, \a parameter2, \a parameter3, \a parameter4, \a parameter5, \a parameter6,
\a parameter7, \a parameter8, \a parameter9, and \a parameter10.
+
+ \sa {component::addElevatedOperation}{component.addElevatedOperation}
*/
bool Component::addElevatedOperation(const QString &operation, const QString &parameter1,
const QString &parameter2, const QString &parameter3, const QString &parameter4, const QString &parameter5,
@@ -1074,6 +1073,8 @@ bool Component::addElevatedOperation(const QString &operation, const QStringList
Specifies whether operations should be automatically created when the installation starts. This
would be done by calling createOperations(). If you set this to \c false, it is completely up
to the component's script to create all operations.
+
+ \sa {component::autoCreateOperations}{component.autoCreateOperations}
*/
bool Component::autoCreateOperations() const
{
@@ -1131,6 +1132,7 @@ bool Component::validatePage()
/*!
Adds the component specified by \a newDependency to the list of dependencies.
+ \sa {component::addDependency}{component.addDependency}
\sa dependencies
*/
@@ -1154,8 +1156,7 @@ QStringList Component::autoDependencies() const
}
/*!
-
- Sets the component's state to installed.
+ \sa {component::setInstalled}{component.setInstalled}
*/
void Component::setInstalled()
{
@@ -1166,6 +1167,8 @@ void Component::setInstalled()
Determines whether the component comes as an auto dependency. Returns \c true if all components
in \a componentsToInstall are already installed or selected for installation and this component
thus needs to be installed as well.
+
+ \sa {component::isAutoDependOn}{component.isAutoDependOn}
*/
bool Component::isAutoDependOn(const QSet<QString> &componentsToInstall) const
{
@@ -1225,7 +1228,9 @@ bool Component::isInstalled() const
}
/*!
- Returns whether the user wants to install the component
+ Returns whether the user wants to install the component.
+
+ \sa {component::installationRequested}{component.installationRequested}
*/
bool Component::installationRequested() const
{
@@ -1242,6 +1247,8 @@ bool Component::isSelectedForInstallation() const
/*!
Sets the \a isUpdateAvailable flag to \c true to indicate that the core found an update.
+
+ \sa {component::setUpdateAvailable}{component.setUpdateAvailable}
*/
void Component::setUpdateAvailable(bool isUpdateAvailable)
{
@@ -1249,7 +1256,9 @@ void Component::setUpdateAvailable(bool isUpdateAvailable)
}
/*!
- Returns whether the user wants to install the update for this component
+ Returns whether the user wants to install the update for this component.
+
+ \sa {component::updateRequested}{component.updateRequested}
*/
bool Component::updateRequested()
{
@@ -1258,6 +1267,8 @@ bool Component::updateRequested()
/*!
Returns \c true if that component will be changed (update, installation, or uninstallation).
+
+ \sa {component::componentChangeRequested}{component.componentChangeRequested}
*/
bool Component::componentChangeRequested()
{
@@ -1266,7 +1277,7 @@ bool Component::componentChangeRequested()
/*!
- Sets the component state to uninstalled.
+ \sa {component::setUninstalled}{component.setUninstalled}
*/
void Component::setUninstalled()
{
@@ -1275,6 +1286,8 @@ void Component::setUninstalled()
/*!
Returns whether the component is uninstalled.
+
+ \sa {component::isUninstalled}{component.isUninstalled}
*/
bool Component::isUninstalled() const
{
@@ -1283,6 +1296,8 @@ bool Component::isUninstalled() const
/*!
Returns whether the user wants to uninstall the component.
+
+ \sa {component::uninstallationRequested}{component.uninstallationRequested}
*/
bool Component::uninstallationRequested() const
{
@@ -1294,7 +1309,8 @@ bool Component::uninstallationRequested() const
/*!
Returns whether this component has been loaded from an online repository.
- \sa addDownloadableArchive, fromOnlineRepository
+ \sa {component::isFromOnlineRepository}{component.isFromOnlineRepository}
+ \sa addDownloadableArchive(), fromOnlineRepository
*/
bool Component::isFromOnlineRepository() const
{
diff --git a/src/libs/installer/component.h b/src/libs/installer/component.h
index ecf786b53..fb53cc934 100644
--- a/src/libs/installer/component.h
+++ b/src/libs/installer/component.h
@@ -203,7 +203,6 @@ public Q_SLOTS:
Q_SIGNALS:
void loaded();
void virtualStateChanged();
- void selectedChanged(bool selected);
void valueChanged(const QString &key, const QString &value);
private Q_SLOTS:
diff --git a/src/libs/installer/init.cpp b/src/libs/installer/init.cpp
index 1b7734463..000b09046 100644
--- a/src/libs/installer/init.cpp
+++ b/src/libs/installer/init.cpp
@@ -89,6 +89,7 @@ void registerArc7z();
void registerCodecBCJ();
void registerCodecBCJ2();
+void registerCodecCopy();
void registerCodecLZMA();
void registerCodecLZMA2();
@@ -107,6 +108,8 @@ static void initArchives()
registerCodecBCJ();
registerCodecBCJ2();
+
+ registerCodecCopy();
registerCodecLZMA();
registerCodecLZMA2();
diff --git a/src/libs/installer/lib7z_facade.cpp b/src/libs/installer/lib7z_facade.cpp
index 9dc4a8283..b4eb36d37 100644
--- a/src/libs/installer/lib7z_facade.cpp
+++ b/src/libs/installer/lib7z_facade.cpp
@@ -1141,12 +1141,13 @@ void Lib7z::createArchive(QFileDevice *archive, const QStringList &sourcePaths,
NWildcard::CCensor censor;
foreach (const QString &path, sourcePaths) {
- const UString sourcePath = QString2UString(QDir::toNativeSeparators(path));
- if (UString2QString(sourcePath) != QDir::toNativeSeparators(path))
- throw UString2QString(sourcePath).toLatin1().data();
- // Only pass recursive with true if path is a directory, otherwise we include the file and
- // possible folders located on the same directory level as the file into the created archive.
- censor.AddItem(true, sourcePath, QFileInfo(path).isDir());
+ const QString cleanPath = QDir::toNativeSeparators(QDir::cleanPath(path));
+ const UString nativePath = QString2UString(cleanPath);
+ if (UString2QString(nativePath) != cleanPath) {
+ throw SevenZipException(QCoreApplication::translate("Lib7z", "Could not convert"
+ "path: %1.").arg(path));
+ }
+ censor.AddItem(true /* always include item */, nativePath, false /* never recurse*/);
}
callback->setSourcePaths(sourcePaths);
diff --git a/src/libs/installer/packagemanagercore.cpp b/src/libs/installer/packagemanagercore.cpp
index d84e29967..934f0d4cf 100644
--- a/src/libs/installer/packagemanagercore.cpp
+++ b/src/libs/installer/packagemanagercore.cpp
@@ -84,249 +84,313 @@
Installer Framework and the installer UI.
*/
-/*!
- \qmltype installer
- \inqmlmodule scripting
+using namespace QInstaller;
- \brief Provides access to core functionality of the Qt Installer Framework.
+/*!
+ \class QInstaller::PackageManagerCore
+ \inmodule QtInstallerFramework
+ \brief The PackageManagerCore class provides the core functionality of the Qt Installer
+ Framework.
*/
/*!
- \qmlproperty array installer::components
+ \enum PackageManagerCore::WizardPage
+
+ This enum type holds the pre-defined package manager pages:
+
+ \value Introduction
+ \l{Introduction Page}
+ \value TargetDirectory
+ \l{Target Directory Page}
+ \value ComponentSelection
+ \l{Component Selection Page}
+ \value LicenseCheck
+ \l{License Agreement Page}
+ \value StartMenuSelection
+ \l{Start Menu Directory Page}
+ \value ReadyForInstallation
+ \l{Ready for Installation Page}
+ \value PerformInstallation
+ \l{Perform Installation Page}
+ \value InstallationFinished
+ \l{Finished Page}
+
+ \omitvalue End
*/
/*!
- \qmlsignal installer::aboutCalculateComponentsToInstall()
+ \enum PackageManagerCore::Status
- Emitted before the ordered list of components to install is calculated.
+ This enum type holds the package manager status:
+
+ \value Success
+ Installation was successful.
+ \value Failure
+ Installation failed.
+ \value Running
+ Installation is in progress.
+ \value Canceled
+ Installation was canceled.
+ \value Unfinished
+ Installation was not completed.
+ \value ForceUpdate
*/
/*!
- \qmlsignal installer::finishedCalculateComponentsToInstall()
-
- Emitted after the ordered list of components to install was calculated.
+ \property PackageManagerCore::status
+ \brief Installation status.
*/
/*!
- \qmlsignal installer::aboutCalculateComponentsToUninstall()
+ \fn PackageManagerCore::aboutCalculateComponentsToInstall() const
- Emitted before the ordered list of components to uninstall is calculated.
+ \sa {installer::aboutCalculateComponentsToInstall}{installer.aboutCalculateComponentsToInstall}
*/
/*!
- \qmlsignal installer::finishedCalculateComponentsToUninstall()
+ \fn PackageManagerCore::finishedCalculateComponentsToInstall() const
- Emitted after the ordered list of components to uninstall was calculated.
+ \sa {installer::finishedCalculateComponentsToInstall}{installer.finishedCalculateComponentsToInstall}
*/
/*!
- \qmlsignal installer::componentAdded(Component component)
+ \fn PackageManagerCore::aboutCalculateComponentsToUninstall() const
+
+ \sa {installer::aboutCalculateComponentsToUninstall}{installer.aboutCalculateComponentsToUninstall}
+*/
- Emitted when a new root component has been added.
+/*!
+ \fn PackageManagerCore::finishedCalculateComponentsToUninstall() const
- \sa rootComponentsAdded, updaterComponentsAdded
+ \sa {installer::finishedCalculateComponentsToUninstall}{installer.finishedCalculateComponentsToUninstall}
*/
/*!
- \qmlsignal installer::rootComponentsAdded(list<Component> components)
+ \fn PackageManagerCore::componentAdded(QInstaller::Component *comp)
- Emitted when a new list of root components has been added.
+ Emitted when the new root component \a comp is added.
- \sa componentAdded, updaterComponentsAdded
+ \sa {installer::componentAdded}{installer.componentAdded}
+ \sa rootComponentsAdded(), updaterComponentsAdded()
*/
/*!
- \qmlsignal installer::updaterComponentsAdded(list<Component> components)
+ \fn PackageManagerCore::rootComponentsAdded(QList<QInstaller::Component*> components)
- Emitted when a new list of updater components has been added.
- \sa componentAdded, rootComponentsAdded
+ Emitted when the list of root components specified by \a components is added.
+
+ \sa {installer::rootComponentsAdded}{installer.rootComponentsAdded}
+ \sa componentAdded(), updaterComponentsAdded()
*/
/*!
- \qmlsignal installer::valueChanged(string key, string value)
+ \fn PackageManagerCore::updaterComponentsAdded(QList<QInstaller::Component*> components)
- Emitted whenever a value changes.
+ Emitted when a new list of updater components specified by \a components is added.
- \sa setValue
+ \sa {installer::updaterComponentsAdded}{installer.updaterComponentsAdded}
+ \sa componentAdded(), rootComponentsAdded()
*/
/*!
- \qmlsignal installer::statusChanged(Status status)
+ \fn PackageManagerCore::valueChanged(const QString &key, const QString &value)
+
+ Emitted when the value \a value of the key \a key changes.
- Emitted whenever the installer status changes.
+ \sa {installer::valueChanged}{installer.valueChanged}, setValue()
*/
/*!
- \qmlsignal installer::currentPageChanged(int page)
+ \fn PackageManagerCore::currentPageChanged(int page)
- Emitted whenever the current page changes.
+ Emitted when the current page \a page changes.
+
+ \sa {installer::currentPageChanged}{installer.currentPageChanged}
*/
/*!
- \qmlsignal installer::finishButtonClicked()
+ \fn PackageManagerCore::finishButtonClicked()
- Emitted when the user clicks the \uicontrol Finish button of the installer.
+ \sa {installer::finishButtonClicked}{installer.finishButtonClicked}
*/
/*!
- \qmlsignal installer::metaJobProgress(int progress)
+ \fn PackageManagerCore::metaJobProgress(int progress)
Triggered with progress updates of the communication with a remote
- repository. Progress ranges from 0 to 100.
+ repository. Values of \a progress range from 0 to 100.
+
+ \sa {installer::metaJobProgress}{installer.metaJobProgress}
*/
/*!
- \qmlsignal installer::metaJobInfoMessage(string message)
+ \fn PackageManagerCore::metaJobInfoMessage(const QString &message)
+
+ Triggered with informative updates, \a message, of the communication with a remote repository.
- Triggered with informative updates of the communication with a remote repository.
+ \sa {installer::metaJobInfoMessage}{installer.metaJobInfoMessage}
*/
/*!
- \qmlsignal installer::startAllComponentsReset()
+ \fn PackageManagerCore::startAllComponentsReset()
- Triggered when the list of components starts to get updated.
-
- \sa finishAllComponentsReset
+ \sa {installer::startAllComponentsReset}{installer.startAllComponentsReset}
+ \sa finishAllComponentsReset()
*/
/*!
- \qmlsignal installer::finishAllComponentsReset(list<Component> rootComponents)
+ \fn PackageManagerCore::finishAllComponentsReset(const QList<QInstaller::Component*> &rootComponents)
- Triggered when the list of new root components has been updated.
+ Triggered when the list of new root components, \a rootComponents, has been updated.
- \sa startAllComponentsReset
+ \sa {installer::finishAllComponentsReset}{installer.finishAllComponentsReset}
+ \sa startAllComponentsReset()
*/
/*!
- \qmlsignal installer::startUpdaterComponentsReset()
+ \fn PackageManagerCore::startUpdaterComponentsReset()
- Triggered when components start to get updated during a remote update.
+ \sa {installer::startUpdaterComponentsReset}{installer.startUpdaterComponentsReset}
*/
/*!
- \qmlsignal installer::finishUpdaterComponentsReset(list<Component> componentsWithUpdates)
+ \fn PackageManagerCore::finishUpdaterComponentsReset(const QList<QInstaller::Component*> &componentsWithUpdates)
+
+ Triggered when the list of available remote updates, \a componentsWithUpdates,
+ has been updated.
- Triggered when the list of available remote updates has been updated.
+ \sa {installer::finishUpdaterComponentsReset}{installer.finishUpdaterComponentsReset}
*/
/*!
- \qmlsignal installer::installationStarted()
-
- Triggered when installation has started.
+ \fn PackageManagerCore::installationStarted()
- \sa installationFinished installationInterrupted
+ \sa {installer::installationStarted}{installer.installationStarted}
+ \sa installationFinished() installationInterrupted()
*/
/*!
- \qmlsignal installer::installationInterrupted()
+ \fn PackageManagerCore::installationInterrupted()
- Triggered when installation has been interrupted (cancelled).
-
- \sa interrupt installationStarted installationFinished
+ \sa {installer::installationInterrupted}{installer.installationInterrupted}
+ \sa interrupt() installationStarted() installationFinished()
*/
/*!
- \qmlsignal installer::installationFinished()
-
- Triggered when installation has been finished.
+ \fn PackageManagerCore::installationFinished()
- \sa installationStarted installationInterrupted
+ \sa {installer::installationFinished}{installer.installationFinished}
+ \sa installationStarted() installationInterrupted()
*/
/*!
- \qmlsignal installer::updateFinished()
+ \fn PackageManagerCore::updateFinished()
- Triggered when an update has been finished.
+ \sa {installer::installationFinished}{installer.installationFinished}
*/
/*!
- \qmlsignal installer::uninstallationStarted()
-
- Triggered when uninstallation has started.
+ \fn PackageManagerCore::uninstallationStarted()
- \sa uninstallationFinished
+ \sa {installer::uninstallationStarted}{installer.uninstallationStarted}
+ \sa uninstallationFinished()
*/
/*!
- \qmlsignal installer::uninstallationFinished()
+ \fn PackageManagerCore::uninstallationFinished()
- Triggered when uninstallation has been finished.
-
- \sa uninstallationStarted
+ \sa {installer::uninstallationFinished}{installer.uninstallationFinished}
+ \sa uninstallationStarted()
*/
/*!
- \qmlsignal installer::titleMessageChanged(string title)
+ \fn PackageManagerCore::titleMessageChanged(const QString &title)
Emitted when the text of the installer status (on the PerformInstallation page) changes to
\a title.
+
+ \sa {installer::titleMessageChanged}{installer.titleMessageChanged}
*/
/*!
- \qmlsignal installer::wizardPageInsertionRequested(Widget widget, WizardPage page)
+ \fn PackageManagerCore::wizardPageInsertionRequested(QWidget *widget, QInstaller::PackageManagerCore::WizardPage page)
- Emitted when a custom \a widget is about to be inserted into \a page by addWizardPage.
+ Emitted when a custom \a widget is about to be inserted into \a page by
+ addWizardPage().
+
+ \sa {installer::wizardPageInsertionRequested}{installer.wizardPageInsertionRequested}
*/
/*!
- \qmlsignal installer::wizardPageRemovalRequested(Widget widget)
+ \fn PackageManagerCore::wizardPageRemovalRequested(QWidget *widget)
+
+ Emitted when a \a widget is removed by removeWizardPage().
- Emitted when a \a widget is removed by removeWizardPage.
+ \sa {installer::wizardPageRemovalRequested}{installer.wizardPageRemovalRequested}
*/
/*!
- \qmlsignal installer::wizardWidgetInsertionRequested(Widget widget, WizardPage page)
+ \fn PackageManagerCore::wizardWidgetInsertionRequested(QWidget *widget, QInstaller::PackageManagerCore::WizardPage page)
- Emitted when a \a widget is inserted into \a page by addWizardPageItem.
+ Emitted when a \a widget is inserted into \a page by addWizardPageItem().
+
+ \sa {installer::wizardWidgetInsertionRequested}{installer.wizardWidgetInsertionRequested}
*/
/*!
- \qmlsignal installer::wizardWidgetRemovalRequested(Widget widget)
+ \fn PackageManagerCore::wizardWidgetRemovalRequested(QWidget *widget)
+
+ Emitted when a \a widget is removed by removeWizardPageItem().
- Emitted when a \a widget is removed by removeWizardPageItem.
+ \sa {installer::wizardWidgetRemovalRequested}{installer.wizardWidgetRemovalRequested}
*/
/*!
- \qmlsignal installer::wizardPageVisibilityChangeRequested(bool visible, int page)
+ \fn PackageManagerCore::wizardPageVisibilityChangeRequested(bool visible, int page)
- Emitted when the visibility of the page with id \a page changes to \a visible.
+ Emitted when the visibility of the page with the ID \a page changes to \a visible.
- \sa setDefaultPageVisible
+ \sa setDefaultPageVisible()
+ \sa {installer::wizardPageVisibilityChangeRequested}{installer.wizardPageVisibilityChangeRequested}
*/
/*!
- \qmlsignal installer::setValidatorForCustomPageRequested(Component component, string name,
- string callbackName)
+ \fn PackageManagerCore::setValidatorForCustomPageRequested(QInstaller::Component *component, const QString &name,
+ const QString &callbackName)
+
+ Requests that a validator be set for the custom page specified by \a name and
+ \a callbackName for the component \a component. Triggered when
+ setValidatorForCustomPage() is called.
- Triggered when setValidatorForCustomPage is called.
+ \sa {installer::setValidatorForCustomPageRequested}{installer.setValidatorForCustomPageRequested}
*/
/*!
- \qmlsignal installer::setAutomatedPageSwitchEnabled(bool request)
+ \fn PackageManagerCore::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).
+ Triggered when the automatic switching from the perform installation to the installation
+ finished page is enabled (\a request is \c true) or disabled (\a request is \c false).
The automatic switching is disabled automatically when for example the user expands or unexpands
- the \gui Details section of the PerformInstallation page.
+ the \uicontrol Details section of the PerformInstallation page.
+
+ \sa {installer::setAutomatedPageSwitchEnabled}{installer.setAutomatedPageSwitchEnabled}
*/
/*!
- \qmlsignal installer::coreNetworkSettingsChanged()
+ \fn PackageManagerCore::coreNetworkSettingsChanged()
- Emitted when the network settings are changed.
+ \sa {installer::coreNetworkSettingsChanged}{installer.coreNetworkSettingsChanged}
*/
-
-using namespace QInstaller;
-
/*!
- \class QInstaller::PackageManagerCore
- \inmodule QtInstallerFramework
- \brief The PackageManagerCore class provides the core functionality of the Qt Installer
- Framework.
+ \fn PackageManagerCore::guiObjectChanged(QObject *gui)
+
+ Emitted when the GUI object is set to \a gui.
*/
+
+
Q_GLOBAL_STATIC(QMutex, globalModelMutex);
static QFont *sVirtualComponentsFont = 0;
Q_GLOBAL_STATIC(QMutex, globalVirtualComponentsFontMutex);
@@ -348,6 +412,9 @@ static bool componentMatches(const Component *component, const QString &name,
return PackageManagerCore::versionMatches(component->value(scVersion), version);
}
+/*!
+ Creates the maintenance tool in the installation directory.
+*/
void PackageManagerCore::writeMaintenanceTool()
{
if (d->m_needToWriteMaintenanceTool) {
@@ -373,11 +440,18 @@ void PackageManagerCore::writeMaintenanceTool()
}
}
+/*!
+ Creates the maintenance tool configuration files.
+*/
void PackageManagerCore::writeMaintenanceConfigFiles()
{
d->writeMaintenanceConfigFiles();
}
+/*!
+ Resets the class to its initial state and applies the values of the
+ parameters specified by \a params.
+*/
void PackageManagerCore::reset(const QHash<QString, QString> &params)
{
d->m_completeUninstall = false;
@@ -388,6 +462,9 @@ void PackageManagerCore::reset(const QHash<QString, QString> &params)
d->initialize(params);
}
+/*!
+ Sets the maintenance tool UI to \a gui.
+*/
void PackageManagerCore::setGuiObject(QObject *gui)
{
if (gui == d->m_guiObject)
@@ -396,16 +473,19 @@ void PackageManagerCore::setGuiObject(QObject *gui)
emit guiObjectChanged(gui);
}
+/*!
+ Returns the GUI object.
+*/
QObject *PackageManagerCore::guiObject() const
{
return d->m_guiObject;
}
/*!
- \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.
+
+ \sa {installer::setCompleteUninstallation}{installer.setCompleteUninstallation}
*/
void PackageManagerCore::setCompleteUninstallation(bool complete)
{
@@ -413,9 +493,7 @@ void PackageManagerCore::setCompleteUninstallation(bool complete)
}
/*!
- \qmlmethod void installer::cancelMetaInfoJob()
-
- Cancels the retrieval of meta information from a remote repository.
+ \sa {installer::cancelMetaInfoJob}{installer.cancelMetaInfoJob}
*/
void PackageManagerCore::cancelMetaInfoJob()
{
@@ -423,9 +501,7 @@ void PackageManagerCore::cancelMetaInfoJob()
}
/*!
- \qmlmethod void installer::componentsToInstallNeedsRecalculation()
-
- Ensures that component dependencies are re-calculated.
+ \sa {installer::componentsToInstallNeedsRecalculation}{installer.componentsToInstallNeedsRecalculation}
*/
void PackageManagerCore::componentsToInstallNeedsRecalculation()
{
@@ -463,11 +539,8 @@ void PackageManagerCore::componentsToInstallNeedsRecalculation()
}
/*!
- \qmlmethod void installer::autoAcceptMessageBoxes()
-
- Automatically accept all user message boxes.
-
- \sa autoRejectMessageBoxes, setMessageBoxAutomaticAnswer
+ \sa {installer::autoAcceptMessageBoxes}{installer.autoAcceptMessageBoxes}
+ \sa autoRejectMessageBoxes(), setMessageBoxAutomaticAnswer()
*/
void PackageManagerCore::autoAcceptMessageBoxes()
{
@@ -475,11 +548,8 @@ void PackageManagerCore::autoAcceptMessageBoxes()
}
/*!
- \qmlmethod void installer::autoRejectMessageBoxes()
-
- Automatically reject all user message boxes.
-
- \sa autoAcceptMessageBoxes, setMessageBoxAutomaticAnswer
+ \sa {installer::autoRejectMessageBoxes}{installer.autoRejectMessageBoxes}
+ \sa autoAcceptMessageBoxes(), setMessageBoxAutomaticAnswer()
*/
void PackageManagerCore::autoRejectMessageBoxes()
{
@@ -487,13 +557,13 @@ void PackageManagerCore::autoRejectMessageBoxes()
}
/*!
- \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.
+ Automatically closes the message box with the ID \a identifier as if the user had pressed
+ \a button.
This can be used for unattended (automatic) installations.
- \sa QMessageBox, autoAcceptMessageBoxes, autoRejectMessageBoxes
+ \sa {installer::setMessageBoxAutomaticAnswer}{installer.setMessageBoxAutomaticAnswer}
+ \sa QMessageBox, autoAcceptMessageBoxes(), autoRejectMessageBoxes()
*/
void PackageManagerCore::setMessageBoxAutomaticAnswer(const QString &identifier, int button)
{
@@ -501,6 +571,9 @@ void PackageManagerCore::setMessageBoxAutomaticAnswer(const QString &identifier,
static_cast<QMessageBox::Button>(button));
}
+/*!
+ Returns the size of the component \a component as \a value.
+*/
quint64 PackageManagerCore::size(QInstaller::Component *component, const QString &value) const
{
if (component->installAction() == ComponentModelHelper::Install)
@@ -509,11 +582,8 @@ quint64 PackageManagerCore::size(QInstaller::Component *component, const QString
}
/*!
- \qmlmethod float installer::requiredDiskSpace()
-
- Returns the additional estimated amount of disk space in bytes required after installation.
-
- \sa requiredTemporaryDiskSpace
+ \sa {installer::requiredDiskSpace}{installer.requiredDiskSpace}
+ \sa requiredTemporaryDiskSpace()
*/
quint64 PackageManagerCore::requiredDiskSpace() const
{
@@ -526,11 +596,8 @@ quint64 PackageManagerCore::requiredDiskSpace() const
}
/*!
- \qmlmethod float installer::requiredTemporaryDiskSpace()
-
- Returns the estimated required disk space during installation in bytes.
-
- \sa requiredDiskSpace
+ \sa {installer::requiredTemporaryDiskSpace}{installer.requiredTemporaryDiskSpace}
+ \sa requiredDiskSpace()
*/
quint64 PackageManagerCore::requiredTemporaryDiskSpace() const
{
@@ -544,7 +611,9 @@ quint64 PackageManagerCore::requiredTemporaryDiskSpace() const
}
/*!
- Returns the count of archives that will be downloaded.
+ Returns the number of archives that will be downloaded.
+
+ \a partProgressSize is reserved for the download progress.
*/
int PackageManagerCore::downloadNeededArchives(double partProgressSize)
{
@@ -596,20 +665,26 @@ int PackageManagerCore::downloadNeededArchives(double partProgressSize)
}
/*!
- Returns \c true if a component marked as essential was installed during the
- update process.
+ Returns \c true if a hard restart of the application is requested.
*/
bool PackageManagerCore::needsHardRestart() const
{
return d->m_needsHardRestart;
}
+/*!
+ Enables a component to request a hard restart of the application if
+ \a needsHardRestart is set to \c true.
+*/
void PackageManagerCore::setNeedsHardRestart(bool needsHardRestart)
{
d->m_needsHardRestart = needsHardRestart;
}
-
+/*!
+ Cancels the installation and performs the UNDO step of all already executed
+ operations.
+*/
void PackageManagerCore::rollBackInstallation()
{
emit titleMessageChanged(tr("Cancelling the Installer"));
@@ -685,10 +760,10 @@ void PackageManagerCore::rollBackInstallation()
}
/*!
- \qmlmethod boolean Installer::isFileExtensionRegistered(string extension)
+ Returns whether the file extension \a extension is already registered in the
+ Windows registry. Returns \c false on all other platforms.
- Returns whether a file extension is already registered in the Windows registry. Returns \c false
- on all other platforms.
+ \sa {installer::isFileExtensionRegistered}{installer.isFileExtensionRegistered}
*/
bool PackageManagerCore::isFileExtensionRegistered(const QString &extension) const
{
@@ -697,12 +772,13 @@ bool PackageManagerCore::isFileExtensionRegistered(const QString &extension) con
}
/*!
- \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.
+
+ \sa {installer::fileExists}{installer.fileExists}
+
*/
bool PackageManagerCore::fileExists(const QString &filePath) const
{
@@ -712,17 +788,28 @@ bool PackageManagerCore::fileExists(const QString &filePath) const
// -- QInstaller
/*!
- Used by operation runner to get a fake installer, can be removed if installerbase can do what operation
- runner does.
+ Used by operation runner to get a fake installer.
*/
PackageManagerCore::PackageManagerCore()
: d(new PackageManagerCorePrivate(this))
{
+ //TODO: Can be removed if installerbase can do what operation runner does.
Repository::registerMetaType(); // register, cause we stream the type as QVariant
qRegisterMetaType<QInstaller::PackageManagerCore::Status>("QInstaller::PackageManagerCore::Status");
qRegisterMetaType<QInstaller::PackageManagerCore::WizardPage>("QInstaller::PackageManagerCore::WizardPage");
}
+/*!
+ Creates an installer or uninstaller and performs sanity checks on the operations specified
+ by \a operations.
+
+ The magic marker \a magicmaker is a \c quint64 that identifies the type of the binary:
+ \c installer or \c uninstaller.
+
+ Creates and initializes a remote client. Requests administrator's rights for
+ QFile, QSettings, and QProcess operations. Calls \c init() with \a socketName, \a key,
+ and \a mode to set the server side authorization key.
+*/
PackageManagerCore::PackageManagerCore(qint64 magicmaker, const QList<OperationBlob> &operations,
const QString &socketName, const QString &key, Protocol::Mode mode)
: d(new PackageManagerCorePrivate(this, magicmaker, operations))
@@ -766,6 +853,9 @@ PackageManagerCore::PackageManagerCore(qint64 magicmaker, const QList<OperationB
}
}
+/*!
+ Destroys the instance.
+*/
PackageManagerCore::~PackageManagerCore()
{
if (!isUninstaller() && !(isInstaller() && status() == PackageManagerCore::Canceled)) {
@@ -785,6 +875,9 @@ PackageManagerCore::~PackageManagerCore()
}
/* static */
+/*!
+ Returns the virtual components' font.
+*/
QFont PackageManagerCore::virtualComponentsFont()
{
QMutexLocker _(globalVirtualComponentsFontMutex());
@@ -794,6 +887,9 @@ QFont PackageManagerCore::virtualComponentsFont()
}
/* static */
+/*!
+ Sets the virtual components' font to \a font.
+*/
void PackageManagerCore::setVirtualComponentsFont(const QFont &font)
{
QMutexLocker _(globalVirtualComponentsFontMutex());
@@ -803,41 +899,68 @@ void PackageManagerCore::setVirtualComponentsFont(const QFont &font)
}
/* static */
+/*!
+ Returns \c true if virtual components are visible.
+*/
bool PackageManagerCore::virtualComponentsVisible()
{
return sVirtualComponentsVisible;
}
/* static */
+/*!
+ Shows virtual components if \a visible is \c true.
+*/
void PackageManagerCore::setVirtualComponentsVisible(bool visible)
{
sVirtualComponentsVisible = visible;
}
/* static */
+/*!
+ Returns \c true if forced installation is not set for all components for
+ which the <ForcedInstallation> element is set in the package information
+ file.
+*/
bool PackageManagerCore::noForceInstallation()
{
return sNoForceInstallation;
}
/* static */
+/*!
+ Overwrites the value specified for the component in the \c <ForcedInstallation>
+ element in the package information file with \a value. This enables end users
+ to select or deselect the component in the installer.
+*/
void PackageManagerCore::setNoForceInstallation(bool value)
{
sNoForceInstallation = value;
}
/* static */
+/*!
+ Returns \c true if a local repository should be created from binary content.
+*/
bool PackageManagerCore::createLocalRepositoryFromBinary()
{
return sCreateLocalRepositoryFromBinary;
}
/* static */
+/*!
+ Determines that a local repository should be created from binary content if
+ \a create is \c true.
+*/
void PackageManagerCore::setCreateLocalRepositoryFromBinary(bool create)
{
sCreateLocalRepositoryFromBinary = create;
}
+/*!
+ Returns \c true if the package manager is running and installed packages are
+ found. Otherwise, returns \c false.
+*/
bool PackageManagerCore::fetchLocalPackagesTree()
{
d->setStatus(Running);
@@ -883,11 +1006,17 @@ bool PackageManagerCore::fetchLocalPackagesTree()
return true;
}
+/*!
+ Returns a list of local installed packages. The list can be empty.
+*/
LocalPackagesHash PackageManagerCore::localInstalledPackages()
{
return d->localInstalledPackages();
}
+/*!
+ Emits the coreNetworkSettingsChanged() signal when network settings change.
+*/
void PackageManagerCore::networkSettingsChanged()
{
cancelMetaInfoJob();
@@ -903,6 +1032,10 @@ void PackageManagerCore::networkSettingsChanged()
emit coreNetworkSettingsChanged();
}
+/*!
+ Returns a copy of the proxy factory that the package manager uses to determine
+ the proxies to be used for requests.
+*/
PackageManagerProxyFactory *PackageManagerCore::proxyFactory() const
{
if (d->m_proxyFactory)
@@ -910,6 +1043,12 @@ PackageManagerProxyFactory *PackageManagerCore::proxyFactory() const
return new PackageManagerProxyFactory(this);
}
+/*!
+ Sets the proxy factory for the package manager to be \a factory. A proxy factory
+ is used to determine a more specific list of proxies to be used for a given
+ request, instead of trying to use the same proxy value for all requests. This
+ might only be of use for HTTP or FTP requests.
+*/
void PackageManagerCore::setProxyFactory(PackageManagerProxyFactory *factory)
{
delete d->m_proxyFactory;
@@ -917,11 +1056,19 @@ void PackageManagerCore::setProxyFactory(PackageManagerProxyFactory *factory)
KDUpdater::FileDownloaderFactory::instance().setProxyFactory(proxyFactory());
}
+/*!
+ Returns a list of packages available in all the repositories that were
+ looked at.
+*/
PackagesList PackageManagerCore::remotePackages()
{
return d->remotePackages();
}
+/*!
+ Checks for packages to install. Returns \c true if newer versions exist
+ and they can be installed and sets the status of the update to \c Success.
+*/
bool PackageManagerCore::fetchRemotePackagesTree()
{
d->setStatus(Running);
@@ -995,16 +1142,16 @@ bool PackageManagerCore::fetchRemotePackagesTree()
}
/*!
- \qmlmethod boolean installer::addWizardPage(Component component, string name, int page)
+ \fn PackageManagerCore::addWizardPage(QInstaller::Component * component, const QString & name, int page)
- Adds the widget with objectName() \a name registered by \a component as a new page
+ Adds the widget with object name \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
+ \sa {installer::addWizardPage}{installer.addWizardPage}
*/
bool PackageManagerCore::addWizardPage(Component *component, const QString &name, int page)
{
@@ -1016,14 +1163,15 @@ bool PackageManagerCore::addWizardPage(Component *component, const QString &name
}
/*!
- \qmlmethod boolean installer::removeWizardPage(Component component, string name)
+ \fn PackageManagerCore::removeWizardPage(QInstaller::Component * component, const QString & name)
- Removes the widget with objectName() \a name previously added to the installer's wizard
+ Removes the widget with the object name \a name previously added to the installer's wizard
by \a component.
Returns \c true if the operation succeeded.
- \sa addWizardPage, setDefaultPageVisible, wizardPageRemovalRequested
+ \sa {installer::removeWizardPage}{installer.removeWizardPage}
+ \sa addWizardPage(), setDefaultPageVisible(), wizardPageRemovalRequested()
*/
bool PackageManagerCore::removeWizardPage(Component *component, const QString &name)
{
@@ -1035,15 +1183,14 @@ bool PackageManagerCore::removeWizardPage(Component *component, const QString &n
}
/*!
- \qmlmethod boolean installer::setDefaultPageVisible(int page, boolean visible)
-
- Sets the visibility of the default page with id \a page to \a visible, i.e.
- removes or adds it from/to the wizard. This works only for pages which have been
+ 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
+ \sa {installer::setDefaultPageVisible}{installer.setDefaultPageVisible}
+ \sa addWizardPage(), removeWizardPage()
*/
bool PackageManagerCore::setDefaultPageVisible(int page, bool visible)
{
@@ -1052,10 +1199,13 @@ bool PackageManagerCore::setDefaultPageVisible(int page, bool visible)
}
/*!
- \qmlmethod void installer::setValidatorForCustomPage(Component component, string name,
- string callbackName)
+ \fn PackageManagerCore::setValidatorForCustomPage(QInstaller::Component * component, const QString & name, const QString & callbackName)
+
+ Sets a validator for the custom page specified by \a name and \a callbackName
+ for the component \a component.
- \sa setValidatorForCustomPageRequested
+ \sa {installer::setValidatorForCustomPage}{installer.setValidatorForCustomPage}
+ \sa setValidatorForCustomPageRequested()
*/
void PackageManagerCore::setValidatorForCustomPage(Component *component, const QString &name,
const QString &callbackName)
@@ -1064,14 +1214,18 @@ void PackageManagerCore::setValidatorForCustomPage(Component *component, const Q
}
/*!
- \qmlmethod boolean installer::addWizardPageItem(Component component, string name, int page)
+ \fn PackageManagerCore::addWizardPageItem(QInstaller::Component * component, const QString & name, int page)
- Adds the widget with objectName() \a name registered by \a component as a GUI element
+ Adds the widget with the object name \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
+ If the widget can be found in an UI file for the component, returns \c true and emits the
+ wizardWidgetInsertionRequested() signal.
+
+ \sa {installer::addWizardPageItem}{installer.addWizardPageItem}
+ \sa removeWizardPageItem(), wizardWidgetInsertionRequested()
*/
bool PackageManagerCore::addWizardPageItem(Component *component, const QString &name, int page)
{
@@ -1083,12 +1237,16 @@ bool PackageManagerCore::addWizardPageItem(Component *component, const QString &
}
/*!
- \qmlmethod boolean installer::removeWizardPageItem(Component component, string name)
+ \fn PackageManagerCore::removeWizardPageItem(QInstaller::Component * component, const QString & name)
- Removes the widget with objectName() \a name previously added to the installer's wizard
+ Removes the widget with the object name \a name previously added to the installer's wizard
by \a component.
- \sa addWizardPageItem
+ If the widget can be found in an UI file for the component, returns \c true and emits the
+ wizardWidgetRemovalRequested() signal.
+
+ \sa {installer::removeWizardPageItem}{installer.removeWizardPageItem}
+ \sa addWizardPageItem()
*/
bool PackageManagerCore::removeWizardPageItem(Component *component, const QString &name)
{
@@ -1100,11 +1258,10 @@ bool PackageManagerCore::removeWizardPageItem(Component *component, const QStrin
}
/*!
- \qmlmethod void installer::addUserRepositories(stringlist repositories)
-
Registers additional \a repositories.
- \sa setTemporaryRepositories
+ \sa {installer::addUserRepositories}{installer.addUserRepositories}
+ \sa setTemporaryRepositories()
*/
void PackageManagerCore::addUserRepositories(const QStringList &repositories)
{
@@ -1116,12 +1273,11 @@ void PackageManagerCore::addUserRepositories(const QStringList &repositories)
}
/*!
- \qmlmethod void installer::setTemporaryRepositories(stringlist repositories, boolean replace)
+ Sets additional \a repositories for this instance of the installer or updater
+ if \a replace is \c false. Will be removed after invoking it again.
- Sets additional \a repositories for this instance of the installer or updater.
- Will be removed after invoking it again.
-
- \sa addUserRepositories
+ \sa {installer::setTemporaryRepositories}{installer.setTemporaryRepositories}
+ \sa addUserRepositories()
*/
void PackageManagerCore::setTemporaryRepositories(const QStringList &repositories, bool replace)
{
@@ -1134,7 +1290,7 @@ void PackageManagerCore::setTemporaryRepositories(const QStringList &repositorie
/*!
Checks whether the downloader should try to download SHA-1 checksums for
- archives.
+ archives and returns the checksums.
*/
bool PackageManagerCore::testChecksum() const
{
@@ -1150,11 +1306,21 @@ void PackageManagerCore::setTestChecksum(bool test)
d->m_testChecksum = test;
}
+/*!
+ Returns the script engine that prepares and runs the component scripts.
+
+ \sa {Component Scripting}
+*/
ScriptEngine *PackageManagerCore::componentScriptEngine() const
{
return d->componentScriptEngine();
}
+/*!
+ Returns the script engine that prepares and runs the control script.
+
+ \sa {Controller Scripting}
+*/
ScriptEngine *PackageManagerCore::controlScriptEngine() const
{
return d->controlScriptEngine();
@@ -1175,30 +1341,39 @@ void PackageManagerCore::appendRootComponent(Component *component)
/*!
\class PackageManagerCore::ComponentType
\inmodule QtInstallerFramework
- \brief The ComponentType class is used with components() to describe what type of \c Component
- list this function should return.
+ \brief The ComponentType class describes a component list.
+
+ This class is used with the components() function to describe what type of \c Component
+ list it should return.
+
+ \list
+ \li \c Root returns a list of root components.
+
+ \li \c Descendants returns a list of all descendant components.
- \value Root
- Return a list of root components.
+ \note In updater mode the list is empty, because component updates cannot have children.
- \value Descendants
- Return a list of all descendant components. \b Note: In updater mode the list is empty,
- because component updates cannot have children.
+ \li \c Dependencies returns a list of all available dependencies when run as updater.
- \value Dependencies
- Return a list of all available dependencies when run as updater. \b Note: In Installer,
- package manager and uninstaller mode, this will always result in an empty list.
+ \note When running as installer, package manager, or uninstaller, this will always
+ result in an empty list.
- \value Replacements
- Return a list of all available replacement components relevant to the run mode.
+ \li \c Replacements returns a list of all available replacement components relevant to the
+ run mode.
- \value AllNoReplacements
- Return a list of available components, including root, descendant and dependency
- components relevant to the run mode.
+ \li \c AllNoReplacements returns a list of available components, including root, descendant,
+ and dependency components relevant to the run mode.
+
+ \li \c All returns a list of all available components, including root, descendant,
+ dependency, and replacement components relevant to the run mode.
+ \endlist
+*/
+
+/*!
+ \typedef PackageManagerCore::ComponentTypes
+
+ Synonym for QList<Component>.
- \value All
- Return a list of all available components, including root, descendant, dependency and
- replacement components relevant to the run mode.
*/
/*!
@@ -1240,18 +1415,23 @@ void PackageManagerCore::appendUpdaterComponent(Component *component)
}
/*!
- \qmlmethod component installer::componentByName(string name)
-
Returns a component matching \a name. \a name can also contain a version requirement.
- For example "org.qt-project.sdk.qt" returns any component with that name,
- "org.qt-project.sdk.qt->=4.5" requires the returned component to have at least version 4.5.
- If no component matches the requirement, 0 is returned.
+ For example, \c org.qt-project.sdk.qt returns any component with that name,
+ whereas \c{org.qt-project.sdk.qt->=4.5} requires the returned component to have
+ at least version 4.5. If no component matches the requirement, \c 0 is returned.
*/
Component *PackageManagerCore::componentByName(const QString &name) const
{
return componentByName(name, components(ComponentType::AllNoReplacements));
}
+/*!
+ Searches \a components for a component matching \a name and returns it.
+ \a name can also contain a version requirement. For example, \c org.qt-project.sdk.qt
+ returns any component with that name, whereas \c{org.qt-project.sdk.qt->=4.5} requires
+ the returned component to have at least version 4.5. If no component matches the
+ requirement, \c 0 is returned.
+*/
Component *PackageManagerCore::componentByName(const QString &name, const QList<Component *> &components)
{
if (name.isEmpty())
@@ -1273,6 +1453,10 @@ Component *PackageManagerCore::componentByName(const QString &name, const QList<
return 0;
}
+/*!
+ Returns a list of components that are marked for installation. The list can
+ be empty.
+*/
QList<Component *> PackageManagerCore::componentsMarkedForInstallation() const
{
QList<Component*> markedForInstallation;
@@ -1298,12 +1482,14 @@ QList<Component *> PackageManagerCore::componentsMarkedForInstallation() const
}
/*!
- \qmlmethod boolean installer::calculateComponentsToInstall()
+ Determines which components to install based on the current run mode and returns an
+ ordered list of components to install. Also auto installed dependencies are resolved.
+ The aboutCalculateComponentsToInstall() signal is emitted
+ before the calculation starts, the finishedCalculateComponentsToInstall()
+ signal once all calculations are done.
+
+ \sa {installer::calculateComponentsToInstall}{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.
*/
bool PackageManagerCore::calculateComponentsToInstall() const
{
@@ -1321,7 +1507,7 @@ bool PackageManagerCore::calculateComponentsToInstall() const
}
/*!
- Returns a list of ordered components to install. The list can be empty.
+ Returns an ordered list of components to install. The list can be empty.
*/
QList<Component*> PackageManagerCore::orderedComponentsToInstall() const
{
@@ -1329,12 +1515,12 @@ QList<Component*> PackageManagerCore::orderedComponentsToInstall() const
}
/*!
- \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
+ 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.
+
+ \sa {installer::calculateComponentsToUninstall}{installer.calculateComponentsToUninstall}
*/
bool PackageManagerCore::calculateComponentsToUninstall() const
{
@@ -1358,13 +1544,20 @@ bool PackageManagerCore::calculateComponentsToUninstall() const
}
/*!
- Returns a list of components to uninstall. The list can be empty.
+ Returns a human-readable description of the error that occurred when
+ evaluating the components to install. The error message is empty if no error
+ occurred.
+
+ \sa calculateComponentsToInstall
*/
QList<Component *> PackageManagerCore::componentsToUninstall() const
{
return d->uninstallerCalculator()->componentsToUninstall().toList();
}
+/*!
+ Returns errors found in the components that are marked for installation.
+*/
QString PackageManagerCore::componentsToInstallError() const
{
return d->installerCalculator()->componentsToInstallError();
@@ -1414,6 +1607,9 @@ QList<Component*> PackageManagerCore::dependees(const Component *_component) con
return dependees;
}
+/*!
+ Returns the default component model.
+*/
ComponentModel *PackageManagerCore::defaultComponentModel() const
{
QMutexLocker _(globalModelMutex());
@@ -1426,6 +1622,9 @@ ComponentModel *PackageManagerCore::defaultComponentModel() const
return d->m_defaultModel;
}
+/*!
+ Returns the updater component model.
+*/
ComponentModel *PackageManagerCore::updaterComponentModel() const
{
QMutexLocker _(globalModelMutex());
@@ -1438,17 +1637,19 @@ ComponentModel *PackageManagerCore::updaterComponentModel() const
return d->m_updaterModel;
}
+/*!
+ Returns the settings for the package manager.
+*/
Settings &PackageManagerCore::settings() const
{
return d->m_data.settings();
}
/*!
- \qmlmethod boolean installer::gainAdminRights()
-
Tries to gain admin rights. On success, it returns \c true.
- \sa dropAdminRights
+ \sa {installer::gainAdminRights}{installer.gainAdminRights}
+ \sa dropAdminRights()
*/
bool PackageManagerCore::gainAdminRights()
{
@@ -1462,11 +1663,8 @@ bool PackageManagerCore::gainAdminRights()
}
/*!
- \qmlmethod void installer::dropAdminRights()
-
- Drops admin rights gained by gainAdminRights.
-
- \sa gainAdminRights
+ \sa {installer::dropAdminRights}{installer.dropAdminRights}
+ \sa gainAdminRights()
*/
void PackageManagerCore::dropAdminRights()
{
@@ -1474,10 +1672,10 @@ void PackageManagerCore::dropAdminRights()
}
/*!
- \qmlmethod boolean installer::isProcessRunning(string name)
-
Returns \c true if a process with \a name is running. On Windows, the comparison
is case-insensitive.
+
+ \sa {installer::isProcessRunning}{installer.isProcessRunning}
*/
bool PackageManagerCore::isProcessRunning(const QString &name) const
{
@@ -1485,12 +1683,12 @@ bool PackageManagerCore::isProcessRunning(const QString &name) const
}
/*!
- \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).
+
+ \sa {installer::killProcess}{installer.killProcess}
*/
bool PackageManagerCore::killProcess(const QString &absoluteFilePath) const
{
@@ -1525,14 +1723,13 @@ bool PackageManagerCore::killProcess(const QString &absoluteFilePath) const
/*!
- \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
+ \sa {installer::setDependsOnLocalInstallerBinary}{installer.setDependsOnLocalInstallerBinary}
+ \sa localInstallerBinaryUsed()
*/
void PackageManagerCore::setDependsOnLocalInstallerBinary()
@@ -1541,12 +1738,11 @@ void PackageManagerCore::setDependsOnLocalInstallerBinary()
}
/*!
- \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
+ \sa {installer::localInstallerBinaryUsed}{installer.localInstallerBinaryUsed}
+ \sa setDependsOnLocalInstallerBinary()
*/
bool PackageManagerCore::localInstallerBinaryUsed()
{
@@ -1557,20 +1753,18 @@ bool PackageManagerCore::localInstallerBinaryUsed()
}
/*!
- \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.
+ \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
+ \sa {installer::execute}{installer.execute}
+ \sa executeDetached()
*/
QList<QVariant> PackageManagerCore::execute(const QString &program, const QStringList &arguments,
const QString &stdIn) const
@@ -1600,9 +1794,6 @@ QList<QVariant> PackageManagerCore::execute(const QString &program, const QStrin
}
/*!
- \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
@@ -1618,6 +1809,8 @@ QList<QVariant> PackageManagerCore::execute(const QString &program, const QStrin
The started process will run as a regular standalone process.
The process will be started in the directory \a workingDirectory.
+
+ \sa {installer::executeDetached}{installer.executeDetached}
*/
bool PackageManagerCore::executeDetached(const QString &program, const QStringList &arguments,
@@ -1637,10 +1830,10 @@ bool PackageManagerCore::executeDetached(const QString &program, const QStringLi
/*!
- \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.
+
+ \sa {installer::environmentVariable}{installer.environmentVariable}
*/
QString PackageManagerCore::environmentVariable(const QString &name) const
{
@@ -1667,6 +1860,9 @@ QString PackageManagerCore::environmentVariable(const QString &name) const
#endif
}
+/*!
+ Returns \c true if the operation specified by \a name exists.
+*/
bool PackageManagerCore::operationExists(const QString &name)
{
static QSet<QString> existingOperations;
@@ -1680,9 +1876,11 @@ bool PackageManagerCore::operationExists(const QString &name)
}
/*!
- \qmlmethod boolean installer::performOperation(string name, stringlist arguments)
-
Instantly performs the operation \a name with \a arguments.
+
+ Returns \c false if the operation cannot be created or executed.
+
+ \sa {installer::performOperation}{installer.performOperation}
*/
bool PackageManagerCore::performOperation(const QString &name, const QStringList &arguments)
{
@@ -1700,11 +1898,11 @@ bool PackageManagerCore::performOperation(const QString &name, const QStringList
}
/*!
- \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 '='.
+
+ \sa {installer::versionMatches}{installer.versionMatches}
*/
bool PackageManagerCore::versionMatches(const QString &version, const QString &requirement)
{
@@ -1729,15 +1927,14 @@ bool PackageManagerCore::versionMatches(const QString &version, const QString &r
}
/*!
- \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
+ \sa {installer::findLibrary}{installer.findLibrary}
+ \sa findPath()
*/
QString PackageManagerCore::findLibrary(const QString &name, const QStringList &paths)
{
@@ -1771,14 +1968,13 @@ QString PackageManagerCore::findLibrary(const QString &name, const QStringList &
}
/*!
- \qmlmethod string installer::findPath(string name, stringlist paths = [])
-
- Tries to find a file name \a name in one of \a paths.
+ Tries to find the file name \a name in one of the paths specified by \a paths.
The resulting path is returned.
This method can be used by scripts to check external dependencies.
- \sa findLibrary
+ \sa {installer::findPath}{installer.findPath}
+ \sa findLibrary()
*/
QString PackageManagerCore::findPath(const QString &name, const QStringList &paths)
{
@@ -1794,13 +1990,13 @@ QString PackageManagerCore::findPath(const QString &name, const QStringList &pat
}
/*!
- \qmlmethod void installer::setInstallerBaseBinary(string path)
+ Sets the \c installerbase binary located at \a path to use when writing the
+ maintenance tool. Set the path if an update to the binary is available.
- Sets the "installerbase" binary to use when writing the maintenance tool.
- Set this if an update to installerbase is available.
-
- If not set, the executable segment of the running installer or uninstaller
+ If the path is not set, the executable segment of the running installer or uninstaller
will be used.
+
+ \sa {installer::setInstallerBaseBinary}{installer.setInstallerBaseBinary}
*/
void PackageManagerCore::setInstallerBaseBinary(const QString &path)
{
@@ -1808,12 +2004,11 @@ void PackageManagerCore::setInstallerBaseBinary(const QString &path)
}
/*!
- \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
+ \sa {installer::value}{installer.value}
+ \sa setValue(), containsValue(), valueChanged()
*/
QString PackageManagerCore::value(const QString &key, const QString &defaultValue) const
{
@@ -1821,12 +2016,11 @@ QString PackageManagerCore::value(const QString &key, const QString &defaultValu
}
/*!
- \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
+ \sa {installer::values}{installer.values}
+ \sa value()
*/
QStringList PackageManagerCore::values(const QString &key, const QStringList &defaultValue) const
{
@@ -1834,11 +2028,10 @@ QStringList PackageManagerCore::values(const QString &key, const QStringList &de
}
/*!
- \qmlmethod void installer::setValue(string key, string value)
-
Sets the installer value for \a key to \a value.
- \sa value, containsValue, valueChanged
+ \sa {installer::setValue}{installer.setValue}
+ \sa value(), containsValue(), valueChanged()
*/
void PackageManagerCore::setValue(const QString &key, const QString &value)
{
@@ -1848,11 +2041,10 @@ void PackageManagerCore::setValue(const QString &key, const QString &value)
}
/*!
- \qmlmethod boolean installer::containsValue(string key)
-
Returns \c true if the installer contains a value for \a key.
- \sa value, setValue, valueChanged
+ \sa {installer::containsValue}{installer.containsValue}
+ \sa value(), setValue(), valueChanged()
*/
bool PackageManagerCore::containsValue(const QString &key) const
{
@@ -1860,14 +2052,13 @@ bool PackageManagerCore::containsValue(const QString &key) const
}
/*!
- \qmlmethod void installer::setSharedFlag(string key, boolean value)
-
- Sets a shared flag with name \a key to \a value. This is one option
+ \obsolete
+ Sets a shared flag with the name \a key to \a value. This is one option
to share information between scripts.
- Deprecated since 2.0.0
+ Deprecated since 2.0.0. Use setValue() instead.
- \sa sharedFlag
+ \sa setValue()
*/
void PackageManagerCore::setSharedFlag(const QString &key, bool value)
{
@@ -1876,14 +2067,13 @@ void PackageManagerCore::setSharedFlag(const QString &key, bool value)
}
/*!
- \qmlmethod boolean installer::sharedFlag(string key)
-
- Returns shared flag with name \a key. This is one option
+ \obsolete
+ Returns the shared flag with the name \a key. This is one option
to share information between scripts.
- Deprecated since 2.0.0
+ Deprecated since 2.0.0. Use value() or values() instead.
- \sa setSharedFlag
+ \sa value(), values()
*/
bool PackageManagerCore::sharedFlag(const QString &key) const
{
@@ -1891,11 +2081,18 @@ bool PackageManagerCore::sharedFlag(const QString &key) const
return d->m_sharedFlags.value(key, false);
}
+/*!
+ Returns \c true if the package manager displays detailed information.
+*/
bool PackageManagerCore::isVerbose() const
{
return QInstaller::isVerbose();
}
+/*!
+ Determines that the package manager displays detailed information if
+ \a on is \c true.
+*/
void PackageManagerCore::setVerbose(bool on)
{
QInstaller::setVerbose(on);
@@ -1906,6 +2103,9 @@ PackageManagerCore::Status PackageManagerCore::status() const
return PackageManagerCore::Status(d->m_status);
}
+/*!
+ Returns a human-readable description of the last error that occurred.
+*/
QString PackageManagerCore::error() const
{
return d->m_error;
@@ -1921,11 +2121,8 @@ bool PackageManagerCore::finishedWithSuccess() const
}
/*!
- \qmlmethod void installer::interrupt()
-
- Cancels an ongoing installation.
-
- \sa installationInterrupted
+ \sa {installer::interrupt}{installer.interrupt}
+ \sa installationInterrupted()
*/
void PackageManagerCore::interrupt()
{
@@ -1934,9 +2131,7 @@ void PackageManagerCore::interrupt()
}
/*!
- \qmlmethod void installer::setCanceled()
-
- Cancels the installation.
+ \sa {installer::setCanceled}{installer.setCanceled}
*/
void PackageManagerCore::setCanceled()
{
@@ -1985,11 +2180,10 @@ QString PackageManagerCore::installerBinaryPath() const
}
/*!
- \qmlmethod boolean installer::isInstaller()
-
- Returns \c true if executed in an install step.
+ Returns \c true if running as installer.
- \sa isUninstaller, isUpdater, isPackageManager
+ \sa {installer::isInstaller}{installer.isInstaller}
+ \sa isUninstaller(), isUpdater(), isPackageManager()
*/
bool PackageManagerCore::isInstaller() const
{
@@ -1997,9 +2191,9 @@ bool PackageManagerCore::isInstaller() const
}
/*!
- \qmlmethod boolean installer::isOfflineOnly()
-
Returns \c true if this is an offline-only installer.
+
+ \sa {installer::isOfflineOnly}{installer.isOfflineOnly}
*/
bool PackageManagerCore::isOfflineOnly() const
{
@@ -2007,11 +2201,8 @@ bool PackageManagerCore::isOfflineOnly() const
}
/*!
- \qmlmethod void installer::setUninstaller()
-
- Forces an uninstaller context.
-
- \sa isUninstaller, setUpdater, setPackageManager
+ \sa {installer::setUninstaller}{installer.setUninstaller}
+ \sa isUninstaller(), setUpdater(), setPackageManager()
*/
void PackageManagerCore::setUninstaller()
{
@@ -2019,11 +2210,10 @@ void PackageManagerCore::setUninstaller()
}
/*!
- \qmlmethod boolean installer::isUninstaller()
-
- Returns \c true if the script is executed in an uninstall context.
+ Returns \c true if running as uninstaller.
- \sa setUninstaller, isInstaller, isUpdater, isPackageManager
+ \sa {installer::isUninstaller}{installer.isUninstaller}
+ \sa setUninstaller(), isInstaller(), isUpdater(), isPackageManager()
*/
bool PackageManagerCore::isUninstaller() const
{
@@ -2031,11 +2221,8 @@ bool PackageManagerCore::isUninstaller() const
}
/*!
- \qmlmethod void installer::setUpdater()
-
- Forces an updater context.
-
- \sa isUpdater, setUninstaller, setPackageManager
+ \sa {installer::setUpdater}{installer.setUpdater}
+ \sa isUpdater(), setUninstaller(), setPackageManager()
*/
void PackageManagerCore::setUpdater()
{
@@ -2043,11 +2230,10 @@ void PackageManagerCore::setUpdater()
}
/*!
- \qmlmethod boolean installer::isUpdater()
-
- Returns \c true if the script is executed in an updater context.
+ Returns \c true if running as updater.
- \sa setUpdater, isInstaller, isUninstaller, isPackageManager
+ \sa {installer::isUpdater}{installer.isUpdater}
+ \sa setUpdater(), isInstaller(), isUninstaller(), isPackageManager()
*/
bool PackageManagerCore::isUpdater() const
{
@@ -2055,9 +2241,7 @@ bool PackageManagerCore::isUpdater() const
}
/*!
- \qmlmethod void installer::setPackageManager()
-
- Forces a package manager context.
+ \sa {installer::setPackageManager}{installer.setPackageManager}
*/
void PackageManagerCore::setPackageManager()
{
@@ -2066,10 +2250,10 @@ void PackageManagerCore::setPackageManager()
/*!
- \qmlmethod boolean installer::isPackageManager()
+ Returns \c true if running as the package manager.
- Returns \c true if the script is executed in a package manager context.
- \sa setPackageManager, isInstaller, isUninstaller, isUpdater
+ \sa {installer::isPackageManager}{installer.isPackageManager}
+ \sa setPackageManager(), isInstaller(), isUninstaller(), isUpdater()
*/
bool PackageManagerCore::isPackageManager() const
{
@@ -2085,9 +2269,9 @@ bool PackageManagerCore::isMaintainer() const
}
/*!
- \qmlmethod boolean installer::runInstaller()
-
Runs the installer. Returns \c true on success, \c false otherwise.
+
+ \sa {installer::runInstaller}{installer.runInstaller}
*/
bool PackageManagerCore::runInstaller()
{
@@ -2095,9 +2279,9 @@ bool PackageManagerCore::runInstaller()
}
/*!
- \qmlmethod boolean installer::runUninstaller()
-
Runs the uninstaller. Returns \c true on success, \c false otherwise.
+
+ \sa {installer::runUninstaller}{installer.runUninstaller}
*/
bool PackageManagerCore::runUninstaller()
{
@@ -2105,9 +2289,9 @@ bool PackageManagerCore::runUninstaller()
}
/*!
- \qmlmethod boolean installer::runPackageUpdater()
+ Runs the updater. Returns \c true on success, \c false otherwise.
- Runs the package updater. Returns \c true on success, \c false otherwise.
+ \sa {installer::runPackageUpdater}{installer.runPackageUpdater}
*/
bool PackageManagerCore::runPackageUpdater()
{
@@ -2115,9 +2299,7 @@ bool PackageManagerCore::runPackageUpdater()
}
/*!
- \qmlmethod void installer::languageChanged()
-
- Calls languangeChanged on all components.
+ \sa {installer::languageChanged}{installer.languageChanged}
*/
void PackageManagerCore::languageChanged()
{
@@ -2127,7 +2309,7 @@ void PackageManagerCore::languageChanged()
/*!
Runs the installer, uninstaller, updater, or package manager, depending on
- the type of this binary.
+ the type of this binary. Returns \c true on success, otherwise \c false.
*/
bool PackageManagerCore::run()
{
diff --git a/src/libs/installer/packagemanagercore_p.cpp b/src/libs/installer/packagemanagercore_p.cpp
index 46a38ab8a..ed95ddd4b 100644
--- a/src/libs/installer/packagemanagercore_p.cpp
+++ b/src/libs/installer/packagemanagercore_p.cpp
@@ -997,6 +997,15 @@ void PackageManagerCorePrivate::writeMaintenanceToolBinary(QFile *const input, q
QInstaller::appendInt64(&dataOut, 4 * sizeof(qint64)); // data block size
QInstaller::appendInt64(&dataOut, BinaryContent::MagicUninstallerMarker);
QInstaller::appendInt64(&dataOut, BinaryContent::MagicCookie);
+
+ {
+ QFile dummy(resourcePath.filePath(QLatin1String("installer.dat")));
+ if (dummy.exists() && !dummy.remove()) {
+ throw Error(tr("Could not remove data file '%1': %2").arg(dummy.fileName(),
+ dummy.errorString()));
+ }
+ }
+
if (!dataOut.rename(resourcePath.filePath(QLatin1String("installer.dat")))) {
throw Error(tr("Could not write maintenance tool data to %1: %2").arg(out.fileName(),
out.errorString()));
diff --git a/src/libs/installer/packagemanagergui.cpp b/src/libs/installer/packagemanagergui.cpp
index 2423fc535..0106bc0cb 100644
--- a/src/libs/installer/packagemanagergui.cpp
+++ b/src/libs/installer/packagemanagergui.cpp
@@ -250,28 +250,27 @@ public:
/*!
\fn void PackageManagerGui::interrupted()
- This signal is emitted when the end user chooses to cancel the installation
- and quit the installer.
+ \sa {gui::interrupted}{gui.interrupted}
*/
/*!
\fn void PackageManagerGui::languageChanged()
- This signal is emitted when the application language changes.
+ \sa {gui::languageChanged}{gui.languageChanged}
*/
/*!
\fn void PackageManagerGui::finishButtonClicked()
- This signal is emitted when the \uicontrol Finish button is clicked.
+ \sa {gui::finishButtonClicked}{gui.finishButtonClicked}
*/
/*!
\fn void PackageManagerGui::gotRestarted()
- This signal is emitted when the installer is restarted.
+ \sa {gui::gotRestarted}{gui.gotRestarted}
*/
/*!
\fn void PackageManagerGui::settingsButtonClicked()
- This signal is emitted when the \uicontrol Settings button is clicked.
+ \sa {gui::settingsButtonClicked}{gui.settingsButtonClicked}
*/
/*!
@@ -411,6 +410,8 @@ void PackageManagerGui::setAutomatedPageSwitchEnabled(bool request)
/*!
Returns the default text for the button specified by \a wizardButton.
+
+ \sa {gui::defaultButtonText}{gui.defaultButtonText}
*/
QString PackageManagerGui::defaultButtonText(int wizardButton) const
{
@@ -439,6 +440,8 @@ static bool swapFinishButton(PackageManagerCore *core, int currentId, int button
/*!
Clicks the button specified by \a wb after the delay specified by \a delay.
+
+ \sa {gui::clickButton}{gui.clickButton}
*/
void PackageManagerGui::clickButton(int wb, int delay)
{
@@ -456,6 +459,8 @@ void PackageManagerGui::clickButton(int wb, int delay)
/*!
Returns \c true if the button specified by \a wb is enabled. Returns \c false
if a button of the specified type is not found.
+
+ \sa {gui::isButtonEnabled}{gui.isButtonEnabled}
*/
bool PackageManagerGui::isButtonEnabled(int wb)
{
@@ -661,6 +666,8 @@ void PackageManagerGui::wizardPageVisibilityChangeRequested(bool visible, int p)
/*!
Returns the page specified by \a id.
+
+ \sa {gui::pageById}{gui.pageById}
*/
QWidget *PackageManagerGui::pageById(int id) const
{
@@ -669,6 +676,8 @@ QWidget *PackageManagerGui::pageById(int id) const
/*!
Returns the page specified by the object name \a name from a UI file.
+
+ \sa {gui::pageByObjectName}{gui.pageByObjectName}
*/
QWidget *PackageManagerGui::pageByObjectName(const QString &name) const
{
@@ -683,7 +692,7 @@ QWidget *PackageManagerGui::pageByObjectName(const QString &name) const
}
/*!
- Returns the current page.
+ \sa {gui::currentPageWidget}{gui.currentPageWidget}
*/
QWidget *PackageManagerGui::currentPageWidget() const
{
@@ -693,6 +702,8 @@ QWidget *PackageManagerGui::currentPageWidget() const
/*!
For dynamic pages, returns the widget specified by \a name read from the UI
file.
+
+ \sa {gui::pageWidgetByObjectName}{gui.pageWidgetByObjectName}
*/
QWidget *PackageManagerGui::pageWidgetByObjectName(const QString &name) const
{
@@ -709,8 +720,7 @@ QWidget *PackageManagerGui::pageWidgetByObjectName(const QString &name) const
}
/*!
- Asks end users whether they want to cancel the operation and quit the installer, uninstaller,
- or package manager.
+ \sa {gui::cancelButtonClicked}{gui.cancelButtonClicked}
*/
void PackageManagerGui::cancelButtonClicked()
{
@@ -752,8 +762,7 @@ void PackageManagerGui::cancelButtonClicked()
}
/*!
- Quits the installer, uninstaller, or package manager without asking end
- users for confirmation.
+ \sa {gui::rejectWithoutPrompt}{gui.rejectWithoutPrompt}
*/
void PackageManagerGui::rejectWithoutPrompt()
{
@@ -777,7 +786,7 @@ void PackageManagerGui::setModified(bool value)
}
/*!
- Shows the next page.
+ \sa {gui::showFinishedPage}{gui.showFinishedPage}
*/
void PackageManagerGui::showFinishedPage()
{
@@ -790,6 +799,8 @@ void PackageManagerGui::showFinishedPage()
/*!
Shows the \uicontrol Settings button if \a show is \c true.
+
+ \sa {gui::showSettingsButton}{gui.showSettingsButton}
*/
void PackageManagerGui::showSettingsButton(bool show)
{
@@ -841,6 +852,8 @@ void PackageManagerGui::updateButtonLayout()
/*!
Enables the \uicontrol Settings button by setting \a enabled to \c true.
+
+ \sa {gui::setSettingsButtonEnabled}{gui.setSettingsButtonEnabled}
*/
void PackageManagerGui::setSettingsButtonEnabled(bool enabled)
{
diff --git a/src/libs/installer/protocol.cpp b/src/libs/installer/protocol.cpp
index ba19c38ee..1bd3f1eee 100644
--- a/src/libs/installer/protocol.cpp
+++ b/src/libs/installer/protocol.cpp
@@ -65,8 +65,6 @@ void sendPacket(QIODevice *device, const QByteArray &command, const QByteArray &
break;
packet.remove(0, bytesWritten);
}
- // needed for big packages over TCP on Windows
- device->waitForBytesWritten(-1);
}
/*!
diff --git a/src/libs/installer/remoteobject.cpp b/src/libs/installer/remoteobject.cpp
index 990710609..a4e88f84b 100644
--- a/src/libs/installer/remoteobject.cpp
+++ b/src/libs/installer/remoteobject.cpp
@@ -106,6 +106,7 @@ bool RemoteObject::connectToServer(const QVariantList &arguments)
out << arg;
sendPacket(m_socket, Protocol::Create, data);
+ m_socket->flush();
return true;
}
diff --git a/src/libs/installer/remoteobject.h b/src/libs/installer/remoteobject.h
index 57ab0599d..18cd1ccbb 100644
--- a/src/libs/installer/remoteobject.h
+++ b/src/libs/installer/remoteobject.h
@@ -151,6 +151,7 @@ private:
out << arg3;
sendPacket(m_socket, name.toLatin1(), data);
+ m_socket->flush();
}
private:
diff --git a/src/libs/installer/remoteserverconnection.cpp b/src/libs/installer/remoteserverconnection.cpp
index cdaf070fd..78dd58643 100644
--- a/src/libs/installer/remoteserverconnection.cpp
+++ b/src/libs/installer/remoteserverconnection.cpp
@@ -165,6 +165,7 @@ void RemoteServerConnection::run()
if (m_signalReceiver) {
QMutexLocker _(&m_signalReceiver->m_lock);
sendData(&socket, m_signalReceiver->m_receivedSignals);
+ socket.flush();
m_signalReceiver->m_receivedSignals.clear();
}
continue;
@@ -179,6 +180,7 @@ void RemoteServerConnection::run()
} else {
qDebug() << "Unknown command:" << command;
}
+ socket.flush();
} else {
// authorization failed, connection not wanted
socket.close();
diff --git a/src/libs/installer/scriptengine.cpp b/src/libs/installer/scriptengine.cpp
index fe7220a49..9a4272ac9 100644
--- a/src/libs/installer/scriptengine.cpp
+++ b/src/libs/installer/scriptengine.cpp
@@ -319,6 +319,10 @@ QJSValue ScriptEngine::newQObject(QObject *object)
return jsValue;
}
+/*!
+ Creates a JavaScript object of class Array with the specified \a length.
+*/
+
QJSValue ScriptEngine::newArray(uint length)
{
return m_engine.newArray(length);
diff --git a/src/sdk/commandlineparser.cpp b/src/sdk/commandlineparser.cpp
index 4a1f0080f..842edde3b 100644
--- a/src/sdk/commandlineparser.cpp
+++ b/src/sdk/commandlineparser.cpp
@@ -57,7 +57,7 @@ CommandLineParser::CommandLineParser()
QLatin1String("Verbose mode. Prints out more information.")));
m_parser.addOption(QCommandLineOption(QLatin1String(CommandLineOptions::Proxy),
- QLatin1String("Use system proxy on Windows and OS X. This option has no effect on Linux.")));
+ QLatin1String("Use system proxy on Windows and Linux. This option has no effect on OS X.")));
m_parser.addOption(QCommandLineOption(QLatin1String(CommandLineOptions::Script),
QLatin1String("Execute the script given as argument."), QLatin1String("file")));
diff --git a/src/sdk/main.cpp b/src/sdk/main.cpp
index a35f1a95a..cda9c932a 100644
--- a/src/sdk/main.cpp
+++ b/src/sdk/main.cpp
@@ -50,6 +50,11 @@
#include <iostream>
+#if defined(Q_OS_OSX)
+# include <unistd.h>
+# include <sys/types.h>
+#endif
+
#define QUOTE_(x) #x
#define QUOTE(x) QUOTE_(x)
#define VERSION "IFW Version: \"" QUOTE(IFW_VERSION_STR) "\""
@@ -144,6 +149,14 @@ int main(int argc, char *argv[])
return EXIT_FAILURE;
}
+#if defined(Q_OS_OSX)
+ // make sure effective == real user id.
+ uid_t realUserId = getuid();
+ uid_t effectiveUserId = geteuid();
+ if (realUserId != effectiveUserId)
+ setreuid(effectiveUserId, -1);
+#endif
+
QInstaller::RemoteServer *server = new QInstaller::RemoteServer;
QObject::connect(server, SIGNAL(destroyed()), &app, SLOT(quit()));
server->init(socketName, key, (production ? QInstaller::Protocol::Mode::Production
diff --git a/tests/auto/installer/packagemanagercore/tst_packagemanagercore.cpp b/tests/auto/installer/packagemanagercore/tst_packagemanagercore.cpp
index 4740b60dd..d6ca5e97e 100644
--- a/tests/auto/installer/packagemanagercore/tst_packagemanagercore.cpp
+++ b/tests/auto/installer/packagemanagercore/tst_packagemanagercore.cpp
@@ -90,7 +90,12 @@ class tst_PackageManagerCore : public QObject
private:
void setIgnoreMessage(const QString &testDirectory)
{
+#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
const QString message = "\"\t- arguments: %1\" ";
+#else
+ const QString message = "\"\\t- arguments: %1\" ";
+#endif
+ QTest::ignoreMessage(QtDebugMsg, "Operations sanity check succeeded.");
QTest::ignoreMessage(QtDebugMsg, "\"backup operation: Mkdir\" ");
QTest::ignoreMessage(QtDebugMsg, qPrintable(message.arg(testDirectory)));
QTest::ignoreMessage(QtDebugMsg, qPrintable(message.arg(testDirectory)));
@@ -233,6 +238,7 @@ private slots:
void testRequiredDiskSpace()
{
// test installer
+ QTest::ignoreMessage(QtDebugMsg, "Operations sanity check succeeded.");
PackageManagerCore core(QInstaller::BinaryContent::MagicInstallerMarker,
QList<QInstaller::OperationBlob>());