summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* CLI: Fix offline installer creation with empty component meta-archiveArttu Tarkiainen2021-03-236-0/+25
| | | | | | | Task-number: QTIFW-2189 Change-Id: Ic6f56156194039cca7bebf095fad8c1fc66fc275 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Add unit tests for offline generationArttu Tarkiainen2021-02-1626-15/+321
| | | | | | | | | | | | This also changes some of the return values in our CLI-related functions in PackageManagerCore class to better catch cases where we exit without failing but also without doing anything. Also adapt existing tests. Task-number: QTIFW-2028 Change-Id: I73c4ca1b20d439773d0e290195f137d0d7369d17 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Add possibility to move component in component treeKatja Marttila2021-02-1138-15/+369
| | | | | | | | | | | | Setting <TreeName> -tag to component.xml will overwrite the default location of component in installer's tree view. This way we can define the component location without a complete repo build. Updates.xml can be directly modified by adding <TreeName> -tag for easy relocation of components. TreeName must be an unique name - it cannot conflict with existing tree name or name. Task-number: QTIFW-594 Change-Id: Ie69f90f1303d932369d566d0d7b4bc0e354505c6 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Try rerunning execute operationKatja Marttila2021-02-053-1/+77
| | | | | | | | | | | | | Execute operation can have hard coded paths to program which is executed. In case the program is relocated, UNDO operation will fail as it will not find the program. Implemented new XXXX_OLD value which can be used for overwriting the hardcoded value. In case the program execution fails, program is tried to launch again with the replaced value. Task-number: QTIFW-2125 Change-Id: I446a4c423e53cc4ffc6e5e25617d2400945ac3d9 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Add support for setting minimum wizard dimensions in config.xmlArttu Tarkiainen2021-02-045-0/+14
| | | | | | | Task-number: QTIFW-1903 Change-Id: I4d8eaf71a1a63dfbfa75ea61af728fa1f5e3e9f3 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix InstallIcons and CreateDesktopEntry operations usage as rootArttu Tarkiainen2021-01-152-0/+4
| | | | | | | | | | | | | | | | | | | | The operations write the output files to a valid, writable directory value of XDG_DATA_HOME variable if set, otherwise defaulting to "$HOME/.local/share". This follows the XDG Base Directory Specification but misses the use case of system-wide installation: the XDG_DATA_HOME should only contain base directory relative to which user specific data files should be stored. Prefer a predefined value "/usr/local/share" when launced as root or the internal elevated admin rights handling is active. This should be a sane and well known value for applications installed system-wide, and should not conflict with files extracted by distribution's package management system. Task-number: QTIFW-2093 Change-Id: I96fab3367122e7df783697e07baeb71dfd9b3f0e Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Add support for generating offline installer from onlineArttu Tarkiainen2021-01-151-4/+4
| | | | | | Task-number: QTIFW-1945 Change-Id: Ic8a076a28385e99ad09cfbccd07c7012d6570639 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Allow disabling undo in RegisterFileType operation during uninstallKatja Marttila2020-12-301-0/+24
| | | | | | Task-number: QTIFW-2089 Change-Id: I8cccd471718eaaa6dc167a852b8854dc424f994e Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Allow disabling undo in SimpleMoveFile operation during uninstallKatja Marttila2020-12-301-16/+44
| | | | | | Task-number: QTIFW-2090 Change-Id: If0c2d4901ee1fb634e1e436ab14a507d06dd99ab Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Allow disabling undo in CopyDirectory during uninstallKatja Marttila2020-12-301-9/+34
| | | | | | Task-number: QTIFW-2088 Change-Id: Ic5e781b89b1c74fc8f65575bd46c073610545523 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Allow disabling undo of GlobalSettings during uninstallKatja Marttila2020-12-303-1/+107
| | | | | | Task-number: QTIFW-1973 Change-Id: I89f15c8ed7d56c3e1bc72d3c740e9054363f9390 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Introduce ForcedUpdate element for componentKatja Marttila2020-12-227-4/+50
| | | | | | | | | | | Setting ForcedUpdate for component will cause a mandatory update for component if it is installed. Component must be updated before any other component can be updated/installed/removed. Essential components are updated at the same time with ForcedUpdate. Task-number: QTIFW-1565 Change-Id: I6af07fba222371e8cd161d1fec65301450077d86 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Add option to define operations in component.xmlKatja Marttila2020-12-0745-241/+642
| | | | | | | | | | | Operations can from now on be declared also in component.xml. The operations are performed, backuped and rollbacked the same way as they would be when defined from scripting api. Task-number: QTIFW-507 Change-Id: Ia509219b94737136c3de25db0cb0c72076b48380 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Tools: refactor to move general purpose functionality to installer libArttu Tarkiainen2020-12-021-1/+0
| | | | | | | | | This makes it possible to utilize parts of our existing tooling in the offline installer from online installer generation process. Task-number: QTIFW-2048 Change-Id: I7ee605be75541cc83a3b6909089bda45f0835bcf Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Print package information in xml formatKatja Marttila2020-11-251-22/+38
| | | | | | | | | Also removed logging categories for package information, the full package information can be printed by increasing the verbosity level. Task-number: QTIFW-1950 Change-Id: I4bce019a63ba1fbf48e3bb0ca45511e42d4974c9 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Merge remote-tracking branch 'origin/4.0' into masterKatja Marttila2020-11-2426-47/+81
|\ | | | | | | Change-Id: If5205ff6ef2c8989520e24d41595c04d5920d207
| * Repogen: Fix unite metadata when --repository switch usedKatja Marttila2020-11-1023-40/+67
| | | | | | | | | | | | | | | | | | | | United metadata 7z was missing the component which had no update available. Task-number: QTIFW-2018 Change-Id: I069fd852499f157075bf28e3ccfef3e42e5f30a9 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io> Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
| * CLI: Tidy up progress message printArttu Tarkiainen2020-11-051-4/+4
| | | | | | | | | | | | | | | | The debug print does not look very nice when the string contains escape characters for quotes or extra spaces. Change-Id: I9428d3aef4e3ebd693f66083447430e4e2600098 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
| * Fix loading controller script with comment on last lineMartin Kampas2020-11-041-0/+2
| | | | | | | | | | | | | | Task-number: QTIFW-1062 Change-Id: I3deb46cae74d1e5851d4ddd4b58c0ba19375ddbd Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
| * CLI: Fix wrong warning text in command 'purge' for running processesArttu Tarkiainen2020-11-031-3/+8
| | | | | | | | | | | | Task-number: QTIFW-1996 Change-Id: Iaf9aa6bfd39d266ed052838e969881c168b4b2ed Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | Automatically uninstall unneeded virtual componentsMartin Kampas2020-11-045-2/+27
| | | | | | | | | | | | Change-Id: Ifbbfec4449a9f5b0a79269fc7ddfcc1780e762e5 Task-number: QTBUG-76210 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | CLI: Add possibility to filter installed packages with regexpArttu Tarkiainen2020-11-041-0/+4
| | | | | | | | | | | | Task-number: QTIFW-1953 Change-Id: Ie291e8ae96d46082e342e9bcb152258862813afd Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | Replace obsolete qrand() with QRandomGeneratorKatja Marttila2020-11-042-2/+4
|/ | | | | Change-Id: Ie61b192bcf047cc70f728ea15370ff50e7a41769 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Fix segfault in 'void localSocket()' test functionArttu Tarkiainen2020-10-161-33/+31
| | | | | Change-Id: Iced229d7d364f68599bd6eec20db57838f36a671 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix packagemanagercore test in macosKatja Marttila2020-10-162-2/+6
| | | | | Change-Id: I67178a9df34e3ed4752452dca9a85709fdd4c620 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Repogen: Fix options to work with unite metadataKatja Marttila2020-10-1537-1/+690
| | | | | | | | | | | | | | Fixed regogen 'update' and 'repository' options to work with unite metadata. --update-new-components with unify metadata is prevented. Moved --update-new-components functionality from repogen.cpp to QInstallerTools so it can be accessed from tests. Created tests for repogen. Task-number: QTIFW-1943 Change-Id: I12389f4747154a0f6f51b4f34f630103c2cfef04 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Fix essential updateKatja Marttila2020-10-095-9/+55
| | | | | | | | | When updating essential, no other components should be installed nor updated unless there is autodepend on the essential component. Task-number: QTIFW-1970 Change-Id: If9edd6515e3e5ec51611ac07ac52b13f05983b9d Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* CLI: Give more meaningfull return value for installsKatja Marttila2020-09-256-49/+145
| | | | | | | | | | | | | | Instead of returning just true or false when running installer or maintenancetool, utilize the PackagemanagerCore status message. Added also a new status enum, EssentialUpdated, which is returned when calling command 'update' and only essential components are updated. Also fixed a bug when components could be installed even when there were an essential update available. Task-number: QTIFW-1969 Change-Id: I43826301656573b34e1338b49566d199bdcd7468 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Page list widget enhancementsArttu Tarkiainen2020-09-111-0/+1
| | | | | | | | | | | | - Add support for a configurable image shown on top of the page list. - Add missing object names for easier object reference, for example when using stylesheets. - Remove the vertical line separating side widget as this looks particularly ugly on custom styles. Task-number: QTIFW-1939 Change-Id: I16e17e72163068381f54491f7fbe965eb4c5295d Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Obey --no-default-installations when default set from scriptKatja Marttila2020-09-093-1/+11
| | | | | | Task-number: QTIFW-1930 Change-Id: Ie180777a0c5dc7c6a7b4e273169e673cd5c7e918 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* CLI: Allow forced component to be selected for installKatja Marttila2020-08-311-0/+12
| | | | | | Task-number: QTIFW-1929 Change-Id: I4c9cc7449126b6bb8898f5148f2cb612b175f52a Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Add support for vendor set image decorationArttu Tarkiainen2020-08-251-0/+1
| | | | | | | | | | | | Add possibility to show an arbitrary number of product related, or other images on PerformInstallationPage. These can be specified in the installer configuration file, using <ProductImages> element with one <Image> child element for each file name. Task-number: QTIFW-1900 Change-Id: I2be727d9189963ef1a79046150111dd8c91153c6 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* CLI: Ask user confirmation before performing installer actionsArttu Tarkiainen2020-08-213-0/+3
| | | | | | | | Also add new option --confirm-command to skip the interactive query. Task-number: QTIFW-1834 Change-Id: I1c63fd990431c792a523da7047637f54b193bee6 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Add a page list widget to installer wizardArttu Tarkiainen2020-06-111-1/+2
| | | | | | | | | | | | | | | | | | | | If an installer is configured with <WizardShowPageList> set to true (default), a QListWidget set as a side widget for the wizard will be shown. The list should indicate completed and incomplete pages and the current wizard page. User navigation is not enabled in this change. The page list should honor the visibility of individual pages and update itself dynamically. In addition the visibility of a page in page list widget can be set internally with setShowOnPageList() which overrides other factors when hiding a page. The page item title shown on the list can be set internally with setPageListTitle() for the PackageManagerPage object, or the item can alternatively use the normal page title and the object name. Task-number: QTIFW-1755 Change-Id: I8a792d957a10e2176de5f42f29b1282e8e7667db Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Refactor maintenance tool writing conditionsArttu Tarkiainen2020-06-104-2/+6
| | | | | | | | | This change fixes a bug caused by a blocking runInstaller() call in PerformInstallationPage::entering() and also contains refactoring to related parts of code. Change-Id: Ic3309707c1f975a646937aa96fc407a3e5931359 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix InstallAction type when updating componentsKatja Marttila2020-06-081-2/+8
| | | | | | | | | | | | Components should be selected for update using model, not components own check state so model values stay in sync. Wrong InstallAction type will cause component to think it will be installed when that is not the case. This caused problems in install scripts when trying to figure out if component is going to be installed or not. Task-number: QTIFW-1830 Change-Id: I367f476de96f27b27d74e06a6fb630f0876924d2 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* CLI: Do not run updater if there are no updates for selected componentsArttu Tarkiainen2020-06-011-0/+6
| | | | | | Task-number: QTIFW-1818 Change-Id: I13dceeeaf294c689a90fbe5fe74586d7a117ea50 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Inform if trying to uninstall virtual componentKatja Marttila2020-05-275-0/+39
| | | | | | Task-number: QTIFW-1811 Change-Id: I333d6d0bd93f8538919f172113b7039b63491492 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* CLI: Add new option --file-query to auto answer QFileDialogKatja Marttila2020-05-264-0/+40
| | | | | | | | | | | | | QFileDialog.getExistingDirectory and QFileDialog.getOpenFileName can be called from scipt. If command line interface is used, user must type the correct directory or file name from command line during install. With --file-query option user can give the values when running the installer or maintenancetool with syntax --file-query filedialogId=C:/temp,filedialogId2=C:/temp/file.txt. Task-number: QTIFW-1631 Change-Id: I5e58be6b509cf00de832646ef31ec4eda90773be Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Add new no-default-installations optionKatja Marttila2020-05-261-2/+54
| | | | | | | | | | | | This option can be used both from CLI and from GUI. Option will overwrite Default true in component.xml, which means that in GUI the components are not selected by default, and in CLI the components are not installed unless those are given as argument to install -command. Task-number:QTIFW-1630 Change-Id: I5dc16b14fc136f421980a55bb5fc6a74213309dc Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Add missing license header to tst_settings.cppArttu Tarkiainen2020-05-151-0/+28
| | | | | Change-Id: I3877a0370cf6e2d2026eca50d44e4ce54b63ac03 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Add support for disabling CLI features from configuration fileArttu Tarkiainen2020-05-152-0/+2
| | | | | | Task-number: QTIFW-1760 Change-Id: Ibd0668756700eeab68bce12ddce1866893cc08f9 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* UnitTests: Cleanup codeKatja Marttila2020-05-1521-341/+212
| | | | | | | Move recurred code to common functions, remove unnecessary includes Change-Id: Idfe3a0c952d1154470ecb229ff3c1e428beaa3ac Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Add possibility to accept licenses from CLIArttu Tarkiainen2020-04-286-1/+106
| | | | | | | | | | | License agreements can be accepted automatically by using command line option --accept-licenses or interactively by answering queries with either "Accept", "Reject" or "Show" selections. Task-number: QTIFW-1742 Task-number: QTIFW-1745 Change-Id: Iff46b44f91faddb7f163b299994167ab16df68b3 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Answer queries from command lineKatja Marttila2020-04-281-2/+1
| | | | | | | | | | | | | | | | | | | | | | Standard input is possible in Windows only in console application. This change makes installers to be console applications by default. If started as gui from command line, console is released and application is restarted so cmd.exe won't be waiting for application to finish. If started from explorer, console is launched but released immediately. This may be seen on screen with short console flash. Using command line interface messagebox strings and possible answer values for it are printed to console. Answers must be given in case sensitive format as StandardButton QMetaEnum is utilized when reading button values. This ensures that if StandardButtons are added/removed/changed the code continues to work. Also added a new option 'default-answer' which will answer the questions with default button values without user interaction. Task-number: QTIFW-1739 Change-Id: I710f921f5c927dbd13090af32f93656dded84e72 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Enable testsIikka Eklund2020-04-241-0/+2
| | | | | | | Remove DisableTests property. Change-Id: Ifa524f2f399e7b3072825a2ef34e752187c34be4 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Add new option --auto-answerKatja Marttila2020-04-165-3/+42
| | | | | | | | | | | With this change user can individually answer to message queries if message id is known. The syntax is --auto-answer message.id=QMessageBox::Ok,message.id2=QMessageBox::Cancel Task-number: QTIFW-1740 Change-Id: I86d08df77cf5f3d665901b599586d8c52b7dcdf6 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Add possibility to auto accept or reject IFW queries from CLIKatja Marttila2020-04-1510-7/+173
| | | | | | | | | | | | | | | Added new command line switches accept-messages and reject-messages to automatically accept or reject installer message queries. Also removed Retry option in CLI when archive or hash download failed. With GUI it is possible to try Retry in case either is missing but without GUI Retry will cause infinite loop. Added unit tests for accept-messages and reject-messages using CLI. Task-number: QTIFW-1736 Change-Id: Ie87d2d8157be772b790415c96e5b94fc882d4be7 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Fix build failures in PackageManagerCore tests with Qt 5.9.xArttu Tarkiainen2020-04-141-9/+9
| | | | | Change-Id: Iae43369276282711b242eac41e32997ebbfb40ce Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix shortcut creation when installing from CLIKatja Marttila2020-04-098-1/+149
| | | | | | | | | | | Change default button from Retry to Cancel if operation fails to avoid infinite loop when running from command line interface. Added also unit tests for shortcut operation. Task-number: QTIFW-1666 QTIFW-1710 Change-Id: I171b6aecd9886acce0051b7082842f8f76b22046 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>