How do I build and install an electron app for raspbian using appimage

bmeers5 picture bmeers5 · Sep 5, 2019 · Viewed 8.6k times · Source

I am working on creating an electron appimage for my raspberry pi 4 to use in my car. I want to be able to use auto-updates from electron-builder so that I wont have to take apart the R-PI every time I want to update it.

I have come across many articles,

https://itsfoss.com/use-appimage-linux/

https://www.youtube.com/watch?v=KiehhZ6Wb-4

saying that you can go to the file properties and check "execute file as program" but this is not the case for raspbian. Raspbian does not have this option in its file properties.

It could be how I am building and releasing my program. For more information, here is the project I am working on: https://github.com/bomeers/Piro/releases/tag/v0.0.3

and here is the source code: https://github.com/bomeers/Piro/tree/dev

Is it even worth using electron? Should I choose Qt (python) instead? Anything helps, thanks!

Answer

andypotato picture andypotato · Sep 6, 2019

I have been building and running Electron Apps in AppImage format on Raspbian for quite a while and it (mostly) works without any issues. Some advice however:

  • If possible use the latest Raspbian "Buster" as previous versions can not properly build recent versions of Electron due to a glibc issue
  • Set the proper target armv7l, this (currently) still applies to the RPI 4
  • Use at least Electron version 5.0.10 as previous versions of the 5.x branch had a weird issue of AppImage format Apps crashing when you clicked any menu item
  • If you build your App using electron-builder you may need to manually add a working version of mksquashfs as described here

Other than that I never found any issues and it works just fine on Raspberry 3 / 3+ and 4.

* Edit *

An example how to configure the build target for Linux / Raspberry 4 in package.json:

linux: {
    target: {
        target: 'appimage',
        arch: ['armv7l']
    }
}