summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/lib7z_facade.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Adapt to changes in QFlagsChristian Stenger2022-12-161-1/+1
| | | | | | Task-number: QTIFW-1829 Change-Id: I13c73f113a74c31dff44247d6931d2a93df40bab Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Add support for parallel extraction of component archivesArttu Tarkiainen2022-04-211-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+2
| | | | | | | | | | | | | | | 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>
* Fix qdoc warnings introduced by the archive handling changesArttu Tarkiainen2021-10-271-6/+12
| | | | | | Change-Id: I47d24c72317bed594b22b234be75d0359f2e2b98 Reviewed-by: Katja Marttila <katja.marttila@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Add support for handling archive files with libarchiveArttu Tarkiainen2021-09-141-96/+11
| | | | | | | | | | | | | | | | | | | | | | 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>
* Translations: validate and update translatable user interface stringsArttu Tarkiainen2021-06-231-2/+2
| | | | | | | Task-number: QTIFW-2245 Change-Id: Id9a79c7c572dc588c05ad37c67ae3f0431fa7cdb Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Provide missing documentation for functionsKatja Marttila2021-02-041-0/+6
| | | | | | Change-Id: I2fe4f6bfc6a31291900d0005550c419cf6582fac Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Doc: Misc fixes for Lib7z namespace documentationArttu Tarkiainen2021-02-041-5/+71
| | | | | | | | | | We are still missing quite a bit documentation for this namespace. Add documentation for symbols that could be easily documented and mark the rest as internal, at least for the time being. Otherwise the generated html docs contain stub sections for these symbols. Change-Id: I471873c8da5050f9fb3a4f033da71dcb0aff7b3c Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Doc: Show documentation for Lib7z namespace and PercentPrinter classLeena Miettinen2021-02-041-0/+6
| | | | | | | The docs were already there, just not displayed in the Manual Change-Id: I3bbc0718150ff792a0657140d1d8999f47667450 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Doc: Reduce the amount of documentation warningsArttu Tarkiainen2020-09-211-6/+6
| | | | | | | | | | | | Miscellaneous fixes to missing function documentation, undocumented parameters, namespace scope etc. As 5.12.7 based qdoc gives a lot more warnings about code missing documentation, mark undocumented implementation details with \internal command. Also some spelling fixes to related parts of documentation. Task-number: QTIFW-1483 Change-Id: Ibf5d1e5098713acbd152c5b61ea4f46cc11feb4b Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Doc: Fix documentation warningsTopi Reinio2020-09-161-3/+3
| | | | | | | | | 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>
* CLI: decrease the amount of default debug printsKatja Marttila2020-02-201-1/+1
| | | | | | | | | | 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-1/+2
| | | | | | | | 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>
* Documentation fixesKatja Marttila2019-12-171-5/+94
| | | | | Change-Id: Ibffb5470d374c8d612791f48c951deddd00f3121 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Replace 0 with nullptrKatja Marttila2019-01-091-8/+8
| | | | | | | Prevents a lot of warnings seen in QtCreator Change-Id: I63bf95aca68a04fc9fd0eecbe29c63e9b9c47efd Reviewed-by: Iikka Eklund <iikka.eklund@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>
| * Fix the exception message because missing a space.Takayuki ORITO2016-04-291-1/+1
| | | | | | | | | | | | | | Added space between 'convert' from 'path'. Change-Id: I25f4eedc7d322d29c8c93dd7dd80fc13232de0b7 Reviewed-by: Niels Weber <niels.weber@qt.io>
* | Doc: added namespace statement for lib7zNico Vertriest2016-01-281-1/+7
| | | | | | | | | | | | Change-Id: I0783917628f0f2608f20b00f90b6a68db7a86253 Task-number: QTBUG-43810 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@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>
* | Fix timezone issue, simply keep the UTC time.Karsten Heimrich2016-01-041-27/+5
| | | | | | | | | | | | | | | | | | | | Since we're the only user of the list archive function, do not convert from UTC. Though once we document the function it should be mentioned that the user needs to convert it (e.g. for display purposes etc...). Change-Id: Icbf8372ddff4f34e3c5a426b983ff25a117d74eb Reviewed-by: Katja Marttila <katja.marttila@theqtcompany.com>
* | Fixed compiling lib7z_facade.cpp with Visual Studio 2013Frerich Raabe2015-12-091-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit c43f3f0c683841f7b2bd62ce8c1556f2e5412d4d introduced a usage of localtime_s for non-MinGW Windows builds. Visual Studio 2013 complained about this, saying ..\..\..\..\source\src\libs\installer\lib7z_facade.cpp(331) : error C3861: 'localtime_s': identifier not found The MSDN explains that <time.h> should be included, so let's do that to make the build succeed. Change-Id: I8447ed0c97480485e4219f6e413b05d80be6ef63 Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* | Fixed running binarycreator if the temporary directory name contains spacesFrerich Raabe2015-12-081-14/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The binarycreator program fails to generate an archive if the temporary directory name contains spaces. This is not uncommon on Windows since the temporary directory is beneath the home directory, e.g. C:\Users\<username>\AppData\Local\Temp. If the user name contains spaces (as it does in my case, the user name is "Frerich Raabe") binarycreator fails with [64] Warning: QFile::remove: Empty or null file name (C:\Qt\MSVC12\5.5.0-src\qtbase\src\corelib\io\qfile.cpp:498, bool __thiscall QFile::remove(void)) Caught exception: Cannot create archive "C:\Users\Frerich": internal code: E_FAIL This was caused by createArchive() assembling a command line without escaping either the 'target' or any of the 'sources' values. Instead of adding escaping only to split the command line again, let's drop the approach of constructing a command and then splitting it completely. Instead, let's build an array of arguments right away. Change-Id: I284c1b5a27e9edd3717243ea7979149ab2033d64 Task-number: QTIFW-787 Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* | Fix violated assertion in error handling of binarycreatorFrerich Raabe2015-12-081-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The errorMessageFrom7zResult() function asserts (via a qFatal) that the given status code is indeed an error, i.e. not S_OK. However, the condition 'res != S_OK || !tempFile.exists()' permitted that the function is called with S_OK (in case !tempFile.exists() is true), violating an assertion. This patch adjusts the error handling such that the details of the error returned by errorMessageFrom7zResult() are only included in the exception message if the status code is not S_OK. Change-Id: I15d686cd35c918093ec90c56a7bcc3f0e6638cfb Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* | Fix broken daylight saving time check.Karsten Heimrich2015-11-231-0/+16
| | | | | | | | | | Change-Id: I9fd27cd014d3b1f13b176dc0d4e8af1a93c37ff5 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
* | Fix missing filename conversion on UNIX systems.Karsten Heimrich2015-06-251-0/+15
| | | | | | | | | | | | | | Task-number: QTIFW-643 Change-Id: If6df557d09b23dce99caed8f7b00dd726a6d42e6 Reviewed-by: Niels Weber <niels.weber@theqtcompany.com> Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | Unify translated error messagesKai Koehne2015-06-241-31/+36
| | | | | | | | | | | | | | | | | | | | | | | | * 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>
* | Cleanup time handling, some minor changes.Karsten Heimrich2015-06-231-45/+22
| | | | | | | | | | Change-Id: I830ff58673efe76c47dcb0c5839bf44bbd2f42a8 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | Fix usage of Lib7z::createArchive(), do not use static.Karsten Heimrich2015-06-161-1/+1
| | | | | | | | | | Change-Id: I749fefeafc924540a8c6119f669685895a69e07d Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
* | Implement option to pass compression level, update documentation.Karsten Heimrich2015-06-101-8/+11
| | | | | | | | | | Change-Id: Iaffbd0de5590131287f5e9414f13d3906b8b3d14 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | Split the huge header file in more dedicated ones.Karsten Heimrich2015-06-101-0/+4
| | | | | | | | | | Change-Id: I35a1500d5a9bb8986765488660cf0487c32d9720 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | Update source tree with version 9.38.beta of LZMA SDK.Karsten Heimrich2015-06-101-890/+613
| | | | | | | | | | | | | | | | | | | | - Remove unused files. - Split in .pri files. - Add HEADERS section. - Adjust lib7z_facade. Change-Id: I31e7bafbfe1a9346364bd58c391601955f98ad3a Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | Update documentation and adjust some code to match.Karsten Heimrich2015-06-091-15/+45
| | | | | | | | | | Change-Id: I3a8d9afb79628135051e4133bea9fc66e14a514a Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | Merge remote-tracking branch 'origin/2.0'Kai Koehne2015-06-041-6/+7
|\| | | | | | | | | | | | | Conflicts: src/libs/installer/packagemanagercore.cpp Change-Id: Ie3d94fe3a633e189c260bf20682c00a2bb901bc8
| * Fix archivegen recursive include of directories with filter.Karsten Heimrich2015-05-121-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Never pass recursive with true even if path is a directory, otherwise the path containing the file name part of the path is used as path to recurse and the actual file name is used as filter. For example: /path/to/doc -> Directory: /path/to -> Filter: doc Task-number: QTIFW-639 Change-Id: I60972eab0b34073b4c81a815ee83058df09d1eab Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
* | Coding style cleanup.Karsten Heimrich2015-06-031-123/+138
| | | | | | | | | | Change-Id: I5761d98c88df72915195f0e004e7d380e6403eb9 Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
* | Remove unused and unmaintained code.Karsten Heimrich2015-06-031-245/+1
| | | | | | | | | | Change-Id: Ieeac37893bf25279c5b0b7d3861eaec7caead120 Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
* | Merge remote-tracking branch 'origin/2.0'Kai Koehne2015-02-261-7/+7
|\| | | | | | | Change-Id: I962f4f19909c06e1da03c14072b15f97de02a07d
| * Update CopyrightKai Koehne2015-02-181-7/+7
| | | | | | | | | | Change-Id: I8dde6629cfd461104364d5cdc255cb54b58283fa Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
* | Fix messagesjkobus2015-02-111-4/+4
|/ | | | | | Change-Id: I3cfa75df0d4da9c818b3341b1a422f845a056ae0 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@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>
* Fix some std::cout usage.kh12014-09-051-2/+1
| | | | | | | Fixes missing timestamps and some propably wrong conversion. Change-Id: I6106e1ea61d0840d132dd3b44cd746f023e795af Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Calm down warnings.kh12014-07-091-7/+4
| | | | | | | | [-Wunused-private-field] and file has no symbols Change-Id: Ie9c9f53041711ee2ba42909fb88e0b9a8a8ebac9 Reviewed-by: Niels Weber <niels.weber@digia.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Don't use QObject::tr().kh12014-06-241-79/+103
| | | | | Change-Id: Icefbff9851a4e096a4b800adea7d17db756abe99 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Split out the file IO stuff and adjust other files respectively.kh12014-06-241-23/+24
| | | | | | | | | Also adjust the API to use QFileDevice instead of QIODevice to make clear we just operate on files here and not on any possible device like sockets, processes etc... Change-Id: I4ecbb6e244fe4bb666ed12e62f9f5586bc1347f0 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Replace auto_ptrKai Koehne2014-06-191-12/+12
| | | | | | | | auto_ptr is deprecated in C++11. Use QScopedPointer instead. Change-Id: I63fd4de0a6edb329046ed9433e295407d95a9f95 Reviewed-by: Niels Weber <niels.weber@digia.com> Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
* Implementation of time and date functions related to 7z.Niels Weber2013-05-301-10/+2
| | | | | | Change-Id: Icb706d829f8470d8cc3cc50925c99255cf5f2b26 Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com> Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
* disable getFileTimeFromProperty on Unix systemsTim Jenssen2013-05-221-0/+4
| | | | | | | - it is not working correctly at the moment and will be fixed later Change-Id: I0527410f09fbdff33e6851558482bf329ba80de6 Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
* Remove local filetime.Niels Weber2013-05-071-2/+6
| | | | | | | | | | | | This leads to time being wrong by a couple of hours depending on usage of local time vs UTC. This has been deemed acceptable for now. Also skip the test failing because of that difference. Needs to be re-enabled when all time functionality has been rewritten. Change-Id: I23d78371df65878d16e0e428c9fca9387e29a908 Reviewed-by: Kai Koehne <kai.koehne@digia.com> Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>