summaryrefslogtreecommitdiffstats
path: root/src/libs/installer
Commit message (Collapse)AuthorAgeFilesLines
* Fix installer stalling when there's only one CPU core4.4Arttu Tarkiainen2022-09-271-4/+6
| | | | | | | | | | | | | | | | | | | | The installer operations are run in the global QThreadPool. The Operation::performOperation() implementation from "QtPatch" operation would call the Component::operations() method, that filtered the returned operation list with QtConcurrent::blockingFilter(). This would lock the installer when the global thread pool object was initialized with maxThreadCount of 1, with the only QThread object from the global pool already running the calling Operation::performOperation() function, which is waiting the result of Component::operations(). Fix by omitting usage of QtConcurrent::blockingFilter() and populating the returned operation list with std::copy_if - the components have usually only a handful operations each so this shouldn't be too noticeable of a performance regression. Task-number: QTIFW-2786 Change-Id: Ia6be9f6697310d3f955a8199712c54f345407067 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix uninstallation of needed virtual componentsKatja Marttila2022-09-161-1/+2
| | | | | | | | | In some rare cases, both component to be uninstalled and component to be installed has dependency to same virtual component. In such case the virtual component should not be uninstalled. Change-Id: I3b826693d4a72d6765a5ac1ee9a3957fdf7415da Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Attach to squish only when the port is separately givenKatja Marttila2022-09-081-2/+2
| | | | | | | | | | Attaching to squish will trigger firewall questions in the installer. Changing the attach behavior so that by default no attach is done, and user can run the installer with --squish-port <number> if the attach is needed. Task-number: QTIFW-2746 Change-Id: I89f06a52b1ef95493e99084cb6080266b4eaf1dc Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Windows: fix installation error with concurrent Extract operationsArttu Tarkiainen2022-09-014-16/+50
| | | | | | | | | | | | | | | | | There was an issue with the Extract operations when using the same "targetDir" argument for multiple archives. The DirectoryGuard object creating the missing leading directories would occasionally run into a race condition when multiple threads competed with creating the directories. Fix by adding installer specific implementation similar to QDir::mkpath(), but which checks if the directory was created elsewhere at every directory level. Also convert an existing similar case with the Extract operation to use the new function. Task-number: QTIFW-2752 Change-Id: I4451e931309edb536294314b11c903189dacf2f0 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix typo resulting in accessing wrong operation result containerArttu Tarkiainen2022-09-011-1/+1
| | | | | | | Fortunately no reported issues yet that would have been caused by this. Change-Id: I0ee9cb368600f660eb7c048e8cf3df5d31e43b4f Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Uninstaller remove target directory if it is emptyYAMAMOTO Atsushi2022-08-251-7/+6
| | | | | | | | | | | When RemoveTargetDir flag is set false, then uninstall.vbs stops with error. Pass to script the correct arguments. And remove the target directory only if it is empty. Task-number: QTIFW-884 Change-Id: I722bfffbecaa6f7f27e545af354649bf17f7a0ae Reviewed-by: Tasuku Suzuki <tasuku.suzuki@signal-slot.co.jp> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* Uninstaller remove maintenancetool's data filesYAMAMOTO Atsushi2022-08-251-0/+8
| | | | | | | | | | maintenancetool create dat,ini,xml and txt files on installation. Remove these files on uninstallation. Task-number: QTIFW-884 Change-Id: I10a268678f1a4285f4a2fd6a749570f707f0dbc2 Reviewed-by: Tasuku Suzuki <tasuku.suzuki@signal-slot.co.jp> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* Uninstaller remove installerResources directoryYAMAMOTO Atsushi2022-08-251-0/+3
| | | | | | | | | | | | The installerResources directory is created with the ExtractArchiveOperation::performOperation() function. But it is not removed from anywhere. Remove it with the ExtractArchiveOperation::undoOperation. Task-number: QTIFW-884 Change-Id: I46e3e3676b5d276e0c0029943070c1eeb2a6e39e Reviewed-by: Tasuku Suzuki <tasuku.suzuki@signal-slot.co.jp> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* Do not convert newline characters in license filesYAMAMOTO Atsushi2022-08-191-1/+1
| | | | | | | | | Framework users expect license files to be copied as is. Task-number: QTIFW-903 Change-Id: I32e3a2a19c242049599407818fcd5e9abb33af0c Reviewed-by: Tasuku Suzuki <tasuku.suzuki@signal-slot.co.jp> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* Set encoding to UTF-8 when writing license fileYAMAMOTO Atsushi2022-08-191-0/+1
| | | | | | | | | License files are read in UTF-8 but written out in the system encoding. This will cause garbled characters. Task-number: QTIFW-1436 Change-Id: I52049d207499609a9cfc3e2a7059882067cc9256 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* Fix unnecessary QSet transformKatja Marttila2022-06-221-7/+3
| | | | | Change-Id: I67ebe6970a54fad9d8c5fcea91b726fb140d6dc3 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Fix bug when installer is not installing required componentsKatja Marttila2022-06-202-44/+73
| | | | | | | | | | | | | | | | | | | Components can be requested to install by several components using dependency. Components should have a reference count to inform how many components are requesting the install, so that the component can be removed from install when nobody has requested it, or user has not explicitly selected it for install. Dependency reference count was not calculated correctly, user selection was ignored if component was already added as dependency. Also if component which is added as dependency is also autodependency to same component should not increase the reference count, as the component is uninstalled when the reference count is zero. Having both autodependency and dependency would never cause the reference count to be zero. Task-number: QTIFW-2708 Change-Id: I398bc892f6626d76c872402d8ab55cb8115112ae Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Revert "Fix bug when installer is not installing all required components"Katja Marttila2022-06-201-6/+3
| | | | | | | | | This reverts commit 86b8f5f5a7e11e2121b5f1181c8a049b5562789a. Reason for revert: Wrong fix after all, we do check in realAppendToInstallComponents() whether the dependency component should be installed or not. This change messes the dependency reference count. Change-Id: Ia7bed84b303f13449edb80e486cf192b8872febc Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Fix bug when installer is not installing all required componentsKatja Marttila2022-06-171-3/+6
| | | | | | | | | | | | | | | Several components can have dependencies to a same component. We calculate the component only once, and increase the reference count to the dependent component to keep track when it needs to be removed from install when user clicks the install tree. The dependency component was removed from install despite of the reference count. Fixing the bug so that it is truly removed from install only when there are no references to it. Task-number: QTIFW-2708 Change-Id: Ieb45270183dc948d9c58271f2d43fccfa7fb8a9f Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Revert "Display progress for loading component install scripts"Katja Marttila2022-06-163-36/+7
| | | | | | | | | This reverts commit a6f2df9ebdb965d38ea2c263e3b3bea17c7abffe. Reason for revert: This should go to master as this requires a long localization round and we need to keep 4.4 branch available for quick fixes Change-Id: I4d4eb27a8f1d791666392ec3249254f6b516205e Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Display progress for loading component install scriptsArttu Tarkiainen2022-06-143-7/+36
| | | | | | | | | | Also process pending events for the main thread in the loop that calls Component::loadComponentScript() repeatedly, to not block the UI while busy loading the scripts. Task-number: QTIFW-2701 Change-Id: I4a1dd8e2441e21b5075b6fdffff8a47cd4bc7c80 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix installer crash if already installed virtual components are replacedKatja Marttila2022-06-061-1/+4
| | | | | | | | | | | | If installed component is replaced by another component, core 'categorizes' it under ComponentType::Replacement. By asking PackageManagerCore::componentByName(QString &name) excludes the replaced components. Fixed so that all 'categories' are used when searching the component by its name. Task-number: QTIFW-2672 Change-Id: I8b5528f7ddca777fe9b696c1d0151640730d1b9f Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* macOS: make creating maintenance tool alias optionalArttu Tarkiainen2022-06-032-8/+15
| | | | | | | | | | | | | | | | Currently the installer will create an alias file for maintenance tool with the name defaulting to the file name of maintenance tool, if the name is not explicitly declared in the installer's configuration file. This can cause issues with installers that use the same maintenance tool filename, as the alias would be overwritten on each install, and the default name does not tell which installation the alias is associated with. Make it so that the alias is only created if installer config specifies a name for the alias. Task-number: QTIFW-2665 Change-Id: I790ee376ec56cff16730189e513a194b8c610066 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Translations: fix duplicate source stringArttu Tarkiainen2022-06-031-1/+1
| | | | | Change-Id: I73e07ac8d4099df0c0a3bade4bc40cb1467fbbe2 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Translations: exclude leading and trailing newlines from source stringsArttu Tarkiainen2022-06-032-17/+26
| | | | | | | | | | | A follow-up for the translation update round for 4.4.0 release, fix the noted issue of some strings having strange formatting in the .ts files. This makes it less likely that the translated strings miss the newlines in cases where it matters to the text presentation. Change-Id: I0fc9c2c8014a6ffa30dc510701b7bfad72e8eb82 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix value query with settings formatKatja Marttila2022-05-302-3/+3
| | | | | | | | Script engine does not know how to evaluate QSettings Formats, use int instead and cast it to QSettings Format when used in c++ code. Change-Id: I5c66708aa09ceb5f9a747849a7a2ca72efdd7080 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* RemoteObject: require server reply for all client commandsArttu Tarkiainen2022-05-305-135/+205
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For classes supporting the remote-client-server protocol through inheritance of the QInstaller::RemoteObject class: when calling functions of return type void, the client process did not block and wait for the server process to finish execution of the corresponding function, only checking that the packet containing the function command and arguments was written to the socket. The server-side connection thread operates in a loop that tries to read a packet from the socket in each iteration, and process the contained command, with the condition that the socket is still in connected state. If the function calls requested by the commands take long time to execute and we destruct the client-side object, disconnecting the socket, the server thread could break out of the loop before handling all pending packets. This hasn't been a problem for non-void functions because the server will send a return value reply and the client would block until the sent packet was available. Fix by refactoring the server connection code to send a default reply for commands not requiring a real return value, and blocking the client until the reply can be read. Task-number: QTIFW-999 Change-Id: Ie1d0e118e6830a1049a2ad50cc80b54c967fcde6 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Windows: Allow asking installer value with different formatsKatja Marttila2022-05-276-9/+34
| | | | | | | | | | | | | | | | This change expands installer.value() -function allowing QSettings::Format setting when asking registry key. Windows 32bit registry keys on 64bit Windows and 64bit application can be accessed using QSettings::Registry32Format. Window 64bit registry keys on 64bit windows and 32bit application can be accessed using QSettings::Registy64Format. If no format is set, QSettings::NativeFormat is used. Task-number: QTIFW-2657 Change-Id: Ie30e31886526db5b9d72793d5883c11bd1910737 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Replace QSettingsWrapper::Format with QSettings::FormatKatja Marttila2022-05-2710-50/+43
| | | | | | | | | | This changes allows in follow-up commits to access windows registy with other than just NativeFormat. This is needed for 32-bit applications to access 64-bit registry and 64-bit application s to access 32-bit registry. Change-Id: I0b88f4eaa499e53e10162ae5343b95d06ddbfc27 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Workaround QSettings / QDateTime incompatibility with Qt 6 applicationsArttu Tarkiainen2022-05-172-10/+30
| | | | | | | | | | | | | | | | | This causes problems when installers created with IFW share config files with Qt 6 applications. If the config file contains keys with QDateTime values written by the other application, the installer and maintenance tool will segfault when attempting to sync the file, even if we do not overwrite the values. This is fixed to recent Qt 5 and 6 versions with the submitted patches to QTBUG-102334. But as this requires updating the baseline Qt version for both the Qt IFW and the Qt 6 application, apply the workaround suggested in the issue comments, to avoid the crash in meantime. Task-number: QTIFW-2610 Change-Id: I968e293324775dc650315e223f549a81657a27a3 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Swap priority of remote and binary resource package sourcesArttu Tarkiainen2022-05-171-3/+3
| | | | | | | | | | | | | | | | | | | | When a component with the same name and equal version is available from both remote repository and installer binary, it makes more sense to use the installer resource as the package source for the component. This also fixes the issue of erroneously registering duplicate archives to a single resource collection. Because both the internal resources and downloaded archives are registered in the same naming scheme of "installer://<component>/<version><archive>", we would register the same archive second time when using the remote source. If the packager has not explicitly added Extract operations for the component, these would be created automatically by looking for archive entries from the component's resource collection, and so the same operation would be added twice. Task-number: QTIFW-2242 Change-Id: I82d4ed8a94a67d982b016bf7cec972e43bef8f03 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix calculating autodependencies for install/uninstallKatja Marttila2022-05-175-13/+53
| | | | | | | | | | | Autodependencies can be added also from script. The uninstaller and installer calculators ignored the values set from script depending on at what state of the script run the autodependencies were added. Fixed so that at any point the autodependencies are added from script, the installer and uninstaller calculators has correct values. Change-Id: If993bcce72f889b51e4b981473540c4e1ccd6067 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Do not install new dependencies for installed componentsKatja Marttila2022-05-1610-17/+55
| | | | | | | | | | | | | | | | If component is updated to repository, and new dependencies are added, the dependencies should be installed only when fresh install to component is made or the component is updated. This change adds a new LocalDependencies value to component. It keeps track of the dependencies the local installed packages has. Fixes also a bug in uninstallecalculator, where we should also read the dependencies from local installed packages instead of newly introduced repositories. Task-number: QTIFW-2624 Change-Id: I0557e5adf1e87c0a1238cc455cfb2c90f6b05c87 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Fix updating autodependency componentsKatja Marttila2022-05-136-8/+24
| | | | | | | | | | | Autodependency components were always forcely updated, even if 'Deselect All' was selected in component selection page. Fixed so that the autodependency component update is updated only when one of its dependants is updated. Task-number: QTIFW-2595 Change-Id: I05ececc45ef32ff80d53b008f839b358158a3316 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Save sorting priority of components to local package hubArttu Tarkiainen2022-05-133-0/+3
| | | | | | | | | | Before this change, components that declared explicit SortingPriority value would be sorted incorrectly with the default sorting value if the repositories were not available after installation. Task-number: QTIFW-2631 Change-Id: I3d18d6c6a5444eb3d2d700f12ed61da72431b8a4 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Add more generic trace messages for concurrent operationsArttu Tarkiainen2022-05-098-61/+293
| | | | | | | | | This makes the output more consistent between operations in Unpack and Install phase and removes the need to hard code some print to the operation side. Change-Id: Ia955f479cb138fcf0ffd6a73a06de6a74df6ed13 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Do not recalculate local installed componentsKatja Marttila2022-05-067-35/+34
| | | | | | | | | | | | | | | | No need to recalculate local installed components if no changes has been made. This makes the component selection quicker if there are lots of components to be installed. Local components are already calculated and listed in LocalPackageHub. Using this class directly instead of calculating own local component hash table. This changes the localInstalledPackages() from QHash to QMap, which is not as optimized for searching components, but overall performance is still now way better. Task-number: QTIFW-2522 Change-Id: I8c16060f4b4014f740be0c7c43ece5e659d92987 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Remove unnecessary unstable calculationKatja Marttila2022-05-052-20/+13
| | | | | | | | | | | | Removed unnecessary dependency component calculation for unstable components. We mark the dependee components unstable already in setUnstable() -function where we mark the original component unstable. This change speeds up building the component tree from zero to fifty percent depending on the number of script all components have. Task-number: QTIFW-2626 Change-Id: I11b35cfd981cea8b8ed958a5af51b695cc47e9c5 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Doc: fix wrong qdoc commands for parametersArttu Tarkiainen2022-05-051-1/+1
| | | | | Change-Id: I9089e814426e177d5af38d19363cdd97189fa0d3 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Do not emit dataChanged when model check state changesKatja Marttila2022-05-051-15/+6
| | | | | | | | | | | | | | Single items check state is not tracked anywhere else but in the model, so we do not need to send dataChanged -signal to every item when the model check state changes. The correct check state is already set to every item above, so this emit seems unnecessary. This has significant effect on 'Select All', 'Deselect All' and 'Default' -buttons. If there are hundreds of items in the tree, this speeds up the button press in best case over 50 percent. Task-number: QTIFW-2623 Change-Id: If3c2aaebcc0dd6619179c31a51c8a57fdcec5c66 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* macOS: Create alias of maintenance tool to Applications directoryArttu Tarkiainen2022-05-057-4/+159
| | | | | | | | | | | | This makes maintenance tool startable from Launchpad and Spotlight search. Add "MaintenanceToolAlias" configuration variable for setting the name of the alias, which may differ from the actual file name in installation directory. Task-number: QTIFW-2535 Task-number: QTIFW-2478 Change-Id: I73ae5bbf5d0196b2512b5517cb02c391b2ab278c Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix "Can't unlink already-existing object" errors on extractArttu Tarkiainen2022-05-041-4/+10
| | | | | | | | | | | | | | | | | | | | | | On Windows, extracting archives containing same files and directories would sometimes cause "Can't unlink already-existing object: Permission denied" error when replacing existing files. This was caused by releasing the FileGuard lock object for the archive entry without ensuring the entry was closed. Normally libarchive clients do not need to care about this, as the entry is closed automatically by archive_write_header() and archive_write_close() as required, but in our case there is a need access synchronization because archives can extract entries with the same entry paths in parallel. Fix by calling archive_write_finish_entry() before releasing the lock, so that no file handles are left open and no file attribute changes are left pending for the implicit closing on writing the next entry header. Task-number: QTIFW-2620 Change-Id: I7e7322927964296c3b32ef4a052a91f1ba29aac3 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Add documentation for typedefs AutoDependencyHash and DependencyHashKatja Marttila2022-05-025-11/+26
| | | | | | | | Also use the typedefs in the code when possible. Change-Id: Ie5aa55997051afc864de87d58a10db1c33312ff2 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* AspectRatioLabel: center the pixmap by defaultArttu Tarkiainen2022-04-291-0/+1
| | | | | | | | This looks better when the pixmap cannot be scaled to the entire viewport because of its aspect ratio. Change-Id: I5826412124363ab38cb07dcc35ff5387e8baa380 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Speed up component selection in component selection pagesKatja Marttila2022-04-2813-234/+491
| | | | | | | | | | | | | | | | | If a lot of components are installed, maintenancetool was slow to select/unselect a single component. This was caused because the whole tree's components were recalculated. Fixed so that only the selected/unselected components and their dependencies and autodependencies are recalculated instead of whole tree. This change speeds up clicking tree item from zero to 90 percent, depending on how much components are already installed. The more components are installed as autodependency, the slower it gets to select the items. Task-number: QTIFW-2522 Change-Id: I5e824aed8787fd7ecdce72b15a1b13848f0a3923 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Print uninstallation progress on archive level with normal verbosityArttu Tarkiainen2022-04-282-1/+6
| | | | | | | | | | | | | | Don't print the name of every single removed file and directory unless the verbosity level is set to detailed, as this really chokes the UI thread. QPlainTextEdit would have had better performance for a real-time output log widget than QTextEdit, but we cannot use it as we require support for displaying and automatically aligning text also for RTL languages. Task-number: QTIFW-2615 Change-Id: Ie2938941b32bb387c0528b894cd058f395561814 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Use fixed width font for the license text browserArttu Tarkiainen2022-04-281-0/+2
| | | | | | | | | Some licenses use ASCII art to display tables, etc. which requires that the font is of fixed width. Task-number: QTIFW-2613 Change-Id: I0f473e6320912702c5df01d99a573ee820da3c1b Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Don't print warnings for backup operations when installer is canceledArttu Tarkiainen2022-04-281-0/+3
| | | | | | | | | Before this change we would print a warning for each operation when iterating over the results of their asynchronous execution. These are unnecessary as canceling is a conscious action from the user. Change-Id: I2b9bd469b3a3e1c9794c6f2c4952896640cd88da Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* libarchive: add more descriptive error messagesArttu Tarkiainen2022-04-281-36/+70
| | | | | | | | Some of the error paths, especially when packaging archives, gave too vague information about what went wrong. Change-Id: I04388a6d333533fb370a472fa82d9562b17df37e Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix rollback of extract when archive lists file entries firstArttu Tarkiainen2022-04-211-2/+22
| | | | | | | | | | | | | | | | | At least with the 7z format packaged with a recent archivegen version, the directory entries from archives get processed last when extracting. We remember the path of each extracted entry in the order the writing happens, to be able to undo the extract later. The directories need to be empty for the removing to succeed, so we cannot rely that the entry order from extraction is correct. Ensure files are removed before directories and that the directories are removed in an order starting from the deepest subdirectory level. Task-number: QTIFW-2594 Change-Id: I8a914c4bf69147b845b12f0481c49c93408b51fd Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Add option for specifying maximum concurrent unpack operationsArttu Tarkiainen2022-04-217-3/+61
| | | | | | | | | | For tracing issues with the multithreaded extraction and limiting the processor load from the installer. Task-number: QTIFW-2586 Change-Id: I5df0bf6be30b4ee5ef8470c407281e2a4318ed0c Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Show additional progress information on PerformInstallationPageArttu Tarkiainen2022-04-219-32/+87
| | | | | | | | | | | | In a similar fashion to the archive download status, display: * Performed operations - total operations, on unpack. * Installed components - total components, on install. * Rolled back operations - total undo operations, on uninstall. Task-number: QTIFW-2513 Change-Id: I61690a25afadd1ca1e4a46b5b980ac094429135b Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Use archive sizes for sorting and calculating progress of Extract opsArttu Tarkiainen2022-04-213-3/+40
| | | | | | | | | | | | | | | | This makes the progress appear smoother when the archives to extract differ in size. The sorting based on the archive sizes provides some improvement to optimal thread utilization, as the larger archives get more time to complete from the start. We are less likely to find ourselves in a situation where any of the last operations left to be run with less than ideal thread count take significantly more time to complete than the others. Task-number: QTIFW-2431 Change-Id: I2534b6f18997d73c4ce1fb8b26900e30e1c6a76f Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Add support for parallel extraction of component archivesArttu Tarkiainen2022-04-2123-183/+804
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce ConcurrentOperationRunner class used for running installer operations concurrently in the global thread pool. Add execution groups for operations; Unpack operations are run concurrently for all components requesting installation, operations belonging to Install group are run sequentially for sorted components one at a time as before. From the default registered operations the Extract op is moved to Unpack group. Move the previously on-the-fly backup steps of Extract operation to the ExtractArchiveOperation::backup(), so that backups are done before any archives are extracted, and that we know if any of the archives requires administrator privileges to unpack. Reparent QInstaller::Error to QException to support throwing and catching exceptions across thread boundaries. Use RAII for the server-side objects of the classes supporting the remote client-server protocol of installer framework. The concurrent extraction revealed that it was still possible that the local socket was disconnected and thus the RemoteServer- Connection thread finished before receiving and processing the final "Destroy" command packet, leaking the dynamically allocated objects. Task-number: QTIFW-2566 Change-Id: Ib8c2928b9405b7b3465c731018df73acb51e949f Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Speed up Next button click in tree viewKatja Marttila2022-04-212-4/+3
| | | | | | | | | | | | | Components were recalculated when leaving the tree view. This is unnecessary as we have just calculated the components. Moving the recalculation to Introduction page so alternate pressing of 'Add or remove components' and 'Update components' will cause the recalculation as we need that to keep the component install states in sync. Task-number: QTIFW-2598 Task-number: QTIFW-694 Change-Id: Ia84a01b4f1d0b39b4844c02470b764c4940e943c Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>