summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/packagemanagercore.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
| * Add command line option to disable checking of free space on target3.2.2-rcArttu Tarkiainen2020-02-271-0/+103
| | | | | | | | | | | | | | | | | | | | Also move functionality to PackageManagerCore::checkAvailableSpace() for more convenient later usage, if we want to use this without starting the Wizard GUI. Task-number: QTIFW-1602 Change-Id: I4f2d3cc78bc542475fe9c51b9364b1b221098e4a Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | CLI: Add unit tests and more detailed debug info of local installed packagesKatja Marttila2020-03-131-1/+17
| | | | | | | | | | Change-Id: I37f0950686aeb303328d7e8137fc4c7cfe7e8840 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | Perform headless commands without GUI dependencyKatja Marttila2020-03-121-12/+26
| | | | | | | | | | | | Task-number: QTIFW-1633 Change-Id: I207cd152a471fddd51c152223460f8a9873f4382 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | Show progress in CLI when performing time consuming operationsArttu Tarkiainen2020-03-091-1/+5
| | | | | | | | | | | | | | | | | | | | Add a bottom scrolling progress indicator that is shown during meta job progresses and installation phase. Also add printing of messages previously shown only on the GUI Wizard's progress bar labels. Task-number: QTIFW-1625 Change-Id: Ic3f92a31c98e41686517f49bbe98fd81fe11d13f Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | Add command line option to start the installer binary as uninstallerArttu Tarkiainen2020-03-021-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add option "--uninstaller" to start the installer binary explicitly as uninstaller. This complements options "--updater" and "--manage-packages". Add convenience functions for setting and checking if the magic binary marker has been set by the user. Task-number: QTIFW-1639 Change-Id: Ie40ba9c56e09be079e309bca985b19a8a7bef7ef Reviewed-by: Iikka Eklund <iikka.eklund@qt.io> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | Add unit tests for CLI option installPackagesKatja Marttila2020-02-201-6/+6
| | | | | | | | | | | | | | Also remove extra space and quotation marks from print output Change-Id: I18eb3532ac79f407023e15ef7ebab78ca0a7f59e Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | CLI: decrease the amount of default debug printsKatja Marttila2020-02-201-3/+3
| | | | | | | | | | | | | | | | | | | | Debug prints can be suppressed or extended with logging rules. Make the default usage so that only relevant information will be shown to user, such as uninstall/install progress, server information, warning messages and package name, version and displayname. Change-Id: I09be754a36dd97530d75cdea3edb5fc77e67a856 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | Uninstall selected packages from command lineKatja Marttila2020-02-141-0/+57
| | | | | | | | | | | | | | | | | | | | Components can be uninstalled from CLI with --uninstallPackages package1,package2,... Replicates the same behavior as when removing from visual UI, so forced installation, virtual and components installed as autodependency cannot be uninstalled. Change-Id: Ibcd87b5ceb8e509c84c6944510c23e59b28dedb9 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | Add unit tests for CLI option listPackagesKatja Marttila2020-02-131-21/+21
| | | | | | | | | | | | | | | | | | Also remove extra space and quotation marks around printed component values. Task-number: QTIFW-1577 Change-Id: If2c81609e32ee40b81a70106b2e9bf8ac536c089 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | Use of QLoggingCategoryKatja Marttila2020-02-131-10/+12
| | | | | | | | | | | | | | | | The change enables easier filtering of log messages Change-Id: I769f7c163e20f34c37fa0fe2b0729867ffca5bcb Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io> Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | Fix bug in CLI updateComponentsKatja Marttila2020-02-131-0/+1
| | | | | | | | | | | | | | No updates were found as the update packages were not fetched Change-Id: Iaa245a5168c999780aa268c1af03c625e6053956 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | Fix CLI installPackagesKatja Marttila2020-02-131-1/+1
| | | | | | | | | | | | | | | | | | | | Installer decided incorrectly weather the package was already installed or not. Check from components isInstalled() instead of model check state as the model check state can be Checked if <Default> is true and the component is not installed. Change-Id: Id1469992a2d56d263f47a6a711dbb878129f545a Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | Do not prompt admin query when command line interface is usedArttu Tarkiainen2020-02-121-0/+21
| | | | | | | | | | | | | | | | | | | | | | If admin rights are needed, fail and require to install with sudo. This is how command line interfaces commonly behave. Add convenience functions for setting and checking if the installer is used from command line. Task-number: QTIFW-1598 Change-Id: Ib28d3be08254dade5d9b2d29da9232064f008eb4 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | Enable command line default components installationArttu Tarkiainen2020-02-031-0/+18
| | | | | | | | | | | | | | | | | | | | Add --installDefault option to install components that are set to be checked by default and their respective dependencies. Do not do anything if the component tree does not have anything checked by default. Task-number: QTIFW-1583 Change-Id: I3825c7e797b102a8d6a65ae0e57bfe82fafef5e9 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | Merge "Merge remote-tracking branch 'origin/3.2' into master"The Qt Project2020-01-171-2/+44
|\ \
| * | Merge remote-tracking branch 'origin/3.2' into masterKatja Marttila2020-01-161-2/+44
| |\| | | | | | | | | | Change-Id: Ie42b694119ecaa59c9df4aa0253663107ef0c68c
| | * Documentation fixesKatja Marttila2019-12-171-2/+48
| | | | | | | | | | | | | | | Change-Id: Ibffb5470d374c8d612791f48c951deddd00f3121 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* | | Remove obsolete sharedFlag() functionKatja Marttila2020-01-161-30/+0
|/ / | | | | | | | | | | | | | | sharedFlag is deprecated since 2.0.0 and it was no longer used, setValue should be used instead. Change-Id: I94ebcf90c422e719ccc853ad67db32840f806514 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* | Install selected packages from CLIKatja Marttila2019-12-041-0/+190
| | | | | | | | | | | | | | | | | | Also move targetDirWarning() from targetdirectorypage to packagemanager and move target directory check to checkTargetDir() function so that those are accessible also without UI. Change-Id: Ia38cc7e66bb542e6a60fea2c39cc3b80735564ef Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | Update selected components from command lineKatja Marttila2019-11-221-26/+22
| | | | | | | | | | | | | | | | | | Selected components can be updated with --updatePackages <package_id>. If essential components are found, only the essential components are updated. Change-Id: I0eb8a8f5ca855af16eabd5f888cd9a0d5e933d84 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | Merge remote-tracking branch 'origin/3.1' into masterKatja Marttila2019-11-201-5/+4
|\| | | | | | | Change-Id: Icc077e3757b84b2367b2a7dd9c1e389f6845365b
| * Refactor setting and checking of file permissionsArttu Tarkiainen2019-08-301-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create methods to explicitly set default file permissions on Unix platforms, use these on installer created files and installation target directory. Add unit test for introduced functions. Remove method introduced in 46aecc23b2983c807ff2232ae9cb9651b4d2fdc2 as the same effect is achieved more efficiently by ensuring target directory will be written with explicit permissions on initial installation. Unlike the removed method, this will also not break if an installed component contains owner non-writable directories. Further simplify PackageManagerCore::directoryWritable() introduced in 89f772f819178ee2502768c3d259d22ecb910fbe. Remove orphan unit test for removed PackageManagerCore::subdirectoriesWritable(). This does not change permissions of files and directories extracted for installed components. Task-number: QTIFW-1412 Change-Id: I59698c78aceef874b1f79482bff5a618b9a1b536 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | List available packages from command lineKatja Marttila2019-11-191-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | Available packages can be listed from command line with --listPackages <regexp>. All packages can be listed with --listPackages . . By default package id, name and version are listed in output. In case you want to see all the packet information use logging category --logging-rules ifw.package.*=true. See --help for more detailed information on how to use logging category. Change-Id: Ic0815d2274643e3fb3f0670ed9036fe765805c0e Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | Refactor code to functions which command line interface needsKatja Marttila2019-11-191-9/+1
| | | | | | | | | | | | | | | | These are needed in multiple places while implementing CLI so created common functions to avoid code repeat. Change-Id: I2b30bedf5de838211f48bd1669c59ff3a17f640e Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | List installed packages from command lineKatja Marttila2019-10-181-0/+11
|/ | | | | Change-Id: Ic8efe08be347f3a208e37458936f8316d66ca916 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Update usage of Apple-related terminologyArttu Tarkiainen2019-08-161-1/+1
| | | | | | | | | | | Replace deprecated Q_OS_OSX macro used in several places with the newer Q_OS_MACOS. Old style reference of Apple's desktop operating system name as "OS X" in documentation and files are also replaced with "macOS" where applicable. Task-number: QTIFW-1406 Change-Id: I0561d5e0d964917ac4fca0702d58a06b85d30e57 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix recalculation of components to install in MaintenanceToolArttu Tarkiainen2019-08-151-0/+8
| | | | | | | | | | | | | | | | In MaintenanceTool, navigating back and forth in "Update" and "Add or remove components" doesn't cause update in components to install and uninstall information. Without changing component model's state by checking/unchecking components the recalculating is not done and performing the opposite maintainer action causes unintended results. Make IFW recalculate components to install when leaving component selection page so InstallerCalculator and UninstallerCalculator's state is correct even without changing the component selection. Task-number: QTIFW-694 Change-Id: I89abd9a1952fe30d1e3ae4012e7a7bac68793a89 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Gain admin rights for writing MaintenanceTool config files if neededArttu Tarkiainen2019-06-141-5/+12
| | | | | | | | | | | | | | | | Running MaintenanceTool from an elevated directory didn't do proper checks for file writing rights when parsing Updates.xml from a repository, for example when a default repository contains actions inside <RepositoryUpdate> tags the MaintenanceTool couldn't write changes to the .ini file immediately. Make MaintenanceTool do proper rights checking when parsing Updates.xml. Create uniform methods for checking directory writing access as it is used on several occasions. Add tests for directory checking methods. Task-number: QTIFW-1363 Change-Id: I6d634ddbd59429e5b98af1d8010e70a71de40f69 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Documentation fixesKatja Marttila2019-05-271-2/+2
| | | | | Change-Id: Ibfb4fd033f8dae23b953f21ebcda40c8325577e1 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Maintenance Tool: Change text in Select Components view when selection of ↵Arttu Tarkiainen2019-05-021-3/+19
| | | | | | | | | components is not possible Task-number: QTIFW-1241 Change-Id: Ib3e67e26b5fd4cf856c4b95f7fe542484e4955ff Reviewed-by: Janne Anttila <janne.anttila@qt.io> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix essential updateKatja Marttila2019-02-191-3/+3
| | | | | | | | | | | | Essential components should be updated before any other component is updated/installed. This did not happen always as when one essential component was found and that did not have any updates, the search was stopped and normal install flow was continued. Fixed so that all essential components are checked if they contain update. Task-number: QTIFW-1299 Change-Id: I754c50f672dd5f13105c710522603e90799d61c5 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Replace 0 with nullptrKatja Marttila2019-01-091-5/+5
| | | | | | | Prevents a lot of warnings seen in QtCreator Change-Id: I63bf95aca68a04fc9fd0eecbe29c63e9b9c47efd Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Merge remote-tracking branch 'origin/3.0' into masterKatja Marttila2018-12-101-13/+8
|\ | | | | | | Change-Id: I73cb43e090c6ff34f1ceb774490d01818465e2e0
| * Remove 'Your install seems to be corrupted' messageboxKatja Marttila2018-11-061-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Messagebox is replaced with log. The critical messagebox is a bit harsh as you can continue using the installer despite of the 'corrupted install' message. 'Your install seems to be corrupted' can happen for number of reasons: the installer for some reason was not able to write the needed information to components.xml or maintenancetool.dat. Reason could be that the installer was forcely interrupted or crashed during write, or the files cannot be opened for write. 'Your install seems to be corrupted' occurs if components.xml contains an element which has no operations in maintenancetool.dat or vice versa. If you get an error "Critical: Operations missing from installed packages ("missing.package.name"), remove the package from components.xml to get rid of the log. Error: "Critical: Orphaned operations("package.name")" you can ignore Or you can install the package again if it is still found from repositories. Task-number: QTIFW-1003 Change-Id: I02c0a945ca3ce30ef4b0a80190d91638ab54c6bf Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
| * Do not reset core data values in restartKatja Marttila2018-10-161-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Do not reset core data values as that removes all data set using setValue() which are needed. Restart is called when pressing 'Restart' after maintenancetool finish page or when changing settings from Settings Dialog. Task-number QTIFW-504 Change-Id: I0713b0371811957b93623433d26f0b10e4c8fb12 Reviewed-by: Janne Anttila <janne.anttila@qt.io> Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* | Merge remote-tracking branch 'origin/3.0' into masterKatja Marttila2018-10-101-1/+4
|\| | | | | | | Change-Id: Ifaa114464151f5ed84ce47a3368c1521eb17a0be
| * Fix performOperation() documentationKatja Marttila2018-09-261-1/+4
| | | | | | | | | | | | | | | | Task-number: QTIFW-1034 Change-Id: I56164e3d5c355bd6a02f9a706b3f375d19d63afb Reviewed-by: Niels Weber <niels.weber@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | Add signal to inform about unstable componentsKatja Marttila2018-09-271-2/+4
| | | | | | | | | | | | Task-number: QTIFW-1197 Change-Id: If9d7941f4c7bfc478daa83dcd73dfa71c9163561 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | Enable usage of categorized repositoriesKatja Marttila2018-09-261-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change allows to categorize repositories in component selection page. Using categorized repositories will by default show only uncagetorized repository items in tree. Selecting one or several categories using checkbox will update the treeview to show all selected categorized repository content. Repository's metadata is fetched only after the category is selected. Categorized repositories can be defined in config.xml: <RepositoryCategories> <RemoteRepositories> <Displayname>category 1</Displayname> <Repository> <Url>(url)</Url></Repository> </RemoteReposiories> ... <RepositoryCategories Change-Id: I6eae9daee70b1afa322144d52c11f25d0b655ebf Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io> Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | Merge remote-tracking branch 'origin/3.0' into masterKatja Marttila2018-09-171-2/+1
|\| | | | | | | Change-Id: I77d539e079f3c7d61c4a965b222f4e02c35b1108
| * Fix admin query retryKatja Marttila2018-09-051-2/+1
| | | | | | | | | | | | Task-number: QTIFW-988 QTIFW-1173 Change-Id: Ie424f4dcb97236015d4287f1b73baee5ec8477b3 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | Allow install other components if sha mismatches in metadataKatja Marttila2018-06-041-0/+9
| | | | | | | | | | | | | | | | | | Expanding commit "Add attribute to mark parts of install tree unstable." This change will allow installing other components if some component has sha mismatch. Change-Id: I61202da95dc07ca3f1fe931cfe1fbbb053596f42 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | Fix select state for unstable componentsKatja Marttila2018-06-011-2/+4
| | | | | | | | | | | | | | | | | | | | In updater mode, unstable components needs to be unselected so that those won't be updated. In packagemanager mode, installed unstable components needs to be in checked state so that those won't be uninstalled. Change-Id: Ib3d16ae8c0eec4e07731a0082c02fd710ffdb9d6 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | Merge remote-tracking branch 'origin/3.0' into masterKatja Marttila2018-03-201-3/+4
|\| | | | | | | Change-Id: I601b783a9d2eed009737b2779803457949cbb014
| * Fix the maintenancetool that failing to elevate to adminTakayuki ORITO2018-03-141-3/+4
| | | | | | | | | | | | | | | | | | | | | | It fails to output logs in ~PackageManagerCore() when using '--checkupdates'. It is installed in 'C:\Program Files (x86)'(needs admin rights). Disable the admin query. Because it does not need the query for checking the updates. Change-Id: I8cbd5823287a23d52c2f1a7f1fae95979314e441 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | Merge remote-tracking branch 'origin/3.0' into masterKatja Marttila2018-02-081-0/+6
|\| | | | | | | Change-Id: I8d0c8b9faa9537b50e989ec264ed7bfe8d2e358b
| * Add documentation for the setValidatorForCustomPage() functionAndy Shaw2017-11-301-0/+6
| | | | | | | | | | | | Change-Id: Id2c52f8a7fa2abbd1ac9de49d597269cb9bed220 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | Add support dash (-) symbol in component nameKonstantin Podsvirov2017-12-051-11/+56
|/ | | | | | | | | | | | | | | | | | | Add colon (:) symbol as alternative separator beetwen component name and version to use dash (-) symbol in component name. For names with dash (-) symbol use colon (:) symbol as separator in dependencies between name and version, even if you do not specify a version. Requirement example: package-with-dash:>=1.2.3, stable:1.x, demo:v1.0-rc1, backward-compatibility:. Also add test 'tst_ComponentIdentifier' for check new feature. Task-number: QTIFW-948 Change-Id: I6340c8001dec369ed8d33fcc4a92c7bce660aec1 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix maintenance tool update with silentUpdateKatja Marttila2017-06-011-5/+23
| | | | | | | | | | | | Maintenance tool is an essential update. Essential updates should be installed before non-essential updates. This change forces essential updates to be installed first. The behavior is same as when updating with visible UI. Task-number: QTIFW-976 Change-Id: I360145821c4e2d1f3384efca641208acb9338d5e Reviewed-by: Antti Kokko <antti.kokko@qt.io> Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Fix install corrupt with silentInstallKatja Marttila2017-05-101-0/+15
| | | | | | | | | | | | | If there are updates available for a component that is executable and the executable is running, installer is unable to update the component and results to a corrupted install. Check that there are no processes running from the install tree and cancel update if there are any. The update is canceled if there are processes running even if the process does not get update. Task-number: QTIFW-969 Change-Id: I5614cdd21d8538ccf8b0d114d3616804fe367667 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>