84 Commits

Author SHA1 Message Date
Katja Marttila
9dacee18f9 Replace 0 with nullptr
Prevents a lot of warnings seen in QtCreator

Change-Id: I63bf95aca68a04fc9fd0eecbe29c63e9b9c47efd
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
2019-01-09 05:41:16 +00:00
Katja Marttila
47ae652577 Do not reset core data values in restart
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>
2018-10-16 05:41:33 +00:00
Katja Marttila
c0b2007d20 Enable building IFW with Squish support
Change enables building IFW with Squish support by passing SQUISH_PATH
to qmake when building IFW. Also enables runtime change of Squish port
with command line option --squish-port <port number>. If no port is set,
default port 11233 is used to attach to Squish.

Change-Id: I4821b360031df66968d3592886c2e45598e1b097
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
Reviewed-by: Antti Kokko <antti.kokko@qt.io>
Reviewed-by: Johanna Äijälä <johanna.aijala@qt.io>
2018-02-12 11:53:34 +00:00
Katja Marttila
677f055115 Fix usesSystemConfiguration usage
As usesSystemConfiguration() is introduced in Qt 5.8, use it only when
compiling with Qt 5.8 or higher. IFW still supports version 5.6.2.

Change-Id: Ib39f38a452624a84627ad53c9941154bc0fd7929
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
2018-01-30 07:04:43 +00:00
Katja Marttila
e3ddb89442 Set correct proxy type
From Qt 5.8 onwards system proxy might be used by default. Checked if that
is the case and updated settings accordingly.

Task-number: QTBUG-65143
Change-Id: Ibe8f3173636c57f73addcc576afdd37a68ec1d03
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2018-01-25 10:53:31 +00:00
Oswald Buddenhagen
5845091bd4 make .ts file naming follow the usual pattern
this makes it easier to integrate ifw into the surrounding
infrastructure.

Change-Id: I7918830b7a6c29d8556911eec83a3b6530478d84
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
2018-01-03 17:39:31 +00:00
Katja Marttila
22d340e39e Check license when doing silentUpdate
Task-number: QTAUTO-428
Change-Id: Ib3d56b59a12d4c7091a6abdbc5231ed5dbe2c3b1
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
2017-05-15 05:44:33 +00:00
Katja Marttila
3fdc5bd4b1 Give warning and exit install if invalid URL given for 7z repository
Task-number: QTIFW-966
Change-Id: I13cf001771d30e0737348d33183e329e4c1d2070
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
2017-05-10 06:02:27 +00:00
Katja Marttila
9772474dd9 Merge remote-tracking branch 'origin/2.0'
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
2017-01-30 14:40:26 +02:00
Katja Marttila
c9d11cc991 License header update to GPL-EXCEPT
Change-Id: I6426c4e8f932cf26c6c638dec18d0c12e22972d1
Reviewed-by: Janne Anttila <janne.anttila@theqtcompany.com>
2017-01-26 10:02:56 +00:00
Katja Marttila
b5b0a8d265 Introduces new --silentUpdate command line option
With this feature one can update all installed components
silently with maintenancetool by passing --silentUpdate parameter

Change-Id: If31d37ce24e794775c2fe47b603259da133c9ee7
Task-number: QTIFW-906
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
2016-11-15 06:43:54 +00:00
Katja Marttila
e7f9321718 allow installing compressed packages
This change introduces new feature to add 7z packages to be
installed. Packages must be installer repositories (created with repogen),
compressed to 7z file and named as qtbsp or 7z. Selecting compressed package
is done either with button in component selection page or with
--installCompressedRepository parameter given to installer or to maintenancetool.
Button will not be created by default. If you want to show the button
either build IFW with DEFINES+=INSTALLCOMPRESSED or enable the button in control
script with allowCompressedRepositoryInstall() in ComponentSelectionPageCallback

Task-number: QTIFW-886
Change-Id: Ia060092c348991d5195393b7dc154205f8bf92a5
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
2016-11-09 07:08:48 +00:00
Frerich Raabe
6e5ef08718 Automatically load all fonts in 'fonts/' resources
...such that they can be used in style sheets.

Change-Id: I677be428972dbfe9385cf438b0ccf2f0f3fcd822
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
2016-11-08 10:22:11 +00:00
Katja Marttila
e87c58548a Merge remote-tracking branch 'origin/2.0'
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/7zip/7zip.pro
	src/libs/7zip/win/CPP/7zip/UI/Common/Update.cpp
	src/libs/installer/component.cpp
	src/libs/installer/lib7z_facade.cpp
	src/libs/installer/packagemanagercore.cpp
	src/libs/installer/proxycredentialsdialog.h
	src/sdk/translations/ja.ts
	tests/auto/installer/messageboxhandler/tst_messageboxhandler.cpp
	tests/auto/installer/scriptengine/tst_scriptengine.cpp
	tests/auto/installer/settings/tst_settings.cpp

Change-Id: I3bb98b8490b3c3eb7f664c1abb7417155b5430b2
2016-06-21 12:32:42 +03:00
Frerich Raabe
b4a1a89e30 Store lock files in temporary directory
The directory in which the application is stored may not be writable for
the current user, e.g. if the installer is stored on a read-only network
drive, or (common case on OS X) if the installer bundle is started from
a read-only .dmg image.

This fixes warnings in the verbose output (especially noticeable during
unattended installations) like:

  [0] Warning: Cannot create lock file "/Volumes/froglogic Squish/Install Squish.app/Contents/MacOS/Squish1234865.lock": Read-only file system

The patch is defensive in that it just uses QDir::tempPath() instead of
going for QTemporaryFile to avoid having to worry about auto-delete
semantics.

Change-Id: Iee2409dd6f884c4fe234057b2926eee82127f985
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
2016-06-15 08:54:46 +00:00
Katja Marttila
2cb5ecf0d7 add missing tr for "AlreadyRunning" messagebox
Change-Id: Icffe886597a1f18d9eaacf1e3a14f31e252919c6
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
2016-05-19 06:24:33 +00:00
Katja Marttila
f3e46570a6 Fix setValue saving in restart
When running maintenancetool and installing a component that sets a value
in installscript with setValue, the value is cleared when pressing
'Restart'.

Task-number:QTIFW-504

Change-Id: Ie588b6f1011d7b50b771ea8ee0dea99350f65878
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
2016-02-15 06:52:59 +00:00
Frerich Raabe
b28809d339 Don't use 'lockmyApp' prefix for lock files
The 'lockmyApp' part of the lock file names looked like some generic
default value which just was not customized to fit the installer. Let's
use the Qt application name instead as returned by
QApplication::applicationName().

We maintain the strong random filename generation algorithm by sticking
to the proven constants which presumably are perfectly random since they
were generated by a fair die roll.

Change-Id: Ief18942ca4e967f7016e7c471a7b44e3b8ab8c95
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
Reviewed-by: Katja Marttila <katja.marttila@theqtcompany.com>
2016-02-15 06:15:09 +00:00
Iikka Eklund
2af57eb8c8 Merge remote-tracking branch 'origin/2.0'
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
2016-01-20 14:18:30 +02:00
Iikka Eklund
6ba58b42ab Update license headers
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>
2015-12-29 07:31:11 +00:00
Karsten Heimrich
cab3405ad2 Missed to rename classes and to update docs and tests.
Change-Id: I2d79ab4094cb9706287d44160543c19b35a66c95
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2015-09-07 10:41:45 +00:00
Kai Koehne
c417d953f7 Merge remote-tracking branch 'origin/2.0'
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/component.cpp
	src/libs/kdtools/updatesinfo.cpp

Change-Id: I0a1b4a464f7d9008b589b54dd7aed0cac71bd666
2015-08-19 16:39:18 +02:00
Karsten Heimrich
de8b7ede25 Rename files. Remove {kd} prefix. Remove {kdupdater} prefix.
Change-Id: I88c93cab718f4659296d5f7f562beefd747a366f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
2015-07-14 12:37:58 +00:00
Kai Koehne
b2a65ce68b Sanitize QDebug output
Prefer using the stream operator logic instead of using
QString::fromLatin1. Add a noquote() where a QString should be printed
without any quotes/escapes.

This also fixes the tests with Qt 5.5, where QString's are further
escaped.

Change-Id: Ie3afd14b9355101d3c0b52f30f66ec759c76526c
Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
2015-07-09 13:38:42 +00:00
Karsten Heimrich
99c2eb19c3 Fix: .dat file gets deleted after multiple component changes.
We can close the .dat file in maintenance mode. There is no need
to keep it open since no packages are in there and resources are
mapped into memory anyway. Fixes commit 7f2c98c8 that updates the
.dat file on soft restart. On Windows updating did not work cause
the .dat is opened and locked by the OS. To overcome locked files
we run a VB script that does a deferred rename once the lock is
gone, but in case of a soft restart we now did start several of
them depending on the amount of restarts.
That had the undesired effect of several replace/rename operations,
of which only 2 "succeeded":

- First script: Remove .dat | Rename .dat.new -> .dat
- Second script: Remove .dat | no .dat anymore...

Task-number: QTIFW-689
Change-Id: Ic3ee1b418890eabe5b854dc7879cd7bc118f9240
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
2015-06-11 15:41:21 +00:00
Jarek Kobus
c522fd5de9 Add more logging categories.
Change-Id: I1c7dabfd16a69ef5a3e5aaa490036de061f1fd13
Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
2015-04-24 12:58:49 +00:00
Jarek Kobus
2554ccb7ba Enable logging categories as an installer option.
Now by default all categories are disabled.
They get enabled only in verbose mode.
Verbose mode enables all categories by default.
Categories can be filtered using logging-rules option.

Change-Id: I9324826a6e2d7a746e3d7369747fcd31a42b84b6
Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
2015-04-24 12:57:10 +00:00
Jarek Kobus
e2a30c0c18 Make componentChecker warnings optional.
To enable them export the following environment variable:
QT_LOGGING_RULES=ifw.componentChecker=true

Change-Id: Ied6744c745ca3fd0840c622c71a8ba30ad22e3d9
Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
2015-04-22 13:37:38 +00:00
Kai Koehne
d6bca86cad Use local sockets for client-server communication
Change-Id: I12bfef671ab31ae9fb8c4bb02776517e7f434d27
Task-number: QTIFW-228
Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
2015-02-20 10:22:28 +00:00
Kai Koehne
99996591e0 Update Copyright
Change-Id: I8dde6629cfd461104364d5cdc255cb54b58283fa
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2015-02-18 10:33:48 +00:00
Kai Koehne
0838e9eac2 Fix use --startclient arguments
So far the arguments to --startclient have been ignored.

Change-Id: Ib76b061381a9320e6e4e9e2e970132c2f614aca7
GPush-Base: 92da4093e32040cb7cd7ed5587de78262d825e65
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
2015-02-02 13:33:21 +00:00
Jarek Kobus
929fef475b Fix loading of translations
In case we hit the English translation just try to load it
and break in any case. In case we hit another language
we only install the translation if the qt translation was
loaded properly, and break.

Change-Id: I2755501c1af8cb51b38cf21e0205bcf05541fb91
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2015-01-26 15:47:13 +01:00
Christoph Vogtländer
86a40b0fca rename CreateOfflineRepository to CreateLocalRepository
Change-Id: I36d7a504b27dfff8b9d10c9d90b6ff77108b9982
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2015-01-08 15:18:59 +01:00
Kai Koehne
b11f689b79 Remove country from most translations
If we provide an en_us translation only this won't be picked up
by users having configured 'en', or 'en_uk'. This also mirrors the
naming of the qt translations.

The exception is zh_CN though, because the difference between
simplified and traditional characters is big. I'm not sure whether
taiwanese people would rather prefer traditional characters or english.
For Qt we have both zh_CN and zh_TW, maybe we will get a zh_TW in the
future too...

Change-Id: I73490337aef8f54da14b6feca3a035e1e405d65b
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2015-01-06 12:17:46 +01:00
Christoph Vogtländer
b14a7d2cbc Add CreateOfflineRepository configuration option
Setting CreateOfflineRepository to "true" in config.xml will
create a local offline repository, same functionality as
"--create-offline-repository" command line option

Change-Id: I51b947157ebc27800b1e9ad0b55d139ac6e164b2
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
2014-12-11 16:12:29 +01:00
kh
4853be33e2 Add possibility to specify a control script.
Right now we support control scripts just as command line argument,
but now we can also bundle it in the binary as well. This helps e.g.
with running scripts during uninstallation, enables the possibility
to modify the introduction page or enables headless installer builds.

Task-number: QTIFW-495
Task-number: QTIFW-166
Change-Id: I6fee6a55db78ed28b1eeb8257a4febaa2703c04e
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
2014-12-10 08:54:18 +01:00
kh
64d49f097f Implement a way to start the server in debug mode and API cleanup.
1; Passing debug as first argument to the starting server does not
start the server side so the server keeps running in an endless loop.
This makes it far easier to attach a debugger.
2; API cleanup and unify init function to take port, key, and mode.
The address was never able to be changed anyway, so stop passing them
around.

Change-Id: I2a847f009ed1557a5e136e2b0006de5c62426da2
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
2014-11-26 14:49:23 +01:00
Kai Koehne
6df883de4a Expose real type of PackageManagerProxyFactory
This allows us to store proxy settings in the factory later on.

Change-Id: Ib389ccffb3163be4f5cd511be4c4b8bbe15e8a93
Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
2014-11-18 16:17:12 +01:00
kh1
b67c842ba8 Make sure we do not fail if we can't create the lock file.
If we can't lock the file (possible missing privileges to create
and lock it), we now check the running processes before we fail.

Task-number: QTIFW-566
Change-Id: I821ccf8c37d6a235df49e060c59a0283bb91261c
Reviewed-by: Takayuki ORITO
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: Niels Weber <niels.weber@digia.com>
2014-11-12 21:22:51 +01:00
kh1
b1b9a3df47 Rewrite the isRunning implementation and remove private class.
Use a more descriptive enum name. On Windows keep the lower case
version of the process name instead of calling toLower() several
times. Print a warning if we cannot obtain or release the lock.

Change-Id: Iaaefae0359cd214290f62ce78677cb343da8823c
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: Niels Weber <niels.weber@digia.com>
2014-11-12 21:22:35 +01:00
kh1
624adb3699 Implement package filtering for online and offline installer.
Change-Id: If17725c0d97111aff67bcc0bc060fb74bb1109cd
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: Niels Weber <niels.weber@digia.com>
2014-10-30 13:40:57 +01:00
Kai Koehne
4ebfecf411 Add LGPLv3 as new license
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>
2014-10-16 15:17:56 +02:00
kh1
84875396b7 Overhaul the binary format API.
Adjust some naming. Add documentation. Make the Resource class
handle files only, this is sufficient to read and map inbuild
resources. Keep the QResources inside the manager as well, no
need to handle them separate. Remove read, write functions from
collection class, the API was just unclear how to use. Still it
is far from intuitive in the manager class either. If we open a
Resource, we need to close it on our own case they are pointers.

Change-Id: Ic8aa32a84a15ac774fe1194ba0dbb5733f7216d6
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
2014-10-15 17:10:18 +02:00
kh1
b73ef0fa7e Fix some std::cout usage.
Fixes missing timestamps and some propably wrong conversion.

Change-Id: I6106e1ea61d0840d132dd3b44cd746f023e795af
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-09-05 10:53:15 +02:00
kh1
77b1e16820 Split and implement new installer base, update checker.
Based on the former patches, split the installer base into its
own class. Use the new binary content read functions. Adjust uses
to match the new classes. Adjust installer base /update checker
signature and inheritance. Remove all now superfluous functions
from binary content. Core engine instantiates the operations now,
makes reading and writing more generic. Move product key check
into QInstaller namespace. Make use of the new command line parser.

Change-Id: I00aff79085b69ce627906881b43f374681ea7e91
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-09-04 10:41:53 +02:00
Kai Koehne
2dfa49ac79 Fix listing of resources
In commit 6466dbd11190 the list iterator advances two times in one go.

Change-Id: I24aae53b764732b04159261921365c99518ee3e9
Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
2014-08-27 12:09:49 +02:00
Kai Koehne
6466dbd111 Make listing of resources less verbose
Print the resources only once, and hide Qt internal resource paths.

Change-Id: I4fce72424b4ab94d44d63e16b6ae89cff7ccac72
Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
2014-08-27 11:22:00 +02:00
Niels Weber
2c6f351491 Fix Typo resulting in wrong error message
Change-Id: I62e91bcb3bfe73ea0d23f6cdf6938af10fffd8cc
Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
2014-07-17 15:50:11 +02:00
kh1
62ef1132ae Move class BinaryContent into its own file.
Prepare for QTIFW-292 and QTIFW-345.

Change-Id: I938b5aa728e8f81eb9521df5753ad80ac630d96e
Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
2014-07-15 11:36:15 +02:00
kh1
7e22555eaa Move updater class into sdk binary and rename to UpdateChecker.
Remove some now superfluous methods from binary format.
Adjust initializing some objects as we need them not earlier.
Unify implementation of accessing the right binary to read the
content from.
UpdateChecker does now have its own run checker, makes it possible
to run the binary even if a e.g. maintenace tool is already running.

Change-Id: I94f32f7f38b62b5aee433753abc2fe72e879ddc9
Reviewed-by: Niels Weber <niels.weber@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-07-15 11:30:48 +02:00