mirror of
https://github.com/QuasarApp/installer-framework.git
synced 2025-05-19 00:09:33 +00:00
remove allowMaintenanceTool check
Change-Id: Ibb6d0757137bef2e381030d2b6baf5f2460d3439 Reviewed-by: Tim Jenssen <tim.jenssen@nokia.com>
This commit is contained in:
parent
5236d1a186
commit
32b8b1c99d
@ -85,24 +85,6 @@ static QSet<Repository> repositories(const QStringList &arguments, const int ind
|
|||||||
return set;
|
return set;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool allowMaintenanceTool()
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
Settings m_settings = Settings(Settings::fromFileAndPrefix(QLatin1String(":/metadata/installer-config/config.xml"),
|
|
||||||
QLatin1String(":/metadata/installer-config/")));
|
|
||||||
|
|
||||||
if (m_settings.value(QLatin1String("AllowExecuteMaintenanceTool"), QLatin1String("true")).toString().toLower()
|
|
||||||
== QLatin1String("true"))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} catch (const Error &e) {
|
|
||||||
qWarning("Could not parse Config: %s", qPrintable(e.message()));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// -- main
|
// -- main
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
@ -260,17 +242,6 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// instantiate the installer we are actually going to use
|
// instantiate the installer we are actually going to use
|
||||||
QInstaller::PackageManagerCore core(content.magicMarker(), content.performedOperations());
|
QInstaller::PackageManagerCore core(content.magicMarker(), content.performedOperations());
|
||||||
Settings m_settings =
|
|
||||||
Settings(Settings::fromFileAndPrefix(QLatin1String(":/metadata/installer-config/config.xml"),
|
|
||||||
QLatin1String(":/metadata/installer-config/")));
|
|
||||||
|
|
||||||
// check execution rights for the maintenance tool
|
|
||||||
if (!core.isInstaller() && !allowMaintenanceTool() && !args.contains(QLatin1String("--script"))) {
|
|
||||||
QString reason = m_settings.value(QLatin1String("DisallowExecuteReason"),
|
|
||||||
QString::fromLatin1("You are not allowed to run %1.").arg(qAppName())).toString();
|
|
||||||
QMessageBox::information(0, QLatin1String("Update notification"), reason);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (QInstaller::isVerbose()) {
|
if (QInstaller::isVerbose()) {
|
||||||
qDebug() << "Resource tree after loading the in-binary resource:";
|
qDebug() << "Resource tree after loading the in-binary resource:";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user