3165 Commits

Author SHA1 Message Date
Katja Marttila
f8ade64515 Update selected components from command line
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>
2019-11-22 12:55:39 +00:00
Katja Marttila
e238e76433 Merge remote-tracking branch 'origin/3.1' into master
Change-Id: Icc077e3757b84b2367b2a7dd9c1e389f6845365b
2019-11-20 07:53:09 +02:00
Katja Marttila
48a43de0be List available packages from command line
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>
2019-11-19 09:38:04 +00:00
Katja Marttila
3bd4e7d632 Refactor code to functions which command line interface needs
These are needed in multiple places while implementing
CLI so created common functions to avoid code repeat.

Change-Id: I2b30bedf5de838211f48bd1669c59ff3a17f640e
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
2019-11-19 09:37:39 +00:00
Katja Marttila
7bac504eb6 Fix installer executable creation in Linux
If Linux has several partitions and tmp is pointing to a different
partition than where we are trying to create installer executable with
binarycreator, binarycreator fails with 'Invalid cross-device link'.
Fixed so that tmp is not used when creating an installer executable.

Change-Id: Ieee52ee1929f980345a7940dd381cc94dbf3d40e
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
3.1.2-rc3
2019-11-19 09:18:38 +00:00
Arttu Tarkiainen
9c2a507215 Add early prompt to run MaintenanceTool as admin when needed
Currently IFW does not support manipulating Windows Access Control Lists
for files. If a user does not have reading permissions to installer.dat
it will throw error on QInstaller::openForRead() before the wizard GUI
is shown. At very least, add a MessageBox to prompt the user to run the
executable again as administrator in such a case.

Task-number: QTIFW-1392
Change-Id: I9e20c34b215ee697118af9c15a7e344f9cfc3c3f
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
2019-11-14 11:36:30 +00:00
Katja Marttila
8053f11af1 Fix file deletion when canceling installation
Task-number: QTIFW-1466
Change-Id: I2b9f000cddc63e9eccefb3d86f93ab05a5631581
Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
2019-11-13 05:31:52 +00:00
Arttu Tarkiainen
f667bf73d0 Add better test branch for testSetDefaultFilePermissions() on Windows
As the function to be tested is now enabled also on Windows platforms,
this should at least check that the unsetting of legacy read-only flag
works as intended.

Task-number: QTIFW-1464
Change-Id: Ibe126d279a31aaa3d204cf6a8fe04a05ea195bb8
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
2019-11-11 07:06:20 +00:00
Arttu Tarkiainen
03166d8e49 Enable QInstaller::setDefaultFilePermissions() also on Windows
In some cases, for example in CreateLocalRepository files may be left
with legacy read-only flag on Windows. Even though the permission
entries in its Access Control List are sane, this will block all writing
operations to the file.

Enable setDefaultFilePermissions() on Windows as this will unset the
read-only flag if it is set. This still does not affect ACLs.

Task-number: QTIFW-1464
Change-Id: I95399e7cb83cb136ef1c978a05f79b6a6790b7e4
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
2019-11-01 07:55:15 +00:00
Arttu Tarkiainen
1cb9feb9a2 Fix extracted files list formation in ExtractArchive operation
In ExtractArchive, the ConnectionType used to connect signal
'currentFileChanged' to slot 'fileFinished' was changed to
Qt::AutoConnection in c8de51cadbc5855ca1e77d038d7f09bf60d059ee,
rather than using Qt::DirectConnection explicitly.

Now the connection type defaults to queued as the sender and
receiver live on a different thread. This seems to cause an issue
where the slot function is not invoked for every emitted
'currentFileChanged' signal before returning from
ExtractArchiveOperation::performOperation(). This can happen
randomly on some installer runs, leaving entries out from
ExtractArchive's "files" list for some components.

The list formation works fine with Qt::DirectConnection, however
reverting to this behavior might be a bad practice as it leaves
'fileFinished' vulnerable to accidental calls from another thread
if we change the behavior in the future. Rather move the extracted
files list formation to ExtractArchiveOperation::Callback like we
already do for backup files.

Task-number: QTIFW-1239
Change-Id: I7dbe73abefe00814e8652432d8abdbcaa83e0bac
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
2019-11-01 06:43:51 +00:00
Katja Marttila
7151a0b087 Initialize 'EssentialUpdate found' -variable
This caused interesting install experiences as EssentialUpdate was
handled although no such packages were found.

Change-Id: I35bb3e1b76ed14d1e8a45cee085916b3689f0dd1
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
2019-10-31 12:44:25 +00:00
Katja Marttila
f6b1d1fea2 Update Changelog
Change-Id: I87ac44f6e821a4cefe8987aa003c823796bfa60e
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2019-10-31 05:51:57 +00:00
Katja Marttila
abf6e847b5 Decrease the dat file file size
Write the filename list to a separate file and only the name of the
separate file is in .dat file. This has significant effect on the .dat file size
and it also decreases the restart/start time of maintenancetool.

Task-number: QTIFW-1448
Change-Id: If03ce1bb91754acfb4e7dd74434f22a6e3fa2554
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
2019-10-31 04:55:27 +00:00
Katja Marttila
64e656846e Use grid layout in component selection page
The layout in component selection page looked bad, especially in macOS
with dark mode as the widgets were not aligned properly vertically.

Task-number: QTIFW-1334
Change-Id: I718b7eaded78906027ce227671e955afda50c264
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
Reviewed-by: Antti Kokko <antti.kokko@qt.io>
2019-10-30 08:14:52 +00:00
Katja Marttila
7dd35b336f Fix addDependency functionality
addDependency was acting weird - if a subcomponent was added as
dependency, the parent was not installed. It was installed the next time
the installer was launched and something else was added/removed.
addDependency should behave the same as when selecting the component
from UI - it should install the parents too

Task-number: QTIFW-1458
Change-Id: I21726ad6acda3b1fb382263405754c2d682dea76
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
2019-10-21 11:05:56 +00:00
Katja Marttila
9ce679325c List installed packages from command line
Change-Id: Ic8efe08be347f3a208e37458936f8316d66ca916
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
2019-10-18 12:52:39 +00:00
Katja Marttila
730425abb0 Fix --no-proxy option in Windows
Task-number: QTIFW-1445
Change-Id: Iad02ecda0d5b27c3c9719f7c57e090d53a249be6
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2019-10-14 11:33:05 +00:00
Johanna Äijälä
1b96174671 Fix env variable remove on Windows
Removing env variable failed on uninstallation on Windows if the env
variable value had @TargetDir@ in path. File separators got changed
from Windows style to unix style.
Update documentation to inform users to use '\\' as separators when
setting a path as environment variable.

Tested with following values (component.addElevatedOperation(...)
in components.qs):
"@TargetDir@\\lib\\system\\qtplugins"
"not_a_path_but_variable_with_slash_\\qtplugins"
"not_a_path_but_variable_with_slash_/qtplugins"
"%SystemRoot%\\lib\\system\\qtplugins"
"12345"

Task-number: QTIFW-1148
Change-Id: Iaa48d890e70afdbe56bbf389dd4994d5ae91b316
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
2019-10-11 06:32:27 +00:00
Katja Marttila
c706665c4f Fix essential package update
If there was essential update available and autodependency to already
installed packages, the component containing autodependency was installed.
If there was a Replaces at the same time, the Replaces was ignored.

If there is an essential update, no other components should be installed
nor updated except essentials and the components that have autodependency
to essential component.

Task-number: QTIFW-1215
Change-Id: Ib782335f98b6af6ec546aeecb9b032cf84254256
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
2019-10-11 06:20:51 +00:00
Arttu Tarkiainen
62eeab668c Fix CreateLink operation destination string formatting on Windows
- Fix string formatting syntax in createJunction() method.
- Calculate destination directory string length in bytes rather than
  characters count.
- Make minor alterations to operation usage documentation.

Task-number: QTIFW-1443
Change-Id: Ia7f6525c865a3e8a6da5376059111c1ef87353ac
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
2019-10-10 12:59:52 +00:00
Katja Marttila
63723d0d74 Hide scrollarea background while fetching categories
Previously we only hide the label inside the scroll area while fetching
categories, which works if the scrollarea has no background. In macOS
there is a background color in the scrollarea by default so hide the
scrollarea instead of the label to prevent the scrollarea colored
background to be visible.

Change-Id: I2ddc97f7ae9a268b8972c91ab6519381fe7b689c
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2019-09-24 08:38:48 +00:00
Katja Marttila
a0647b7aa6 macOS: Fix widget overlapping in componentselection page in macOS 10.12
In componentselection page, calling setVisible(false) does not work in
macOS 10.12 causing the treeview to be partly visible under the progressbar.
Added repaint() call to cause immediate redraw to widget to fix the
issue.

Task-number: QTIFW-1437
Change-Id: I854d439908b8d8cd0f81076fced07a4d2d4bb6f2
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2019-09-24 06:59:45 +00:00
Katja Marttila
72fcd5fb27 Update Changelog
Change-Id: Ib4d7f137b5839d3a18560aff10491e90346ff778
Reviewed-by: Antti Kokko <antti.kokko@qt.io>
3.1.2-rc2
2019-09-03 05:46:06 +00:00
Arttu Tarkiainen
c410e42502 Refactor setting and checking of file permissions
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>
2019-08-30 07:22:30 +00:00
Katja Marttila
516492370b Merge remote-tracking branch 'origin/3.1' into master
Change-Id: I8b203e12283374aed707e0e89c2f73d44ff296cb
2019-08-23 11:05:07 +03:00
Andy Shaw
8f7af86198 Fix maintenance tool source translations to match the actual strings
Change-Id: If4f87a6d14450a74151b610e0da54ef3a82712fd
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
2019-08-23 07:00:01 +00:00
Arttu Tarkiainen
b3eaeb1782 Enable support for Qt 5.12 in installer framework
Workaround issues of IFW not being able to work on elevated mode
caused by changes in qtbase, namely when initializing socket
connection between remote installer client and server, and writing
maintenance tool binary.

Switch to using unbuffered mode for QFSFileEngine instances as
buffered mode support has been dropped. Fix calls to QFile::copy()
when running elevated installer process. Make minor modifications
for unit tests to pass. Explicitly fail and return when performing
CreateLocalRepositoryOperation on non-owned directory.

Task-number: QTIFW-1312
Change-Id: I3db72547ee95c87d8c02d27e5b31c7b30e793431
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
2019-08-22 11:49:19 +00:00
Katja Marttila
8efb76dc0a Update ChangeLog
Change-Id: Ida8a94b3396c97708dbbab64224c185169122bb4
Reviewed-by: Antti Kokko <antti.kokko@qt.io>
2019-08-19 10:56:22 +00:00
Arttu Tarkiainen
c7066c9dc2 Update usage of Apple-related terminology
Replace deprecated Q_OS_OSX macro used in several places with the newer
Q_OS_MACOS. Old style reference of Apple's desktop operating system name
as "OS X" in documentation and files are also replaced with "macOS"
where applicable.

Task-number: QTIFW-1406
Change-Id: I0561d5e0d964917ac4fca0702d58a06b85d30e57
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
2019-08-16 08:35:19 +00:00
Arttu Tarkiainen
3b310a3ec1 Add regular expression support to replace operation
Introduce search with regular expressions support to replace
operation. Add unit tests and make associated documentation
changes.

Task-number: QTIFW-889
Change-Id: I82e30056030ebc900be49046fda1903b27a2824d
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
2019-08-16 08:33:43 +00:00
Arttu Tarkiainen
28f92d3784 Change ApplicationsDir variable on macOS to return "/Applications"
QStandardPaths::standardLocations(QStandardPaths::ApplicationsLocation)
first element returns $HOME/Applications, as being user writable it
has a higher priority.

Change the variable to return system wide /Applications as it is
a more expected default. Add the user-specific applications
directory as its own variable, and make associated documentation
changes.

Task-number: QTIFW-1011
Change-Id: Ia81a1f5dafdea8665d5f9fc1df3799e59858e5aa
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
2019-08-16 08:30:41 +00:00
Arttu Tarkiainen
54f1de217b Add IFW version information to installerbase binary on Windows
Add Windows VERSIONINFO resource definition to installerbase.rc so we
can link the installerbase executable with file version property.
Created installers using this base binary will include the set version
property.

Task-number: QTIFW-1397
Change-Id: Ie7781bf65c6032c01bb0bac9e945c665e81973d9
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
2019-08-15 12:16:57 +00:00
Arttu Tarkiainen
864aaa7ea3 Fix Mkdir undo operation fail to remove directory in Settings operation
Related to 0a842140f5d7cc7383c5266acbbc74428dd82014. MkdirOperation
object instantiated in SettingsOperation::undoOperation() doesn't have
reference to PackageManagerCore instance. As such, replacing
@RELOCATABLE_PATH@ with targetDir value can't be done and the created
settings file path, being invalid, doesn't get removed.

Pass reference of the package manager core which the Settings operation
belongs to, to MkdirOperation object, so @RELOCATABLE_PATH@ will be
replaced with core's targetDir value.

Task-number: QTIFW-1365
Change-Id: I327d8a63320ecec0e1d51fe7ed899d236fbd21e2
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
2019-08-15 12:15:44 +00:00
Arttu Tarkiainen
6d5c3d36ea Fix incorrect compare string on findMagicCookieWithError() test function
Change-Id: Ic38a4dd321d01606deb5f85bfdabac3677205e81
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
2019-08-15 12:14:34 +00:00
Arttu Tarkiainen
d4eb7fba67 Fix IFW version information not apparent on macOS
On macOS remove the use of obsolete CFBundleGetInfoString, replace with
CFBundleVersion and CFBundleShortVersionString respectively so that the
bundle's properties in Info.plist are up to date and version shows
correctly.

Task-number: QTIFW-1396
Change-Id: Iac03478e266d9d2994ecdf3b229e63976d683ac0
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
2019-08-15 10:01:55 +00:00
Arttu Tarkiainen
1c22f5dd46 Doc: Define CreateShortcut operation as a Windows-specific feature
Task-number: QTIFW-1399
Change-Id: I81d5bf2c2abde9f0e49f5ea8cb99845e14159800
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
2019-08-15 10:00:50 +00:00
Arttu Tarkiainen
55ecbb9660 Update repository categories on server authentication request
If repositories in a category were located on a server that requires
user authentication, IFW couldn't update information of the repositories
inside a category during runtime. This prevents for example storing
credentials from the authentication request dialog and blocks the
usage of that category.

Add a method for updating contents in repository categories and a
unit test for the new method. Also some minor tweaks to relevant
bits of code.

Task-number: QTIFW-1358
Change-Id: Idfa2559df6d0d2a6de428b8d5fb1f7672aa1e300
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
2019-08-15 10:00:37 +00:00
Arttu Tarkiainen
120e527ed1 Fix recalculation of components to install in MaintenanceTool
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>
2019-08-15 10:00:10 +00:00
Arttu Tarkiainen
1ae7ad5c68 Doc: Fix wrong values in Settings Operation summary
Task-number: QTIFW-1386
Change-Id: Ic8faf41fd972505353f6c2e461ddfb47a8db6d94
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2019-08-15 09:59:45 +00:00
Katja Marttila
18a722ade4 Doc: Update getting-started page
Task-number: QTIFW-1185
Change-Id: I602425589b3b2e0482d025a02b06f4b4c27ac330
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2019-08-13 10:48:51 +00:00
Katja Marttila
670e8b69f3 Prepare 3.1.2 release
Change-Id: I3e0c2cb9825974ec42940c55d8d9b48afa770d8e
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
3.1.2-rc
2019-06-18 06:40:24 +00:00
Andy Shaw
b07d55203b Doc: Don't indicate that you can add pages in a control script
Change-Id: I6ddfc27334d8f14852cd926653b5ab56851c3fec
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
2019-06-17 12:58:02 +00:00
Arttu Tarkiainen
89f772f819 Gain admin rights for writing MaintenanceTool config files if needed
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>
2019-06-14 08:10:26 +00:00
Katja Marttila
8d020f1b19 Update INSTALL file
Fix recommended configure options and building of Qt

Task-number: QTIFW-1185
Change-Id: Id4365b3debe8adbe325cba3ed868a7659438bdbe
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
2019-06-13 10:28:15 +00:00
Katja Marttila
c1f87ceed0 Fix double condition check
Task-number: QTIFW-1082
Change-Id: I47e403444b2932984f0a559613826ca6fa9e41df
Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
2019-06-13 10:27:30 +00:00
Arttu Tarkiainen
0bb2d25e87 Fix initially deactivated buttons when selecting components to update
When entering component selection page for updates, force checking of
component model state change so we can enable or disable relevant
component selection buttons right when entering, not after first
selection change.

Task-number: QTIFW-1320
Change-Id: I86a94b70979f7064618186c539b0b7fc594d1481
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
2019-06-11 08:04:49 +00:00
Arttu Tarkiainen
4ada7607ae Update documentation for Component Selection Page
Repository categories introduced in IFW 3.1 can cause behavior changes
in older automation scripts that use component selection methods.
Update documentation to include new items on Component Selection Page
and provide an example code for fetching components from a category.

Task-number: QTIFW-1354
Change-Id: Icf93d1325563d3bdf6a38799ab260b13f4078a81
Reviewed-by: Tarja Sundqvist <tarja.sundqvist@qt.io>
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
2019-06-03 07:01:54 +00:00
Arttu Tarkiainen
46aecc23b2 Fix MaintenanceTool file write permission check on Linux and macOS
Running the Qt installer on Linux and macOS with sudo will leave
the installation target directory and some installation files
writable by other users than their owner (root). Make
MaintenanceTool check over all subdirectories in the installation
directory for write permission so that admin rights can be always
requested when needed.

Task-number: QTIFW-1324
Change-Id: I9b314853634642b0be1fb3ea7a9164a2d4beb853
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
2019-06-03 07:00:48 +00:00
Katja Marttila
c97eb6750c Documentation fixes
Change-Id: Ibfb4fd033f8dae23b953f21ebcda40c8325577e1
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2019-05-27 09:15:47 +00:00
Katja Marttila
3946e2f860 Merge remote-tracking branch 'origin/3.1' into master
Change-Id: I65e3ed3858cda954a5f916031d4ff02a39a9aa87
2019-05-27 11:45:32 +03:00