summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/extractarchiveoperation_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Print uninstallation progress on archive level with normal verbosityArttu Tarkiainen2022-04-281-1/+3
| | | | | | | | | | | | | | 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>
* 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 support for parallel extraction of component archivesArttu Tarkiainen2022-04-211-94/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Gain admin rights when user is missing privilege to create symlinksArttu Tarkiainen2022-01-311-0/+37
| | | | | | | | | | | | | | | On Windows, the non-admin users cannot create symbolic links by default. Extracting archives containing symlinks would fail if the installer was no started as administrator. Catch the case and auto-elevate installer to extract such archives. Do not elevate installer if the current user has the privilege for symlink creation, or if the Developer mode is enabled, allowing unprivileged creation of symlinks. Task-number: QTIFW-2428 Change-Id: I0b6b1079daabb9727055dce8a9475c203d7e92b0 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Make 'override' specifier usage consistentArttu Tarkiainen2022-01-211-2/+2
| | | | | | | | | Add where missing. Replace occurrences of Q_DECL_OVERRIDE macro, building IFW requires a C++11 compatible compiler so the language specifier is preferred. Change-Id: Idb75e2813d26b9da85e03891f0ae9537c6524c56 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Add support for handling archive files with libarchiveArttu Tarkiainen2021-09-141-54/+82
| | | | | | | | | | | | | | | | | | | | | | libarchive is a multi-format archive and compression library written in C and licensed under the new BSD license. Usage of libarchive brings in support for additional archive formats (in addition to 7z) with the installer framework, like zip and tar, with several available compression methods like gzip, bzip2 and xz. libarchive will coexist as a supported archive format handler with the LZMA SDK currently used in the framework, which will continue to be used for handling the 7-Zip file format. This change introduces classes for handling archive operations using both libraries, removes most calls to the old Lib7z facade and migrates the code base to use the new handling methods. Task-number: QTIFW-2255 Change-Id: I8d77110ded503060495a3d6fdfdbc26281df9453 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix extracted files list formation in ExtractArchive operationArttu Tarkiainen2019-11-011-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | In ExtractArchive, the ConnectionType used to connect signal 'currentFileChanged' to slot 'fileFinished' was changed to Qt::AutoConnection in c8de51cadbc5855ca1e77d038d7f09bf60d059ee, rather than using Qt::DirectConnection explicitly. Now the connection type defaults to queued as the sender and receiver live on a different thread. This seems to cause an issue where the slot function is not invoked for every emitted 'currentFileChanged' signal before returning from ExtractArchiveOperation::performOperation(). This can happen randomly on some installer runs, leaving entries out from ExtractArchive's "files" list for some components. The list formation works fine with Qt::DirectConnection, however reverting to this behavior might be a bad practice as it leaves 'fileFinished' vulnerable to accidental calls from another thread if we change the behavior in the future. Rather move the extracted files list formation to ExtractArchiveOperation::Callback like we already do for backup files. Task-number: QTIFW-1239 Change-Id: I7dbe73abefe00814e8652432d8abdbcaa83e0bac Reviewed-by: Iikka Eklund <iikka.eklund@qt.io> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Merge remote-tracking branch 'origin/2.0'Katja Marttila2017-01-301-17/+12
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: Changelog dist/config/config.xml dist/packages/org.qtproject.ifw.binaries/meta/package.xml dist/packages/org.qtproject.ifw/meta/package.xml installerfw.pri src/libs/installer/lib7z_create.h src/libs/kdtools/kdgenericfactory.cpp src/libs/kdtools/kdgenericfactory.h src/libs/kdtools/kdupdaterapplication.cpp src/libs/kdtools/kdupdaterapplication.h src/libs/kdtools/kdupdaterupdatesourcesinfo.cpp src/libs/kdtools/kdupdaterupdatesourcesinfo.h src/libs/kdtools/localpackagehub.cpp src/libs/kdtools/localpackagehub.h src/libs/kdtools/updatefinder.cpp src/libs/kdtools/updatefinder.h tools/binarycreator/resources/mkdmg.sh Change-Id: Iab2513f549832d2e750e77131c673457ab265af4
| * License header update to GPL-EXCEPTKatja Marttila2017-01-261-17/+12
| | | | | | | | | | Change-Id: I6426c4e8f932cf26c6c638dec18d0c12e22972d1 Reviewed-by: Janne Anttila <janne.anttila@theqtcompany.com>
* | Merge remote-tracking branch 'origin/2.0'Iikka Eklund2016-01-201-4/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: installerfw.pri src/libs/kdtools/kdgenericfactory.cpp src/libs/kdtools/kdgenericfactory.h src/libs/kdtools/kdupdaterapplication.cpp src/libs/kdtools/kdupdaterapplication.h src/libs/kdtools/kdupdaterupdatesourcesinfo.cpp src/libs/kdtools/kdupdaterupdatesourcesinfo.h sync.profile Change-Id: Ifdc8b065f89b7e241bd3788ed79768e21888161f
| * Update license headersIikka Eklund2015-12-291-4/+3
| | | | | | | | | | | | | | | | | | Update existing license headers. LGPL -> LGPLv21. Update copyright year as well. Change-Id: Ie1d71f8c68186b8f625f409ddf94691f178093c9 Reviewed-by: Katja Marttila <katja.marttila@theqtcompany.com> Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
* | Cleanup. Prepare for proper rollback implementation.Karsten Heimrich2015-07-141-66/+73
| | | | | | | | | | Change-Id: I798702d86dccad2883d36355c5e98d1e698a18ab Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
* | Unify translated error messagesKai Koehne2015-06-241-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | * Enclose file paths in "" * Localize file paths with QDir::toNativeSeparators. * Make sure sentences end with a '.' * Append error details always by ':', e.g. tr("Failed to copy file '%1': %2").(...) * Use 'directory' instead of 'folder' everywhere Change-Id: Ie045f429f72ad5045c96537465c5fb9d2e99d250 Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* | Split the huge header file in more dedicated ones.Karsten Heimrich2015-06-101-0/+1
| | | | | | | | | | Change-Id: I35a1500d5a9bb8986765488660cf0487c32d9720 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | Remove unused and unmaintained code.Karsten Heimrich2015-06-031-0/+1
|/ | | | | Change-Id: Ieeac37893bf25279c5b0b7d3861eaec7caead120 Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
* Update CopyrightKai Koehne2015-02-181-7/+7
| | | | | Change-Id: I8dde6629cfd461104364d5cdc255cb54b58283fa Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
* Set objectName for QThreadKai Koehne2015-02-021-0/+1
| | | | | | | | The objectName of a QThread will be picked up and shown by debuggers. Change-Id: Iabd1006a228a73fff0a9a89bd3d8c1021bab6945 Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com> Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
* Add LGPLv3 as new licenseKai Koehne2014-10-161-14/+7
| | | | | | | Change-Id: I61158f956894e209dccf83744b4753774676099d Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com> Reviewed-by: Niels Weber <niels.weber@digia.com> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
* Connect extract operation to progress calculation.kh12013-10-091-5/+11
| | | | | | | | | | | | Ignore senders which are sending 100% more then once, got that from 7z lib at the extracting step. Task-number: QTIFW-11 Task-number: QTIFW-141 Change-Id: I7750f9e49d5705df91e6c79c7ee2b0530e156e84 Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com> Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
* Force updating of Essential components.kh12013-08-141-3/+5
| | | | | | | | | | | | Task-number: QTIFW-38 Task-number: QTIFW-155 This is necessary for correct functioning of the Maintenance Tool. Change-Id: I3844760bdd31abf547c660f82dda14a3da38c5da Reviewed-by: Niels Weber <niels.weber@digia.com> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com> Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
* fix error handling in 7z libTim Jenssen2013-04-191-6/+1
| | | | | | | | | | | | | | | | - remove an already existing symlink at extraction, because it uses QFile to get the io device and that would be the symlink target which was wrong. - try to get better 7z error output - an error would be now: "There was a problem while performing the operation: Error while extracting 'C:\Qt\qtcreator-2.7.0_test.7z': Cannot open file: D:/test/qtcreator-2.7.0_test/bin/sqldrivers/qsqlite4.dll (Access is denied.)" - move setPermissions to the end so read only files are getting the right timestamp Change-Id: I8881144660296618d443568e6974bf2721328991 Reviewed-by: Niels Weber <niels.weber@digia.com> Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
* Add 2013 to the copyright.Niels Weber2013-02-051-1/+1
| | | | | Change-Id: If64730ba7203d1a910a426c0d9c9a738ecfeff4b Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
* Change copyright headers from Nokia to DigiaSergio Ahumada2012-12-211-18/+27
| | | | | Change-Id: Id55a71a6ee24b234739b6066e11e9c1f2e389f73 Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
* use Q_OS instead of Q_WS definesTim Jenssen2012-04-241-1/+1
| | | | | Change-Id: I2bbc5b97b8aa9d3dbe77a3334c0182158c2db9c5 Reviewed-by: Karsten Heimrich <karsten.heimrich@nokia.com>
* Reorganize the tree, have better ifw.pri. Shadow build support.kh12012-03-191-0/+231
Change-Id: I01fb12537f863ed0744979973c7e4153889cc5cb Reviewed-by: Tim Jenssen <tim.jenssen@nokia.com>