Verified Commit 3a6daa1d authored by azubieta's avatar azubieta

add update action to the installed apps desktop entry

parent 6e96b7ef
Pipeline #2138 passed with stages
in 20 minutes and 36 seconds
......@@ -147,16 +147,27 @@ int InstallCommand::libappimage_install() const {// integrate with the desktop e
auto systemEnvironment = QProcessEnvironment::systemEnvironment();
// Use the APPIMAGE path if the app is used as an APPIMAGE
QString rmCommand = systemEnvironment.value("APPIMAGE");
QString bin_path = systemEnvironment.value("APPIMAGE");
// Otherwise use the application file path
if (rmCommand.isEmpty())
rmCommand = QCoreApplication::applicationFilePath();
if (bin_path.isEmpty())
bin_path = QCoreApplication::applicationFilePath();
rmCommand += " remove " + targetPath;
QString rmCommand = bin_path + " remove " + targetPath;
entry.set("Desktop Action Remove/Exec", rmCommand.toStdString());
// Add update action
entry.set("Desktop Entry/Actions", actions.dump());
entry.set("Desktop Action Update/Name", "Update");
entry.set("Desktop Action Update/Icon", "update-low");
QString updateCommand = bin_path + " update " + targetPath;
entry.set("Desktop Action Update/Exec", updateCommand.toStdString());
std::ofstream ofstream(desktopFilePath);
ofstream << entry;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment