From 21aef7e78341b1931ca029dda5e5118172bdaafa Mon Sep 17 00:00:00 2001 From: Arttu Tarkiainen Date: Mon, 30 Mar 2020 16:42:21 +0300 Subject: Remove existing installation from command line Add new "purge" command to command line interface. This removes all components and all program directory contents. Add test function to unit tests. Task-number: QTIFW-1574 Change-Id: Iccd4a052c7e2fc8eec0a6ae2b5a93c0c607604cb Reviewed-by: Leena Miettinen Reviewed-by: Katja Marttila --- src/libs/installer/packagemanagercore.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/libs/installer/packagemanagercore.cpp') diff --git a/src/libs/installer/packagemanagercore.cpp b/src/libs/installer/packagemanagercore.cpp index 55a143ceb..0a5eec513 100644 --- a/src/libs/installer/packagemanagercore.cpp +++ b/src/libs/installer/packagemanagercore.cpp @@ -2218,6 +2218,22 @@ bool PackageManagerCore::uninstallComponentsSilently(const QStringList& componen return false; } +/*! + Uninstalls all installed components without GUI and removes + the program directory. Returns \c true if components are + uninstalled successfully, otherwise returns \c false. +*/ +bool PackageManagerCore::removeInstallationSilently() +{ + if (d->runningProcessesFound()) + throw Error(tr("Running processes found.")); + + autoRejectMessageBoxes(); + + setCompleteUninstallation(true); + return run(); +} + /*! Installs the selected components \a components without displaying a user interface. Virtual components cannot be installed unless made visible with -- cgit v1.2.3