diff options
| author | Alexander Lohnau <[email protected]> | 2020-04-21 21:32:46 +0200 |
|---|---|---|
| committer | Alexander Lohnau <[email protected]> | 2020-04-21 21:32:46 +0200 |
| commit | e78fe03294973c20d70c839af1e9944c6b97faaf (patch) | |
| tree | ced0dfe9588139e645e6105d11b3717f6ddf6e2f /src | |
| parent | cb085066ae1c4d60b452a12e1da491ce3bfdf75b (diff) | |
| parent | 5bbdf66fce8d01c73ce87a5175234c7f60a2c9cb (diff) | |
Merge branch 'release/20.04'
Diffstat (limited to 'src')
| -rw-r--r-- | src/settings/services/servicemenuinstaller/servicemenuinstaller.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/settings/services/servicemenuinstaller/servicemenuinstaller.cpp b/src/settings/services/servicemenuinstaller/servicemenuinstaller.cpp index 1c4ea4cff..06f34c6b9 100644 --- a/src/settings/services/servicemenuinstaller/servicemenuinstaller.cpp +++ b/src/settings/services/servicemenuinstaller/servicemenuinstaller.cpp @@ -126,7 +126,7 @@ QString findRecursive(const QString &dir, const QString &basename) return QString(); } -bool runInstallerScriptOnce(const QString &path, const QStringList &args) +bool runScriptOnce(const QString &path, const QStringList &args) { QProcess process; process.setWorkingDirectory(QFileInfo(path).absolutePath()); @@ -152,7 +152,7 @@ bool runInstallerScriptOnce(const QString &path, const QStringList &args) // If hasArgVariants is true, run "path". // If hasArgVariants is false, run "path argVariants[i]" until successful. -bool runInstallerScript(const QString &path, bool hasArgVariants, const QStringList &argVariants, QString &errorText) +bool runScriptVariants(const QString &path, bool hasArgVariants, const QStringList &argVariants, QString &errorText) { QFile file(path); if (!file.setPermissions(QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner)) { @@ -163,11 +163,11 @@ bool runInstallerScript(const QString &path, bool hasArgVariants, const QStringL qInfo() << "[servicemenuinstaller]: Trying to run installer/uninstaller" << path; if (hasArgVariants) { for (const auto &arg : argVariants) { - if (runInstallerScriptOnce(path, {arg})) { + if (runScriptOnce(path, {arg})) { return true; } } - } else if (runInstallerScriptOnce(path, {})) { + } else if (runScriptOnce(path, {})) { return true; } @@ -232,7 +232,7 @@ bool cmdInstall(const QString &archive, QString &errorText) } if (!installItPath.isEmpty()) { - return runInstallerScript(installItPath, false, QStringList{}, errorText); + return runScriptVariants(installItPath, false, QStringList{}, errorText); } // If "install-it" is missing, try "install" @@ -247,7 +247,7 @@ bool cmdInstall(const QString &archive, QString &errorText) } if (!installerPath.isEmpty()) { - return runInstallerScript(installerPath, true, {"--local", "--local-install", "--install"}, errorText); + return runScriptVariants(installerPath, true, {"--local", "--local-install", "--install"}, errorText); } fail(i18n("Failed to find an installation script in %1", dir)); @@ -272,7 +272,7 @@ bool cmdUninstall(const QString &archive, QString &errorText) // Try "deinstall" first QString deinstallPath; - const QStringList basenames1 = {"deinstall.sh", "deinstall"}; + const QStringList basenames1 = {"uninstall.sh", "uninstal", "deinstall.sh", "deinstall"}; for (const auto &basename : basenames1) { const auto path = findRecursive(dir, basename); if (!path.isEmpty()) { @@ -282,7 +282,7 @@ bool cmdUninstall(const QString &archive, QString &errorText) } if (!deinstallPath.isEmpty()) { - const bool ok = runInstallerScript(deinstallPath, false, {}, errorText); + const bool ok = runScriptVariants(deinstallPath, false, {}, errorText); if (!ok) { return ok; } @@ -300,8 +300,8 @@ bool cmdUninstall(const QString &archive, QString &errorText) } if (!installerPath.isEmpty()) { - const bool ok = runInstallerScript(installerPath, true, - {"--remove", "--delete", "--uninstall", "--deinstall"}, errorText); + const bool ok = runScriptVariants(installerPath, true, + {"--remove", "--delete", "--uninstall", "--deinstall"}, errorText); if (!ok) { return ok; } |
