probonopd / go-appimage

Go implementation of AppImage tools
MIT License
676 stars 69 forks source link

'Invalid desktop file' with exit status 1 on Debian #273

Closed Cobraeti closed 3 months ago

Cobraeti commented 3 months ago

Hello,

I'm opening this new issue, as I feel #145 is not related, even if the error raised is the same.

I only use two AppImage apps (czkawka and MuseScore), but I feel the error comes from the way appimaged is building the desktop files and not the apps themselves.

Here is the feedback from desktop-file-validate (I only trimmed user-specific and app-specific elements from the output):

/home/<user>/.local/share/applications/appimagekit_<ref>.desktop: error: value "mv "/home/<user>/Applications/<app_name>.AppImage" ~/.local/share/Trash" for key "Exec" in group "Desktop Action Trash" contains a reserved character '~' outside of a quote

This error appears on a fresh Debian 12.5.0 install with XFCE desktop. I'm also managing similar installs on Ubuntu-based OS, including Xubuntu and this error is not raised for the exact same AppImage files.

Cobraeti commented 3 months ago

I tried to mimic your handling of Home directory from https://github.com/probonopd/go-appimage/blob/09fd0186774aefa2351c42b4bb22f92ce0c4f235/src/appimaged/appimaged.go#L76 and https://github.com/probonopd/go-appimage/blob/09fd0186774aefa2351c42b4bb22f92ce0c4f235/src/appimaged/prerequisites.go#L115 but I never coded in Go, so don't hesitate to discuss here of a better way to fix this issue, I would be happy to rework my PR accordingly :wink:

probonopd commented 3 months ago

Probably the culprit is here:

https://github.com/probonopd/go-appimage/blob/09fd0186774aefa2351c42b4bb22f92ce0c4f235/src/appimaged/desktop.go#L136

Cobraeti commented 3 months ago

Hi @probonopd , that's exactly the line I proposed to fix in my PR => #274 :wink:

I already updated it with an improvement proposed by @CalebQ42, don't hesitate to review and merge it if it suits you...