summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/packagemanagercore.h
Commit message (Collapse)AuthorAgeFilesLines
* Emit signal after loading default translationsArttu Tarkiainen2021-02-111-0/+1
| | | | | | | | | This makes it easier to get the load order correct, if there are translations to be loaded for additional pages from vendor extensions to the internal C++ API. Change-Id: I9e10cfa7e1cbf25f87d998157436c44425403cac Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Try rerunning execute operationKatja Marttila2021-02-051-0/+1
| | | | | | | | | | | | | 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>
* Restructure logging utilitiesArttu Tarkiainen2021-02-041-3/+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>
* Add support for generating offline installer from onlineArttu Tarkiainen2021-01-151-0/+14
| | | | | | Task-number: QTIFW-1945 Change-Id: Ic8a076a28385e99ad09cfbccd07c7012d6570639 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Arrange licenses and filter duplicatesJarkko Lehtoranta2020-11-061-0/+3
| | | | | | | | | | | - Add a "priority" attribute to the "License" element used in "package.xml" for arranging licenses by priority in the LicenseAgreementPage and in CLI. Priority >0 shows the license on top of others. - Arrange the licenses with the same priority alphabetically - Filter duplicate licenses from the LicenseAgreementPage and from CLI Change-Id: I1dcacdd417d2383b8dc18149e4de329fbf11cfe8 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* CLI: Print extra archive information with higher verbosity levelArttu Tarkiainen2020-11-051-1/+2
| | | | | | | | | | 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>
* CLI: Add possibility to filter installed packages with regexpArttu Tarkiainen2020-11-041-1/+1
| | | | | | Task-number: QTIFW-1953 Change-Id: Ie291e8ae96d46082e342e9bcb152258862813afd Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* CLI: Give more meaningfull return value for installsKatja Marttila2020-09-251-9/+10
| | | | | | | | | | | | | | 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>
* Add verbose levels and cleanup log categoriesKatja Marttila2020-08-241-0/+2
| | | | | | | | | 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>
* CLI: Ask user confirmation before performing installer actionsArttu Tarkiainen2020-08-211-0/+2
| | | | | | | | 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>
* Documentation fixesKatja Marttila2020-07-031-3/+0
| | | | | | | | Added missing documentation and fixed warnings. KDUpdate documentation not added in this commit. Change-Id: Idc0b167bed95b7ae4a46a350290fdb241aa94448 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Add possibility to add custom widget from script to certain positionKatja Marttila2020-06-251-2/+4
| | | | | | | | | | | If several custom widgets are added to same page, the order of the widgets is arbitrary. Added a new member to addWizardPageItem which can define the position of the widget in the page, relative to another custom widgets. Non-custom widgets are always placed on top as before. Task-number: QTIFW-1847 Change-Id: Iadafef3a08e60a8b05b959cb06caea2a2042b419 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Add function to get information if default install is performedKatja Marttila2020-06-251-0/+1
| | | | | | Task-number: QTIFW-1847 Change-Id: I737b9b527c25e089386f74038b57a83f3d7e2062 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Add possibility to select/deselect component from script using coreKatja Marttila2020-06-251-0/+2
| | | | | | | | | We might not have componentselection page visible, so we need a possibility to select/deselect components also using core. Task-number: QTIFW-1847 Change-Id: I85ccf0602144f843c15ef7c0818ba435d36bdac5 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Add a page list widget to installer wizardArttu Tarkiainen2020-06-111-0/+1
| | | | | | | | | | | | | | | | | | | | 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-101-0/+2
| | | | | | | | | 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>
* CLI: Add new option --file-query to auto answer QFileDialogKatja Marttila2020-05-261-0/+5
| | | | | | | | | | | | | 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-0/+3
| | | | | | | | | | | | 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>
* CLI: Add option to read arbitrary user inputKatja Marttila2020-05-151-0/+1
| | | | | | | | | | | Added new readConsoleLine() function which can be used to read user input from console. Function can be only called when command line instance is used without gui. Task-number: QTIFW-1631 Change-Id: Ic856f4bafc4a8d469d3fe497b4e0321e104df499 Reviewed-by: Tarja Sundqvist <tarja.sundqvist@qt.io> Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Add possibility to accept licenses from CLIArttu Tarkiainen2020-04-281-0/+2
| | | | | | | | | | | 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-0/+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>
* Initialize user arguments earlierKatja Marttila2020-04-081-1/+3
| | | | | | | | | | | | | | | 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-071-0/+1
| | | | | | | | | | | 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>
* Add function to allow additional processes to be runKatja Marttila2020-03-311-0/+2
| | | | | | | | | | | | | | 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>
* Create unit tests for CLI option uninstallPackagesKatja Marttila2020-03-251-0/+1
| | | | | | Task-number: QTIFW-1638 Change-Id: I027ce7d70cb5a49f1c2a2ed39979a0d3c8773282 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Refactor and add unit tests for metadatajobKatja Marttila2020-03-241-0/+1
| | | | | | | | Split long functions into smaller understandable functions, added unit tests for metadatajob. Change-Id: Ib423eab3c9ae7771fb032b99f767f96e52266ea7 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Separate maintenance tool writing for testing purposeKatja Marttila2020-03-201-5/+5
| | | | | | | | | 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>
* Merge remote-tracking branch 'origin/3.2' to masterKatja Marttila2020-03-161-0/+3
|\ | | | | | | Change-Id: Ia4cf718409ce431cce8d766865ecec506426afb9
| * Add command line option to disable checking of free space on target3.2.2-rcArttu Tarkiainen2020-02-271-0/+3
| | | | | | | | | | | | | | | | | | | | 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>
* | CLI: Add unit tests and more detailed debug info of local installed packagesKatja Marttila2020-03-131-0/+1
| | | | | | | | | | Change-Id: I37f0950686aeb303328d7e8137fc4c7cfe7e8840 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | Add command line option to start the installer binary as uninstallerArttu Tarkiainen2020-03-021-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Uninstall selected packages from command lineKatja Marttila2020-02-141-0/+3
| | | | | | | | | | | | | | | | | | | | 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>
* | Do not prompt admin query when command line interface is usedArttu Tarkiainen2020-02-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | 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>
* | Enable command line default components installationArttu Tarkiainen2020-02-031-0/+1
| | | | | | | | | | | | | | | | | | | | 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-171-8/+0
|\ \
| * | Merge remote-tracking branch 'origin/3.2' into masterKatja Marttila2020-01-161-8/+0
| |\| | | | | | | | | | Change-Id: Ie42b694119ecaa59c9df4aa0253663107ef0c68c
| | * Documentation fixesKatja Marttila2019-12-171-8/+0
| | | | | | | | | | | | | | | Change-Id: Ibffb5470d374c8d612791f48c951deddd00f3121 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* | | Remove obsolete sharedFlag() functionKatja Marttila2020-01-161-5/+0
|/ / | | | | | | | | | | | | | | sharedFlag is deprecated since 2.0.0 and it was no longer used, setValue should be used instead. Change-Id: I94ebcf90c422e719ccc853ad67db32840f806514 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* | Install selected packages from CLIKatja Marttila2019-12-041-0/+5
| | | | | | | | | | | | | | | | | | Also move targetDirWarning() from targetdirectorypage to packagemanager and move target directory check to checkTargetDir() function so that those are accessible also without UI. Change-Id: Ia38cc7e66bb542e6a60fea2c39cc3b80735564ef Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | Update selected components from command lineKatja Marttila2019-11-221-2/+1
| | | | | | | | | | | | | | | | | | Selected components can be updated with --updatePackages <package_id>. If essential components are found, only the essential components are updated. Change-Id: I0eb8a8f5ca855af16eabd5f888cd9a0d5e933d84 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | Merge remote-tracking branch 'origin/3.1' into masterKatja Marttila2019-11-201-1/+0
|\| | | | | | | Change-Id: Icc077e3757b84b2367b2a7dd9c1e389f6845365b
| * Refactor setting and checking of file permissionsArttu Tarkiainen2019-08-301-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | List available packages from command lineKatja Marttila2019-11-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Available packages can be listed from command line with --listPackages <regexp>. All packages can be listed with --listPackages . . By default package id, name and version are listed in output. In case you want to see all the packet information use logging category --logging-rules ifw.package.*=true. See --help for more detailed information on how to use logging category. Change-Id: Ic0815d2274643e3fb3f0670ed9036fe765805c0e Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | List installed packages from command lineKatja Marttila2019-10-181-0/+1
|/ | | | | Change-Id: Ic8efe08be347f3a208e37458936f8316d66ca916 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Fix recalculation of components to install in MaintenanceToolArttu Tarkiainen2019-08-151-0/+1
| | | | | | | | | | | | | | | | In MaintenanceTool, navigating back and forth in "Update" and "Add or remove components" doesn't cause update in components to install and uninstall information. Without changing component model's state by checking/unchecking components the recalculating is not done and performing the opposite maintainer action causes unintended results. Make IFW recalculate components to install when leaving component selection page so InstallerCalculator and UninstallerCalculator's state is correct even without changing the component selection. Task-number: QTIFW-694 Change-Id: I89abd9a1952fe30d1e3ae4012e7a7bac68793a89 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Gain admin rights for writing MaintenanceTool config files if neededArttu Tarkiainen2019-06-141-0/+3
| | | | | | | | | | | | | | | | Running MaintenanceTool from an elevated directory didn't do proper checks for file writing rights when parsing Updates.xml from a repository, for example when a default repository contains actions inside <RepositoryUpdate> tags the MaintenanceTool couldn't write changes to the .ini file immediately. Make MaintenanceTool do proper rights checking when parsing Updates.xml. Create uniform methods for checking directory writing access as it is used on several occasions. Add tests for directory checking methods. Task-number: QTIFW-1363 Change-Id: I6d634ddbd59429e5b98af1d8010e70a71de40f69 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Maintenance Tool: Change text in Select Components view when selection of ↵Arttu Tarkiainen2019-05-021-0/+3
| | | | | | | | | components is not possible Task-number: QTIFW-1241 Change-Id: Ib3e67e26b5fd4cf856c4b95f7fe542484e4955ff Reviewed-by: Janne Anttila <janne.anttila@qt.io> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Merge remote-tracking branch 'origin/3.0' into masterKatja Marttila2018-12-101-1/+1
|\ | | | | | | Change-Id: I73cb43e090c6ff34f1ceb774490d01818465e2e0
| * Do not reset core data values in restartKatja Marttila2018-10-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Do not reset core data values as that removes all data set using setValue() which are needed. Restart is called when pressing 'Restart' after maintenancetool finish page or when changing settings from Settings Dialog. Task-number QTIFW-504 Change-Id: I0713b0371811957b93623433d26f0b10e4c8fb12 Reviewed-by: Janne Anttila <janne.anttila@qt.io> Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* | Add signal to inform about unstable componentsKatja Marttila2018-09-271-0/+9
| | | | | | | | | | | | Task-number: QTIFW-1197 Change-Id: If9d7941f4c7bfc478daa83dcd73dfa71c9163561 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>