78 Commits

Author SHA1 Message Date
Katja Marttila
49201fdb99 Revert "Allow signing maintenancetool in Windows"
This reverts commit 76fd6e8f2953347ea0bf7a57b643968784bc9acc.
The change caused that two installation files were needed -
one executable and one dat file. Many users did not find it acceptable.
We need to figure out something else.

Change-Id: Ief12cd47f9897cee8a234d8611a5c18296d42b1c
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
2016-09-15 07:01:05 +00:00
Katja Marttila
76fd6e8f29 Allow signing maintenancetool in Windows
Signing was not possible for maintenancetool since metadata was
added to binary. Separated metadata to installer.dat like in OS X.

Task-number: QTIFW-667
Change-Id: I74ef307c51a2f43059475dd943d6f0910925fa86
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
2016-06-21 04:51:29 +00:00
Frerich Raabe
b5480f253a Fixed (and greatly simplified) creating .dmg files
The mkdmg.sh script which is used to create .dmg files made some effort
to calculate the size of the file system contained in the .dmg file.
However, it neglected to consider that a .dmg file is not always
(never?) totally empty. A sample session on OS X 10.10.5 shows:

  $ hdiutil create /tmp/foo.dmg -megabytes 33 -ov -volname foo -type UDIF -fs HFS+
  ... <a lot more dots here>
  created: /tmp/foo.dmg
  $ hdid /tmp/foo.dmg
  /dev/disk3              GUID_partition_scheme
  /dev/disk3s1            Apple_HFS                       /Volumes/foo
  $ df /Volumes/foo
  Filesystem   512-blocks Used Available Capacity iused ifree %iused Mounted on
  /dev/disk3s1      67504 1584     65920     3%     196  8240    2% /Volumes/foo

About 792kB are apparently used for bookkeeping (in ".Trashes" and
".fseventsd") directories.

Since mkdmg.sh failed to account for these 792kB, the .dmg file it
creates was occasionally too small, causing an error message to be
printed by the 'cp' command in the mkdmg.sh script (but that error
message was never printed anywhere, at least I never noticed when
executing binarycreator - always only when running mkdmg.sh directly).

Instead of fixing the allocated size, let's just make use of the
'-srcfolder' argument to 'hdiutil create' which does all of this
automatically. It requires no copying around or calculating sizes, which
not only makes the script much simpler, it also avoids the
above-mentioned issue but also makes the script run faster: about 30%
faster in my experiments.

With this, the mkdmg.sh script is so small (just one hdiutil and one rm
call) that we may just as well drop it completely and perform those
operations straight from the C++ code.

A final nice side-effect is that '-srcfolder' can be specified multiple
times: this makes it very easy to copy multiple directory trees in the
resulting .dmg file. This in turn is useful to create nicely styled .dmg
files with custom background image and icon arrangements.

Change-Id: I54d63a00e56d1ee9fa61c2690ca42d512fda37b1
Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
2016-04-08 10:18:57 +00:00
Frerich Raabe
4de3b0612b Add new '--sign' switch to binarycreator for signing OS X app bundles
This patch introduces -s/--sign switches for binarycreator which are
only available on OS X. Using these switches, a 'Code Signing Identity'
can be configured which should be used for signing the generated .app
bundle.

Signing the application bundles avoids that Apple's Gatekeeper complains
about the application coming from an unidentified publisher.

Change-Id: I507c6cac0b99faf19faf48c21e47a2df054b0b11
Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
2016-02-18 08:38:28 +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
Frerich Raabe
ba9ddaed74 Fix timeout errors while building app bundles files on OS X
...by simply not using any timeout anymore. I believe this was the
original intention of the code (it's arguably hideous that the default
value of the waitForFinished() method is a 30000ms timeout).

What happened for me is that the mkdmg.sh script took longer than 30
seconds. As a consequence

  1. the 'waitForFinished()' call returned
  2. The mkdgm.sh script was deleted
  3. The QProcess object went out of scope, terminating the shell process
  4. The binarycreator process terminated successfully

The resulting .dmg file seemed plausible (it was fairly large already)
but it wasn't usable yet since the hdiutil process started by mkdmg.sh
was still running, i.e. the .dmg file was still growing. Hence, the
caller of binarycreator (e.g. some CI system) continued processing a
malformed .dmg file (and the temporary file created by mkdmg.sh never
got deleted).

Last but not least, proper error handling would have been nice of course
but I considered that to be out of scope for this particular commit.

Change-Id: I767ff89d20802306189660804cea617c148a943e
Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
Reviewed-by: Katja Marttila <katja.marttila@theqtcompany.com>
2016-01-12 12:57:06 +00: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
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
Kai Koehne
1e589e37a9 Unify translated error messages
* Enclose file paths in ""
* Localize file paths with QDir::toNativeSeparators.
* Make sure sentences end with a '.'
* Append error details always by ':', e.g.
    tr("Failed to copy file '%1': %2").(...)
* Use 'directory' instead of 'folder' everywhere

Change-Id: Ie045f429f72ad5045c96537465c5fb9d2e99d250
Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
2015-06-24 09:22:42 +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
Christoph Vogtländer
552d964c6f no longer use Version as the repository format version
Use the Version value defined in config.xml as the product version
exclusively instead of sometimes using it as the repository format
version in components.xml (which must be 1.0.0) and sometimes as the
product version.

Change-Id: I63864947bf131ac6e246a2aaf6febdda0555c13d
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
2015-01-20 17:01:39 +01:00
karsten.heimrich@theqtcompany.com
2e30849eb9 Small cosmetical changes, no functional.
Change-Id: Ic984503444187dfcfcfa83f82768bebb329381d0
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2014-11-21 13:18:50 +01:00
Christoph Vogtländer
de66578f22 Fix generation of Updates.xml
Generated Updates.xml was missing DownloadableArchives property and
component size was not calculated properly in case package directory
contains files that are packaged into 7zip archives by the installer.

Change-Id: I73e3d16b73cfbe25cb8b2e55b9c93f48b1ecdb1c
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
2014-11-18 16:34:49 +01:00
Niels Weber
ddb068f7c3 Fix compilation on OSX and Windows
Change-Id: I2981cdebda3fba7d69269ae6b1a1ae7999162fa6
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2014-11-14 14:24:08 +01:00
Kai Koehne
c8ed41495f Allow to check for IFW version in code
Rename the IFW_VERSION to IFW_VERSION_STR, and add a new IFW_VERSION
define that encodes the version in hex. This follows the pattern of
QT_VERSION and QT_VERSION_STR, and allows easy checking of the IFW
version e.g. in macros.

Change-Id: I232c8aa53c9a04522810208cdd1ac595d8676879
Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
2014-11-11 16:51:39 +01:00
kh1
5bacbf96be Fix the steps we perform to build an installer.
We need to keep a specific order, otherwise the data might endup in
the resource file as well and gets appended twice to the installer
binary.

Task-number: QTIFW-564
Change-Id: Idcadb5d65043d1855846556b63191898a4a54027
Reviewed-by: Christoph Vogtländer <c.vogtlaender@sigma-surface-science.com>
Reviewed-by: Niels Weber <niels.weber@digia.com>
2014-11-05 11:31:29 +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
711ff0fe83 Make use of the new binary content write function.
Change-Id: Icd6e8a77458e61adc92d93e49846b63a79082513
Reviewed-by: Niels Weber <niels.weber@digia.com>
2014-08-27 13:26:33 +02:00
kh1
2312e7fd59 Rename binary format classes and functions. Move to QInstaller.
Adjust some minor implementation details. Some renaming of member
variables and function names is left out but will follow in later
patches. Add some documentation.

Change-Id: I929dcbe13fa701be5224b9e5fdf8d19bfff81235
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Reviewed-by: Niels Weber <niels.weber@digia.com>
2014-08-27 10:44:00 +02:00
kh1
a0c051656c Update documentation and rename code to improve readability.
Change-Id: I5b467aca314f81304f7a4854cb6ea5b4f57361f3
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-07-15 13:03:34 +02:00
kh1
5a3063968c Make the marker and the find function class members.
Prepare for QTIFW-292 and QTIFW-345.

Change-Id: I065366742d28e72bc5ae55e70eabf6532b809fea
Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
2014-07-15 11:37:07 +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
7f4fadd08d Workaround for QFileInfo::isBundle().
For some reason the former code did not work anyore as expected,
the issue seems to be in QFileInfo::isBundle or how we used it.
To not depend on a possible fix in Qt, we now always resolve the
path before we ask QFileInfo if it is a bundle.

Fixes also the behavior change introduced in cead4555. On OSX,
we get the .dat file passed that's inside the bundle, still we
need to read the data from a .dat file that's located beside
the app bundle...

Change-Id: Idaa7adc6fbad6bd8e9ce90c383b34ea51fe40e8f
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-07-04 14:41:21 +02:00
Niels Weber
adb91d5dd8 Replace Q_OS_MAC with Q_OS_OSX
Q_OS_MAC also refers to iOS.

Change-Id: I91603d0add90a0f3948453a6b9628814b0d9f80c
Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
2014-07-03 11:14:19 +02:00
kh1
71868e96bf Fix broken tools after switching to QFileDevice.
Follow up on 924ebcdbc9b9e590a5f0905941e2d05ac34d4be2 (Part 1).
Get rid of KDSaveFile, reuse QTemporaryFile. After changing
KDSaveFile to inherit from QFileDevice, it turns out to be not
working properly anymore and crashing e.g. binarycreator while
using it. To save fixing it we just switch to QTemporaryFile.

Change-Id: I785a04db91b431f5e122f193ecf2ef3c54e34b1c
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-07-02 14:07:08 +02:00
kh1
924ebcdbc9 Split out the file IO stuff and adjust other files respectively.
Also adjust the API to use QFileDevice instead of QIODevice to
make clear we just operate on files here and not on any possible
device like sockets, processes etc...

Change-Id: I4ecbb6e244fe4bb666ed12e62f9f5586bc1347f0
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-06-24 10:31:08 +02:00
kh1
86f3bd1f75 Use QTemporaryDir instead of our homemade solution.
Change-Id: Ia584a9b2f954df5c29a2f0aa5f12b201b2bfbcc4
Reviewed-by: Niels Weber <niels.weber@digia.com>
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
2014-06-03 10:49:59 +02:00
Sascha Cunz
819e068216 Name .dmg files after the application bundle on Mac OS X
Use the name of the application bundle (input.outputPath) to give the
disc image a volume name instead of using the file name of the .dat
file ("out" is set to 'installer.dat' at construction time).

Change-Id: I0f53ca7fcafb83353f4fea61b62037f48281375e
Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
2013-11-08 12:59:43 +01:00
Tim Jenssen
e14d0b31bc Merge remote-tracking branch 'origin/1.4' into 1.5
Change-Id: I2725f9bacbe04240dc3f97062c5ebc50884822c8
2013-11-06 17:06:15 +01:00
Eike Ziller
0e63df370e Mac: Fix Info.plist for installer
Change-Id: I7a0199c3001395356e96c0ef5a0c5104144b9cb2
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
2013-11-06 16:08:26 +01:00
Eike Ziller
917a234d18 Make installer apps retina-ready.
Also fixes the generator note.

Change-Id: Ic9a9a033d74320221563c46611122d0fef216c23
Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
2013-10-24 11:20:40 +02:00
Tim Jenssen
7778787b91 Merge remote-tracking branch 'origin/1.4' into 1.5
Change-Id: Ib2d382d1aa398b642dc15f4df7c03b19bf638546
2013-10-23 17:09:23 +02:00
Michal Klocek
6e25ca4ec7 Option parser, rcc works for current path -> no target expected
Change-Id: I93bc6613203e1e879b18e7a8d6ef8849870835ee
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
2013-10-16 17:27:49 +02:00
kh1
0f4ceb1950 Implement a way to replace the default resource.
Change-Id: I2e362d255bf2526f216cbb872bbb64d37383d229
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
Reviewed-by: Michal Klocek <michal.klocek@digia.com>
2013-10-16 15:51:30 +02:00
Tim Jenssen
d8d93f85d6 Merge remote-tracking branch 'origin/1.4'
Change-Id: I9ee4395291754fd5a56555e1dd974df19ee39376
2013-08-26 12:24:11 +02:00
Tim Jenssen
9407b86794 fix online only installer creation
Task-number: QTIFW-319

Change-Id: I1f66f80b952742e7ff21ee6960120271e1579fb9
Reviewed-by: Niels Weber <niels.weber@digia.com>
Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
2013-08-01 15:57:14 +02:00
Tim Jenssen
af045e1321 rename copiedArchives to copiedFiles
- they are including the sha1 files so the old name was misleading

Change-Id: I6156b5590bc98ed319a093c82be32d9f79699d28
Reviewed-by: Niels Weber <niels.weber@digia.com>
Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
2013-07-30 09:49:33 +02:00
Tim Jenssen
72dfa6df1e Merge remote-tracking branch 'origin/1.4'
Conflicts:
	installerfw.pri
	tools/binarycreator/binarycreator.cpp
	tools/common/repositorygen.cpp
	tools/common/repositorygen.h
	tools/repogen/repogen.cpp

Change-Id: I97767b2e4ef9b7afd5ce368d99c6a7d38dfbd947
2013-06-27 11:20:29 +02:00
Kai Koehne
b38573f2da Do not use don't, can't ... in output
Don't, Can't, etc abbreviations are used in informal speech. This is
okay in code comments etc, but user output should use the correct,
non-abbreviated terms.

Change-Id: I53c0dfa91596c151bfa7ef7b65f57d5084ceccde
Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
2013-06-20 12:36:03 +02:00
Niels Weber
dc3f0a459d Lists packages not found that were given explicitly.
When the user calls repogen or binarycreator using the include or
exclude parameter, those packages that were given but could not
be found in the packages directory are now listed in a warning.

Task-number: QTIFW-233
Change-Id: Iaadd0a14d2c6d834daa6dbe956118d674e048fac
Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
2013-06-20 12:31:40 +02:00
Niels Weber
3ddfcacc51 Allow multiple package directories.
Task-number: QTIFW-24

Change-Id: I4e6e31457ecd63de7a2de98e35a7be00616151a5
Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
2013-06-11 16:29:27 +02:00
Tim Jenssen
95dc8d8930 binarycreator tries to copy qt_menu.nib dir
Change-Id: I86ae6eb2c1129537939fc797a88b5c5b8619fbf7
Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
2013-05-27 15:44:15 +02:00
Sergio Ahumada
c7f9289af6 Some minor Nokia -> Qt Project changes
- Updating the supported platforms link
 - changing com.nokia -> org.qt-project

Change-Id: Ib74fda09f177a989b79288b967423ef04c16786e
Reviewed-by: Niels Weber <niels.weber@digia.com>
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
2013-04-30 13:05:14 +02:00
kh1
b8dc0c7313 Fully qualify function calls. Fix minor typos.
Change-Id: I36cc096f3195e69bf027aa629d31ffac1d519732
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
2013-03-25 22:00:36 +01:00
kh1
3224fa9834 Change function names (to what they actually do) and signature.
The signature change is kind of a cosmetic one, but I think it
is more obvious that passing a reference into a function might
modify the parameter.

Change-Id: I424c06ed7a449204bd0b243ff07c2d36669b7381
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
2013-03-25 21:59:53 +01:00
kh1
08ca491ca6 Assume offline installer if there are no repositories.
Task-number: QTIFW-224

Change-Id: I90f6b5002fde182ed59d2c26f473e258e4bdbfad
Reviewed-by: Niels Weber <niels.weber@digia.com>
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
2013-03-25 21:59:41 +01:00
kh1
72d17b0b19 Pass the settings object to assemble.
There's no need to parse the config file a second time.

Change-Id: I7303b86a30f9ce17a8cfa419b70fc70b5948d151
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
2013-03-25 21:59:28 +01:00
kh1
6359716fb8 Rewrite copy configuration function.
Fix broken function naming. Copy only files that are referenced
inside the config file. Replace ":" as well, copy fails here on W8.

Task-number: QTIFW-221

Change-Id: Ic039a8c54d4bb391fcd644c9da0dba7b20bda0f5
Reviewed-by: Niels Weber <niels.weber@digia.com>
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
2013-03-25 21:59:13 +01:00
kh1
5bb70f3676 Small cleanup.
Use exit codes more consequent. Delete the meta dir even if an
exception was thrown.

Change-Id: I87354218091b562147fbc04c20181952fdc967ca
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
2013-03-21 19:10:04 +01:00