diff options
author | Tim Jenssen <tim.jenssen@nokia.com> | 2011-11-08 14:36:12 +0100 |
---|---|---|
committer | Alexander Lenhardt <alexander.lenhardt@nokia.com> | 2011-11-08 15:09:44 +0100 |
commit | 7ccd0acdcf35b957e9e7d04cd81902bac362ad04 (patch) | |
tree | be165094276d0a019a2c66d89d54fb4691fc05d0 /installerbuilder/common | |
parent | 8f7d6b327976da87ff8c312ab1528352ffbcf35a (diff) |
make sure that a component with addElevatedOperation will get RequiresAdminRights tag
Change-Id: I5b8e00212b580c968d15e7b5e93be43a66ad6649
Reviewed-by: Karsten Heimrich <karsten.heimrich@nokia.com>
Diffstat (limited to 'installerbuilder/common')
-rw-r--r-- | installerbuilder/common/repositorygen.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/installerbuilder/common/repositorygen.cpp b/installerbuilder/common/repositorygen.cpp index a0510b6c7..9717b63c1 100644 --- a/installerbuilder/common/repositorygen.cpp +++ b/installerbuilder/common/repositorygen.cpp @@ -472,6 +472,20 @@ void QInstaller::generateMetaDataDirectory(const QString& outDir, const QString& // copy scripts const QString script = package.firstChildElement("Script").text(); if (!script.isEmpty()) { + + QFile scriptFile(script); + QString scriptContent; + if (scriptFile.open(QIODevice::ReadOnly | QIODevice::Text)) { + QTextStream in(&scriptFile); + scriptContent = in.readAll(); + } + + //added the xml tag RequiresAdminRights to the xml if somewhere addElevatedOperation is used + if (scriptContent.contains("addElevatedOperation")) { + QDomElement requiresAdminRightsElement = doc.createElement("RequiresAdminRights"); + requiresAdminRightsElement.appendChild(doc.createTextNode("true")); + } + verbose() << " Copying associated script " << script << " into the meta package..."; QString fromLocation(QString::fromLatin1("%1/meta/%2").arg(it->directory, script)); QString toLocation(QString::fromLatin1("%1/%2/%3").arg(metapath, it->name, script)); |