I'm creating an AppImage, following Creating AppImages in the project Wiki. I'm supposed to create an AppRun file, but I don't see any documentation on that file's format or how to create it. My project is a Python app, and apt-appdir is not an option because this is my team's software and is not available in any repo.
3 Answers
You may know already, that an AppImage (type 2) is a SquashFS-compressed file system. At run-time, it gets mounted to a temporary (on-the-fly created) mountpoint for execution of its payload. This "mounting" business is cared for by an embedded component called "runtime". Another embedded component is called "AppRun"
The AppRun's task inside an AppImage is to invoke the AppImage's payload application with the correct parameters and environment variables set.
You have two options for the AppRun your AppImage can use:
Use a standard "AppRun" binary, as is provided by the AppImage project for download here: https://github.com/AppImage/AppImageKit/releases (Note, that there are two versions to download: one for i686, one for x64_86 architecture. Whichever you choose, you have to rename it to simply 'AppRun' if you embed it into your AppImage manually.) The standard AppRun does not do anything special and very likely is suitable for more than 90% of projects.
Use a custom AppRun which you have to write yourself and which will do all fancy things you may ever imagine: implement additional command line parameters, setting up the environment in a very specific way, etc. An example of a rather sophisticated AppRun is here: https://github.com/KurtPfeifle/ImageMagick/blob/master/appimage/AppRun (It does its work for example if you run an ImageMagick AppImage from here with the
--help
parameter).Such an AppRun can even be a Bash (or any other language) script.
In many cases an AppRun can be simply a symlink from the top level (root) directory of the AppImage pointing to an executable in the (relative) usr/bin/ path inside the AppImage should that be enough to invoke and run the payload application.

- 86,724
- 23
- 248
- 345
-
Why today's serial downvotes for some of my answers, dear unknown StackOverflow user? Care to explain what was wrong with them? – Kurt Pfeifle Mar 17 '18 at 19:15
-
BTW, the desktop file is not really required if your custom AppRun does not read it anyway. However when building the AppImage this is checked for. – Queeg Jan 25 '22 at 06:55
-
This is so badly documented it hurts. I am going through basic documentation on packaging and nothing of this sort is explained. – Colombo Jul 01 '23 at 10:21
Found it. AppRun is in the AppImageKit directory created at the beginning of the guide.

- 3,580
- 3
- 29
- 40
This is the general structure of an AppDir:
MyApp.AppDir/
MyApp.AppDir/AppRun
MyApp.AppDir/myapp.desktop
MyApp.AppDir/myapp.png
MyApp.AppDir/usr/bin/myapp
MyApp.AppDir/usr/lib/libfoo.so.0
Rather than creating it by hand, you could use the functions.sh helper script which will greatly simplify AppDir and AppImage generation.
See the sample recipes on how to use this, and the AppImageSpec for a more formal specification of the format.

- 1,620
- 1
- 8
- 5
-
-
Thanks for the pointer to functions.sh. Looks like AppRun is a prebuilt that I will wget from the project github using get_apprun(). – philo Aug 04 '16 at 19:12