AppImage / AppImageSpec

This repository holds the specification for the AppImage format.
http://appimage.org/
MIT License
71 stars 22 forks source link

How to determine app name? #7

Open matthewbauer opened 7 years ago

matthewbauer commented 7 years ago

$APPNAME.png, $APPNAME.desktop are going to be different for each app. How can a tool know where to look?

I suppose you can check for any .png or .desktop in the root folder, but that seems like it could cause issues if there are multiples of any of these. Perhaps there needs to be something like "MUST include only ONE .desktop file in the root directory" and use the name of the .desktop to get the .png.

Alternatively, you could require that there be an ELF section called .appimage_name and maybe even .appstream_id for the AppStream stuff. To get even more specific, you could have ELF sections for .icon_path, .desktop_path, and .appstream_path. This may be overusing the ELF sections though, and it might make sense to just put it in a file somewhere.

I know that ideally the AppImage file name would include it, but this is not always guaranteed. For instance, a user makes a copy of an AppImage and the new name is Copy of $APPNAME-$VERSION-$ARCH.AppImage. Without proper checks, this would resolve to Copy of $APPNAME.desktop.

probonopd commented 7 years ago

Currently the AppImageSpec defines that an AppDir

SHOULD contain exactly one $APPNAME.desktop file in its root directory with $APPNAME being the name of the payload application

It is not a MUST because the .desktop file is not strictly necessary for a valid AppDir as long as the AppRun file knows how to launch the payload app.

matthewbauer commented 7 years ago

Maybe

MUST contain no more than one $APPNAME.desktop file...

instead?

probonopd commented 7 years ago

@matthewbauer right now it can contain as many as you like, but the behavior is undefined, an undefined one will be picked.

There might be cases in which having multiple ones are desirable, and a specific one could be picked e.g., depending on how the AppImage was invoked.

Hence I'd like to keep it as it is for now unless there is trouble caused by it.

probonopd commented 7 years ago

Also see http://discourse.appimage.org/t/call-alternative-binary-from-appimage/93