Reputation: 1332
I use electron to create cross-platform application. For Windows and Mac it could be done by electron tools, like autoUpdate, Squirrel, so on.
The problem is only with Linux. I have built a .deb package for Ubuntu. But I can't find any "step-by-step" instruction or comprehensive info about it.
I'm not familiar with java and hadn't experience with creating apps for Linux.
So the main questions are:
All information will be helpful, even the it (info) will not be related to electron app.
Upvotes: 13
Views: 11854
Reputation: 9670
You can use electron-builder
to create Appimages to install or auto-update you application almost in any Linux distribution
AppImage is a universal software package format. By packaging the software in AppImage, the developer provides just one file ‘to rule them all’. End user, i.e. you, can use it in most (if not all) modern Linux distributions
If you want to auto-update your app you will also need electron-autoupdater
. Targets:
You can find an example of a project that uses this here. The important files: package.json
, updater.js
, updater_renderer.js
With some of these instruction you can create the installers:
yarn electron-builder --linux --x64
yarn dist_linux # shortcut in package.json
You can create packages such as deb or rpm with electron-builder
, but to autoupdate them depends on how you distribute them as Jens says in his answer. The final user may need to add an apt repository to keep up to date
Upvotes: 8
Reputation: 3941
You can try electron-simple-updater if AppImage format is ok for your project.
Upvotes: 3
Reputation: 5447
Answer from Jens is really the best.
But if you do not want to spend your time with learning RPM and DEB and building packages for all distribution, then you may consider package your application using Flatpak. http://flatpak.org/#about
It create one big archive which can be run on Ubuntu, RHEL.... Everywhere.
Upvotes: 3
Reputation: 5446
There really is nothing standard in the *nix world. You will always have to support specific ditributions, and each of these distribution can in turn have multiple possible ways of creating an auto-updater.
To your questions:
There is no standard way.
That depends on your way of actually distributing he package. If you plan on using package managers like rpm/apt-get/apt install, then each of these managers has a specific way of configuring your application to be among those packages that are checked for automatic updates.
Difference between .rpm / .deb:
Main difference for a package maintainer (I think that would be 'developer' in Debian lingo) is the way package meta-data and accompanying scripts come together. Link
Difference between Ubuntu & Fedora: As creating a detailed answer on this questions would both be too lengthy and too much effort to maintain, check out this blog post detailing the differences between these two distributions.
Upvotes: 7