PackageManagerCore Class

(QInstaller::PackageManagerCore)

The PackageManagerCore class provides the core functionality of the Qt Installer Framework. More...

Header: #include <PackageManagerCore>
Inherits: QObject

Public Types

enum ComponentType { Root, Descendants, Dependencies, Replacements, AllNoReplacements, All }
flags ComponentTypes
enum Status { Success, Failure, Running, Canceled, Unfinished, ForceUpdate }
enum WizardPage { Introduction, TargetDirectory, ComponentSelection, LicenseCheck, ..., InstallationFinished }

Properties

  • 1 property inherited from QObject

Public Functions

PackageManagerCore()
PackageManagerCore(qint64 magicmaker, const QList<OperationBlob> &operations, const QString &socketName = QString(), const QString &key = QLatin1String( Protocol::DefaultAuthorizationKey ), Protocol::Mode mode = Protocol::Mode::Production)
~PackageManagerCore()
void addFilesForDelayedDeletion(const QStringList &files)
void addUserRepositories(const QStringList &repositories)
bool addWizardPage(QInstaller::Component *component, const QString &name, int page)
bool addWizardPageItem(QInstaller::Component *component, const QString &name, int page)
void appendRootComponent(Component *component)
void appendUpdaterComponent(Component *component)
void autoAcceptMessageBoxes()
void autoRejectMessageBoxes()
bool calculateComponents(QString *displayString)
bool calculateComponentsToInstall() const
bool calculateComponentsToUninstall() const
Component *componentByName(const QString &name) const
ScriptEngine *componentScriptEngine() const
QList<Component *> components(ComponentTypes mask) const
QString componentsToInstallError() const
QList<Component *> componentsToUninstall() const
bool containsValue(const QString &key) const
ScriptEngine *controlScriptEngine() const
ComponentModel *defaultComponentModel() const
QList<Component *> dependees(const Component *_component) const
int downloadNeededArchives(double partProgressSize)
void dropAdminRights()
QString environmentVariable(const QString &name) const
QString error() const
QList<QVariant> execute(const QString &program, const QStringList &arguments = QStringList(), const QString &stdIn = QString(), const QString &stdInCodec = QLatin1String( "latin1" ), const QString &stdOutCodec = QLatin1String( "latin1" )) const
bool executeDetached(const QString &program, const QStringList &arguments = QStringList(), const QString &workingDirectory = QString()) const
bool fetchCompressedPackagesTree()
bool fetchLocalPackagesTree()
bool fetchRemotePackagesTree()
bool fileExists(const QString &filePath) const
QStringList filesForDelayedDeletion() const
bool finishedWithSuccess() const
bool gainAdminRights()
QObject *guiObject() const
QString installReason(Component *component) const
QString installerBinaryPath() const
bool isFileExtensionRegistered(const QString &extension) const
bool isInstaller() const
bool isMaintainer() const
bool isOfflineOnly() const
bool isPackageManager() const
bool isProcessRunning(const QString &name) const
bool isUninstaller() const
bool isUpdater() const
bool isVerbose() const
bool killProcess(const QString &absoluteFilePath) const
LocalPackagesHash localInstalledPackages()
bool localInstallerBinaryUsed()
QString maintenanceToolName() const
bool needsHardRestart() const
void networkSettingsChanged()
bool operationExists(const QString &name)
QList<Component *> orderedComponentsToInstall() const
bool performOperation(const QString &name, const QStringList &arguments)
PackageManagerProxyFactory *proxyFactory() const
QString readFile(const QString &filePath, const QString &codecName) const
PackagesList remotePackages()
bool removeWizardPage(QInstaller::Component *component, const QString &name)
bool removeWizardPageItem(QInstaller::Component *component, const QString &name)
QString replaceVariables(const QString &str) const
QByteArray replaceVariables(const QByteArray &ba) const
QStringList replaceVariables(const QStringList &str) const
quint64 requiredDiskSpace() const
quint64 requiredTemporaryDiskSpace() const
void reset(const QHash<QString, QString> &params)
void rollBackInstallation()
bool run()
bool setDefaultPageVisible(int page, bool visible)
void setDependsOnLocalInstallerBinary()
void setGuiObject(QObject *gui)
void setInstallerBaseBinary(const QString &path)
void setMessageBoxAutomaticAnswer(const QString &identifier, int button)
void setNeedsHardRestart(bool needsHardRestart = true)
void setPackageManager()
void setProxyFactory(PackageManagerProxyFactory *factory)
void setTemporaryRepositories(const QStringList &repositories, bool replace = false, bool compressed = false)
void setTestChecksum(bool test)
void setUninstaller()
void setUpdater()
void setValidatorForCustomPage(QInstaller::Component *component, const QString &name, const QString &callbackName)
void setValue(const QString &key, const QString &value)
void setVerbose(bool on)
Settings &settings() const
quint64 size(QInstaller::Component *component, const QString &value) const
Status status() const
bool testChecksum() const
void updateComponentsSilently()
ComponentModel *updaterComponentModel() const
QString value(const QString &key, const QString &defaultValue = QString()) const
QStringList values(const QString &key, const QStringList &defaultValue = QStringList()) const
void writeMaintenanceConfigFiles()
void writeMaintenanceTool()
  • 32 public functions inherited from QObject

Public Slots

  • 1 public slot inherited from QObject

Signals

void aboutCalculateComponentsToInstall() const
void aboutCalculateComponentsToUninstall() const
void componentAdded(QInstaller::Component *comp)
void coreNetworkSettingsChanged()
void currentPageChanged(int page)
void finishAllComponentsReset(const QList<QInstaller::Component *> &rootComponents)
void finishButtonClicked()
void finishUpdaterComponentsReset(const QList<QInstaller::Component *> &componentsWithUpdates)
void finishedCalculateComponentsToInstall() const
void finishedCalculateComponentsToUninstall() const
void guiObjectChanged(QObject *gui)
void installationFinished()
void installationInterrupted()
void installationStarted()
void metaJobInfoMessage(const QString &message)
void metaJobProgress(int progress)
void metaJobTotalProgress(int progress)
void rootComponentsAdded(QList<QInstaller::Component *> components)
void setAutomatedPageSwitchEnabled(bool request)
void setValidatorForCustomPageRequested(QInstaller::Component *component, const QString &name, const QString &callbackName)
void startAllComponentsReset()
void startUpdaterComponentsReset()
void statusChanged(QInstaller::PackageManagerCore::Status)
void titleMessageChanged(const QString &title)
void uninstallationFinished()
void uninstallationStarted()
void updateFinished()
void updaterComponentsAdded(QList<QInstaller::Component *> components)
void valueChanged(const QString &key, const QString &value)
void wizardPageInsertionRequested(QWidget *widget, QInstaller::PackageManagerCore::WizardPage page)
void wizardPageRemovalRequested(QWidget *widget)
void wizardPageVisibilityChangeRequested(bool visible, int page)
void wizardWidgetInsertionRequested(QWidget *widget, QInstaller::PackageManagerCore::WizardPage page)
void wizardWidgetRemovalRequested(QWidget *widget)

Static Public Members

Component *componentByName(const QString &name, const QList<Component *> &components)
bool createLocalRepositoryFromBinary()
QString findLibrary(const QString &name, const QStringList &paths = QStringList())
QString findPath(const QString &name, const QStringList &paths = QStringList())
bool noForceInstallation()
void setCreateLocalRepositoryFromBinary(bool create)
void setNoForceInstallation(bool value)
void setVirtualComponentsFont(const QFont &font)
void setVirtualComponentsVisible(bool visible)
bool versionMatches(const QString &version, const QString &requirement)
QFont virtualComponentsFont()
bool virtualComponentsVisible()
  • 10 static public members inherited from QObject

Additional Inherited Members

  • 1 public variable inherited from QObject
  • 9 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

The PackageManagerCore class provides the core functionality of the Qt Installer Framework.

Member Type Documentation

enum PackageManagerCore::ComponentType
flags PackageManagerCore::ComponentTypes

This enum holds the type of the component list to be returned:

ConstantValueDescription
QInstaller::PackageManagerCore::Root0x1Returns a list of root components.
QInstaller::PackageManagerCore::Descendants0x2Returns a list of all descendant components. In updater mode the list is empty, because component updates cannot have children.
QInstaller::PackageManagerCore::Dependencies0x4Returns a list of all available dependencies when run as updater. When running as installer, package manager, or uninstaller, this will always result in an empty list.
QInstaller::PackageManagerCore::Replacements0x8Returns a list of all available replacement components relevant to the run mode.
QInstaller::PackageManagerCore::AllNoReplacements( Root | Descendants | Dependencies )Returns a list of available components, including root, descendant, and dependency components relevant to the run mode.
QInstaller::PackageManagerCore::All( Root | Descendants | Dependencies | Replacements )Returns a list of all available components, including root, descendant, dependency, and replacement components relevant to the run mode.

The ComponentTypes type is a typedef for QFlags<ComponentType>. It stores an OR combination of ComponentType values.

enum PackageManagerCore::Status

This enum type holds the package manager status:

ConstantValueDescription
QInstaller::PackageManagerCore::SuccessEXIT_SUCCESSInstallation was successful.
QInstaller::PackageManagerCore::FailureEXIT_FAILUREInstallation failed.
QInstaller::PackageManagerCore::Running?Installation is in progress.
QInstaller::PackageManagerCore::Canceled?Installation was canceled.
QInstaller::PackageManagerCore::Unfinished?Installation was not completed.
QInstaller::PackageManagerCore::ForceUpdate? 

enum PackageManagerCore::WizardPage

This enum type holds the pre-defined package manager pages:

ConstantValueDescription
QInstaller::PackageManagerCore::Introduction0x1000Introduction Page
QInstaller::PackageManagerCore::TargetDirectory0x2000Target Directory Page
QInstaller::PackageManagerCore::ComponentSelection0x3000Component Selection Page
QInstaller::PackageManagerCore::LicenseCheck0x4000License Agreement Page
QInstaller::PackageManagerCore::StartMenuSelection0x5000Start Menu Directory Page
QInstaller::PackageManagerCore::ReadyForInstallation0x6000Ready for Installation Page
QInstaller::PackageManagerCore::PerformInstallation0x7000Perform Installation Page
QInstaller::PackageManagerCore::InstallationFinished0x8000Finished Page

Property Documentation

status : const int

Installation status.

Access functions:

Status status() const

Notifier signal:

void statusChanged(QInstaller::PackageManagerCore::Status)

Member Function Documentation

PackageManagerCore::PackageManagerCore()

Used by operation runner to get a fake installer.

PackageManagerCore::PackageManagerCore(qint64 magicmaker, const QList<OperationBlob> &operations, const QString &socketName = QString(), const QString &key = QLatin1String( Protocol::DefaultAuthorizationKey ), Protocol::Mode mode = Protocol::Mode::Production)

Creates an installer or uninstaller and performs sanity checks on the operations specified by operations.

The magic marker magicmaker is a quint64 that identifies the type of the binary: installer or uninstaller.

Creates and initializes a remote client. Requests administrator's rights for QFile, QSettings, and QProcess operations. Calls init() with socketName, key, and mode to set the server side authorization key.

PackageManagerCore::~PackageManagerCore()

Destroys the instance.

[signal] void PackageManagerCore::aboutCalculateComponentsToInstall() const

See also installer.aboutCalculateComponentsToInstall.

[signal] void PackageManagerCore::aboutCalculateComponentsToUninstall() const

See also installer.aboutCalculateComponentsToUninstall.

void PackageManagerCore::addFilesForDelayedDeletion(const QStringList &files)

void PackageManagerCore::addUserRepositories(const QStringList &repositories)

Registers additional repositories.

See also installer.addUserRepositories and setTemporaryRepositories().

bool PackageManagerCore::addWizardPage(QInstaller::Component *component, const QString &name, int page)

Adds the widget with object name name registered by component as a new page into the installer's GUI wizard. The widget is added before page.

See Controller Scripting for the possible values of page.

Returns true if the operation succeeded.

See also installer.addWizardPage.

bool PackageManagerCore::addWizardPageItem(QInstaller::Component *component, const QString &name, int page)

Adds the widget with the object name name registered by component as a GUI element into the installer's GUI wizard. The widget is added on page.

See Controller Scripting for the possible values of page.

If the widget can be found in an UI file for the component, returns true and emits the wizardWidgetInsertionRequested() signal.

See also installer.addWizardPageItem, removeWizardPageItem(), and wizardWidgetInsertionRequested().

void PackageManagerCore::appendRootComponent(Component *component)

Appends component as the root component to the internal storage for installer or package manager components. To append a component as a child to an already existing component, use Component::appendComponent(). Emits the componentAdded() signal.

void PackageManagerCore::appendUpdaterComponent(Component *component)

Appends component to the internal storage for updater components. Emits the componentAdded() signal.

void PackageManagerCore::autoAcceptMessageBoxes()

See also installer.autoAcceptMessageBoxes, autoRejectMessageBoxes(), and setMessageBoxAutomaticAnswer().

void PackageManagerCore::autoRejectMessageBoxes()

See also installer.autoRejectMessageBoxes, autoAcceptMessageBoxes(), and setMessageBoxAutomaticAnswer().

bool PackageManagerCore::calculateComponents(QString *displayString)

bool PackageManagerCore::calculateComponentsToInstall() const

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.

See also installer.calculateComponentsToInstall.

bool PackageManagerCore::calculateComponentsToUninstall() const

Calculates a list of components to uninstall based on the current run mode. The aboutCalculateComponentsToUninstall() signal is emitted before the calculation starts, the finishedCalculateComponentsToUninstall() signal once all calculations are done. Always returns true.

See also installer.calculateComponentsToUninstall.

[slot] void PackageManagerCore::cancelMetaInfoJob()

See also installer.cancelMetaInfoJob.

[signal] void PackageManagerCore::componentAdded(QInstaller::Component *comp)

Emitted when the new root component comp is added.

See also installer.componentAdded, rootComponentsAdded(), and updaterComponentsAdded().

[static] Component *PackageManagerCore::componentByName(const QString &name, const QList<Component *> &components)

Searches components for a component matching name and returns it. name can also contain a version requirement. For example, org.qt-project.sdk.qt returns any component with that name, whereas 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.

Component *PackageManagerCore::componentByName(const QString &name) const

Returns a component matching name. name can also contain a version requirement. For example, org.qt-project.sdk.qt returns any component with that name, whereas 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.

ScriptEngine *PackageManagerCore::componentScriptEngine() const

Returns the script engine that prepares and runs the component scripts.

See also Component Scripting.

QList<Component *> PackageManagerCore::components(ComponentTypes mask) const

Returns a list of components depending on the component types passed in mask.

QString PackageManagerCore::componentsToInstallError() const

Returns errors found in the components that are marked for installation.

[slot] void PackageManagerCore::componentsToInstallNeedsRecalculation()

See also installer.componentsToInstallNeedsRecalculation.

QList<Component *> PackageManagerCore::componentsToUninstall() const

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.

See also calculateComponentsToInstall.

bool PackageManagerCore::containsValue(const QString &key) const

Returns true if the installer contains a value for key.

See also installer.containsValue, value(), setValue(), and valueChanged().

ScriptEngine *PackageManagerCore::controlScriptEngine() const

Returns the script engine that prepares and runs the control script.

See also Controller Scripting.

[signal] void PackageManagerCore::coreNetworkSettingsChanged()

See also installer.coreNetworkSettingsChanged.

[static] bool PackageManagerCore::createLocalRepositoryFromBinary()

Returns true if a local repository should be created from binary content.

See also setCreateLocalRepositoryFromBinary().

[signal] void PackageManagerCore::currentPageChanged(int page)

Emitted when the current page page changes.

See also installer.currentPageChanged.

ComponentModel *PackageManagerCore::defaultComponentModel() const

Returns the default component model.

QList<Component *> PackageManagerCore::dependees(const Component *_component) const

Returns a list of components that depend on _component. The list can be empty.

Note: Automatic dependencies are not resolved.

int PackageManagerCore::downloadNeededArchives(double partProgressSize)

Returns the number of archives that will be downloaded.

partProgressSize is reserved for the download progress.

void PackageManagerCore::dropAdminRights()

See also installer.dropAdminRights and gainAdminRights().

QString PackageManagerCore::environmentVariable(const QString &name) const

Returns the content of the environment variable name. An empty string is returned if the environment variable is not set.

See also installer.environmentVariable.

QString PackageManagerCore::error() const

Returns a human-readable description of the last error that occurred.

QList<QVariant> PackageManagerCore::execute(const QString &program, const QStringList &arguments = QStringList(), const QString &stdIn = QString(), const QString &stdInCodec = QLatin1String( "latin1" ), const QString &stdOutCodec = QLatin1String( "latin1" )) const

Starts the program program with the arguments arguments in a new process and waits for it to finish.

stdIn is sent as standard input to the application.

stdInCodec is the name of the codec to use for converting the input string into bytes to write to the standard input of the application.

stdOutCodec is the name of the codec to use for converting data written by the application to standard output into a string.

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.

See also installer.execute and executeDetached().

bool PackageManagerCore::executeDetached(const QString &program, const QStringList &arguments = QStringList(), const QString &workingDirectory = QString()) const

Starts the program program with the arguments arguments in a new process, and detaches from it. Returns true on success; otherwise returns 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.

Unix: The started process will run in its own session and act like a daemon.

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 workingDirectory.

See also installer.executeDetached.

bool PackageManagerCore::fetchCompressedPackagesTree()

Checks for compressed packages to install. Returns true if newer versions exist and they can be installed.

bool PackageManagerCore::fetchLocalPackagesTree()

Returns true if the package manager is running and installed packages are found. Otherwise, returns false.

bool PackageManagerCore::fetchRemotePackagesTree()

Checks for packages to install. Returns true if newer versions exist and they can be installed.

bool PackageManagerCore::fileExists(const QString &filePath) const

Returns true if the filePath exists; otherwise returns false.

Note: If the file is a symlink that points to a non existing file, false is returned.

See also installer.fileExists.

QStringList PackageManagerCore::filesForDelayedDeletion() const

[static] QString PackageManagerCore::findLibrary(const QString &name, const QStringList &paths = QStringList())

Finds a library named name in paths. If 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.

See also installer.findLibrary and findPath().

[static] QString PackageManagerCore::findPath(const QString &name, const QStringList &paths = QStringList())

Tries to find the file name name in one of the paths specified by paths. The resulting path is returned.

This method can be used by scripts to check external dependencies.

See also installer.findPath and findLibrary().

[signal] void PackageManagerCore::finishAllComponentsReset(const QList<QInstaller::Component *> &rootComponents)

Triggered when the list of new root components, rootComponents, has been updated.

See also installer.finishAllComponentsReset and startAllComponentsReset().

[signal] void PackageManagerCore::finishButtonClicked()

See also installer.finishButtonClicked.

[signal] void PackageManagerCore::finishUpdaterComponentsReset(const QList<QInstaller::Component *> &componentsWithUpdates)

Triggered when the list of available remote updates, componentsWithUpdates, has been updated.

See also installer.finishUpdaterComponentsReset.

[signal] void PackageManagerCore::finishedCalculateComponentsToInstall() const

See also installer.finishedCalculateComponentsToInstall.

[signal] void PackageManagerCore::finishedCalculateComponentsToUninstall() const

See also installer.finishedCalculateComponentsToUninstall.

bool PackageManagerCore::finishedWithSuccess() const

Returns true if at least one complete installation or update was successful, even if the user cancelled the latest installation process.

bool PackageManagerCore::gainAdminRights()

Tries to gain admin rights. On success, it returns true.

See also installer.gainAdminRights and dropAdminRights().

QObject *PackageManagerCore::guiObject() const

Returns the GUI object.

See also setGuiObject().

[signal] void PackageManagerCore::guiObjectChanged(QObject *gui)

Emitted when the GUI object is set to gui.

QString PackageManagerCore::installReason(Component *component) const

Returns the reason why component needs to be installed:

  • The component was scheduled for installation.
  • The component was added as a dependency for another component.
  • The component was added as an automatic dependency.

[signal] void PackageManagerCore::installationFinished()

See also installer.installationFinished, installationStarted(), and installationInterrupted().

[signal] void PackageManagerCore::installationInterrupted()

See also installer.installationInterrupted, interrupt(), installationStarted(), and installationFinished().

[signal] void PackageManagerCore::installationStarted()

See also installer.installationStarted, installationFinished(), and installationInterrupted().

QString PackageManagerCore::installerBinaryPath() const

Returns the path to the installer binary.

[slot] void PackageManagerCore::interrupt()

See also installer.interrupt and installationInterrupted().

bool PackageManagerCore::isFileExtensionRegistered(const QString &extension) const

Returns whether the file extension extension is already registered in the Windows registry. Returns false on all other platforms.

See also installer.isFileExtensionRegistered.

bool PackageManagerCore::isInstaller() const

Returns true if running as installer.

See also installer.isInstaller, isUninstaller(), isUpdater(), and isPackageManager().

bool PackageManagerCore::isMaintainer() const

Returns true if it is a package manager or an updater.

bool PackageManagerCore::isOfflineOnly() const

Returns true if this is an offline-only installer.

See also installer.isOfflineOnly.

bool PackageManagerCore::isPackageManager() const

Returns true if running as the package manager.

See also installer.isPackageManager, setPackageManager(), isInstaller(), isUninstaller(), and isUpdater().

bool PackageManagerCore::isProcessRunning(const QString &name) const

Returns true if a process with name is running. On Windows, the comparison is case-insensitive.

See also installer.isProcessRunning.

bool PackageManagerCore::isUninstaller() const

Returns true if running as uninstaller.

See also installer.isUninstaller, setUninstaller(), isInstaller(), isUpdater(), and isPackageManager().

bool PackageManagerCore::isUpdater() const

Returns true if running as updater.

See also installer.isUpdater, setUpdater(), isInstaller(), isUninstaller(), and isPackageManager().

bool PackageManagerCore::isVerbose() const

Returns true if the package manager displays detailed information.

bool PackageManagerCore::killProcess(const QString &absoluteFilePath) const

Returns true if a process with 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).

See also installer.killProcess.

[slot] void PackageManagerCore::languageChanged()

See also installer.languageChanged.

LocalPackagesHash PackageManagerCore::localInstalledPackages()

Returns a list of local installed packages. The list can be empty.

bool PackageManagerCore::localInstallerBinaryUsed()

Returns false if the installer is run on Windows, and the installer has been started from a remote file system drive. Otherwise returns true.

See also installer.localInstallerBinaryUsed and setDependsOnLocalInstallerBinary().

QString PackageManagerCore::maintenanceToolName() const

Returns the path name of the maintenance tool binary.

[signal] void PackageManagerCore::metaJobInfoMessage(const QString &message)

Triggered with informative updates, message, of the communication with a remote repository.

See also installer.metaJobInfoMessage.

[signal] void PackageManagerCore::metaJobProgress(int progress)

Triggered with progress updates of the communication with a remote repository. Values of progress range from 0 to 100.

See also installer.metaJobProgress.

[signal] void PackageManagerCore::metaJobTotalProgress(int progress)

bool PackageManagerCore::needsHardRestart() const

Returns true if a hard restart of the application is requested.

See also setNeedsHardRestart().

void PackageManagerCore::networkSettingsChanged()

Emits the coreNetworkSettingsChanged() signal when network settings change.

[static] bool PackageManagerCore::noForceInstallation()

Returns true if forced installation is not set for all components for which the <ForcedInstallation> element is set in the package information file.

See also setNoForceInstallation().

bool PackageManagerCore::operationExists(const QString &name)

Returns true if the operation specified by name exists.

QList<Component *> PackageManagerCore::orderedComponentsToInstall() const

Returns an ordered list of components to install. The list can be empty.

bool PackageManagerCore::performOperation(const QString &name, const QStringList &arguments)

Instantly performs the operation name with arguments.

Returns false if the operation cannot be created or executed.

See also installer.performOperation.

PackageManagerProxyFactory *PackageManagerCore::proxyFactory() const

Returns a copy of the proxy factory that the package manager uses to determine the proxies to be used for requests.

See also setProxyFactory().

QString PackageManagerCore::readFile(const QString &filePath, const QString &codecName) const

Returns the contents of the file filePath using the encoding specified by codecName. The file is read in the text mode, that is, end-of-line terminators are translated to the local encoding.

Note: If the file does not exist or an error occurs while reading the file, an empty string is returned.

See also installer.readFile.

PackagesList PackageManagerCore::remotePackages()

Returns a list of packages available in all the repositories that were looked at.

bool PackageManagerCore::removeWizardPage(QInstaller::Component *component, const QString &name)

Removes the widget with the object name name previously added to the installer's wizard by component.

Returns true if the operation succeeded.

See also installer.removeWizardPage, addWizardPage(), setDefaultPageVisible(), and wizardPageRemovalRequested().

bool PackageManagerCore::removeWizardPageItem(QInstaller::Component *component, const QString &name)

Removes the widget with the object name name previously added to the installer's wizard by component.

If the widget can be found in an UI file for the component, returns true and emits the wizardWidgetRemovalRequested() signal.

See also installer.removeWizardPageItem and addWizardPageItem().

QString PackageManagerCore::replaceVariables(const QString &str) const

Replaces all variables within str by their respective values and returns the result.

QByteArray PackageManagerCore::replaceVariables(const QByteArray &ba) const

This is an overloaded function.

Replaces all variables within ba by their respective values and returns the result.

QStringList PackageManagerCore::replaceVariables(const QStringList &str) const

This is an overloaded function.

Replaces all variables in any instance of str by their respective values and returns the results.

quint64 PackageManagerCore::requiredDiskSpace() const

See also installer.requiredDiskSpace and requiredTemporaryDiskSpace().

quint64 PackageManagerCore::requiredTemporaryDiskSpace() const

See also installer.requiredTemporaryDiskSpace and requiredDiskSpace().

void PackageManagerCore::reset(const QHash<QString, QString> &params)

Resets the class to its initial state and applies the values of the parameters specified by params.

void PackageManagerCore::rollBackInstallation()

Cancels the installation and performs the UNDO step of all already executed operations.

[signal] void PackageManagerCore::rootComponentsAdded(QList<QInstaller::Component *> components)

Emitted when the list of root components specified by components is added.

See also installer.rootComponentsAdded, componentAdded(), and updaterComponentsAdded().

bool PackageManagerCore::run()

Runs the installer, uninstaller, updater, or package manager, depending on the type of this binary. Returns true on success, otherwise false.

[slot] bool PackageManagerCore::runInstaller()

Runs the installer. Returns true on success, false otherwise.

See also installer.runInstaller.

[slot] bool PackageManagerCore::runPackageUpdater()

Runs the updater. Returns true on success, false otherwise.

See also installer.runPackageUpdater.

[slot] bool PackageManagerCore::runUninstaller()

Runs the uninstaller. Returns true on success, false otherwise.

See also installer.runUninstaller.

[signal] void PackageManagerCore::setAutomatedPageSwitchEnabled(bool request)

Triggered when the automatic switching from the perform installation to the installation finished page is enabled (request is true) or disabled (request is false).

The automatic switching is disabled automatically when for example the user expands or unexpands the Details section of the PerformInstallation page.

See also installer.setAutomatedPageSwitchEnabled.

[slot] void PackageManagerCore::setCanceled()

See also installer.setCanceled.

[slot] void PackageManagerCore::setCompleteUninstallation(bool complete)

Sets the uninstallation to be complete. If complete is false, only components deselected by the user will be uninstalled. This option applies only on uninstallation.

See also installer.setCompleteUninstallation.

[static] void PackageManagerCore::setCreateLocalRepositoryFromBinary(bool create)

Determines that a local repository should be created from binary content if create is true.

See also createLocalRepositoryFromBinary().

bool PackageManagerCore::setDefaultPageVisible(int page, bool visible)

Sets the visibility of the default page with the ID page to 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 true.

See also installer.setDefaultPageVisible, addWizardPage(), and removeWizardPage().

void PackageManagerCore::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.

See also installer.setDependsOnLocalInstallerBinary and localInstallerBinaryUsed().

void PackageManagerCore::setGuiObject(QObject *gui)

Sets the maintenance tool UI to gui.

See also guiObject().

void PackageManagerCore::setInstallerBaseBinary(const QString &path)

Sets the installerbase binary located at path to use when writing the maintenance tool. Set the path if an update to the binary is available.

If the path is not set, the executable segment of the running installer or uninstaller will be used.

See also installer.setInstallerBaseBinary.

void PackageManagerCore::setMessageBoxAutomaticAnswer(const QString &identifier, int button)

Automatically closes the message box with the ID identifier as if the user had pressed button.

This can be used for unattended (automatic) installations.

See also installer.setMessageBoxAutomaticAnswer, QMessageBox, autoAcceptMessageBoxes(), and autoRejectMessageBoxes().

void PackageManagerCore::setNeedsHardRestart(bool needsHardRestart = true)

Enables a component to request a hard restart of the application if needsHardRestart is set to true.

See also needsHardRestart().

[static] void PackageManagerCore::setNoForceInstallation(bool value)

Overwrites the value specified for the component in the <ForcedInstallation> element in the package information file with value. This enables end users to select or deselect the component in the installer.

See also noForceInstallation().

void PackageManagerCore::setPackageManager()

See also isPackageManager() and installer.setPackageManager.

void PackageManagerCore::setProxyFactory(PackageManagerProxyFactory *factory)

Sets the proxy factory for the package manager to be 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.

See also proxyFactory().

void PackageManagerCore::setTemporaryRepositories(const QStringList &repositories, bool replace = false, bool compressed = false)

Sets additional repositories for this instance of the installer or updater if replace is false. Will be removed after invoking it again.

See also installer.setTemporaryRepositories and addUserRepositories().

void PackageManagerCore::setTestChecksum(bool test)

The test argument determines whether the downloader should try to download SHA-1 checksums for archives.

See also testChecksum().

void PackageManagerCore::setUninstaller()

See also installer.setUninstaller, isUninstaller(), setUpdater(), and setPackageManager().

void PackageManagerCore::setUpdater()

See also installer.setUpdater, isUpdater(), setUninstaller(), and setPackageManager().

void PackageManagerCore::setValidatorForCustomPage(QInstaller::Component *component, const QString &name, const QString &callbackName)

Sets a validator for the custom page specified by name and callbackName for the component component.

When using this, name has to match a dynamic page starting with Dynamic. For example, if the page is called DynamicReadyToInstallWidget, then name should be set to ReadyToInstallWidget. The callbackName should be set to a function that returns a boolean. When the Next button is pressed on the custom page, then it will call the callbackName function. If this returns true, then it will move to the next page.

See also installer.setValidatorForCustomPage and setValidatorForCustomPageRequested().

[signal] void PackageManagerCore::setValidatorForCustomPageRequested(QInstaller::Component *component, const QString &name, const QString &callbackName)

Requests that a validator be set for the custom page specified by name and callbackName for the component component. Triggered when setValidatorForCustomPage() is called.

See also installer.setValidatorForCustomPageRequested.

void PackageManagerCore::setValue(const QString &key, const QString &value)

Sets the installer value for key to value.

See also installer.setValue, value(), containsValue(), and valueChanged().

void PackageManagerCore::setVerbose(bool on)

Determines that the package manager displays detailed information if on is true.

See also isVerbose().

[static] void PackageManagerCore::setVirtualComponentsFont(const QFont &font)

Sets the virtual components' font to font.

See also virtualComponentsFont().

[static] void PackageManagerCore::setVirtualComponentsVisible(bool visible)

Shows virtual components if visible is true.

See also virtualComponentsVisible().

Settings &PackageManagerCore::settings() const

Returns the settings for the package manager.

quint64 PackageManagerCore::size(QInstaller::Component *component, const QString &value) const

Returns the size of the component component as value.

[signal] void PackageManagerCore::startAllComponentsReset()

See also installer.startAllComponentsReset and finishAllComponentsReset().

[signal] void PackageManagerCore::startUpdaterComponentsReset()

See also installer.startUpdaterComponentsReset.

bool PackageManagerCore::testChecksum() const

Checks whether the downloader should try to download SHA-1 checksums for archives and returns the checksums.

See also setTestChecksum().

[signal] void PackageManagerCore::titleMessageChanged(const QString &title)

Emitted when the text of the installer status (on the PerformInstallation page) changes to title.

See also installer.titleMessageChanged.

[signal] void PackageManagerCore::uninstallationFinished()

See also installer.uninstallationFinished and uninstallationStarted().

[signal] void PackageManagerCore::uninstallationStarted()

See also installer.uninstallationStarted and uninstallationFinished().

void PackageManagerCore::updateComponentsSilently()

[signal] void PackageManagerCore::updateFinished()

See also installer.installationFinished.

ComponentModel *PackageManagerCore::updaterComponentModel() const

Returns the updater component model.

[signal] void PackageManagerCore::updaterComponentsAdded(QList<QInstaller::Component *> components)

Emitted when a new list of updater components specified by components is added.

See also installer.updaterComponentsAdded, componentAdded(), and rootComponentsAdded().

QString PackageManagerCore::value(const QString &key, const QString &defaultValue = QString()) const

Returns the installer value for key. If key is not known to the system, defaultValue is returned. Additionally, on Windows, key can be a registry key.

See also installer.value, setValue(), containsValue(), and valueChanged().

[signal] void PackageManagerCore::valueChanged(const QString &key, const QString &value)

Emitted when the value value of the key key changes.

See also installer.valueChanged and setValue().

QStringList PackageManagerCore::values(const QString &key, const QStringList &defaultValue = QStringList()) const

Returns the installer value for key. If key is not known to the system, defaultValue is returned. Additionally, on Windows, key can be a registry key.

See also installer.values and value().

[static] bool PackageManagerCore::versionMatches(const QString &version, const QString &requirement)

Returns true when version matches the requirement. requirement can be a fixed version number or it can be prefixed by the comparators '>', '>=', '<', '<=' and '='.

See also installer.versionMatches.

[static] QFont PackageManagerCore::virtualComponentsFont()

Returns the virtual components' font.

See also setVirtualComponentsFont().

[static] bool PackageManagerCore::virtualComponentsVisible()

Returns true if virtual components are visible.

See also setVirtualComponentsVisible().

[signal] void PackageManagerCore::wizardPageInsertionRequested(QWidget *widget, QInstaller::PackageManagerCore::WizardPage page)

Emitted when a custom widget is about to be inserted into page by addWizardPage().

See also installer.wizardPageInsertionRequested.

[signal] void PackageManagerCore::wizardPageRemovalRequested(QWidget *widget)

Emitted when a widget is removed by removeWizardPage().

See also installer.wizardPageRemovalRequested.

[signal] void PackageManagerCore::wizardPageVisibilityChangeRequested(bool visible, int page)

Emitted when the visibility of the page with the ID page changes to visible.

See also setDefaultPageVisible() and installer.wizardPageVisibilityChangeRequested.

[signal] void PackageManagerCore::wizardWidgetInsertionRequested(QWidget *widget, QInstaller::PackageManagerCore::WizardPage page)

Emitted when a widget is inserted into page by addWizardPageItem().

See also installer.wizardWidgetInsertionRequested.

[signal] void PackageManagerCore::wizardWidgetRemovalRequested(QWidget *widget)

Emitted when a widget is removed by removeWizardPageItem().

See also installer.wizardWidgetRemovalRequested.

void PackageManagerCore::writeMaintenanceConfigFiles()

Creates the maintenance tool configuration files.

void PackageManagerCore::writeMaintenanceTool()

Creates the maintenance tool in the installation directory.

© 2017 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. The Qt Company, Qt and their respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.