summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKatja Marttila <katja.marttila@qt.io>2024-01-22 16:06:17 +0200
committerKatja Marttila <katja.marttila@qt.io>2024-01-22 16:06:17 +0200
commit047bb926705b8fa290d2a276ab0869b2afaa96f9 (patch)
treed120b85b683a680cb764dbfe1f34d053e5e253e1
parente431686510719ef7a373bbced3d001cf4fa6ca72 (diff)
parentc748b70791f8653500f137f84dedace8cef16901 (diff)
Merge remote-tracking branch 'origin/4.7' into master
-rw-r--r--INSTALL23
-rw-r--r--README4
-rw-r--r--coin/instructions/make_instructions.yaml28
-rw-r--r--doc/installerfw-getting-started.qdoc38
-rw-r--r--doc/installerfw.qdoc5
-rw-r--r--doc/scripting.qdoc2
-rw-r--r--src/libs/installer/constants.h1
-rw-r--r--src/libs/installer/metadatajob.cpp76
-rw-r--r--src/libs/installer/metadatajob.h8
-rw-r--r--src/libs/installer/packagemanagercore.cpp11
-rw-r--r--src/libs/installer/packagemanagercore.h3
-rw-r--r--src/libs/installer/packagemanagergui.cpp9
-rw-r--r--src/libs/installer/settings.cpp9
-rw-r--r--src/libs/installer/settings.h2
-rw-r--r--tests/auto/installer/clientserver/BLACKLIST2
-rw-r--r--tests/auto/installer/clientserver/tst_clientserver.cpp3
-rw-r--r--tests/auto/installer/settings/data/full_config.xml1
-rw-r--r--tests/auto/installer/settings/tst_settings.cpp1
18 files changed, 148 insertions, 78 deletions
diff --git a/INSTALL b/INSTALL
index 15e260297..dd7d78cd8 100644
--- a/INSTALL
+++ b/INSTALL
@@ -15,15 +15,15 @@ http://code.qt.io/cgit/installer-framework/installer-framework.git/
Build a static Qt
---------------------
-Building the Qt Installer Framework from sources requires at least Qt version 5.15.2.
-Supported compilers are MSVC 2015 or newer, GCC 5 or newer,
-and Clang 11.0.0 or newer. Currently, the tested combination for Windows is Qt 5.15.2 with MSVC 2015 (Windows 10).
+Building the Qt Installer Framework from sources requires at least Qt version 6.6.0.
+Supported compilers are MSVC 2019 or newer, GCC 9 or newer,
+and Clang 13.0.0 or newer. Currently, the tested combination for Windows is Qt 6.6.0 with MSVC 2019 (Windows 10).
If you want to ship your installer as a single file you have to build
Qt and the Qt Installer Framework statically.
See the Qt documentation for the prerequisites and steps to build Qt from sources.
-Please read SSL Import and Export Restrictions from http://doc.qt.io/qt-5/ssl.html if
+Please read SSL Import and Export Restrictions from http://doc.qt.io/qt-6/ssl.html if
you are statically linking against OpenSSL libraries.
### Windows
@@ -32,21 +32,26 @@ Recommended configuration options for Microsoft Windows:
configure -prefix %CD%\qtbase -release -static -static-runtime -accessibility -no-icu -no-sql-sqlite -no-qml-debug -nomake examples -nomake tests
Build Qt:
-nmake module-qtbase module-qtdeclarative module-qttools module-qttranslations module-qtwinextras
+cmake --build . --parallel
+cmake --install .
### Linux
Recommended configuration options for Linux:
-configure -prefix $PWD/qtbase -release -static -accessibility -qt-zlib -qt-libpng -qt-libjpeg -qt-pcre -no-glib -no-cups -no-sql-sqlite -no-feature-gssapi -no-qml-debug -no-opengl -no-egl -no-xinput2 -no-sm -no-icu -nomake examples -nomake tests -no-libudev
+configure -prefix $PWD/qtbase -release -static -accessibility -qt-zlib -qt-libpng -qt-libjpeg -qt-pcre -no-glib -no-cups -no-sql-sqlite -no-feature-gssapi -no-qml-debug -no-opengl -no-egl -no-xinput2 -no-sm -no-icu -nomake examples -nomake tests -no-libudev -bundled-xcb-xinput -qt-harfbuzz -qt-doubleconversion
+
Build Qt:
-make module-qtbase module-qtdeclarative module-qttools module-qttranslations
+cmake --build . --parallel
+cmake --install .
### macOS
Recommended configuration options for macOS:
-configure -prefix $PWD/qtbase -release -static -no-securetransport -accessibility -qt-zlib -qt-libpng -qt-libjpeg -no-cups -no-sql-sqlite -no-qml-debug -nomake examples -nomake tests -no-freetype
+configure -prefix $PWD/qtbase -release -static -accessibility -qt-zlib -qt-libpng -no-cups -no-sql-sqlite -no-qml-debug -nomake examples -nomake tests -no-freetype
+
Build Qt:
-make module-qtbase module-qtdeclarative module-qttools module-qttranslations
+cmake --build . --parallel
+cmake --install .
Third party dependencies
diff --git a/README b/README
index cd57790dd..8ba25e7bc 100644
--- a/README
+++ b/README
@@ -13,8 +13,8 @@ doc directory. The documentation is also available online at
Notes
--------------------------
-To build an installer, it is advised to use a statically linked Qt (5.15.2 or
-newer). The tested and supported Qt version is 5.15.2.
+To build an installer, it is advised to use a statically linked Qt (6.6.0 or
+newer). The tested and supported Qt version is 6.6.0
See the documentation at
https://doc.qt.io/qtinstallerframework/ifw-getting-started.html
diff --git a/coin/instructions/make_instructions.yaml b/coin/instructions/make_instructions.yaml
index ea5625af1..0957f2bc7 100644
--- a/coin/instructions/make_instructions.yaml
+++ b/coin/instructions/make_instructions.yaml
@@ -77,13 +77,13 @@ instructions:
- type: ChangeDirectory
directory: "{{.InstallRoot}}/{{.AgentWorkingDir}}"
- type: ExecuteCommand
- command: "python3 {{.SourceDir}}/coin/create_ifw_installer.py --src-dir {{.SourceDir}} --bld-dir {{.SourceDir}} --target-dir {{.SourceDir}}/IfwInstaller --target-name QtInstallerFramework-linux-x64-4.7.0-beta.run"
+ command: "python3 {{.SourceDir}}/coin/create_ifw_installer.py --src-dir {{.SourceDir}} --bld-dir {{.SourceDir}} --target-dir {{.SourceDir}}/IfwInstaller --target-name QtInstallerFramework-linux-x64-4.7.0.run"
maxTimeInSeconds: 36000
maxTimeBetweenOutput: 3600
userMessageOnFailure: "Failed to create ifw installer."
- type: Rename
- sourcePath: "{{.SourceDir}}/IfwInstaller/QtInstallerFramework-linux-x64-4.7.0-beta.run"
- targetPath: "{{.InstallRoot}}/{{.AgentWorkingDir}}/QtInstallerFramework-linux-x64-4.7.0-beta.run"
+ sourcePath: "{{.SourceDir}}/IfwInstaller/QtInstallerFramework-linux-x64-4.7.0.run"
+ targetPath: "{{.InstallRoot}}/{{.AgentWorkingDir}}/QtInstallerFramework-linux-x64-4.7.0.run"
userMessageOnFailure: "Failed to copy installer."
enable_if:
condition: and
@@ -100,13 +100,13 @@ instructions:
- type: ChangeDirectory
directory: "{{.InstallRoot}}/{{.AgentWorkingDir}}"
- type: ExecuteCommand
- command: "python3 {{.SourceDir}}/coin/create_ifw_installer.py --src-dir {{.SourceDir}} --bld-dir {{.SourceDir}} --target-dir {{.SourceDir}}/IfwInstaller --target-name QtInstallerFramework-linux-aarch64-4.7.0-beta.run"
+ command: "python3 {{.SourceDir}}/coin/create_ifw_installer.py --src-dir {{.SourceDir}} --bld-dir {{.SourceDir}} --target-dir {{.SourceDir}}/IfwInstaller --target-name QtInstallerFramework-linux-aarch64-4.7.0.run"
maxTimeInSeconds: 36000
maxTimeBetweenOutput: 3600
userMessageOnFailure: "Failed to create ifw installer."
- type: Rename
- sourcePath: "{{.SourceDir}}/IfwInstaller/QtInstallerFramework-linux-aarch64-4.7.0-beta.run"
- targetPath: "{{.InstallRoot}}/{{.AgentWorkingDir}}/QtInstallerFramework-linux-aarch64-4.7.0-beta.run"
+ sourcePath: "{{.SourceDir}}/IfwInstaller/QtInstallerFramework-linux-aarch64-4.7.0.run"
+ targetPath: "{{.InstallRoot}}/{{.AgentWorkingDir}}/QtInstallerFramework-linux-aarch64-4.7.0.run"
userMessageOnFailure: "Failed to copy installer."
enable_if:
condition: and
@@ -123,7 +123,7 @@ instructions:
- type: ChangeDirectory
directory: "{{.InstallRoot}}/{{.AgentWorkingDir}}"
- type: ExecuteCommand
- command: "python3 {{.SourceDir}}/coin/create_ifw_installer.py --src-dir {{.SourceDir}} --bld-dir {{.SourceDir}} --target-dir {{.SourceDir}}/IfwInstaller --target-name QtInstallerFramework-macOS-x64-4.7.0-beta.app"
+ command: "python3 {{.SourceDir}}/coin/create_ifw_installer.py --src-dir {{.SourceDir}} --bld-dir {{.SourceDir}} --target-dir {{.SourceDir}}/IfwInstaller --target-name QtInstallerFramework-macOS-x64-4.7.0.app"
maxTimeInSeconds: 36000
maxTimeBetweenOutput: 3600
userMessageOnFailure: "Failed to create ifw installer."
@@ -140,18 +140,18 @@ instructions:
- type: ChangeDirectory
directory: "{{.AgentWorkingDir}}/qtsdk/tqtc-qtsdk/packaging_tools"
- type: ExecuteCommand
- command: "python3 -m pipenv run python sign_installer.py mac --file={{.SourceDir}}/IfwInstaller/QtInstallerFramework-macOS-x64-4.7.0-beta.app"
+ command: "python3 -m pipenv run python sign_installer.py mac --file={{.SourceDir}}/IfwInstaller/QtInstallerFramework-macOS-x64-4.7.0.app"
maxTimeInSeconds: 36000
maxTimeBetweenOutput: 3600
userMessageOnFailure: "Failed to sign the ifw installer"
- type: ExecuteCommand
- command: "python3 -m pipenv run python notarize.py --path={{.SourceDir}}/IfwInstaller/QtInstallerFramework-macOS-x64-4.7.0-beta.dmg"
+ command: "python3 -m pipenv run python notarize.py --path={{.SourceDir}}/IfwInstaller/QtInstallerFramework-macOS-x64-4.7.0.dmg"
maxTimeInSeconds: 36000
maxTimeBetweenOutput: 3600
userMessageOnFailure: "Failed to notarize the ifw installer"
- type: Rename
- sourcePath: "{{.SourceDir}}/IfwInstaller/QtInstallerFramework-macOS-x64-4.7.0-beta.dmg"
- targetPath: "{{.InstallRoot}}/{{.AgentWorkingDir}}/QtInstallerFramework-macOS-x64-4.7.0-beta.dmg"
+ sourcePath: "{{.SourceDir}}/IfwInstaller/QtInstallerFramework-macOS-x64-4.7.0.dmg"
+ targetPath: "{{.InstallRoot}}/{{.AgentWorkingDir}}/QtInstallerFramework-macOS-x64-4.7.0.dmg"
userMessageOnFailure: "Failed to copy installer."
enable_if:
condition: and
@@ -165,7 +165,7 @@ instructions:
- type: ChangeDirectory
directory: "{{.SourceDir}}"
- type: ExecuteCommand
- command: "{{.Env.PYTHON3_PATH}}\\python {{.SourceDir}}\\coin\\create_ifw_installer.py --src-dir {{.SourceDir}} --bld-dir {{.SourceDir}} --target-dir C:\\{{.SourceDir}}\\IfwInstaller --target-name QtInstallerFramework-windows-x64-4.7.0-beta"
+ command: "{{.Env.PYTHON3_PATH}}\\python {{.SourceDir}}\\coin\\create_ifw_installer.py --src-dir {{.SourceDir}} --bld-dir {{.SourceDir}} --target-dir C:\\{{.SourceDir}}\\IfwInstaller --target-name QtInstallerFramework-windows-x64-4.7.0"
maxTimeInSeconds: 1200
maxTimeBetweenOutput: 1200
userMessageOnFailure: "Failed to create ifw installer."
@@ -186,8 +186,8 @@ instructions:
equals_value: Windows
- type: Rename
- sourcePath: "{{.SourceDir}}/IfwInstaller/QtInstallerFramework-windows-x64-4.7.0-beta.exe"
- targetPath: "{{.InstallRoot}}/{{.AgentWorkingDir}}/QtInstallerFramework-windows-x64-4.7.0-beta.exe"
+ sourcePath: "{{.SourceDir}}/IfwInstaller/QtInstallerFramework-windows-x64-4.7.0.exe"
+ targetPath: "{{.InstallRoot}}/{{.AgentWorkingDir}}/QtInstallerFramework-windows-x64-4.7.0.exe"
userMessageOnFailure: "Failed to copy installer."
enable_if:
condition: property
diff --git a/doc/installerfw-getting-started.qdoc b/doc/installerfw-getting-started.qdoc
index 6ae36f63a..1a86953a7 100644
--- a/doc/installerfw-getting-started.qdoc
+++ b/doc/installerfw-getting-started.qdoc
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2023 The Qt Company Ltd.
+** Copyright (C) 2024 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Installer Framework.
@@ -39,7 +39,10 @@
\section1 Supported Platforms
You can use the Qt Installer Framework to create installers for all
- platforms supported by \l[QtDoc]{Supported Platforms}{desktop Qt}.
+ platforms supported by \l{https://doc.qt.io/qt-6/supported-platforms.html}{desktop Qt}.
+
+ If you use Linux, install also
+ \l {https://doc.qt.io/qt-6/linux-requirements.html} {Platform Plugin dependencies}.
\section1 Building from Sources
@@ -50,18 +53,24 @@
\section2 Supported Compilers
You can compile the Qt Installer Framework with Microsoft Visual Studio
- 2015 and newer, GCC 5 and newer, and Clang 11.0.0 and newer. Currently, the
- tested combination for Windows is Qt 5.15.2 with MSVC 2015 (Windows 10).
+ 2019 and newer, GCC 9 and newer, and Clang 13.0.0 and newer. Currently, the
+ tested combination for Windows is Qt 6.6.0 with MSVC 2019 (Windows 10).
\section2 Configuring Qt
If you use a statically built Qt to build the Qt Installer Framework
you do not have to deliver Qt libraries, which enables you to distribute
installers as one file. For more information about statically linking
- against OpenSSL libraries, see \l{http://doc.qt.io/qt-5/ssl.html}{SSL
+ against OpenSSL libraries, see \l{http://doc.qt.io/qt-6/ssl.html}{SSL
Import and Export Restrictions}.
- The supported Qt version is 5.15.2.
+ The supported Qt version is 6.6.0.
+
+ Get Qt sources:
+ \code
+ \l{https://wiki.qt.io/Building_Qt_6_from_Git}{Get Qt sources from git}.
+ Call init-repository with --module-subset=qt5compat, qtbase, qtdeclarative, qttools, qttranslations
+ \endcode
\section3 Configuring Qt for Windows
@@ -72,22 +81,12 @@
\endcode
- Build Qt:
- \code
- nmake module-qtbase module-qtdeclarative module-qttools module-qttranslations module-qtwinextras
- \endcode
-
\section3 Configuring Qt for Linux
Use the following configuration options for Linux:
\code
- configure -prefix $PWD/qtbase -release -static -accessibility -qt-zlib -qt-libpng -qt-libjpeg -qt-pcre -no-glib -no-cups -no-sql-sqlite -no-feature-gssapi -no-qml-debug -no-opengl -no-egl -no-xinput2 -no-sm -no-icu -nomake examples -nomake tests -no-libudev
- \endcode
-
- Build Qt:
- \code
- make module-qtbase module-qtdeclarative module-qttools module-qttranslations
+ configure -prefix $PWD/qtbase -release -static -accessibility -qt-zlib -qt-libpng -qt-libjpeg -qt-pcre -no-glib -no-cups -no-sql-sqlite -no-feature-gssapi -no-qml-debug -no-opengl -no-egl -no-xinput2 -no-sm -no-icu -nomake examples -nomake tests -no-libudev -bundled-xcb-xinput -qt-harfbuzz -qt-doubleconversion
\endcode
\section3 Configuring Qt for macOS
@@ -95,12 +94,13 @@
Use the following configuration options for macOS:
\code
- configure -prefix $PWD/qtbase -release -static -no-securetransport -accessibility -qt-zlib -qt-libpng -qt-libjpeg -no-cups -no-sql-sqlite -no-qml-debug -nomake examples -nomake tests -no-freetype
+ configure -prefix $PWD/qtbase -release -static -accessibility -qt-zlib -qt-libpng -no-cups -no-sql-sqlite -no-qml-debug -nomake examples -nomake tests -no-freetype
\endcode
Build Qt:
\code
- make module-qtbase module-qtdeclarative module-qttools module-qttranslations
+ cmake --build . --parallel
+ cmake --install .
\endcode
\section2 Third Party Dependencies
diff --git a/doc/installerfw.qdoc b/doc/installerfw.qdoc
index 55dc463b6..4c55c6d43 100644
--- a/doc/installerfw.qdoc
+++ b/doc/installerfw.qdoc
@@ -566,6 +566,11 @@
\li RepositorySettingsPageVisible
\li Set to \c false to hide the repository settings page inside the settings dialog.
\row
+ \li AllowRepositoriesForOfflineInstaller
+ \li Set to \c false to disable usage of any temporary or user configured repositories
+ set for offline installers. The maintenance tool written by an offline installer
+ can still access the repositories. Defaults to \c true.
+ \row
\li AllowSpaceInPath
\li Set to \c false if the installation path cannot contain space characters.
\row
diff --git a/doc/scripting.qdoc b/doc/scripting.qdoc
index 8854442fa..1dde6576a 100644
--- a/doc/scripting.qdoc
+++ b/doc/scripting.qdoc
@@ -94,7 +94,7 @@
\li Reference to the \l QInstaller of the component
\row
\li component
- \li Reference to the \l Component of the component
+ \li Reference to the \l{https://doc.qt.io/qtinstallerframework/qinstaller-component.html}{Component}. of the component
\endtable
\section1 Message Boxes
diff --git a/src/libs/installer/constants.h b/src/libs/installer/constants.h
index e69d1bd4d..d0173b872 100644
--- a/src/libs/installer/constants.h
+++ b/src/libs/installer/constants.h
@@ -158,6 +158,7 @@ static const QLatin1String scRemoteRepositories("RemoteRepositories");
static const QLatin1String scRepositoryCategories("RepositoryCategories");
static const QLatin1String scRepositorySettingsPageVisible("RepositorySettingsPageVisible");
static const QLatin1String scAllowSpaceInPath("AllowSpaceInPath");
+static const QLatin1String scAllowRepositoriesForOfflineInstaller("AllowRepositoriesForOfflineInstaller");
static const QLatin1String scWizardStyle("WizardStyle");
static const QLatin1String scStyleSheet("StyleSheet");
static const QLatin1String scTitleColor("TitleColor");
diff --git a/src/libs/installer/metadatajob.cpp b/src/libs/installer/metadatajob.cpp
index 8cdeedaed..e680c4c1f 100644
--- a/src/libs/installer/metadatajob.cpp
+++ b/src/libs/installer/metadatajob.cpp
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** Copyright (C) 2023 The Qt Company Ltd.
+** Copyright (C) 2024 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Installer Framework.
@@ -236,11 +236,11 @@ void MetadataJob::doStart()
const bool onlineInstaller = m_core->isInstaller() && !m_core->isOfflineOnly();
const QSet<Repository> repositories = getRepositories();
- if (onlineInstaller || m_core->isMaintainer() || !repositories.isEmpty()) {
+ if (onlineInstaller || m_core->isMaintainer()
+ || (m_core->settings().allowRepositoriesForOfflineInstaller() && !repositories.isEmpty())) {
static const QString updateFilePath(QLatin1Char('/') + scUpdatesXML + QLatin1Char('?'));
static const QString randomQueryString = QString::number(QRandomGenerator::global()->generate());
- QList<FileTaskItem> items;
quint64 cachedCount = 0;
setProgressTotalAmount(0); // Show only busy indicator during this loop as we have no progress to measure
foreach (const Repository &repo, repositories) {
@@ -285,7 +285,7 @@ void MetadataJob::doStart()
FileTaskItem item(url, tmp.path() + QLatin1String("/Updates.xml"));
item.insert(TaskRole::UserRole, QVariant::fromValue(repo));
item.insert(TaskRole::Authenticator, QVariant::fromValue(authenticator));
- items.append(item);
+ m_updatesXmlItems.append(item);
}
}
setProgressTotalAmount(100);
@@ -293,10 +293,16 @@ void MetadataJob::doStart()
if (cachedCount > 0) {
qCDebug(lcInstallerInstallLog).nospace() << "Loaded from cache "
<< cachedCount << "/" << totalCount << ". Downloading remaining "
- << items.count() << "/" << totalCount <<".";
+ << m_updatesXmlItems.count() << "/" << totalCount <<".";
+ } else {
+ qCDebug(lcInstallerInstallLog).nospace() <<"Downloading " << m_updatesXmlItems.count()
+ << " items to cache.";
}
- if (items.count() > 0) {
- startXMLTask(items);
+ if (m_updatesXmlItems.count() > 0) {
+ double taskCount = m_updatesXmlItems.length()/static_cast<double>(m_downloadableChunkSize);
+ m_totalTaskCount = qCeil(taskCount);
+ m_taskNumber = 0;
+ startXMLTask();
} else {
emitFinished();
}
@@ -335,13 +341,22 @@ void MetadataJob::doStart()
}
}
-void MetadataJob::startXMLTask(const QList<FileTaskItem> &items)
+bool MetadataJob::startXMLTask()
{
- DownloadFileTask *const xmlTask = new DownloadFileTask(items);
- xmlTask->setProxyFactory(m_core->proxyFactory());
- connect(&m_xmlTask, &QFutureWatcher<FileTaskResult>::progressValueChanged, this,
- &MetadataJob::progressChanged);
- m_xmlTask.setFuture(QtConcurrent::run(&DownloadFileTask::doTask, xmlTask));
+ int chunkSize = qMin(m_updatesXmlItems.length(), m_downloadableChunkSize);
+ QList<FileTaskItem> tempPackages = m_updatesXmlItems.mid(0, chunkSize);
+ m_updatesXmlItems = m_updatesXmlItems.mid(chunkSize, m_updatesXmlItems.length());
+ if (tempPackages.length() > 0) {
+ DownloadFileTask *const xmlTask = new DownloadFileTask(tempPackages);
+ xmlTask->setProxyFactory(m_core->proxyFactory());
+ connect(&m_xmlTask, &QFutureWatcher<FileTaskResult>::progressValueChanged, this,
+ &MetadataJob::progressChanged);
+ m_xmlTask.setFuture(QtConcurrent::run(&DownloadFileTask::doTask, xmlTask));
+
+ setInfoMessage(QLatin1String("Retrieving Updates.xml files from remote repository..."));
+ return true;
+ }
+ return false;
}
void MetadataJob::doCancel()
@@ -428,7 +443,7 @@ void MetadataJob::unzipRepositoryTaskFinished()
FileTaskItem item(url, tmp.path() + QLatin1String("/Updates.xml"));
item.insert(TaskRole::UserRole, QVariant::fromValue(repo));
- m_unzipRepositoryitems.append(item);
+ m_updatesXmlItems.append(item);
} else {
//Repository is not valid, remove it
Settings &s = m_core->settings();
@@ -448,8 +463,8 @@ void MetadataJob::unzipRepositoryTaskFinished()
//One can specify many zipped repository items at once. As the repositories are
//unzipped one by one, we collect here all items before parsing xml files from those.
- if (m_unzipRepositoryitems.count() > 0 && m_unzipRepositoryTasks.isEmpty()) {
- startXMLTask(m_unzipRepositoryitems);
+ if (m_updatesXmlItems.count() > 0 && m_unzipRepositoryTasks.isEmpty()) {
+ startXMLTask();
} else {
if (error != Job::NoError) {
emitFinishedWithError(QInstaller::DownloadError, errorString);
@@ -473,7 +488,13 @@ void MetadataJob::xmlTaskFinished()
Status status = XmlDownloadFailure;
try {
m_xmlTask.waitForFinished();
- status = parseUpdatesXml(m_xmlTask.future().results());
+ m_updatesXmlResult.append(m_xmlTask.future().results());
+ if (!startXMLTask()) {
+ status = parseUpdatesXml(m_updatesXmlResult);
+ m_updatesXmlResult.clear();
+ } else {
+ return;
+ }
} catch (const AuthenticationRequiredException &e) {
if (e.type() == AuthenticationRequiredException::Type::Proxy) {
const QNetworkProxy proxy = e.proxy();
@@ -682,17 +703,11 @@ bool MetadataJob::fetchMetaDataPackages()
QList<FileTaskItem> tempPackages = m_packages.mid(0, chunkSize);
m_packages = m_packages.mid(chunkSize, m_packages.length());
if (tempPackages.length() > 0) {
- m_taskNumber++;
setProcessedAmount(0);
DownloadFileTask *const metadataTask = new DownloadFileTask(tempPackages);
metadataTask->setProxyFactory(m_core->proxyFactory());
m_metadataTask.setFuture(QtConcurrent::run(&DownloadFileTask::doTask, metadataTask));
- QString metaInformation;
- if (m_totalTaskCount > 1)
- metaInformation = tr("Retrieving meta information from remote repository... %1/%2 ").arg(m_taskNumber).arg(m_totalTaskCount);
- else
- metaInformation = tr("Retrieving meta information from remote repository... ");
- emit infoMessage(this, metaInformation);
+ setInfoMessage(QLatin1String("Retrieving meta information from remote repository..."));
return true;
}
return false;
@@ -701,6 +716,7 @@ bool MetadataJob::fetchMetaDataPackages()
void MetadataJob::reset()
{
m_packages.clear();
+ m_updatesXmlItems.clear();
m_defaultRepositoriesFetched = false;
m_fetchedCategorizedRepositories.clear();
@@ -719,6 +735,7 @@ void MetadataJob::reset()
} catch (...) {}
m_tempDirDeleter.releaseAndDeleteAll();
m_metadataResult.clear();
+ m_updatesXmlResult.clear();
m_taskNumber = 0;
}
@@ -726,7 +743,6 @@ void MetadataJob::resetCompressedFetch()
{
setError(Job::NoError);
setErrorString(QString());
- m_unzipRepositoryitems.clear();
try {
foreach (QFutureWatcher<void> *const watcher, m_unzipTasks.keys()) {
@@ -1129,4 +1145,14 @@ MetadataJob::Status MetadataJob::setAdditionalRepositories(QMultiHash<QString, Q
}
return status;
}
+
+void MetadataJob::setInfoMessage(const QString &message)
+{
+ m_taskNumber++;
+ QString metaInformation = message;
+ if (m_totalTaskCount > 1)
+ metaInformation = tr("%1 %2/%3 ").arg(message).arg(m_taskNumber).arg(m_totalTaskCount);
+ emit infoMessage(this, metaInformation);
+
+}
} // namespace QInstaller
diff --git a/src/libs/installer/metadatajob.h b/src/libs/installer/metadatajob.h
index 1dbb28773..c862215de 100644
--- a/src/libs/installer/metadatajob.h
+++ b/src/libs/installer/metadatajob.h
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** Copyright (C) 2022 The Qt Company Ltd.
+** Copyright (C) 2024 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Installer Framework.
@@ -86,7 +86,7 @@ private slots:
void progressChanged(int progress);
void setProgressTotalAmount(int maximum);
void unzipRepositoryTaskFinished();
- void startXMLTask(const QList<FileTaskItem> &items);
+ bool startXMLTask();
private:
bool fetchMetaDataPackages();
@@ -108,6 +108,7 @@ private:
const FileTaskResult &result, const Metadata &metadata);
MetadataJob::Status setAdditionalRepositories(QMultiHash<QString, QPair<Repository, Repository> > repositoryUpdates,
const FileTaskResult &result, const Metadata& metadata);
+ void setInfoMessage(const QString &message);
private:
friend class Metadata;
@@ -116,6 +117,7 @@ private:
PackageManagerCore *m_core;
QList<FileTaskItem> m_packages;
+ QList<FileTaskItem> m_updatesXmlItems;
TempPathDeleter m_tempDirDeleter;
QFutureWatcher<FileTaskResult> m_xmlTask;
QFutureWatcher<FileTaskResult> m_metadataTask;
@@ -123,8 +125,8 @@ private:
QHash<QFutureWatcher<void> *, QObject*> m_unzipTasks;
QHash<QFutureWatcher<void> *, QObject*> m_unzipRepositoryTasks;
DownloadType m_downloadType;
- QList<FileTaskItem> m_unzipRepositoryitems;
QList<FileTaskResult> m_metadataResult;
+ QList<FileTaskResult> m_updatesXmlResult;
int m_downloadableChunkSize;
int m_taskNumber;
int m_totalTaskCount;
diff --git a/src/libs/installer/packagemanagercore.cpp b/src/libs/installer/packagemanagercore.cpp
index dac80433f..0471be537 100644
--- a/src/libs/installer/packagemanagercore.cpp
+++ b/src/libs/installer/packagemanagercore.cpp
@@ -3964,6 +3964,17 @@ bool PackageManagerCore::isPackageViewer() const
}
/*!
+ Resets the binary marker supplement of the installer to \c Default.
+ The supplement enables or disables additional features on top of the binary
+ marker state (\c Installer, \c Updater, \c PackageManager, \c Uninstaller).
+*/
+void PackageManagerCore::resetBinaryMarkerSupplement()
+{
+ d->m_magicMarkerSupplement = BinaryContent::Default;
+ emit installerBinaryMarkerChanged(d->m_magicBinaryMarker);
+}
+
+/*!
Sets the installer magic binary marker based on \a magicMarker and
userSetBinaryMarker to \c true.
*/
diff --git a/src/libs/installer/packagemanagercore.h b/src/libs/installer/packagemanagercore.h
index 4286642e2..713f77f00 100644
--- a/src/libs/installer/packagemanagercore.h
+++ b/src/libs/installer/packagemanagercore.h
@@ -29,6 +29,7 @@
#define PACKAGEMANAGERCORE_H
#include "binaryformat.h"
+#include "binarycontent.h"
#include "component.h"
#include "protocol.h"
#include "repository.h"
@@ -306,6 +307,8 @@ public:
void setPackageViewer();
Q_INVOKABLE bool isPackageViewer() const;
+ void resetBinaryMarkerSupplement();
+
void setUserSetBinaryMarker(qint64 magicMarker);
Q_INVOKABLE bool isUserSetBinaryMarker() const;
diff --git a/src/libs/installer/packagemanagergui.cpp b/src/libs/installer/packagemanagergui.cpp
index 77cdb274b..32a2a5099 100644
--- a/src/libs/installer/packagemanagergui.cpp
+++ b/src/libs/installer/packagemanagergui.cpp
@@ -412,10 +412,13 @@ PackageManagerGui::PackageManagerGui(PackageManagerCore *core, QWidget *parent)
connect(this, &QDialog::rejected, m_core, &PackageManagerCore::setCanceled);
connect(this, &PackageManagerGui::interrupted, m_core, &PackageManagerCore::interrupt);
- // both queued to show the finished page once everything is done
+ // all queued to show the finished page once everything is done
connect(m_core, &PackageManagerCore::installationFinished,
this, &PackageManagerGui::showFinishedPage,
Qt::QueuedConnection);
+ connect(m_core, &PackageManagerCore::offlineGenerationFinished,
+ this, &PackageManagerGui::showFinishedPage,
+ Qt::QueuedConnection);
connect(m_core, &PackageManagerCore::uninstallationFinished,
this, &PackageManagerGui::showFinishedPage,
Qt::QueuedConnection);
@@ -2229,6 +2232,10 @@ void ComponentSelectionPage::entering()
}
d->showCompressedRepositoryButton();
d->showCreateOfflineInstallerButton(true);
+
+ // Reset to default supplement state. The page may set it to OfflineGenerator
+ // which needs to be reset after navigating back to the page.
+ core->resetBinaryMarkerSupplement();
}
/*!
diff --git a/src/libs/installer/settings.cpp b/src/libs/installer/settings.cpp
index 594ba8fea..e18f63689 100644
--- a/src/libs/installer/settings.cpp
+++ b/src/libs/installer/settings.cpp
@@ -323,8 +323,8 @@ Settings Settings::fromFileAndPrefix(const QString &path, const QString &prefix,
<< scRemoveTargetDir << scLocalCacheDir << scPersistentLocalCache
<< scRunProgram << scRunProgramArguments << scRunProgramDescription
<< scDependsOnLocalInstallerBinary
- << scAllowSpaceInPath << scAllowNonAsciiCharacters << scDisableAuthorizationFallback
- << scDisableCommandLineInterface
+ << scAllowSpaceInPath << scAllowNonAsciiCharacters << scAllowRepositoriesForOfflineInstaller
+ << scDisableAuthorizationFallback << scDisableCommandLineInterface
<< scWizardStyle << scStyleSheet << scTitleColor
<< scWizardDefaultWidth << scWizardDefaultHeight << scWizardMinimumWidth << scWizardMinimumHeight
<< scWizardShowPageList << scProductImages
@@ -649,6 +649,11 @@ bool Settings::allowNonAsciiCharacters() const
return d->m_data.value(scAllowNonAsciiCharacters, false).toBool();
}
+bool Settings::allowRepositoriesForOfflineInstaller() const
+{
+ return d->m_data.value(scAllowRepositoriesForOfflineInstaller, true).toBool();
+}
+
bool Settings::disableAuthorizationFallback() const
{
return d->m_data.value(scDisableAuthorizationFallback, false).toBool();
diff --git a/src/libs/installer/settings.h b/src/libs/installer/settings.h
index 077646dff..85b59869c 100644
--- a/src/libs/installer/settings.h
+++ b/src/libs/installer/settings.h
@@ -145,6 +145,8 @@ public:
bool allowSpaceInPath() const;
bool allowNonAsciiCharacters() const;
+ bool allowRepositoriesForOfflineInstaller() const;
+
bool disableAuthorizationFallback() const;
bool disableCommandLineInterface() const;
diff --git a/tests/auto/installer/clientserver/BLACKLIST b/tests/auto/installer/clientserver/BLACKLIST
deleted file mode 100644
index a328d26e7..000000000
--- a/tests/auto/installer/clientserver/BLACKLIST
+++ /dev/null
@@ -1,2 +0,0 @@
-[testQProcessWrapper]
-rhel-7.6 ci
diff --git a/tests/auto/installer/clientserver/tst_clientserver.cpp b/tests/auto/installer/clientserver/tst_clientserver.cpp
index fd6a08d87..7b3e65c4a 100644
--- a/tests/auto/installer/clientserver/tst_clientserver.cpp
+++ b/tests/auto/installer/clientserver/tst_clientserver.cpp
@@ -467,6 +467,9 @@ private slots:
void testQProcessWrapper()
{
+ #ifdef Q_OS_LINUX
+ QSKIP("This test failes in CI redhat");
+ #endif
RemoteServer server;
QString socketName = QUuid::createUuid().toString();
server.init(socketName, QLatin1String("SomeKey"), Protocol::Mode::Production);
diff --git a/tests/auto/installer/settings/data/full_config.xml b/tests/auto/installer/settings/data/full_config.xml
index 304dd21f4..bccb6f7ca 100644
--- a/tests/auto/installer/settings/data/full_config.xml
+++ b/tests/auto/installer/settings/data/full_config.xml
@@ -37,6 +37,7 @@ File should contain all elements we allow in a config.xml
<DependsOnLocalInstallerBinary>true</DependsOnLocalInstallerBinary>
<AllowSpaceInPath>true</AllowSpaceInPath>
<AllowNonAsciiCharacters>true</AllowNonAsciiCharacters>
+ <AllowRepositoriesForOfflineInstaller>true</AllowRepositoriesForOfflineInstaller>
<DisableAuthorizationFallback>true</DisableAuthorizationFallback>
<DisableCommandLineInterface>true</DisableCommandLineInterface>
<RepositorySettingsPageVisible>false</RepositorySettingsPageVisible>
diff --git a/tests/auto/installer/settings/tst_settings.cpp b/tests/auto/installer/settings/tst_settings.cpp
index d120f5680..15dcc98a1 100644
--- a/tests/auto/installer/settings/tst_settings.cpp
+++ b/tests/auto/installer/settings/tst_settings.cpp
@@ -109,6 +109,7 @@ void tst_Settings::loadTutorialConfig()
QCOMPARE(settings.repositorySettingsPageVisible(), true);
QCOMPARE(settings.allowSpaceInPath(), true);
QCOMPARE(settings.allowNonAsciiCharacters(), false);
+ QCOMPARE(settings.allowRepositoriesForOfflineInstaller(), true);
QCOMPARE(settings.disableAuthorizationFallback(), false);
QCOMPARE(settings.disableCommandLineInterface(), false);
QCOMPARE(settings.createLocalRepository(), false);