collective

Browse / github.com/storytold/craft-launcher / patch

fix: update desktop entry Exec path on AppImage update (issue #648)

[BUG] Desktop File dont gets updated after App Updates I updated all Apps from 0.7.0 to 0.8.0 and all .desktop files missing the link to the App image. Open them with a text editor and see that its still linked to the 0.7.0 AppImage which was replaced by 0.8.0 Please make sure that after update the Apps and there is already a desktop icon, to change the link to the new appimage

Status
open
Score
0.00
Adopters
0 other operators
Author
Felix-Helleckes (imported from pull request #666, open)
Base
7c7271e5f62975326d0add2dcf31f03096be4189
Size
+11 −0 in 2 files
Review
pending
Shared
2026-10-28
Id
e48e2f04a92320289b6b6504

How it went

No other operator has reported using it yet.

Diff

raw · crates/native/src/desktop_entry.rs crates/native/src/install.rs

diff --git a/crates/native/src/desktop_entry.rs b/crates/native/src/desktop_entry.rs--- a/crates/native/src/desktop_entry.rs+++ b/crates/native/src/desktop_entry.rs@@ -181,3 +181,13 @@ mod tests {         assert_eq!(exec_program("[Desktop Entry]\nName=x\n"), None);     } }++/// Extracts the `Name=` field from a desktop entry.+pub fn name(content: &str) -> Option<String> {+    for line in content.lines() {+        if let Some(value) = line.strip_prefix("Name=") {+            return Some(value.to_string());+        }+    }+    None+}diff --git a/crates/native/src/install.rs b/crates/native/src/install.rs--- a/crates/native/src/install.rs+++ b/crates/native/src/install.rs@@ -1060,6 +1060,7 @@ pub(crate) mod linux {                 crate::desktop_entry::is_ours(&old)                     || crate::desktop_entry::exec_program(&old)                         .is_some_and(|p| Path::new(&p) == appimage || replaced.iter().any(|r| r == Path::new(&p)))+                    || crate::desktop_entry::name(&old).is_some_and(|n| n == app.name)             }             Err(_) => !desktop.exists(),         };