Search code examples
linuxelectronappimage

How to detect if I run in an Electron AppImage in Linux?


I am building an electron app and I need to make a decision depending on if the app is an AppImage. The image itself is mounted in a directory, so sys.argv contains nothing that helps. Any ideas?


Solution

  • If the app is an AppImage, process.env.APPIMAGE contains the path to the .AppImage file, otherwise it is undefined.

    Some of the other properties of process.env can be helpful, such as APPDIR which contains the path of the temporary directory where the actual image is mounted.