summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Fix installationlog.txt writingKatja Marttila2020-04-273-21/+27
| | | | | | | | | Fixes also remoterepo deletion from tmp folder Task-number: QTIFW-1664 Task-number: QTIFW-1683 Change-Id: I8485eb63c4ec5a30c04f4177922bb60f2176ce37 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Fix creation of local repository with elevated permissionsArttu Tarkiainen2020-04-211-10/+38
| | | | | | | | | | | As starting with Qt 5.10 we cannot copy compiled-in resources using QInstaller::RemoteFileEngine, add a pre-step for the internal metadata copy operation. First dump the resources to a writable directory as a normal user, then do the real copy work with elevated rights. Task-number: QTIFW-1500 Change-Id: I20316bc55514365d051f0fa6fb435c5532ce9e3b Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Add new option --auto-answerKatja Marttila2020-04-164-3/+47
| | | | | | | | | | | 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>
* CLI: Print message if search does not find anythingArttu Tarkiainen2020-04-161-0/+5
| | | | | | Task-number: QTIFW-1703 Change-Id: I56c841eaac18234b3d3971eeeb497f8205a7b348 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Give meaningful default value to messagebox queriesKatja Marttila2020-04-163-5/+5
| | | | | | | | | | | | | | If error occurs in install phase, change the default button to be cancel/ignore etc. to avoid inifinite loop when installing with CLI. When using GUI, default button is highlighted but user can choose otherwise. When using CLI the default button is always chosen if user don't give option to overwrite the default button values from command line. Task-number: QTIFW-1737 Change-Id: I721636d5a23e22ad5eee73b84e250e90eb1a6004 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io> Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Add possibility to auto accept or reject IFW queries from CLIKatja Marttila2020-04-156-5/+29
| | | | | | | | | | | | | | | 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 shortcut creation when installing from CLIKatja Marttila2020-04-095-7/+23
| | | | | | | | | | | 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>
* Fix bugs in InstallIconsOperation and add unit testsArttu Tarkiainen2020-04-082-16/+6
| | | | | | | | | | | | | | | | | | - Fix conflicting naming and reference of operation value in InstallIconsOperation::targetDirectory(). - Fix bug related to appending of "icons" suffix to paths in XDG_DATA_HOME, the logic was glued to old default values which have been since changed. - Remove unused variable in class destructor and remove unneeded default implementation. Also add unit and CLI tests for InstallIconsOperation and move addToFileMap() to common functions so it can be used in multiple tests. Task-number: QTIFW-1715 Task-number: QTIFW-1465 Change-Id: I5281ca7a5dec1453f49fbe2cb2852d6467bf0c97 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Initialize user arguments earlierKatja Marttila2020-04-085-19/+36
| | | | | | | | | | | | | | | User can give arguments from command line, for example AllUsers=true, which can affect to other core values. Initialize user arguments in core constructor so we an utilize the user given values when defining other core values. Added also unit test for overwriting core data values. Note that some values belong to QSettings such as MaintenanceToolName which cannot be overwritten. Task-number: QTIFW-576 QTIFW-1730 Change-Id: I82a05f9f4bc8498f4e0e2af407ba29f6dabbf030 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Remove existing installation from command lineArttu Tarkiainen2020-04-077-3/+47
| | | | | | | | | | | Add new "purge" command to command line interface. This removes all components and all program directory contents. Add test function to unit tests. Task-number: QTIFW-1574 Change-Id: Iccd4a052c7e2fc8eec0a6ae2b5a93c0c607604cb Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix startserver argument when starting installer as adminKatja Marttila2020-03-312-3/+5
| | | | | | Task-number: QTIFW-1701 Change-Id: I1ae59a0a352578918a718d89ce600f4e41910306 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Add function to allow additional processes to be runKatja Marttila2020-03-314-12/+27
| | | | | | | | | | | | | | Maintenancetool does not allow updating install if running processes are found from install directory. Only maintenancetool process was allowed, otherwise the install failed with query to shut down processes. This commit adds a function to extend the allowed processes to be run, this is mandatory when running tests as test executable lies in the install directory. Task-number: QTIFW-1019 Change-Id: I5422b0327e3f77edf3f9c88c74f40eff5cc8c830 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io> Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Fix bug in command line option updateKatja Marttila2020-03-311-6/+10
| | | | | | | | | | | | | | Update was working only for latter component if several was given as arguments. Added also unit tests for cli option update Also created common functions which are used by several command line test. Task-number: QTIFW-1695 Change-Id: I472e1c34bcfb1b60cda110353068f2cec64c468f Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Add unit tests for LineReplaceOperationArttu Tarkiainen2020-03-301-0/+8
| | | | | | | | | Also fix found bug with empty search string causing replacement of every line in a file. Task-number: QTIFW-1697 Change-Id: I226aa8aa4cab62befb6828aa8e27d9f83e25e7e6 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Create unit tests for CLI option uninstallPackagesKatja Marttila2020-03-252-3/+9
| | | | | | Task-number: QTIFW-1638 Change-Id: I027ce7d70cb5a49f1c2a2ed39979a0d3c8773282 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Refactor and add unit tests for metadatajobKatja Marttila2020-03-244-105/+148
| | | | | | | | Split long functions into smaller understandable functions, added unit tests for metadatajob. Change-Id: Ib423eab3c9ae7771fb032b99f767f96e52266ea7 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Add possibility to compress metadata per repositoryKatja Marttila2020-03-242-42/+58
| | | | | | | | | | | | Added two new configure options for repogen. --unite-metadata will create both 'old' style meta 7z, which is one per component, and new style which is one per repository. --unite-metadata-only will create only new syntax meta 7z. One meta 7z per repository will significantly decrease the download time if there are several packages in one repository. Change-Id: I651b24e93fdef3efb6253ee9b119ebad3bae4d59 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Separate maintenance tool writing for testing purposeKatja Marttila2020-03-205-61/+101
| | | | | | | | | Some unit tests wont work as installer wants to unpack maintenance tool from the installer. As unit tests are not normal installers we need to separate the maintenance unpacking when running tests. Change-Id: I5f2bb60e775a42d1b8dd6ee088ff4f2a694a7a09 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Add short versions of CLI optionsArttu Tarkiainen2020-03-196-133/+186
| | | | | | | | | | | | | | Add single or couple letter short options and two letter short commands. Single letter short options can be passed in a single joined form, for instance '-dg'. Also change CLI options constant string literals type to QLatin1String as we would have to use this as a wrapper anyway wherever the constants would be used, causing quite long and verbose statements. Task-number: QTIFW-1634 Change-Id: I17e80c9a657d934687d2b7e87fcecddffa1b9b21 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Refactor naming and usage of CLI commandsArttu Tarkiainen2020-03-1913-285/+385
| | | | | | | | | | | | | | | | | | | | | | | | - Rename and alter the description of some command line options according to validation results from task QTIFW-1635. The suggested additions are not added in this change. - Remove options "framework-version" and "silentUpdate", these should not be needed anymore. - Combine options "installPackages" and "installDefault" into single "install" command. - Change command line syntax from "binary [options]" to "binary [options] command <arguments>". - Re-order & group known option variables and "--help" printing order based on their topic. - Move CommandLineParser class files under src/libs/installer and add private class for future options extension. Short versions of command line options should be added in a follow-up commit. Task-number: QTIFW-1671 Change-Id: Ie0d393368b5275c8ffa1ab8833885b149af3178e Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix case sensitive to two logging categoriesKatja Marttila2020-03-181-2/+2
| | | | | | | | Values were introduced as lower case but referenced as upper case. Change-Id: I73cf0bf18cb4dc0610818dc713f916f4bc25bc48 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io> Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Merge remote-tracking branch 'origin/3.2' to masterKatja Marttila2020-03-1611-93/+127
|\ | | | | | | Change-Id: Ia4cf718409ce431cce8d766865ecec506426afb9
| * Fix incorrect ScriptLoadingFailed enumerator scope resolutionArttu Tarkiainen2020-03-021-1/+1
| | | | | | | | | | | | | | This was causing problems while building with msvc2013. Change-Id: Idd6b3b4c55d2cedb946b22db75d95222d37fe64b Reviewed-by: Katja Marttila <katja.marttila@qt.io>
| * Add command line option to disable checking of free space on target3.2.2-rcArttu Tarkiainen2020-02-278-89/+120
| | | | | | | | | | | | | | | | | | | | Also move functionality to PackageManagerCore::checkAvailableSpace() for more convenient later usage, if we want to use this without starting the Wizard GUI. Task-number: QTIFW-1602 Change-Id: I4f2d3cc78bc542475fe9c51b9364b1b221098e4a Reviewed-by: Katja Marttila <katja.marttila@qt.io>
| * Fix EnvironmentVariableOp undo behavior with non-persistent variablesArttu Tarkiainen2020-02-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The return value for undoOperation() was incorrect when dealing with non-persistent variable, causing an empty installer error dialog to appear if the current env does not contain exactly same variable value as on installation. The return value inside !isPersistent condition scope should always be true regardless of if the temporary variable set on installation still exists on current environment or contains the same value. Change-Id: If7deaa310d73a371194138fa1e2c382614452e26 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
| * Fix building against Qt 5.14 and newerJoni Poikelin2020-02-032-0/+5
| | | | | | | | | | | | | | Fixes: QTIFW-1526 Change-Id: I085dd8b2818f26058432d165a1250b3ac67e1dda Reviewed-by: Iikka Eklund <iikka.eklund@qt.io> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | CLI: Add unit tests and more detailed debug info of local installed packagesKatja Marttila2020-03-134-1/+26
| | | | | | | | | | Change-Id: I37f0950686aeb303328d7e8137fc4c7cfe7e8840 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | Improve warning log stringsKatja Marttila2020-03-131-6/+6
| | | | | | | | | | | | Change-Id: Ifdc7a63b9e60807b0d5f6e68758296d417da1d1c Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io> Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | Do not print progress indicator when running in silent modeArttu Tarkiainen2020-03-121-0/+4
| | | | | | | | | | Change-Id: I921f364022cea0d2a0213e49bc6af6f95a6ca64c Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | Perform headless commands without GUI dependencyKatja Marttila2020-03-129-511/+587
| | | | | | | | | | | | Task-number: QTIFW-1633 Change-Id: I207cd152a471fddd51c152223460f8a9873f4382 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | Show progress in CLI when performing time consuming operationsArttu Tarkiainen2020-03-094-5/+53
| | | | | | | | | | | | | | | | | | | | Add a bottom scrolling progress indicator that is shown during meta job progresses and installation phase. Also add printing of messages previously shown only on the GUI Wizard's progress bar labels. Task-number: QTIFW-1625 Change-Id: Ic3f92a31c98e41686517f49bbe98fd81fe11d13f Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | Add command line option to start the installer binary as uninstallerArttu Tarkiainen2020-03-029-3/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add option "--uninstaller" to start the installer binary explicitly as uninstaller. This complements options "--updater" and "--manage-packages". Add convenience functions for setting and checking if the magic binary marker has been set by the user. Task-number: QTIFW-1639 Change-Id: Ie40ba9c56e09be079e309bca985b19a8a7bef7ef Reviewed-by: Iikka Eklund <iikka.eklund@qt.io> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | Fix license check failuresSimo Fält2020-02-287-88/+123
| | | | | | | | | | Change-Id: I123b1c6a06717c37387a636aae8296e27c1df8c0 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | Add checkupdates to command interface optionsKatja Marttila2020-02-241-1/+2
| | | | | | | | | | | | | | | | We are not showing GUI in checkupdates so add it to options too Change-Id: I581df6671429ce83d9d48e613f5e6a7e7e3501ed Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io> Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | Add unit tests for CLI option installPackagesKatja Marttila2020-02-201-6/+6
| | | | | | | | | | | | | | Also remove extra space and quotation marks from print output Change-Id: I18eb3532ac79f407023e15ef7ebab78ca0a7f59e Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | CLI: decrease the amount of default debug printsKatja Marttila2020-02-2023-114/+126
| | | | | | | | | | | | | | | | | | | | 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>
* | Change IntroductionPage radio button handling in maintenance toolArttu Tarkiainen2020-02-182-13/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If magic binary marker is set to either updater or package manager, act as before. If the marker is set to uninstaller (default for maintenance tool), decide the default checked button based on if any valid repositories are available - a prerequisite for package manager and updater actions to succeed. If repositories are available the default is "Add or remove components", otherwise "Remove all components". Modify validRepositoriesAvailable() implementation to suit this change and better match its function name. Task-number: QTIFW-349 Change-Id: Idf92ad3a2b294cc1ecb939d716f2852ad1872f15 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | Enable optional targetDir argument on command line installationArttu Tarkiainen2020-02-172-29/+17
| | | | | | | | | | | | | | | | | | | | Try to use default target directory value from internal configuration when --targetDir option is not set. This affects usage of options --installDefault and --installPackages (when running as installer). Task-number: QTIFW-1608 Change-Id: Ieac709f6e3d7c539a3a1cb66dce8eb448b20dcfe Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | Uninstall selected packages from command lineKatja Marttila2020-02-147-3/+80
| | | | | | | | | | | | | | | | | | | | Components can be uninstalled from CLI with --uninstallPackages package1,package2,... Replicates the same behavior as when removing from visual UI, so forced installation, virtual and components installed as autodependency cannot be uninstalled. Change-Id: Ibcd87b5ceb8e509c84c6944510c23e59b28dedb9 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | Add unit tests for CLI option listPackagesKatja Marttila2020-02-131-21/+21
| | | | | | | | | | | | | | | | | | Also remove extra space and quotation marks around printed component values. Task-number: QTIFW-1577 Change-Id: If2c81609e32ee40b81a70106b2e9bf8ac536c089 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | Move CLI options from /sdk to /libs for access from installer extensionsKatja Marttila2020-02-134-83/+47
| | | | | | | | | | Change-Id: I657645f2126813a93bc38626fabf46deb4711791 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | Use of QLoggingCategoryKatja Marttila2020-02-1337-217/+330
| | | | | | | | | | | | | | | | 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>
* | Fix bug in CLI updateComponentsKatja Marttila2020-02-131-0/+1
| | | | | | | | | | | | | | No updates were found as the update packages were not fetched Change-Id: Iaa245a5168c999780aa268c1af03c625e6053956 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | Fix CLI installPackagesKatja Marttila2020-02-131-1/+1
| | | | | | | | | | | | | | | | | | | | Installer decided incorrectly weather the package was already installed or not. Check from components isInstalled() instead of model check state as the model check state can be Checked if <Default> is true and the component is not installed. Change-Id: Id1469992a2d56d263f47a6a711dbb878129f545a Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | Fix checking for options requiring verbose outputArttu Tarkiainen2020-02-121-5/+5
| | | | | | | | | | | | | | | | QInstaller::setVerbose(true) was not executed for the last option in foreach loop. Change-Id: Ie0b63e6f996c0c702b4844dc5bdd92f736bda4f9 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | Do not prompt admin query when command line interface is usedArttu Tarkiainen2020-02-125-1/+30
| | | | | | | | | | | | | | | | | | | | | | If admin rights are needed, fail and require to install with sudo. This is how command line interfaces commonly behave. Add convenience functions for setting and checking if the installer is used from command line. Task-number: QTIFW-1598 Change-Id: Ib28d3be08254dade5d9b2d29da9232064f008eb4 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | Move cli options list to static const variable for easier later usageArttu Tarkiainen2020-02-122-7/+19
| | | | | | | | | | Change-Id: Ib1011058124601160aa69ee7ceaad1ee0cc9ecd6 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | Use verbose mode by default when command line interface is usedArttu Tarkiainen2020-02-101-1/+6
| | | | | | | | | | | | | | | | Enable verbose console output for a select set of options by default. Task-number: QTIFW-1597 Change-Id: I774fdfcc19dd0297eb79116d1889881e8ac314d5 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | Enable command line default components installationArttu Tarkiainen2020-02-036-15/+52
| | | | | | | | | | | | | | | | | | | | Add --installDefault option to install components that are set to be checked by default and their respective dependencies. Do not do anything if the component tree does not have anything checked by default. Task-number: QTIFW-1583 Change-Id: I3825c7e797b102a8d6a65ae0e57bfe82fafef5e9 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | Merge "Merge remote-tracking branch 'origin/3.2' into master"The Qt Project2020-01-1718-134/+350
|\ \