How to create an AppImage?

Hi there, i want to know, if someone have a Tutorials, Tips & Tricks for create by easy way or not too much dificult way an AppImage file.

i recently compile AppImage Kit, but i dont know what i should do to make an AppImage.

someone have an easy example???

1 Like

Hi @inukaze and welcome to AppImage.

There are different ways to generate an AppImage of your application:

  1. Convert existing binary packages, or
  2. Bundle your Travis CI builds as AppImages, or
  3. Run linuxdeployqt on your Qt application, or
  4. Use electron-builder, or
  5. Manually create an AppDir

Please see this to get started:

1 Like

I wanna make manually for example :

MyApp/usr
MyApp/usr/bin/app.x32
MyApp/usr/bin/app.x64
MyApp/usr/share/applications
MyApp/usr/share/icons
MyApp/usr/share/pixmaps
MyApp/usr/share/doc
MyApp/usr/share/man
MyApp/usr/lib32
MyApp/usr/lib64

and include binaries for 32 Bits and 64 Bits. if possible use an script to launch it

But i have a dunno. if i need the portable extract some files inside "$HOME/.config/" its possible to make it, and use the script for check if the file exist, if the files exist “do nothing” but if not exist. extract the files i need for the configuration of App, i can make that for the launcher-script the part of check files

From my scripts , i just need the “architecture” part :

# Get the Kernel Name
Kernel=$(uname -s)
case "$Kernel" in
    Linux)  Kernel="linux"              ;;
    Darwin) Kernel="mac"                ;;
    FreeBSD)    Kernel="freebsd"            ;;
* ) echo "Your Operating System -> ITS NOT SUPPORTED"   ;;
esac

echo
echo "Operating System Kernel : $Kernel"
echo

# Get the machine Architecture
Architecture=$(uname -m)
case "$Architecture" in
    x86)    Architecture="x86"                  ;;
    ia64)   Architecture="ia64"                 ;;
    i?86)   Architecture="x86"                  ;;
    amd64)  Architecture="amd64"                    ;;
    x86_64) Architecture="x86_64"                   ;;
    sparc64)    Architecture="sparc64"                  ;;
* ) echo    "Your Architecture '$Architecture' -> ITS NOT SUPPORTED."   ;;
esac

echo
echo "Operating System Architecture : $Architecture"
echo

Yesterday i try to use :

$ ./AppDirAssistant\ 0.3.1 
Traceback (most recent call last):
  File "./bin//appimager", line 15, in <module>
    import sys, os, gtk, shutil, time, datetime
  File "/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/__init__.py", line 30, in <module>
    import gobject as _gobject
  File "/usr/lib64/python2.7/site-packages/gobject/__init__.py", line 26, in <module>
    from glib import spawn_async, idle_add, timeout_add, timeout_add_seconds, \
  File "/usr/lib64/python2.7/site-packages/glib/__init__.py", line 22, in <module>
    from glib._glib import *
ImportError: /usr/lib64/python2.7/site-packages/glib/_glib.so: undefined symbol: PyUnicodeUCS2_DecodeUTF8

$ ./AppImageAssistant\ 0.9 
Traceback (most recent call last):
  File "/tmp/.mount_EYpPMb/AppImageAssistant", line 36, in <module>
    import os, sys, gtk, vte
  File "/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/__init__.py", line 30, in <module>
    import gobject as _gobject
  File "/usr/lib64/python2.7/site-packages/gobject/__init__.py", line 26, in <module>
    from glib import spawn_async, idle_add, timeout_add, timeout_add_seconds, \
  File "/usr/lib64/python2.7/site-packages/glib/__init__.py", line 22, in <module>
    from glib._glib import *
ImportError: /usr/lib64/python2.7/site-packages/glib/_glib.so: undefined symbol: PyUnicodeUCS2_DecodeUTF8

This not work under Slackware64 14.2 :’(
I prefer and need a manually method, to understand i should do
and the method, works on every distribution without exceptions.

Please don’t use AppImageAssistant. It is outdated. Use appimagetool instead.

You also need

MyApp/AppRun
MyApp/myapp.desktop
MyApp/myapp.png

The AppRun file should be your main launcher script.

1 Like

Ok, but i download and compile AppImageKit from github .
i compile it.

i can’t install it, because
su -c "make install" root

dont work, looks like the “makefile” dont have the default prefix paths. for make installation.

and if i enter in the “build” folder and try to use “appimagetool”

$ ./appimagetool
WARNING: appstreamcli is missing, please install it if you want to use AppStream metadata
SOURCE is missing

in the build folder, dont exist file called "appstreamcli"
How i “install” this software if the makefile, dont have installation, and appstreamcli is not compile by default ???

Why don’t you use the AppImage of appimagetool?
https://github.com/probonopd/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage

1 Like

Because i dont find it, yesterday. but let my try it :smiley:

./appimagetool-x86_64.AppImage 
WARNING: appstreamcli is missing, please install it if you want to use AppStream metadata
SOURCE is missing

Its the same thing :frowning:

This is just for Terminal, or have a GUI / Front-End ???

You need to supply the <SOURCE> argument.

Can you give me an example, please ?
How i do should use it ?

Please send a link to the application you are trying to package, then I can give you step-by-step instructions. If it is a proprietary application, do you have/can you make a demo version.

Manual compile of :

Since there is no Travis CI build or other binaries, I tried with zdoom instead and it works well for me with the following zdoom.yml file.

app: zdoom
union: true

ingredients:
  dist: precise
  sources:
    - deb http://us.archive.ubuntu.com/ubuntu/ precise main universe multiverse
    - deb http://us.archive.ubuntu.com/ubuntu/ precise-updates main universe multiverse
    - deb http://debian.drdteam.org/ stable multiverse
  script:
    - wget -c https://github.com/freedoom/freedoom/releases/download/v0.11.1/freedoom-0.11.1.zip
    - unzip freedoom-*.zip
script:
  - mv -f opt/zdoom/* usr/bin/
  - mkdir -p usr/share/games/doom
  - mv ../freedoom-*/* usr/share/games/doom/

You can use this to generate an AppImage on any deb-based system like this:

wget "https://github.com/probonopd/AppImages/blob/master/recipes/meta/Recipe"
bash -ex Recipe zdoom.yml

1 - im use GzDoom, for the OpenGL Support, zDoom don’t have OpenGL support

2 - I don’t use Debian or Derivates ( less Ubuntu because is very buggy and glitchy on my pc its impossible to use it )

3 - The Apps i wanna try to make it portable, are manual compile, like :

GitHub -> Gens2 ( Sega Emulator )
GitHub -> GzDoom-GPL ( GzDoom Fork, becase Gloome is dead )
Codeplex -> Pcsxr Stable
Git -> Pcsx
GoogleCode -> Snes9x-gtk (version ; 1.51-78)

You don’t have to use Debian, or its derivatives to run AppImages. But the infrastructure I use to put them together is using Debian and Ubuntu so far (e.g., the example given above). There is nothing preventing you from creating AppImage using other systems though, e.g., the Subsurface AppImage is put together on CentOS 6.

Can you give me an example without use a packages files in : deb, rpm, tgz, txz, flatpak, snap.

Just using the binary files, please ?

i am not using others systems, i not using Mac OS X or Microsoft Windows, i am using GNU/Linux, my idea for use AppImage, is for made more ease usage of application under any GNU/Linux distributions.

Where do I get the binary files from? Compile myself?

Yes, or if you want i can send you a version compile by me under
Slackware64 14.2.

Or well, you can use a precompiled binary of some Linux App. i just need an example how i make an AppImage file using Binary and libs for solve dependency.

for example for solve dependency i can use something like

#!/bin/bash
Kernel=$(uname -s)
case "$Kernel" in
    Linux)	        Kernel="linux"					;;
    Darwin)	        Kernel="mac"					;;
    KFreeBSD)	Kernel="freebsd"				;;
* ) echo	"Your Operating System -> IT'S NOT SUPPORTED"	;;
esac

Architecture=$(uname -m)
case "$Architecture" in
    x86)	Architecture="x32"						;;
    i?86)	Architecture="x32"						;;
    amd64)	Architecture="x64"						;;
    x86_64)	Architecture="x64"						;;
* ) echo	"Your Architecture '$Architecture' -> IT'S NOT SUPPORTED."	;;
esac

export LD_LIBRARY_PATH="$PWD/.libs_$Architecture/$Kernel"

On the launch script

Can you provide debs for Ubuntu 14.04 (trusty) in a ppa or repository? Then it would be easy for me to make an AppImage, and give you a script so that you can do it yourself.

No, because i dont use Ubuntu, for the reasons i say before
1 - Is very unstable
2 - is very Glitchy
3 - Is very buggy
4 - Is extremly slowpoke (On my machine 45 mins to reach Lxde Desktop)

Why someone wanna a software make it from that ???
It not possible to use Binary files directly for make AppImage File ???

it is possible, but it is more work - see how the Krita and Subsurface AppImages are built on CentOS 6 for example.

Can you build your software on Travis CI?