QInstaller::PackageManagerCore Class
class QInstaller::PackageManagerCoreThe PackageManagerCore class provides the core functionality of the Qt Installer Framework. More...
Header: | #include <PackageManagerCore> |
Inherits: | QObject |
Public Types
enum class | ComponentType { Root, Descendants, Dependencies, Replacements, AllNoReplacements, All } |
flags | ComponentTypes |
enum | Status { Success, Failure, Running, Canceled, Unfinished, …, NoPackagesFound } |
enum | WizardPage { Introduction, TargetDirectory, ComponentSelection, LicenseCheck, StartMenuSelection, …, InstallationFinished } |
Properties
- status : const int
Public Functions
PackageManagerCore() | |
PackageManagerCore(qint64 magicmaker, const QList<QInstaller::OperationBlob> &operations, const QString &datFileName = QString(), const QString &socketName = QString(), const QString &key = QLatin1String(Protocol::DefaultAuthorizationKey), QInstaller::Protocol::Mode mode = Protocol::Mode::Production, const QHash<QString, QString> ¶ms = QHash<QString, QString>(), const bool commandLineInstance = false) | |
virtual | ~PackageManagerCore() |
void | acceptMessageBoxDefaultButton() |
void | addAliasSource(const QInstaller::AliasSource &source) |
void | addFilesForDelayedDeletion(const QStringList &files) |
void | addLicenseItem(const QHash<QString, QVariantMap> &licenses) |
void | addResourcesForOfflineGeneration(const QString &rcPath) |
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, int position = 100) |
QInstaller::ComponentAlias * | aliasByName(const QString &name) const |
QList<QInstaller::ComponentAlias *> | aliasesMarkedForInstallation() const |
void | appendRootComponent(QInstaller::Component *component) |
void | appendUpdaterComponent(QInstaller::Component *component) |
void | autoAcceptMessageBoxes() |
void | autoRejectMessageBoxes() |
QString | availableSpaceMessage() const |
bool | calculateComponentsToInstall() const |
bool | calculateComponentsToUninstall() const |
bool | checkAvailableSpace() |
void | clearLicenses() |
bool | clearLocalCache(QString *error = nullptr) |
void | commitSessionOperations() |
QInstaller::Component * | componentByName(const QString &name) const |
QString | componentResolveReasons() const |
QInstaller::ScriptEngine * | componentScriptEngine() const |
QInstaller::ComponentSortFilterProxyModel * | componentSortFilterProxyModel() |
QList<QInstaller::Component *> | components(const QString ®exp = QString()) const |
QList<QInstaller::Component *> | components(QInstaller::PackageManagerCore::ComponentTypes mask, const QString ®exp = QString()) const |
QList<QInstaller::Component *> | componentsMarkedForInstallation() const |
QString | componentsToInstallError() const |
QList<QInstaller::Component *> | componentsToUninstall() const |
QString | componentsToUninstallError() const |
bool | containsFileDialogAutomaticAnswer(const QString &identifier) const |
bool | containsValue(const QString &key) const |
QInstaller::ScriptEngine * | controlScriptEngine() const |
void | createAutoDependencyHash(const QString &component, const QString &oldDependencies, const QString &newDependencies) const |
void | createLocalDependencyHash(const QString &component, const QString &dependencies) const |
QInstaller::PackageManagerCore::Status | createOfflineInstaller(const QStringList &componentsToAdd) |
QInstaller::ComponentModel * | defaultComponentModel() const |
QList<QInstaller::Component *> | dependees(const QInstaller::Component *_component) const |
void | deselectComponent(const QString &id) |
bool | directoryWritable(const QString &path) const |
void | disableWriteMaintenanceTool(bool disable = true) |
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(const QStringList &components = QStringList()) |
QHash<QString, QString> | fileDialogAutomaticAnswers() const |
bool | fileExists(const QString &filePath) const |
QStringList | filesForDelayedDeletion() const |
bool | finishedWithSuccess() const |
bool | foundEssentialUpdate() const |
QString | fromNativeSeparators(const QString &path) |
bool | gainAdminRights() |
QStringList | givenArguments() const |
QObject * | guiObject() const |
bool | hasAdminRights() const |
QInstaller::PackageManagerCore::Status | installDefaultComponentsSilently() |
QString | installReason(QInstaller::Component *component) const |
QInstaller::PackageManagerCore::Status | installSelectedComponentsSilently(const QStringList &components) |
bool | installationAllowedToDirectory(const QString &targetDirectory) |
QString | installerBaseBinary() const |
QString | installerBinaryPath() const |
bool | isCommandLineDefaultInstall() const |
bool | isCommandLineInstance() const |
bool | isDependencyForRequestedComponent(const QInstaller::Component *component) const |
bool | isFileExtensionRegistered(const QString &extension) const |
bool | isInstaller() const |
bool | isMaintainer() const |
bool | isOfflineGenerator() const |
bool | isOfflineOnly() const |
bool | isPackageManager() const |
bool | isPackageViewer() const |
bool | isProcessRunning(const QString &name) const |
bool | isUninstaller() const |
bool | isUpdater() const |
bool | isUserSetBinaryMarker() const |
bool | isValidCache() const |
bool | isVerbose() const |
QString | key(const QString &value) const |
bool | killProcess(const QString &absoluteFilePath) const |
bool | listAvailableAliases(const QString ®exp = QString()) |
bool | listAvailablePackages(const QString ®exp = QString(), const QHash<QString, QString> &filters = QHash<QString, QString>()) |
void | listInstalledPackages(const QString ®exp = QString()) |
QStringList | localDependenciesToComponent(const QInstaller::Component *component) const |
QInstaller::LocalPackagesMap | localInstalledPackages() |
bool | localInstallerBinaryUsed() |
QString | maintenanceToolName() const |
bool | needsHardRestart() const |
void | networkSettingsChanged() |
QString | offlineBinaryName() const |
bool | operationExists(const QString &name) |
QList<QInstaller::Component *> | orderedComponentsToInstall() const |
bool | performOperation(const QString &name, const QStringList &arguments) |
QInstaller::PackageManagerProxyFactory * | proxyFactory() const |
QString | readConsoleLine(const QString &title = QString(), qint64 maxlen = 0) const |
QString | readFile(const QString &filePath, const QString &codecName) const |
bool | recalculateAllComponents() |
QInstaller::PackagesList | remotePackages() |
void | removeFileDialogAutomaticAnswer(const QString &identifier) |
QInstaller::PackageManagerCore::Status | removeInstallationSilently() |
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() |
void | resetBinaryMarkerSupplement() |
bool | resetLocalCache(bool init = false) |
void | rollBackInstallation() |
bool | run() |
void | saveGivenArguments(const QStringList &args) |
void | selectComponent(const QString &id) |
void | setAutoAcceptLicenses() |
void | setAutoConfirmCommand() |
void | setCheckAvailableSpace(bool check) |
void | setCommandLineInstance(bool commandLineInstance) |
bool | setDefaultPageVisible(int page, bool visible) |
void | setDependsOnLocalInstallerBinary() |
void | setFileDialogAutomaticAnswer(const QString &identifier, const QString &value) |
void | setFoundEssentialUpdate(bool foundEssentialUpdate = true) |
void | setGuiObject(QObject *gui) |
void | setInstaller() |
void | setInstallerBaseBinary(const QString &path) |
void | setMessageBoxAutomaticAnswer(const QString &identifier, int button) |
void | setNeedsHardRestart(bool needsHardRestart = true) |
void | setOfflineBaseBinary(const QString &path) |
void | setOfflineBinaryName(const QString &name) |
void | setOfflineGenerator() |
void | setPackageManager() |
void | setPackageViewer() |
void | setProxyFactory(QInstaller::PackageManagerProxyFactory *factory) |
void | setTemporaryRepositories(const QStringList &repositories, bool replace = false, bool compressed = false) |
void | setUninstaller() |
void | setUpdater() |
void | setUserSetBinaryMarker(qint64 magicMarker) |
void | setValidatorForCustomPage(QInstaller::Component *component, const QString &name, const QString &callbackName) |
void | setValue(const QString &key, const QString &value) |
void | setVerbose(bool on) |
QInstaller::Settings & | settings() const |
quint64 | size(QInstaller::Component *component, const QString &value) const |
QHash<QString, QMap<QString, QString>> | sortedLicenses() |
QInstaller::PackageManagerCore::Status | status() const |
QString | targetDirWarning(const QString &targetDirectory) const |
QString | toNativeSeparators(const QString &path) |
QInstaller::PackageManagerCore::Status | uninstallComponentsSilently(const QStringList &components) |
QString | uninstallReason(QInstaller::Component *component) const |
QInstaller::PackageManagerCore::Status | updateComponentsSilently(const QStringList &componentsToUpdate) |
QInstaller::ComponentModel * | updaterComponentModel() const |
QString | value(const QString &key, const QString &defaultValue = QString(), const int &format = QSettings::NativeFormat) const |
QStringList | values(const QString &key, const QStringList &defaultValue = QStringList()) const |
void | writeMaintenanceConfigFiles() |
void | writeMaintenanceTool() |
Public Slots
void | cancelMetaInfoJob() |
void | interrupt() |
void | languageChanged() |
bool | runInstaller() |
bool | runOfflineGenerator() |
bool | runPackageUpdater() |
bool | runUninstaller() |
void | setCanceled() |
void | setCompleteUninstallation(bool complete) |
Signals
void | aboutCalculateComponentsToInstall() const |
void | aboutCalculateComponentsToUninstall() const |
void | componentAdded(QInstaller::Component *comp) |
void | componentsRecalculated() |
void | coreNetworkSettingsChanged() |
void | currentPageChanged(int page) |
void | defaultTranslationsLoadedForLanguage(QLocale lang) |
void | downloadArchivesFinished() |
void | finishAllComponentsReset(const QList<QInstaller::Component *> &rootComponents) |
void | finishButtonClicked() |
void | finishUpdaterComponentsReset(const QList<QInstaller::Component *> &componentsWithUpdates) |
void | finishedCalculateComponentsToInstall() const |
void | finishedCalculateComponentsToUninstall() const |
void | guiElementsReady() |
void | guiObjectChanged(QObject *gui) |
void | installationFinished() |
void | installationInterrupted() |
void | installationStarted() |
void | installerBinaryMarkerChanged(qint64 magicMarker) |
void | metaJobInfoMessage(const QString &message) |
void | metaJobProgress(int progress) |
void | metaJobTotalProgress(int progress) |
void | offlineGenerationFinished() |
void | offlineGenerationStarted() |
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 | unstableComponentFound(const QString &type, const QString &errorMessage, const QString &component) |
void | updateFinished() |
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, int position) |
void | wizardWidgetRemovalRequested(QWidget *widget) |
Static Public Members
QString | checkableName(const QString &name) |
QInstaller::Component * | componentByName(const QString &name, const QList<QInstaller::Component *> &components) |
bool | createLocalRepositoryFromBinary() |
QString | findLibrary(const QString &name, const QStringList &paths = QStringList()) |
QString | findPath(const QString &name, const QStringList &paths = QStringList()) |
int | maxConcurrentOperations() |
bool | noDefaultInstallation() |
bool | noForceInstallation() |
void | parseNameAndVersion(const QString &requirement, QString *name, QString *version) |
QStringList | parseNames(const QStringList &requirements) |
void | setCreateLocalRepositoryFromBinary(bool create) |
void | setMaxConcurrentOperations(int count) |
void | setNoDefaultInstallation(bool value) |
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() |
Member Type Documentation
enum class PackageManagerCore::ComponentType
flags PackageManagerCore::ComponentTypes
This enum holds the type of the component list to be returned:
Constant | Value | Description |
---|---|---|
QInstaller::PackageManagerCore::ComponentType::Root | 0x1 | Returns a list of root components. |
QInstaller::PackageManagerCore::ComponentType::Descendants | 0x2 | Returns a list of all descendant components. In updater mode the list is empty, because component updates cannot have children. |
QInstaller::PackageManagerCore::ComponentType::Dependencies | 0x4 | Returns 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::ComponentType::Replacements | 0x8 | Returns a list of all available replacement components relevant to the run mode. |
QInstaller::PackageManagerCore::ComponentType::AllNoReplacements | (Root | Descendants | Dependencies) | Returns a list of available components, including root, descendant, and dependency components relevant to the run mode. |
QInstaller::PackageManagerCore::ComponentType::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:
Constant | Value | Description |
---|---|---|
QInstaller::PackageManagerCore::Success | EXIT_SUCCESS | Installation was successful. |
QInstaller::PackageManagerCore::Failure | EXIT_FAILURE | Installation failed. |
QInstaller::PackageManagerCore::Running | 2 | Installation is in progress. |
QInstaller::PackageManagerCore::Canceled | 3 | Installation was canceled. |
QInstaller::PackageManagerCore::Unfinished | 4 | Installation was not completed. |
QInstaller::PackageManagerCore::ForceUpdate | 5 | Installation has to be updated. |
QInstaller::PackageManagerCore::EssentialUpdated | 6 | Installation essential components were updated. |
QInstaller::PackageManagerCore::NoPackagesFound | 7 | No packages found from remote. |
enum PackageManagerCore::WizardPage
This enum type holds the pre-defined package manager pages:
Constant | Value | Description |
---|---|---|
QInstaller::PackageManagerCore::Introduction | 0x1000 | Introduction Page |
QInstaller::PackageManagerCore::TargetDirectory | 0x2000 | Target Directory Page |
QInstaller::PackageManagerCore::ComponentSelection | 0x3000 | Component Selection Page |
QInstaller::PackageManagerCore::LicenseCheck | 0x4000 | License Agreement Page |
QInstaller::PackageManagerCore::StartMenuSelection | 0x5000 | Start Menu Directory Page |
QInstaller::PackageManagerCore::ReadyForInstallation | 0x6000 | Ready for Installation Page |
QInstaller::PackageManagerCore::PerformInstallation | 0x7000 | Perform Installation Page |
QInstaller::PackageManagerCore::InstallationFinished | 0x8000 | Finished Page |
Property Documentation
[read-only]
status : const int
Installation status.
Access functions:
QInstaller::PackageManagerCore::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<QInstaller::OperationBlob> &operations, const QString &datFileName = QString(), const QString &socketName = QString(), const QString &key = QLatin1String(Protocol::DefaultAuthorizationKey), QInstaller::Protocol::Mode mode = Protocol::Mode::Production, const QHash<QString, QString> ¶ms = QHash<QString, QString>(), const bool commandLineInstance = false)
Creates an installer or uninstaller and performs sanity checks on the operations specified by operations. A hash table of variables to be stored as package manager core values can be specified by params. Sets the current instance type to be either a GUI or CLI one based on the value of commandLineInstance.
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.
The datFileName contains the corresponding .dat file name for the running maintenance
tool binary. datFileName can be empty if maintenance
tool fails to find it or if installer
is run instead of maintenance
tool.
[virtual noexcept]
PackageManagerCore::~PackageManagerCore()
Destroys the instance.
[signal]
void PackageManagerCore::aboutCalculateComponentsToInstall() const
See also installer.aboutCalculateComponentsToInstall.
[signal]
void PackageManagerCore::aboutCalculateComponentsToUninstall() const
See also installer.aboutCalculateComponentsToUninstall.
[invokable]
void PackageManagerCore::acceptMessageBoxDefaultButton()
Automatically uses the default button value set for the message box.
This can be used for unattended (automatic) installations.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
void PackageManagerCore::addAliasSource(const QInstaller::AliasSource &source)
Add new source for looking component aliases.
void PackageManagerCore::addFilesForDelayedDeletion(const QStringList &files)
Adds files for delayed deletion.
void PackageManagerCore::addLicenseItem(const QHash<QString, QVariantMap> &licenses)
Adds new set of licenses. If a license with the key already exists, it is not added again.
void PackageManagerCore::addResourcesForOfflineGeneration(const QString &rcPath)
Adds the resource collection in rcPath to the list of resource files to be included into the generated offline installer binary.
[invokable]
void PackageManagerCore::addUserRepositories(const QStringList &repositories)
Registers additional repositories.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.addUserRepositories and setTemporaryRepositories().
[invokable]
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.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.addWizardPage.
[invokable]
bool PackageManagerCore::addWizardPageItem(QInstaller::Component *component, const QString &name, int page, int position = 100)
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 ordered by position number. If several widgets are added to the same page, the widget with lower position number will be inserted on top.
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.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.addWizardPageItem, removeWizardPageItem(), and wizardWidgetInsertionRequested().
QInstaller::ComponentAlias *PackageManagerCore::aliasByName(const QString &name) const
Searches for a component alias matching name and returns it. If no alias matches the name, nullptr
is returned.
QList<QInstaller::ComponentAlias *> PackageManagerCore::aliasesMarkedForInstallation() const
Returns a list of component aliases that are marked for installation. The list can be empty.
void PackageManagerCore::appendRootComponent(QInstaller::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(QInstaller::Component *component)
Appends component to the internal storage for updater components. Emits the componentAdded() signal.
[invokable]
void PackageManagerCore::autoAcceptMessageBoxes()
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.autoAcceptMessageBoxes, autoRejectMessageBoxes(), and setMessageBoxAutomaticAnswer().
[invokable]
void PackageManagerCore::autoRejectMessageBoxes()
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.autoRejectMessageBoxes, autoAcceptMessageBoxes(), and setMessageBoxAutomaticAnswer().
QString PackageManagerCore::availableSpaceMessage() const
Returns informative text about disk space status
[invokable]
bool PackageManagerCore::calculateComponentsToInstall() const
Determines which components to install based on the current run mode, including component aliases, dependencies and automatic dependencies. Returns true
on success, false
otherwise.
The aboutCalculateComponentsToInstall() signal is emitted before the calculation starts, the finishedCalculateComponentsToInstall() signal once all calculations are done.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.calculateComponentsToInstall.
[invokable]
bool PackageManagerCore::calculateComponentsToUninstall() const
Calculates a list of components to uninstall.
The aboutCalculateComponentsToUninstall() signal is emitted before the calculation starts, the finishedCalculateComponentsToUninstall() signal once all calculations are done. Returns true
on success, false
otherwise.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.calculateComponentsToUninstall.
[slot]
void PackageManagerCore::cancelMetaInfoJob()
See also installer.cancelMetaInfoJob.
bool PackageManagerCore::checkAvailableSpace()
Checks available disk space if the feature is not explicitly disabled. Returns true
if there is sufficient free space on installation and temporary volumes.
See also setCheckAvailableSpace() and availableSpaceMessage().
[static]
QString PackageManagerCore::checkableName(const QString &name)
Adds a colon symbol to the component name
as a separator between component name and version.
void PackageManagerCore::clearLicenses()
Clears all previously added licenses.
bool PackageManagerCore::clearLocalCache(QString *error = nullptr)
Clears the contents of the cache used to store downloaded metadata. Returns true
on success, false
otherwise. An error string can be retrieved with error.
void PackageManagerCore::commitSessionOperations()
Saves temporarily current operations for installer usage. This is needed for unit tests when several commands (for example install and uninstall) are performed with the same installer instance.
[signal]
void PackageManagerCore::componentAdded(QInstaller::Component *comp)
Emitted when the new root component comp is added.
See also installer.componentAdded.
[invokable]
QInstaller::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.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
[static]
QInstaller::Component *PackageManagerCore::componentByName(const QString &name, const QList<QInstaller::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.
QString PackageManagerCore::componentResolveReasons() const
Returns a HTML-formatted description of the reasons each component is about to be installed or uninstalled, or a description of the error occurred while calculating components to install and uninstall.
QInstaller::ScriptEngine *PackageManagerCore::componentScriptEngine() const
Returns the script engine that prepares and runs the component scripts.
See also Component Scripting.
QInstaller::ComponentSortFilterProxyModel *PackageManagerCore::componentSortFilterProxyModel()
Returns the proxy model
[invokable]
QList<QInstaller::Component *> PackageManagerCore::components(const QString ®exp = QString()) const
Returns an array of all components currently available. If the repository metadata have not been fetched yet, the array will be empty. Optionally, a regexp expression can be used to further filter the listed packages.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.components.
QList<QInstaller::Component *> PackageManagerCore::components(QInstaller::PackageManagerCore::ComponentTypes mask, const QString ®exp = QString()) const
Returns a list of components depending on the component types passed in mask. Optionally, a regexp expression can be used to further filter the listed packages.
QList<QInstaller::Component *> PackageManagerCore::componentsMarkedForInstallation() const
Returns a list of components that are marked for installation. The list can be empty.
[signal]
void PackageManagerCore::componentsRecalculated()
Emitted when the component tree is recalculated. In a graphical interface, this signal is emitted also after the categories are fetched.
QString PackageManagerCore::componentsToInstallError() const
Returns errors found in the components that are marked for installation.
QList<QInstaller::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.
QString PackageManagerCore::componentsToUninstallError() const
Returns errors found in the components that are marked for uninstallation.
[invokable]
bool PackageManagerCore::containsFileDialogAutomaticAnswer(const QString &identifier) const
Returns true
if QFileDialog with the ID identifier has an automatic answer set.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.containsFileDialogAutomaticAnswer, installer.removeFileDialogAutomaticAnswer, QFileDialog.getExistingDirectory, and QFileDialog.getOpenFileName.
[invokable]
bool PackageManagerCore::containsValue(const QString &key) const
Returns true
if the installer contains a value for key.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.containsValue, value(), setValue(), and valueChanged().
QInstaller::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.
void PackageManagerCore::createAutoDependencyHash(const QString &component, const QString &oldDependencies, const QString &newDependencies) const
Adds component newDependencies to a hash table for quicker search for install and uninstall autodependency components. Removes oldDependencies from the hash table if dependencies have changed.
void PackageManagerCore::createLocalDependencyHash(const QString &component, const QString &dependencies) const
Adds component local dependencies to a hash table for quicker search for uninstall dependency components.
[static]
bool PackageManagerCore::createLocalRepositoryFromBinary()
Returns true
if a local repository should be created from binary content.
See also setCreateLocalRepositoryFromBinary().
QInstaller::PackageManagerCore::Status PackageManagerCore::createOfflineInstaller(const QStringList &componentsToAdd)
Creates an offline installer from selected componentsToAdd without displaying a user interface. Virtual components cannot be selected unless made visible with –show-virtual-components as in installation. AutoDependOn nor non-checkable components cannot be selected directly. Returns PackageManagerCore::Status
.
[signal]
void PackageManagerCore::currentPageChanged(int page)
Emitted when the current page page changes.
See also installer.currentPageChanged.
QInstaller::ComponentModel *PackageManagerCore::defaultComponentModel() const
Returns the default component model.
[signal]
void PackageManagerCore::defaultTranslationsLoadedForLanguage(QLocale lang)
Emitted when the language lang has changed.
QList<QInstaller::Component *> PackageManagerCore::dependees(const QInstaller::Component *_component) const
Returns a list of components that depend on _component. The list can be empty.
Note: Automatic dependencies are not resolved.
[invokable]
void PackageManagerCore::deselectComponent(const QString &id)
Deselects the component with id.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.deselectComponent and selectComponent().
bool PackageManagerCore::directoryWritable(const QString &path) const
Returns true
if directory specified by path is writable by the current user.
void PackageManagerCore::disableWriteMaintenanceTool(bool disable = true)
Disables writing of maintenance tool for the current session if disable is true
.
[signal]
void PackageManagerCore::downloadArchivesFinished()
Emitted when all data archives for components have been downloaded successfully.
See also installer.downloadArchivesFinished.
int PackageManagerCore::downloadNeededArchives(double partProgressSize)
Returns the number of archives that will be downloaded.
partProgressSize is reserved for the download progress.
[invokable]
void PackageManagerCore::dropAdminRights()
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.dropAdminRights and gainAdminRights().
[invokable]
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.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.environmentVariable.
QString PackageManagerCore::error() const
Returns a human-readable description of the last error that occurred.
[invokable]
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.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.execute and executeDetached().
[invokable]
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.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
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(const QStringList &components = QStringList())
Checks for packages to install. Returns true
if newer versions exist and they can be installed. Returns false
if not components are found for install, or if error occurred when fetching and generating package tree.
QHash<QString, QString> PackageManagerCore::fileDialogAutomaticAnswers() const
Returns the hash of file dialog automatic answers
See also setFileDialogAutomaticAnswer().
[invokable]
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.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.fileExists.
QStringList PackageManagerCore::filesForDelayedDeletion() const
Returns the file list used for delayed deletion.
[static invokable]
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.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.findLibrary and findPath().
[static invokable]
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.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
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::foundEssentialUpdate() const
Returns true
if an essential component update is found.
See also setFoundEssentialUpdate().
[invokable]
QString PackageManagerCore::fromNativeSeparators(const QString &path)
Returns path using '/' as file separator.
On Unix platforms the returned string is the same as the argument.
Note: Predefined variables, such as @TargetDir@, are not resolved by this function. To convert the separators to predefined variables, use installer.value()
to resolve the variables first.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.fromNativeSeparators, toNativeSeparators(), and installer.value.
[invokable]
bool PackageManagerCore::gainAdminRights()
Tries to gain admin rights. On success, it returns true
.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.gainAdminRights and dropAdminRights().
QStringList PackageManagerCore::givenArguments() const
Returns the commands and options user has given when running installer.
[signal]
void PackageManagerCore::guiElementsReady()
Emitted after installer has finished making QWizard and common QWizard pages.
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.
[invokable]
bool PackageManagerCore::hasAdminRights() const
Returns true
if the installer has admin rights. For example, if the installer was started with a root account, or the internal admin rights elevation is active.
Returns false
otherwise.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.hasAdminRights, gainAdminRights(), and dropAdminRights().
QInstaller::PackageManagerCore::Status PackageManagerCore::installDefaultComponentsSilently()
Installs components that are checked by default, i.e. those that are set with <Default> or <ForcedInstallation> and their respective dependencies without GUI. Returns PackageManagerCore installation status.
QString PackageManagerCore::installReason(QInstaller::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.
QInstaller::PackageManagerCore::Status PackageManagerCore::installSelectedComponentsSilently(const QStringList &components)
Installs the selected components components without displaying a user interface. Virtual components cannot be installed unless made visible with –show-virtual-components. AutoDependOn nor non-checkable components cannot be installed directly. Returns PackageManagerCore installation status.
bool PackageManagerCore::installationAllowedToDirectory(const QString &targetDirectory)
Checks whether installation is allowed to targetDirectory:
- Returns
true
if the directory does not exist. - Returns
true
if the directory exists and is empty. - Returns
false
if the directory already exists and contains an installation. - Returns
false
if the target is a file or a symbolic link. - Returns
true
orfalse
if the directory exists but is not empty, depending on the choice that the end users make in the displayed message box.
[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::installerBaseBinary() const
Returns the value of installerbase
binary which is used when writing the maintenance tool. Value can be empty.
See also setInstallerBaseBinary().
[signal]
void PackageManagerCore::installerBinaryMarkerChanged(qint64 magicMarker)
Emitted when installer binary marker magicMarker has changed.
QString PackageManagerCore::installerBinaryPath() const
Returns the path to the installer binary.
[slot]
void PackageManagerCore::interrupt()
See also installer.interrupt and installationInterrupted().
[invokable]
bool PackageManagerCore::isCommandLineDefaultInstall() const
Returns true
if installation is performed with default components.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.isCommandLineDefaultInstall.
[invokable]
bool PackageManagerCore::isCommandLineInstance() const
Returns true
if running as command line instance.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.isCommandLineInstance.
bool PackageManagerCore::isDependencyForRequestedComponent(const QInstaller::Component *component) const
Returns true if components which are about to be installed or updated are dependent on component.
[invokable]
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.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.isFileExtensionRegistered.
[invokable]
bool PackageManagerCore::isInstaller() const
Returns true
if running as installer.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.isInstaller, isUninstaller(), isUpdater(), and isPackageManager().
bool PackageManagerCore::isMaintainer() const
Returns true
if it is a package manager or an updater.
[invokable]
bool PackageManagerCore::isOfflineGenerator() const
Returns true
if current installer is executed as offline generator.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.isOfflineGenerator.
[invokable]
bool PackageManagerCore::isOfflineOnly() const
Returns true
if this is an offline-only installer.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.isOfflineOnly.
[invokable]
bool PackageManagerCore::isPackageManager() const
Returns true
if running as the package manager.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.isPackageManager, setPackageManager(), isInstaller(), isUninstaller(), and isUpdater().
[invokable]
bool PackageManagerCore::isPackageViewer() const
Returns true
if the current installer is executed as package viewer.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.isPackageViewer.
[invokable]
bool PackageManagerCore::isProcessRunning(const QString &name) const
Returns true
if a process with name is running. On Windows, the comparison is case-insensitive.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.isProcessRunning.
[invokable]
bool PackageManagerCore::isUninstaller() const
Returns true
if running as uninstaller.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.isUninstaller, setUninstaller(), isInstaller(), isUpdater(), and isPackageManager().
[invokable]
bool PackageManagerCore::isUpdater() const
Returns true
if running as updater.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.isUpdater, setUpdater(), isInstaller(), isUninstaller(), and isPackageManager().
[invokable]
bool PackageManagerCore::isUserSetBinaryMarker() const
Returns true
if the magic binary marker has been set by user, for example from a command line argument.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.isUserSetBinaryMarker.
bool PackageManagerCore::isValidCache() const
Returns true
if the metadata cache is initialized and valid, false
otherwise.
bool PackageManagerCore::isVerbose() const
Returns true
if the package manager displays detailed information.
[invokable]
QString PackageManagerCore::key(const QString &value) const
Returns the installer key for value. If value is not known, empty string is returned.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.key.
[invokable]
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).
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.killProcess.
[slot]
void PackageManagerCore::languageChanged()
See also installer.languageChanged.
bool PackageManagerCore::listAvailableAliases(const QString ®exp = QString())
Lists available component aliases filtered with regexp without GUI. Virtual aliases are not listed unless set visible.
Returns true
if matching package aliases were found, false
otherwise.
See also setVirtualComponentsVisible().
bool PackageManagerCore::listAvailablePackages(const QString ®exp = QString(), const QHash<QString, QString> &filters = QHash<QString, QString>())
Lists available packages filtered with regexp without GUI. Virtual components are not listed unless set visible. Optionally, a filters hash containing package information elements and regular expressions can be used to further filter listed packages.
Returns true
if matching packages were found, false
otherwise.
See also setVirtualComponentsVisible().
void PackageManagerCore::listInstalledPackages(const QString ®exp = QString())
Lists installed packages without GUI. List of packages can be filtered with regexp.
QStringList PackageManagerCore::localDependenciesToComponent(const QInstaller::Component *component) const
Returns a list of local components which are dependent on component.
QInstaller::LocalPackagesMap PackageManagerCore::localInstalledPackages()
Returns a list of local installed packages. The list can be empty.
[invokable]
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
.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.localInstallerBinaryUsed and setDependsOnLocalInstallerBinary().
QString PackageManagerCore::maintenanceToolName() const
Returns the path name of the maintenance tool binary.
[static]
int PackageManagerCore::maxConcurrentOperations()
Returns the maximum count of operations that should be run concurrently at the given time.
Currently this affects only operations in the unpacking phase.
See also setMaxConcurrentOperations().
[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)
Triggered when the total progress value of the communication with a remote repository changes.
See also installer.metaJobTotalProgress.
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::noDefaultInstallation()
Returns true
if components are not selected by default although <Default>
element is set in the package information file.
See also setNoDefaultInstallation().
[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().
QString PackageManagerCore::offlineBinaryName() const
Returns the path set for the generated offline binary.
See also setOfflineBinaryName().
[signal]
void PackageManagerCore::offlineGenerationFinished()
See also installer.offlineGenerationFinished().
[signal]
void PackageManagerCore::offlineGenerationStarted()
See also installer.offlineGenerationStarted().
[invokable]
bool PackageManagerCore::operationExists(const QString &name)
Returns true
if the operation specified by name exists.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
QList<QInstaller::Component *> PackageManagerCore::orderedComponentsToInstall() const
Returns an ordered list of components to install. The list can be empty.
[static]
void PackageManagerCore::parseNameAndVersion(const QString &requirement, QString *name, QString *version)
Parses name and version from requirement component. requirement
contains both name and version separated either with ':' or with '-'.
[static]
QStringList PackageManagerCore::parseNames(const QStringList &requirements)
Excludes version numbers from names from requirements components. requirements list contains names that have both name and version.
Returns a list containing names without version numbers.
[invokable]
bool PackageManagerCore::performOperation(const QString &name, const QStringList &arguments)
Performs the operation name with arguments.
Returns false
if the operation cannot be created or executed.
Note: The operation is performed threaded. It is not advised to call this function after installation finished signals.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.performOperation.
QInstaller::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().
[invokable]
QString PackageManagerCore::readConsoleLine(const QString &title = QString(), qint64 maxlen = 0) const
Prints title to console and reads console input. Function will halt the installer and wait for user input. Returns a line which user has typed into console. The maximum allowed line length is set to maxlen. If the stream contains lines longer than this, then the line will be split after maxlen characters. If maxlen is 0, the line can be of any length.
Note: Can be only called when installing from command line instance without GUI. If the output device is not a TTY, i.e. when forwarding to a file, the function will throw an error.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.readConsoleLine.
[invokable]
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.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.readFile.
[invokable]
bool PackageManagerCore::recalculateAllComponents()
Recalculates all components to install and uninstall. Returns true
on success, false
otherwise. Detailed error messages can be retrieved with {installer::componentsToInstallError} and {installer::componentsToUninstallError}.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
QInstaller::PackagesList PackageManagerCore::remotePackages()
Returns a list of packages available in all the repositories that were looked at.
[invokable]
void PackageManagerCore::removeFileDialogAutomaticAnswer(const QString &identifier)
Removes the automatic answer from QFileDialog with the ID identifier. QFileDialog can be called from script.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.removeFileDialogAutomaticAnswer, QFileDialog.getExistingDirectory, and QFileDialog.getOpenFileName.
QInstaller::PackageManagerCore::Status PackageManagerCore::removeInstallationSilently()
Uninstalls all installed components without GUI and removes the program directory. Returns PackageManagerCore installation status.
[invokable]
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.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.removeWizardPage, addWizardPage(), setDefaultPageVisible(), and wizardPageRemovalRequested().
[invokable]
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.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
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.
[invokable]
quint64 PackageManagerCore::requiredDiskSpace() const
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.requiredDiskSpace and requiredTemporaryDiskSpace().
[invokable]
quint64 PackageManagerCore::requiredTemporaryDiskSpace() const
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.requiredTemporaryDiskSpace and requiredDiskSpace().
void PackageManagerCore::reset()
Resets the class to its initial state.
void PackageManagerCore::resetBinaryMarkerSupplement()
Resets the binary marker supplement of the installer to Default
. The supplement enables or disables additional features on top of the binary marker state (Installer
, Updater
, PackageManager
, Uninstaller
).
bool PackageManagerCore::resetLocalCache(bool init = false)
Resets the cache used to store downloaded metadata, if one was previously initialized. If init is set to true
, the cache is reinitialized for the path configured in installer's settings.
Returns true
on success, false
otherwise.
void PackageManagerCore::rollBackInstallation()
Cancels the installation and performs the UNDO step of all already executed operations.
bool PackageManagerCore::run()
Runs the installer, uninstaller, updater, package manager, or offline generator 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::runOfflineGenerator()
Runs the offline generator. Returns true
on success, false
otherwise.
See also installer.runOfflineGenerator.
[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.
void PackageManagerCore::saveGivenArguments(const QStringList &args)
Saves the installer args user has given when running installer. Command and option arguments are not saved.
[invokable]
void PackageManagerCore::selectComponent(const QString &id)
Selects the component with id.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.selectComponent and deselectComponent().
[invokable]
void PackageManagerCore::setAutoAcceptLicenses()
Automatically accepts all license agreements required to install the selected components.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.setAutoAcceptLicenses.
void PackageManagerCore::setAutoConfirmCommand()
Set to automatically confirm install, update or remove without asking user.
[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.
void PackageManagerCore::setCheckAvailableSpace(bool check)
Sets checkAvailableSpace based on value of check.
See also checkAvailableSpace().
void PackageManagerCore::setCommandLineInstance(bool commandLineInstance)
Set to use command line instance based on commandLineInstance.
See also isCommandLineInstance().
[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().
[invokable]
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
.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.setDefaultPageVisible, addWizardPage(), and removeWizardPage().
[invokable]
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.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.setDependsOnLocalInstallerBinary and localInstallerBinaryUsed().
[invokable]
void PackageManagerCore::setFileDialogAutomaticAnswer(const QString &identifier, const QString &value)
Automatically sets the existing directory or filename value to QFileDialog with the ID identifier. QFileDialog can be called from script.
This can be used for unattended (automatic) installations.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.setFileDialogAutomaticAnswer, QFileDialog.getExistingDirectory, and QFileDialog.getOpenFileName.
void PackageManagerCore::setFoundEssentialUpdate(bool foundEssentialUpdate = true)
Sets the value of foundEssentialUpdate, defaults to true
.
See also foundEssentialUpdate().
void PackageManagerCore::setGuiObject(QObject *gui)
Sets the maintenance tool UI to gui.
See also guiObject().
[invokable]
void PackageManagerCore::setInstaller()
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.setInstaller, isInstaller(), setUpdater(), and setPackageManager().
[invokable]
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.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installerBaseBinary() and installer.setInstallerBaseBinary.
[static]
void PackageManagerCore::setMaxConcurrentOperations(int count)
Sets the maximum count of operations that should be run concurrently at the given time. A value of 0
is synonym for automatic count.
Currently this affects only operations in the unpacking phase.
See also maxConcurrentOperations().
[invokable]
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.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
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::setNoDefaultInstallation(bool value)
Overwrites the value specified for the component in the <Default>
element in the package information file with value. Setting value to true
unselects the components.
See also noDefaultInstallation().
[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::setOfflineBaseBinary(const QString &path)
Sets the installerbase
binary located at path to use when writing the offline installer. Setting this makes it possible to run the offline generator in cases where we are not running a real installer, i.e. when executing autotests.
For normal runs, the executable segment of the running installer will be used.
void PackageManagerCore::setOfflineBinaryName(const QString &name)
Sets the name for the generated offline binary.
See also offlineBinaryName().
void PackageManagerCore::setOfflineGenerator()
Sets current installer to be offline generator.
See also isOfflineGenerator().
[invokable]
void PackageManagerCore::setPackageManager()
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also isPackageManager() and installer.setPackageManager.
void PackageManagerCore::setPackageViewer()
Sets the current installer as the package viewer.
See also isPackageViewer().
void PackageManagerCore::setProxyFactory(QInstaller::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().
[invokable]
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
. compressed repositories can be added as well. Will be removed after invoking it again.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.setTemporaryRepositories and addUserRepositories().
[invokable]
void PackageManagerCore::setUninstaller()
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.setUninstaller, isUninstaller(), setUpdater(), and setPackageManager().
[invokable]
void PackageManagerCore::setUpdater()
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.setUpdater, isUpdater(), setUninstaller(), and setPackageManager().
void PackageManagerCore::setUserSetBinaryMarker(qint64 magicMarker)
Sets the installer magic binary marker based on magicMarker and userSetBinaryMarker to true
.
See also isUserSetBinaryMarker().
[invokable]
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.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
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.
[invokable]
void PackageManagerCore::setValue(const QString &key, const QString &value)
Sets the installer value for key to value.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
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
. Calling setVerbose() more than once increases verbosity.
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().
QInstaller::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.
QHash<QString, QMap<QString, QString>> PackageManagerCore::sortedLicenses()
Returns licenses hash which can be sorted by priority.
[signal]
void PackageManagerCore::startAllComponentsReset()
See also installer.startAllComponentsReset and finishAllComponentsReset().
[signal]
void PackageManagerCore::startUpdaterComponentsReset()
See also installer.startUpdaterComponentsReset.
QString PackageManagerCore::targetDirWarning(const QString &targetDirectory) const
Returns a warning if the path to the target directory targetDirectory is not set or if it is invalid.
[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.
[invokable]
QString PackageManagerCore::toNativeSeparators(const QString &path)
Returns path with the '/' separators converted to separators that are appropriate for the underlying operating system.
On Unix platforms the returned string is the same as the argument.
Note: Predefined variables, such as @TargetDir@, are not resolved by this function. To convert the separators to predefined variables, use installer.value()
to resolve the variables first.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.toNativeSeparators, fromNativeSeparators(), and installer.value.
QInstaller::PackageManagerCore::Status PackageManagerCore::uninstallComponentsSilently(const QStringList &components)
Uninstalls the selected components components without GUI. Returns PackageManagerCore installation status.
QString PackageManagerCore::uninstallReason(QInstaller::Component *component) const
Returns the reason why component needs to be uninstalled:
- The component was scheduled for uninstallation.
- The component was replaced by another component.
- The component is virtual and its dependencies are uninstalled.
- The components dependencies are uninstalled.
- The components autodependencies are uninstalled.
[signal]
void PackageManagerCore::uninstallationFinished()
See also installer.uninstallationFinished and uninstallationStarted().
[signal]
void PackageManagerCore::uninstallationStarted()
See also installer.uninstallationStarted and uninstallationFinished().
[signal]
void PackageManagerCore::unstableComponentFound(const QString &type, const QString &errorMessage, const QString &component)
Emitted when an unstable component is found containing an unstable type and errorMessage.
QInstaller::PackageManagerCore::Status PackageManagerCore::updateComponentsSilently(const QStringList &componentsToUpdate)
Updates the selected components componentsToUpdate without GUI. If essential components are found, then only those will be updated. Returns PackageManagerCore installation status.
[signal]
void PackageManagerCore::updateFinished()
See also installer.installationFinished.
QInstaller::ComponentModel *PackageManagerCore::updaterComponentModel() const
Returns the updater component model.
[invokable]
QString PackageManagerCore::value(const QString &key, const QString &defaultValue = QString(), const int &format = QSettings::NativeFormat) 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. Optionally, you can specify the format of the registry key. By default the format is QSettings::NativeFormat. For accessing the 32-bit system registry from a 64-bit application running on 64-bit Windows, use QSettings::Registry32Format. For accessing the 64-bit system registry from a 32-bit application running on 64-bit Windows, use QSettings::Registry64Format.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
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().
[invokable]
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.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also installer.values and value().
[static invokable]
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 '='.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
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, int position)
Emitted when a widget is inserted into page by addWizardPageItem(). If several widgets are added to the same page, widget with lower position number will be inserted on top.
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.
© 2021 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.