summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/utils.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix deprecated QCryptographichHash function callKatja Marttila2023-09-051-1/+1
| | | | | | | | | | Function QCryptographichHash::addData(const char *data, qsizetype length) has been deprecated since 6.x. Task-number: QTIFW-3077 Change-Id: I5c36d52d7e8fe4c1724072b33c1ff19e9f2fb846 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Adapt to differences between Qt5 and Qt6Christian Stenger2022-12-161-1/+1
| | | | | | Task-number: QTIFW-1829 Change-Id: Ieae92a7736784784bc548433eda8b073b1a4b8f8 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Fix clang and compiler warningsKatja Marttila2022-11-081-1/+1
| | | | | | | | Added const and reference to function names, removed unused variables etc. Change-Id: I5e3851c13ff3baf1884356198020fc86e69d69b4 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Replace QSettingsWrapper::Format with QSettings::FormatKatja Marttila2022-05-271-1/+1
| | | | | | | | | | 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>
* Gain admin rights when user is missing privilege to create symlinksArttu Tarkiainen2022-01-311-1/+97
| | | | | | | | | | | | | | | 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>
* Cppcheck: Fix local variable shadowing outer variableKatja Marttila2021-03-091-4/+4
| | | | | Change-Id: Idff9a40c5089b4de7b8afd1c280603601317beda Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Restructure logging utilitiesArttu Tarkiainen2021-02-041-171/+1
| | | | | | | | | | | | | | 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>
* CLI: Print extra archive information with higher verbosity levelArttu Tarkiainen2020-11-051-4/+47
| | | | | | | | | | 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>
* Expand the sanity check for mutually exclusive optionsArttu Tarkiainen2020-10-011-3/+18
| | | | | | Task-number: QTIFW-1744 Change-Id: I4a4fdcd2517028e05f9282c15a91a4fb83c24901 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Doc: Remove internal classes and structs from generated documentationArttu Tarkiainen2020-09-211-0/+18
| | | | | | | | | | 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: Reduce the amount of documentation warningsArttu Tarkiainen2020-09-211-2/+44
| | | | | | | | | | | | 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-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-3/+11
| | | | | | | | | 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>
* Refactor setting and checking of file permissionsArttu Tarkiainen2019-08-301-0/+3
| | | | | | | | | | | | | | | | | | | | | | | 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>
* Replace 0 with nullptrKatja Marttila2019-01-091-10/+10
| | | | | | | 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>
* | Factored QFile usage out of VerboseWriter::flush()Frerich Raabe2016-02-151-12/+31
| | | | | | | | | | | | | | | | | | | | | | This introduces a new 'VerboseWriterOutput' interface which can be reimplemented to perform writing the installation log file by different means. For now, there's just a standard QFile-based implementation. The plan is to use this facility for implementing log writing via RemoteFileEngine. Change-Id: I89d91a4c7a146401ca96f27b25c49558099c5bb7 Reviewed-by: Katja Marttila <katja.marttila@theqtcompany.com>
* | Factored flushing of VerboseWriter into dedicated methodFrerich Raabe2016-02-151-3/+14
|/ | | | | | | | | | | | | | This patch introduces a (yet unused) VerboseWriter::flush() method which can be used to explicitly trigger flushing the installation log. This permits clients to decide when to do the flushing instead of having to rely on the destructor being called. The destructor will call flush() if needed - whether flushing is needed is defined in terms of the 'perFileBuffer': if it's open, flushing is needed - otherwise, no flushing is needed. Change-Id: I17f1df96e5ddf3b6f613d647c28b90b6973c9393 Reviewed-by: Katja Marttila <katja.marttila@theqtcompany.com>
* 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>
* Unify handling of translationsKai Koehne2015-06-301-0/+19
| | | | | | | | | | | Mimic the logic implemented in installerbase/QTranslator::load() by - using QLocale().uiLanguages() - splitting up the locales into candidates (first en-US, then en ...) - implicitly assuming the default is English Task-number: QTIFW-390 Change-Id: I294288d5fc739ebf12c93a0e1a43d613b3834721 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>
* tr() -> translate()Niels Weber2014-12-121-1/+1
| | | | | Change-Id: I805926a241d31f3ae6846a7429b99af4f68169fe Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Move the function to utils and make use where possible.kh12014-11-061-0/+26
| | | | | | Change-Id: Ie4c97114a1f1874e239955a5d9634b1029f9c178 Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com> Reviewed-by: Niels Weber <niels.weber@digia.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>
* Simplify VerboseWriterKai Koehne2014-07-181-2/+2
| | | | | | | | | This class does not need to be a QObject. Also, rename 'setOutputStream' to more accurate 'setFileName'. Change-Id: Iefb5997bb1ee1d5c54fa9abbdd3ad81f5d9a49d8 Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
* Simplify loggingKai Koehne2014-07-181-40/+2
| | | | | | | | | | | | Let VerboseWriter solely handle logging to the destination file. qt_message_handler takes the role of logging to cout. This allows us to get rid of the twisted stream logic in utils.cpp, and furthermore let us get rid of the buggy debugstream. Change-Id: I5cf2e41b126a90025825a0d93f95b41d783ef22a Task-number: QTIFW-524 Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com> Reviewed-by: Niels Weber <niels.weber@digia.com>
* Cleanup, use what we have in QThread.kh12014-07-031-18/+6
| | | | | | Change-Id: I6efc3ef90f8797b71a795f62423eda96f61934e5 Reviewed-by: Niels Weber <niels.weber@digia.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Introduce new classes for client-server communication.kh12014-06-031-1/+50
| | | | | | | Still based on what we had already, though more separated. Change-Id: I4cce298003a4ffc2ebcec01fea1a07adfbfdf990 Reviewed-by: Tim Jenssen <tim.jenssen@digia.com> Reviewed-by: Niels Weber <niels.weber@digia.com>
* move the currentDateTime to the constructorTim Jenssen2014-01-221-2/+4
| | | | | | | | It was crashing on Qt5 because the currentDateTime uses QLocal::system Q_GLOBAL_STATIC which could be already deleted. Change-Id: I10ff1b02a72baccbe0acd2d0f54e187653abaa04 Reviewed-by: Niels Weber <niels.weber@digia.com>
* Use qt_windows.h.kh12014-01-071-5/+1
| | | | | | | Fixes NOMINMAX and mingw missing _WIN32_WINNT define. Change-Id: I28ea6f328b495033d484fa07181062dc92f0855f Reviewed-by: Niels Weber <niels.weber@digia.com>
* adding ConsumeOutputOperationTim Jenssen2013-06-031-0/+34
| | | | | | | | | | | - With that operation we can save the original qmake output, before the installer does the patching. So we can use the old values for modules patching if they will be installed later. - added a autotest which does that with the current used qmake Change-Id: Ie07d273bf64d1813b7af3374a0db35a9e1215503 Reviewed-by: Niels Weber <niels.weber@digia.com> Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
* Typos, style and language improvements.Niels Weber2013-02-071-1/+1
| | | | | Change-Id: Ibc7d4ea8319b48b908adad75aa3a43858667cdde Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
* Add 2013 to the copyright.Niels Weber2013-02-051-1/+1
| | | | | Change-Id: If64730ba7203d1a910a426c0d9c9a738ecfeff4b Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
* Fix InstallationLog.txt wrong line endings on windows.kh12013-01-311-1/+1
| | | | | | | Task-number: QTIFW-216 Change-Id: I0e0ed02f3f57e5f6be964356ac65980947dbaf79 Reviewed-by: Tim Jenssen <tim.jenssen@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>
* Finally IFW compiles with Qt5 (use private headers)kh12012-12-071-3/+0
| | | | | Change-Id: I2604c77418e4a930bd0f76092db581fef1e45817 Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
* Some changes to start compile with Qt5.kh12012-11-201-2/+2
| | | | | Change-Id: Ie6a3ba7b3c0b24fc292d0d7444ae920dfa866a54 Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
* Merge "buffered" calculateHash function and reuse.kh12012-10-011-3/+8
| | | | | Change-Id: I294038888bd47a139b8c3df68e298e66e5ec2202 Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
* Reorganize the tree, have better ifw.pri. Shadow build support.kh12012-03-191-0/+341
Change-Id: I01fb12537f863ed0744979973c7e4153889cc5cb Reviewed-by: Tim Jenssen <tim.jenssen@nokia.com>