summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/fileutils.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/4.4' into 4.5Arttu Tarkiainen2022-11-031-0/+1
|\ | | | | | | Change-Id: If99e84c5f6e6914f0d90770053ce6850e70ed403
| * Windows: fix installation error with concurrent Extract operationsArttu Tarkiainen2022-09-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Add persistent metadata file cacheArttu Tarkiainen2022-10-141-5/+5
|/ | | | | | | | | | | | | | | | | | | | | | | | | | Introduce GenericDataCache and Metadata classes for storing the fetched metadata files (Updates.xml and uncompressed files from the meta.7z archives) on local filesystem. The cache uses a checksum based dictionary to keep track of the cached metadata items, with the SHA1 sums of downloaded Updates.xml files being the keys to refer single metadata item. We still need to download all the Updates.xml files on each fetch to check if the cached metadata items are applicable for the current repositories. Update the Updates.xml files in auto-test data to have unique contents, otherwise there could be conflicts with identical test repositories, as the tests will also utilize the cache now. Also omit registering Repository type to the meta-object system in the class contructors, this is expensive as we construct objects from the class frequently, in the worst case hundreds of thousands times. PackageManagerCore already does the registering. Task-number: QTIFW-2621 Change-Id: Iee10ead68befd722ffe7f18ca48483d5a3666658 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* macOS: Create alias of maintenance tool to Applications directoryArttu Tarkiainen2022-05-051-0/+3
| | | | | | | | | | | | 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>
* Use of separators in Execute operationKatja Marttila2022-02-031-2/+2
| | | | | | | | | | | | | Execute -operation might be strict with the path separators. If wrong separators are used the Execute -operation might fail. Fixed so that Execute -operations paths are saved to dat file without converting to normalized separators. As the target dir is saved as @RELOCATABLE_PATH@ also for Execute -operation, check from the next available separator which separator should be used for operation. Task-number: QTIFW-2501 Change-Id: Ia9969bbe3177a6b2daab21c026df88d4e2ec2bb0 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Add support for generating offline installer from onlineArttu Tarkiainen2021-01-151-0/+5
| | | | | | Task-number: QTIFW-1945 Change-Id: Ic8a076a28385e99ad09cfbccd07c7012d6570639 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Add high dpi image support for Logo and ProductImagesKatja Marttila2020-12-211-0/+1
| | | | | | | Task-number: QTIFW-2061 Task-number: QTIFW-2060 Change-Id: Idaabb6a08f5e52aa7808de4b3ad541ae47dc4dd8 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Remove unused code blocks and functionsKatja Marttila2020-11-041-6/+1
| | | | | | | | Results analyzed using cppcheck tools. Also add Q_DECL_OVERRIDE to overwrited functions. Change-Id: Iab5eb43206af0050c1dd84efb7ed860ab9594496 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Doc: Reduce the amount of documentation warningsArttu Tarkiainen2020-09-211-14/+0
| | | | | | | | | | | | 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>
* Refactor setting and checking of file permissionsArttu Tarkiainen2019-08-301-0/+10
| | | | | | | | | | | | | | | | | | | | | | | 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>
* 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>
* | Make the installation relocatable (with some limitations).Karsten Heimrich2015-07-141-0/+2
|/ | | | | | | | | | | | | | | | | Replace the install path with a constant that's updated while loading the stored configuration and operation values. Dynamic variables now need to be set after reading the .ini file, cause there we store the values we found during installation. Makes an installation relocatable, though with some limitations: * Uninstaller entry might break on Windows * Start menu sortcuts might break on Windows * Everything else written to the system using full path Task-number: QTIFW-653 Change-Id: Ie3255299460d4ad7f18c88de9044c95db10d17ac Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* Update CopyrightKai Koehne2015-02-181-7/+7
| | | | | Change-Id: I8dde6629cfd461104364d5cdc255cb54b58283fa 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>
* Workaround for QFileInfo::isBundle().kh12014-07-041-0/+1
| | | | | | | | | | | | | | | For some reason the former code did not work anyore as expected, the issue seems to be in QFileInfo::isBundle or how we used it. To not depend on a possible fix in Qt, we now always resolve the path before we ask QFileInfo if it is a bundle. Fixes also the behavior change introduced in cead4555. On OSX, we get the .dat file passed that's inside the bundle, still we need to read the data from a .dat file that's located beside the app bundle... Change-Id: Idaa7adc6fbad6bd8e9ce90c383b34ea51fe40e8f Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Split out the file IO stuff and adjust other files respectively.kh12014-06-241-11/+0
| | | | | | | | | 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>
* Use QTemporaryDir instead of our homemade solution.kh12014-06-031-6/+0
| | | | | | Change-Id: Ia584a9b2f954df5c29a2f0aa5f12b201b2bfbcc4 Reviewed-by: Niels Weber <niels.weber@digia.com> Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
* Fix broken random name generation for temporary directories.kh12013-09-201-1/+1
| | | | | | | | | | | | Task-number: QTIFW-354 The function was correctly calculating the initial part of the name using QTemporaryFile, though the appended "meta" was not checked and could result in duplicated names later on. Change-Id: I00eeebbb01fbfcc5a626e4bdfe04013f8e520ed5 Reviewed-by: Niels Weber <niels.weber@digia.com> Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
* Properly calculate the file size for symlinks.kh12013-05-301-0/+3
| | | | | | | | Task-number: QTIFW-137 Change-Id: I8a39094228bbb82ff99adfa814cda79634f71274 Reviewed-by: Niels Weber <niels.weber@digia.com> 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>
* "Normalize" installation path on Windows installer.kh12013-02-041-0/+8
| | | | | | | | Task-number: QTIFW-175 Change-Id: I10ecc5830ff80f00a2aa67a2d9b66d9e37ac8ef0 Reviewed-by: Niels Weber <niels.weber@digia.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Change copyright headers from Nokia to DigiaSergio Ahumada2012-12-211-14/+29
| | | | | Change-Id: Id55a71a6ee24b234739b6066e11e9c1f2e389f73 Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
* Some changes to start compile with Qt5.kh12012-11-201-1/+1
| | | | | Change-Id: Ie6a3ba7b3c0b24fc292d0d7444ae920dfa866a54 Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
* introduce general humanReadableSize methodTim Jenssen2012-03-271-0/+2
| | | | | Change-Id: I4731be424cf2207e8cc2320ab9e442d02c29aeda Reviewed-by: Tim Jenssen <tim.jenssen@nokia.com>
* Reorganize the tree, have better ifw.pri. Shadow build support.kh12012-03-191-0/+114
Change-Id: I01fb12537f863ed0744979973c7e4153889cc5cb Reviewed-by: Tim Jenssen <tim.jenssen@nokia.com>