summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/2.0'Katja Marttila2016-06-219-40/+55
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Make Execute operation work without arguments in WindowsKatja Marttila2016-06-131-10/+1
| | | | | | | | | | | | | | | | | | | | | | Since Qt5.5, QProcess start() needs a program to start. When using native arguments the program is empty and QProcess will fail to start. Removed the use of native arguments until QProcess supports setting program through native arguments. Task-number: QTIFW-862 Change-Id: Ia56344e1bf82fbd76e4e8f2ae8b6817e4bb2fce1 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
| * add make install functionality with INSTALL_ROOTKatja Marttila2016-05-193-0/+9
| | | | | | | | | | | | Change-Id: I8bad1c9bbe7b705ff0842f15fb0c9bc6c127e9bc Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
| * add missing tr for "AlreadyRunning" messageboxKatja Marttila2016-05-191-2/+2
| | | | | | | | | | | | Change-Id: Icffe886597a1f18d9eaacf1e3a14f31e252919c6 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com> Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
| * Doc: Fix PackageManagerCore::ComponentType briefLeena Miettinen2016-05-131-1/+1
| | | | | | | | | | | | | | | | The \enum command \brief commands do not seem to get automatically completed during builds anymore. Change-Id: Id81aa8f3044f6151d6b4d8a441e386deb0ca4844 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
| * Doc: Describe return values for boolean Component functionsLeena Miettinen2016-05-131-2/+11
| | | | | | | | | | | | | | ...to suppress QDoc warnings. Change-Id: Ib79b0392efaed37b4a52932d4f7d98327a3ad306 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
| * Doc: PackageManagerCore::ComponentType is now an enumLeena Miettinen2016-05-131-27/+21
| | | | | | | | | | | | | | Change the documentation accordingly. Change-Id: I2f15bf724558794b66e99eab1120dc2d224600de Reviewed-by: Katja Marttila <katja.marttila@qt.io>
| * Cleanup Japanese translation (12 obsolete).Takayuki ORITO2016-04-291-71/+0
| | | | | | | | | | | | | | Remove 12 obsolete messages in ja.ts. Change-Id: I2d514b93056f5755760ff4eb1b44e36923b01f1c Reviewed-by: Katja Marttila <katja.marttila@theqtcompany.com>
| * Update Japanese translation (new 2).Takayuki ORITO2016-04-291-0/+8
| | | | | | | | | | | | | | | | Update new 2 messages in ja.ts. Change-Id: Ifde5277b4ec968472831c46a940480471dec33dd Reviewed-by: Tasuku Suzuki <stasuku@gmail.com> Reviewed-by: Niels Weber <niels.weber@qt.io>
| * Fix the exception message because missing a space.Takayuki ORITO2016-04-291-1/+1
| | | | | | | | | | | | | | Added space between 'convert' from 'path'. Change-Id: I25f4eedc7d322d29c8c93dd7dd80fc13232de0b7 Reviewed-by: Niels Weber <niels.weber@qt.io>
| * Make IFW compile with FreeBSDKatja Marttila2016-04-262-1/+14
| | | | | | | | | | | | | | Change-Id: Ibebc25b738c843c0eb4291faa2bba7ac9836b008 Task-number: QTIFW-841 Reviewed-by: Ralf Nolden <nolden@kde.org> Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
| * Fix MSVC2015 build.Rafael Roquetto2016-04-182-2/+2
| | | | | | | | | | Change-Id: I502e48dea6329bd6f05a776a669093f41698a274 Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
| * Revert "Use QQmlV4Function to correctly get empty parameters from script."Katja Marttila2016-02-173-55/+46
| | | | | | | | | | | | | | | | | | | | | | This reverts commit eb574d77b0ab9a92b61e7738d089cd4ea4304e51. The change will not work with Qt5.5 as it is causing constant crashes in Qt installers. Using this change will require a fix for Qt5. As we are about to make Qt installers based on 2.0 we need to revert this change for now. Change-Id: Ia7906d02db645f2407ab07d14f5a037224574b29 Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
| * Fix crash when updating admin installation with user/temp repositoryKatja Marttila2016-02-151-1/+10
| | | | | | | | | | | | | | | | Grant permission rights for writing maintenance config file Change-Id: I9364358455b8ad5e98b03c20d949c2562ba2535a Task-number: QTIFW-740 Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
| * Compile with Qt 5.5, 5.6. Minimum version is now 5.5.Karsten Heimrich2016-01-211-2/+2
| | | | | | | | | | Change-Id: I60d248ea38e8176e18a9b2a642e81a0ad5fb21d3 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
| * Fix compile with namespace'ed Qt.Karsten Heimrich2016-01-211-0/+2
| | | | | | | | | | Change-Id: I9c0d399943d2f6eb9a0ab136abf24a5c8b108abb Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
* | Allow signing maintenancetool in WindowsKatja Marttila2016-06-212-12/+25
| | | | | | | | | | | | | | | | | | 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>
* | Fix cancel button functionality in Settings->Repositories->TestKatja Marttila2016-06-201-1/+3
| | | | | | | | | | | | | | | | | | | | | | When pressing cancel button when testing repositories, the dialog pops up again and again. Cancel the TestRepository job if cancel button is pressed. Change-Id: I48da41a8b791bf04571acd8af4a421b11e0fccc7 Task-number: QTIFW-832 Reviewed-by: Niels Weber <niels.weber@qt.io> Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | Introduced gui.setTextItems() methodFrerich Raabe2016-06-154-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This utility function can be used to populate a Qt control which is backed by some QAbstractItemModel with a list of strings. E.g. this can be used to populate a QComboBox or any QAbstractItemView with some items. This is very useful since in many cases, the methods for adding elements to such controls are neither slots, nor marked with Q_INVOKABLE and such unreachable from the script code. Change-Id: I2195f41e53765ef3a798477ed08d8f09ab5c4379 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | Store lock files in temporary directoryFrerich Raabe2016-06-152-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Vertical layout for LicenseAgreement pageKatja Marttila2016-06-131-4/+4
| | | | | | | | | | | | | | | | | | | | License agreement was hard to read and the title sometimes needed scrolling. Make the layout vertical so there is more room for license title and license agreement text. Change-Id: I46a9d4880b0219a2a92af19a8f17a39ba53faf6a Task-number: QTIFW-815 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* | Fix qml includeKatja2016-06-011-1/+1
| | | | | | | | | | | | | | | | This is needed for QV4::Object usage. Missing include was causing compile errors in Qt5.7. Change-Id: Idf9cc6dafedb54be4cb02f12176b31c794b592fa Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Revert "Windows: Fix crashes in elevated installation"Katja Marttila2016-05-205-80/+4
| | | | | | | | | | | | | | | | This reverts commit 95ae661cba931a982d12cd68d8b4da392d74bdd0. As we now require at least Qt5.5.0 we don't need this workaround Change-Id: I6ab930886bc9af0716a61a8e21b12db83018b0c2 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* | Make usage of authorization fallback optionalSlobodan Vrkacevic2016-05-187-1/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Asking users to use the authorization fallback in case of authorization errors might be a bit problematic in some cases. If the users are not familiar with the concept, running: "<installer_exe> --startserver PRODUCTION,{GUID},{GUID}" from command line might be confusing or difficult. Also it might not help at all. So let's make this optional. If the config variable DisableAuthorizationFallback is set to true the installer will not ask users to run the authorization fallback but instead it will abort the installation immediately. In RemoteClient this is implemented by adding a new function called setAuthorizationFallbackDisabled. The init function could be also extend for this but the config settings are not loaded at the time when the function is called. Change-Id: I4baf1dea34c5cc0016e98df47a9492ee1418c5ee Reviewed-by: Katja Marttila <katja.marttila@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* | Add the Predefined Variables in Component Scripting.Takayuki ORITO2016-05-031-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add variables - ApplicationsDirX86 - ApplicationsDirX64 Change that the application directory can be selected on Windows, don't depend on the architecture(32bit or 64bit) of QtIFW. For example: When on Windows(64bit version). - QtIFW(32bit version) - ApplicationsDir -> C:\Program Files (x86) - ApplicationsDirX86 -> C:\Program Files (x86) - ApplicationsDirX64 -> C:\Program Files - QtIFW(64bit version) - ApplicationsDir -> C:\Program Files - ApplicationsDirX86 -> C:\Program Files (x86) - ApplicationsDirX64 -> C:\Program Files Change-Id: Idbc41d6f1ba9d7b0b9a9ff5590d05077662345cb Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Niels Weber <niels.weber@qt.io> Reviewed-by: Katja Marttila <katja.marttila@theqtcompany.com>
* | Fixed detecting problems while launching sudoFrerich Raabe2016-05-031-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The installer would always consider the exit status of the sudo process, but if executing sudo itself fails (e.g. because the file does not exist, or because of insufficient permissions), a success exit status (zero) was returned. Fix this by rather returning the (negative) errno value in case anything goes wrong with execve. Change-Id: Iac5051e998982c6a31fa49cb6f4290cf66050c44 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Fixed handling of Destroy command in server processFrerich Raabe2016-04-071-2/+2
| | | | | | | | | | | | | | | | | | Destroying QProcess or QAbstractFileEngine objects never worked, since the code for deciding what type of object is to be destroyed confused the 'type' with the 'command'. Change-Id: I8d6c6bf2f11ff82cfbd744c43fcc91d234967b69 Reviewed-by: Katja Marttila <katja.marttila@theqtcompany.com>
* | Add a logging category and debug for http downloadKatja Marttila2016-04-073-2/+21
| | | | | | | | | | | | | | | | | | | | | | Sometimes installing fails due to a problem in server. Since downloading can happen from mirror, it is hard to detect where the problem is. Print the IP address where the download actually happens to ease the problem solving. Change-Id: I31e15c2b1926745c251093cd1663d1ca1c65bff6 Task-number: QTIFW-813 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | Make communication via installer.execute() Unicode safeKarsten Heimrich2016-03-302-4/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was impossible to pass Unicode data safely to a process started via installer.execute(), or to read Unicode data printed by that process safely back in. The reason for this is that the code hardcoded the latin1 codec for converting between strings used in the script interpreter and bytes used by the QProcessWrapper API. Fix this by adding two new optional arguments to installer.execute() which can be used to define the codec to be used for writing to stdin resp. reading from stdout. This defaults to latin1 for backwards compatibility. Change-Id: I290d8d9617b286ef90b2f0a05c6e7a47f6df317f Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com> Reviewed-by: Frerich Raabe <raabe@froglogic.com>
* | Fix warning introduced with commit 175ffec58f9.Karsten Heimrich2016-03-231-8/+9
| | | | | | | | | | | | Change-Id: I922e572e246abfbd0647216a0134df615d36b484 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Katja Marttila <katja.marttila@theqtcompany.com>
* | Fixed file handle leak when sudo'ingFrerich Raabe2016-03-041-1/+1
| | | | | | | | | | | | | | | | The write handle of the stderr pipe was closed in the parent process further up already. What's left to close is the read handle. Change-Id: I988c5334edb2df002cb29b1f2d47fb34eb284185 Reviewed-by: Katja Marttila <katja.marttila@theqtcompany.com>
* | Allow specifying the installer size in 'em' or 'ex' unitsSlobodan Vrkacevic2016-02-291-2/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The WizardDefaultWidth and WizardDefaultHeight configuration settings always expected pixel values. This made the installer look somewhat awkward on high DPI displays, in which case the ratio between the font size and the installer window size was such that the fonts looked very big. Let's fix this by allowing to specify the width/height of the installer using units which are defined in terms of the font size, namely 'em' ("The width of the letter M") and 'ex' ("The width of the letter x"). 'px' is supported as well and means the same thing as not specifying any unit at all: the given size is defined in pixels. We choose to *not* use the font width for 'em' and 'ex' to be consistent with what the Qt CSS parser does (see src/gui/text/qcssparser.cpp), which adheres to what the W3C document at https://www.w3.org/WAI/GL/css2em.htm describes. Change-Id: Iaeb5a29c79d437ef4b956cb318158181f6289ec9 Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
* | Fixed deleting files when uninstalling on OS XFrerich Raabe2016-02-291-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Uninstalling packages on OS X didn't seem to work very reliably, it often (always?) seemed to not remove a couple of files. When clicking the 'Show Progress' button while uninstalling, it became apparent that the paths to all the files to remove were computed wrongly: instead of deleting e.g. the file /tmp/installdir/foo.txt The uninstaller attempted to remove /tmp/installdir/Uninstall.app/foo.txt What happens is when uninstalling, the ExtractArchiveOperation class (which performs deletion of installed files in its 'undoOperation' reimplementation) reads the files which were installed from the XML markup embedded in the maintenance tool binary (this happens in UpdateOperation::fromXml()). The paths to the files which were installed make use of a special '@RELOCATABLE_PATH@' placeholder which denotes the effective installation directory. This placeholder is meant to be replaced with the actual installation directory, which is assumed to be the directory where the maintenance tool resides, i.e. what QCoreApplication::applicationDirPath();. On OS X however, the maintenance tool is an app bundle, i.e. the actual binary is not in /tmp/installdir/Uninstall but rather /tmp/installdir/Uninstall.app/Contents/MacOS/Uninstall The code already called the QInstaller:isInBundle() utility function to handle this case, but did so wrongly: isInBundle() returns the directory to the app bundle, i.e. /tmp/installdir/Uninstall.app What we want though is just '/tmp/installdir'. Hence, let's go one directory up. Change-Id: I927a453d7fbdd1048ff3d2172bd3cfec3a563b4a Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* | fix banner sizeKatja Marttila2016-02-291-2/+9
| | | | | | | | | | | | | | | | | | | | If WizardDefaultSize was not set, banner size was zero. In this commit default banner size to page size if WizardDefaultSize is not set. Also resize banner only when it is found to avoid warning messages in console. Change-Id: If47f947b134714ae935d80bc3074226763ca8ea7 Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* | Fix arguments in RegisterFileTypeKatja Marttila2016-02-292-22/+39
| | | | | | | | | | | | | | | | | | | | When using RegisterFileType, argumens include progId. Removed it from arguments and saved as member variable. This way progId won't interfere argument check count and it can be used also in undo operation. Change-Id: Ic80a54a28b5e171a5d4e3023b58eb1636a16fa49 Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* | Fixed reading stderr output of sudoFrerich Raabe2016-02-191-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After the sudo process finished, we need to make sure to read any buffered bytes from the stderr pipe. Without this, the stderr data which was shown in the message box often ended up being incomplete. For instance, three failures to enter the correct root password would show a message box saying Sorry, try again. Sorry, try again. Instead of Sorry, try again. Sorry, try again. Sorry, try again. sudo: 3 incorrect password attempts Change-Id: Ib1e7aa40d95f9bf140ba1978fdb9be92cad926b6 Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com> Reviewed-by: Katja Marttila <katja.marttila@theqtcompany.com>
* | Don't print error messages in case correct sudo password is enteredFrerich Raabe2016-02-191-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Any stderr data printed by 'sudo' was always printed as part of an error message box, even if sudo succeeded. This issue is triggered very easily by entering a wrong root password first, and then the correct password on the second try. Let's just print stderr data in case we have some *and* in case 'sudo' returns a non-zero return code. Change-Id: Icbb2d31cdf5c4d5d20ed4200553e9bf7e2b5bedd Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com> Reviewed-by: Katja Marttila <katja.marttila@theqtcompany.com>
* | Fixed checking exit status when calling 'sudo'Frerich Raabe2016-02-191-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were a few closely related issues in how the code tried to decide whether running 'sudo' succeeded: The first issue I noticed was that in some cases, the wait() call would fail with ECHILD. What happened was that the waitpid() call noticed that the sudo process terminated and reaped the zombie. Then, the loop was left and wait() was called on the PID again -- at this point, there was no child with that PID anymore though. The user-visible consequence of this was that the authentication was incorrectly considered to have failed, and a "Cannot get authorization" dialog was shown even though the correct root password was entered. No matter whether wait() failed or not, the code would try to use the WIFEXITED() and WEXITSTATUS() macros to interpret the last status. This caused some reading of uninitialized memory (as Valgrind pointed out), since WIFEXITED() may only be called in case wait() succeeded. Furthermore, as wait(2) explains: WEXITSTATUS(status) returns the exit status of the child. [..] This macro should be employed only if WIFEXITED returned true. This patch fixes all these problems by a) not calling wait() again but rather using the status which was fetched by waitpid() and b) only using the W* macros if it's legal to do so (i.e. waitpid() succeeded). Change-Id: I81741898dc686bb2d2128fceb9e71535fab43417 Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* | Fix setValue saving in restartKatja Marttila2016-02-153-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Fixed out of bounds access when calling su/sudoFrerich Raabe2016-02-151-1/+1
| | | | | | | | | | | | | | | | The memory block allocated for the execv() arguments was too small, causing subsequent code to invoke undefined behavior. Change-Id: Ic0b1e03ddc07e3147ef0d920f18d86276b21e222 Reviewed-by: Katja Marttila <katja.marttila@theqtcompany.com>
* | Don't use 'lockmyApp' prefix for lock filesFrerich Raabe2016-02-152-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Allow calling installer.setValue() with an empty string as the valueFrerich Raabe2016-02-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calls like installer.setValue("RunProgram", ""); would fail if there was no previous setValue() call which set the variable to a non-empty string. In PackageManagerCoreData, the variables of the installer which are accessible via installer.setValue and installer.value are managed in two data structures: * m_variables contains all variables which were set at runtime, via installer.setValue * m_settings contains all variables as defined in the XML configuration file. When calling installer.value(), it would first consider m_variables and if the given variable name is not in that structure, it falls back to m_settings. What happened for calls like 'installer.setValue("RunProgram", "");' was that the code tries to detect whether the variable already has the specified value -- and only if it doesn't, the variable is set. To test if the variable has the specified value, it would simply check m_variables.value(key) and compare it with the given new value. However, if the key was never set, 'value()' returns an empty string -- which is equal to the new value, and hence PackageManagerCoreData::setValue() returned false. Fix this by first verifying that the given key exists in the m_variables object at all before bothering to check what m_variables.value() returns. Change-Id: I8a2bcb74e52e05f1454945628bcf372445c91a17 Reviewed-by: Katja Marttila <katja.marttila@theqtcompany.com>
* | Fixed writing log on Windows if target dir requires admin rightsFrerich Raabe2016-02-151-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Writing the installation log would fail on Windows in case writing to the target directory requires admin privileges. Instead of relying on the VerboseWriter destructor, let the PackageManagerCore destructor explicitly write the installation log. In case using the PlainVerboseWriterOutput does not work, try to use a newly introduced VerboseWriterAdminOutput which first tries to acquire admin privileges before writing a file via RemoteFileEngine. Change-Id: I13f203afa67175012409bc1eed95f05e51cdcb81 Reviewed-by: Katja Marttila <katja.marttila@theqtcompany.com>
* | Factored QFile usage out of VerboseWriter::flush()Frerich Raabe2016-02-152-13/+46
| | | | | | | | | | | | | | | | | | | | | | This introduces a new 'VerboseWriterOutput' interface which can be reimplemented to perform writing the installation log file by different means. For now, there's just a standard QFile-based implementation. The plan is to use this facility for implementing log writing via RemoteFileEngine. Change-Id: I89d91a4c7a146401ca96f27b25c49558099c5bb7 Reviewed-by: Katja Marttila <katja.marttila@theqtcompany.com>
* | Factored flushing of VerboseWriter into dedicated methodFrerich Raabe2016-02-152-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces a (yet unused) VerboseWriter::flush() method which can be used to explicitly trigger flushing the installation log. This permits clients to decide when to do the flushing instead of having to rely on the destructor being called. The destructor will call flush() if needed - whether flushing is needed is defined in terms of the 'perFileBuffer': if it's open, flushing is needed - otherwise, no flushing is needed. Change-Id: I17f1df96e5ddf3b6f613d647c28b90b6973c9393 Reviewed-by: Katja Marttila <katja.marttila@theqtcompany.com>
* | Fixed final 'Finish' message on OS XFrerich Raabe2016-02-151-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On OS X, the final page of the installer would say something like Click Done to exit the %1 wizard. However, the final "commit" button is only actually labelled "Done" when using the natie OS X style. When specifying a different style in the config.xml file, e.g. 'Modern', the commit button is labelled the same as on other operating systems: "Finish". Hence, in such cases the final message would be wrong. Fix this by not hardcoding any particular label in the message but rather querying the default button text - this works with all styles. This also required setting the text a little later (when entering the page) because only then we can safely access the pointer returned by the gui() method. Change-Id: I285c6e376c8450457fcce20941240f9e29350de7 Reviewed-by: Niels Weber <niels.weber@theqtcompany.com> Reviewed-by: Katja Marttila <katja.marttila@theqtcompany.com>
* | Resize banner image to fit default installer widthSlobodan Vrkacevic2016-02-151-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the Modern wizard style is used, the size of the banner picture limits the width of the installer and that's a problem on high DPI displays. Scaling and resizing of the UI does not work correctly in that case. Also the WizardDefaultWidth option from config.xml is ignored completely. Let's try to solve this by resizing the banner image to fit the installers default width. This is technically not backwards compatible (existing installers may suddenly appear to be much more narrow or wide than before) but makes the installer work much better on high DPI displays in which case the fonts tends to be very big (in terms of pixels) and the banner image looks very small. If the old behavior is needed, setting the 'WizardDefaultWidth' value to be equal to the width of the banner image will do the job. Change-Id: Ib311df3bbc277c328e015c1095ae4d35663c42e1 Reviewed-by: Niels Weber <niels.weber@theqtcompany.com> Reviewed-by: Katja Marttila <katja.marttila@theqtcompany.com>
* | Doc: added namespace statement for lib7zNico Vertriest2016-01-281-1/+7
| | | | | | | | | | | | Change-Id: I0783917628f0f2608f20b00f90b6a68db7a86253 Task-number: QTBUG-43810 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
* | Doc: removed qdoc var declaration pixmapNico Vertriest2016-01-211-4/+0
| | | | | | | | | | | | | | | | Variable had previously been removed from localpackagehub.h Change-Id: I9673de6bbc1f5fedd6957b53a059e654930f77c2 Task-number: QTBUG-50557 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* | Compilation fix for QV4 usageIikka Eklund2016-01-211-2/+2
| | | | | | | | | | | | | | | | asObject() is deprecated so use as<QV4::Object>() instead. Change-Id: Ib0ea08a69e1c806a6c76d10a92c0280cb0bed153 Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>