summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/packagemanagercore_p.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add possibility to move component in component treeKatja Marttila2021-02-111-1/+3
| | | | | | | | | | | | Setting <TreeName> -tag to component.xml will overwrite the default location of component in installer's tree view. This way we can define the component location without a complete repo build. Updates.xml can be directly modified by adding <TreeName> -tag for easy relocation of components. TreeName must be an unique name - it cannot conflict with existing tree name or name. Task-number: QTIFW-594 Change-Id: Ie69f90f1303d932369d566d0d7b4bc0e354505c6 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Try rerunning execute operationKatja Marttila2021-02-051-14/+14
| | | | | | | | | | | | | Execute operation can have hard coded paths to program which is executed. In case the program is relocated, UNDO operation will fail as it will not find the program. Implemented new XXXX_OLD value which can be used for overwriting the hardcoded value. In case the program execution fails, program is tried to launch again with the replaced value. Task-number: QTIFW-2125 Change-Id: I446a4c423e53cc4ffc6e5e25617d2400945ac3d9 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Restructure logging utilitiesArttu Tarkiainen2021-02-041-1/+2
| | | | | | | | | | | | | | Create a singleton-pattern class as an encapsulation unit for holding and altering the state of debug printing attributes. Move related code from various places under a single umbrella header file for logging utilities, with some minor stylistic changes & cleanup. This acts as a preparatory change for providing non-blocking headless CLI runs when there is no TTY attached - that will be fixed in a follow-up change. Change-Id: Ib7f72cf75362c3ea6713058e92eda997d6df55c3 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Save Execute operation with predefined variableKatja Marttila2021-02-031-2/+5
| | | | | | | | | | | When operations are saved to dat file, the variables are resolved making it impossible to change it afterwards. This change allows saving the Execute -operation variables unresolved. Variables are resolved runtime so those can be changed using e.g. script. Task-number: QTIFW-2124 Change-Id: I22a0502a5760234fc331aa931b8c66864e855e34 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Add support for generating offline installer from onlineArttu Tarkiainen2021-01-151-0/+212
| | | | | | Task-number: QTIFW-1945 Change-Id: Ic8a076a28385e99ad09cfbccd07c7012d6570639 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Introduce ForcedUpdate element for componentKatja Marttila2020-12-221-1/+3
| | | | | | | | | | | Setting ForcedUpdate for component will cause a mandatory update for component if it is installed. Component must be updated before any other component can be updated/installed/removed. Essential components are updated at the same time with ForcedUpdate. Task-number: QTIFW-1565 Change-Id: I6af07fba222371e8cd161d1fec65301450077d86 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Print package information in xml formatKatja Marttila2020-11-251-45/+0
| | | | | | | | | Also removed logging categories for package information, the full package information can be printed by increasing the verbosity level. Task-number: QTIFW-1950 Change-Id: I4bce019a63ba1fbf48e3bb0ca45511e42d4974c9 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Merge remote-tracking branch 'origin/4.0' into masterKatja Marttila2020-11-241-2/+15
|\ | | | | | | Change-Id: If5205ff6ef2c8989520e24d41595c04d5920d207
| * Add missing members to PackageManagerCorePrivate member initializer listArttu Tarkiainen2020-11-031-0/+8
| | | | | | | | | | | | | | | | | | | | The lesser called class constructor function was missing initialization for some of the fundamental data type member variables. This could cause weird behavior in autotests, where a PackageManagerCore object for "fake" installers is instantiated on multiple occasions. Change-Id: I4e65453e3125cb5b4b662314a593bb0232907478 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
| * CLI: Fix wrong warning text in command 'purge' for running processesArttu Tarkiainen2020-11-031-2/+7
| | | | | | | | | | | | Task-number: QTIFW-1996 Change-Id: Iaf9aa6bfd39d266ed052838e969881c168b4b2ed Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | Arrange licenses and filter duplicatesJarkko Lehtoranta2020-11-061-6/+16
| | | | | | | | | | | | | | | | | | | | | | - Add a "priority" attribute to the "License" element used in "package.xml" for arranging licenses by priority in the LicenseAgreementPage and in CLI. Priority >0 shows the license on top of others. - Arrange the licenses with the same priority alphabetically - Filter duplicate licenses from the LicenseAgreementPage and from CLI Change-Id: I1dcacdd417d2383b8dc18149e4de329fbf11cfe8 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* | CLI: Print extra archive information with higher verbosity levelArttu Tarkiainen2020-11-051-1/+1
|/ | | | | | | | | | Also rework verbosity level handling to use predefined and range constrained enumeration list values. Task-number: QTIFW-1998 Change-Id: Iaf15ca638411e6842d3d502c4d7ff11d28d06658 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Don't warn if maintenance tool cannot be deletedKatja Marttila2020-10-151-0/+2
| | | | | | | | | We have a deferred delete for maintenance tool as in Windows the running program cannot be deleted. Task-number: QTIFW-1979 Change-Id: I3bfd98dd1d476450b9b770c9b2f1c70810e67492 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* CLI: Add retry count limit for checking running processesArttu Tarkiainen2020-10-091-0/+7
| | | | | | Task-number: QTIFW-1974 Change-Id: I5f2c815a5fe64a2fc2d15e26ff8687b3929292d7 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* CLI: Give more meaningfull return value for installsKatja Marttila2020-09-251-1/+4
| | | | | | | | | | | | | | Instead of returning just true or false when running installer or maintenancetool, utilize the PackagemanagerCore status message. Added also a new status enum, EssentialUpdated, which is returned when calling command 'update' and only essential components are updated. Also fixed a bug when components could be installed even when there were an essential update available. Task-number: QTIFW-1969 Change-Id: I43826301656573b34e1338b49566d199bdcd7468 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* CLI: Prevent MT restart after MT is updatedKatja Marttila2020-09-231-1/+1
| | | | | | | | | | Command line instance does not launch properly without user interaction. In Windows, the maintenancetool was launched to the background without GUI and CLI, in Linux the CLI does not take user inputs. Task-number: QTIFW-1967 Change-Id: I5e6ebb40f7db37a70f8d0063cbe279f5cd26080b Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Change MT restart commandsKatja Marttila2020-09-231-1/+2
| | | | | | | | | 'updater' command option is deprecated, use predefined variable instead so code continues to work even if the command name changes. Change-Id: I99537bfd37dd55aeeff132b7c6ae04f9ea74d711 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Doc: Remove internal classes and structs from generated documentationArttu Tarkiainen2020-09-211-0/+6
| | | | | | | | | | After migration to using 5.12.7 based qdoc, the generated documentation contains also empty declarations for members of undocumented internal classes. Mark them internal as needed. Task-number: QTIFW-1483 Change-Id: Iad40e4efdd098f09a825ce1c8d0aafcc76bd83bf Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Doc: Fix documentation warningsTopi Reinio2020-09-161-1/+1
| | | | | | | | | These changes fix many of the documentation warnings when building with a recent version of (Clang-integrated) QDoc. Change-Id: I5714635a25707cd7ab7bec209fa043a95f0b9832 Reviewed-by: Katja Marttila <katja.marttila@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Add verbose levels and cleanup log categoriesKatja Marttila2020-08-241-8/+8
| | | | | | | | | Setting several verbose switches enables more logging and performs component checking. Also cleanup some logging categories and unify the rules. Task-number: QTIFW-1914 Change-Id: I9195f4bb02affaa87e66cf9023a3512e65e0645b Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* CLI: Ask user confirmation before performing installer actionsArttu Tarkiainen2020-08-211-6/+25
| | | | | | | | Also add new option --confirm-command to skip the interactive query. Task-number: QTIFW-1834 Change-Id: I1c63fd990431c792a523da7047637f54b193bee6 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Documentation fixesKatja Marttila2020-07-031-0/+44
| | | | | | | | Added missing documentation and fixed warnings. KDUpdate documentation not added in this commit. Change-Id: Idc0b167bed95b7ae4a46a350290fdb241aa94448 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Add function to get information if default install is performedKatja Marttila2020-06-251-0/+2
| | | | | | Task-number: QTIFW-1847 Change-Id: I737b9b527c25e089386f74038b57a83f3d7e2062 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Add possibility to select/deselect component from script using coreKatja Marttila2020-06-251-0/+8
| | | | | | | | | We might not have componentselection page visible, so we need a possibility to select/deselect components also using core. Task-number: QTIFW-1847 Change-Id: I85ccf0602144f843c15ef7c0818ba435d36bdac5 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Refactor maintenance tool writing conditionsArttu Tarkiainen2020-06-101-3/+30
| | | | | | | | | This change fixes a bug caused by a blocking runInstaller() call in PerformInstallationPage::entering() and also contains refactoring to related parts of code. Change-Id: Ic3309707c1f975a646937aa96fc407a3e5931359 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix const correctness for CLI license acceptance functionsArttu Tarkiainen2020-06-031-2/+2
| | | | | Change-Id: If3fdafc982c8f2180fc15529bba1bd408d9fbfee Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix CreateShortcut path when running updateKatja Marttila2020-05-281-1/+1
| | | | | | | | | | | CreateShortcut operation is written to dat file. When updating the component, the operation is already containing the correct start menu value, so adding the start menu path is needed only when running installer. Task-number: QTIFW-1816 Change-Id: I7f60b07b21217c59ff2f419c3e92478c82d42445 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Merge remote-tracking branch 'origin/3.2' into masterKatja Marttila2020-05-251-1/+1
|\ | | | | | | Change-Id: Icd1dbcfa7f6eef138aad5287a6dcdf7d061a7d70
| * Translation fixesKatja Marttila2020-05-201-1/+1
| | | | | | | | | | | | Task-number: QTIFW-1435 Change-Id: Ic3850754541775f76e86ed09e2dd36f036f5d67c Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | Fix interrupt() call from scriptKatja Marttila2020-05-151-4/+7
| | | | | | | | | | | | | | | | | | Installer can be interrupted with interrupt() call from script. The interrupt was not correctly handled causing the installer to continue install successfully. Change-Id: I6c211ef985cc1a06445249bde27cdff5678a8ed0 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | Remove unnecessary component calculationKatja Marttila2020-05-151-1/+0
| | | | | | | | | | | | | | | | At this point of the install, components are already calculated. Removed the call to avoid unnecessary signals to be sent. Change-Id: I90b8e99ce63b30e8829dce4837164a6c3a919516 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | Add possibility to accept licenses from CLIArttu Tarkiainen2020-04-281-1/+59
| | | | | | | | | | | | | | | | | | | | | | License agreements can be accepted automatically by using command line option --accept-licenses or interactively by answering queries with either "Accept", "Reject" or "Show" selections. Task-number: QTIFW-1742 Task-number: QTIFW-1745 Change-Id: Iff46b44f91faddb7f163b299994167ab16df68b3 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | Give meaningful default value to messagebox queriesKatja Marttila2020-04-161-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If error occurs in install phase, change the default button to be cancel/ignore etc. to avoid inifinite loop when installing with CLI. When using GUI, default button is highlighted but user can choose otherwise. When using CLI the default button is always chosen if user don't give option to overwrite the default button values from command line. Task-number: QTIFW-1737 Change-Id: I721636d5a23e22ad5eee73b84e250e90eb1a6004 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io> Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* | Fix shortcut creation when installing from CLIKatja Marttila2020-04-091-2/+16
| | | | | | | | | | | | | | | | | | | | | | Change default button from Retry to Cancel if operation fails to avoid infinite loop when running from command line interface. Added also unit tests for shortcut operation. Task-number: QTIFW-1666 QTIFW-1710 Change-Id: I171b6aecd9886acce0051b7082842f8f76b22046 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* | Initialize user arguments earlierKatja Marttila2020-04-081-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | User can give arguments from command line, for example AllUsers=true, which can affect to other core values. Initialize user arguments in core constructor so we an utilize the user given values when defining other core values. Added also unit test for overwriting core data values. Note that some values belong to QSettings such as MaintenanceToolName which cannot be overwritten. Task-number: QTIFW-576 QTIFW-1730 Change-Id: I82a05f9f4bc8498f4e0e2af407ba29f6dabbf030 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | Add function to allow additional processes to be runKatja Marttila2020-03-311-12/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Maintenancetool does not allow updating install if running processes are found from install directory. Only maintenancetool process was allowed, otherwise the install failed with query to shut down processes. This commit adds a function to extend the allowed processes to be run, this is mandatory when running tests as test executable lies in the install directory. Task-number: QTIFW-1019 Change-Id: I5422b0327e3f77edf3f9c88c74f40eff5cc8c830 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io> Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | Separate maintenance tool writing for testing purposeKatja Marttila2020-03-201-21/+3
| | | | | | | | | | | | | | | | | | Some unit tests wont work as installer wants to unpack maintenance tool from the installer. As unit tests are not normal installers we need to separate the maintenance unpacking when running tests. Change-Id: I5f2bb60e775a42d1b8dd6ee088ff4f2a694a7a09 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* | Merge remote-tracking branch 'origin/3.2' to masterKatja Marttila2020-03-161-0/+2
|\| | | | | | | Change-Id: Ia4cf718409ce431cce8d766865ecec506426afb9
| * Add command line option to disable checking of free space on target3.2.2-rcArttu Tarkiainen2020-02-271-0/+2
| | | | | | | | | | | | | | | | | | | | 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>
* | Add command line option to start the installer binary as uninstallerArttu Tarkiainen2020-03-021-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | CLI: decrease the amount of default debug printsKatja Marttila2020-02-201-28/+28
| | | | | | | | | | | | | | | | | | | | 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>
* | Use of QLoggingCategoryKatja Marttila2020-02-131-46/+60
| | | | | | | | | | | | | | | | 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>
* | Do not prompt admin query when command line interface is usedArttu Tarkiainen2020-02-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/3.1' into masterKatja Marttila2019-11-201-32/+13
|\| | | | | | | Change-Id: Icc077e3757b84b2367b2a7dd9c1e389f6845365b
| * Initialize 'EssentialUpdate found' -variableKatja Marttila2019-10-311-0/+2
| | | | | | | | | | | | | | | | This caused interesting install experiences as EssentialUpdate was handled although no such packages were found. Change-Id: I35bb3e1b76ed14d1e8a45cee085916b3689f0dd1 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
| * Refactor setting and checking of file permissionsArttu Tarkiainen2019-08-301-32/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | 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-0/+28
|/ | | | | | | | 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>
* Enable support for Qt 5.12 in installer frameworkArttu Tarkiainen2019-08-221-7/+10
| | | | | | | | | | | | | | | | | Workaround issues of IFW not being able to work on elevated mode caused by changes in qtbase, namely when initializing socket connection between remote installer client and server, and writing maintenance tool binary. Switch to using unbuffered mode for QFSFileEngine instances as buffered mode support has been dropped. Fix calls to QFile::copy() when running elevated installer process. Make minor modifications for unit tests to pass. Explicitly fail and return when performing CreateLocalRepositoryOperation on non-owned directory. Task-number: QTIFW-1312 Change-Id: I3db72547ee95c87d8c02d27e5b31c7b30e793431 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Update usage of Apple-related terminologyArttu Tarkiainen2019-08-161-10/+10
| | | | | | | | | | | 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>