Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build AppImage for Linux #504

Closed
probonopd opened this issue Jun 14, 2016 · 55 comments · May be fixed by qcif/data-curator#563
Closed

Build AppImage for Linux #504

probonopd opened this issue Jun 14, 2016 · 55 comments · May be fixed by qcif/data-curator#563

Comments

@probonopd
Copy link

probonopd commented Jun 14, 2016

AppImage is a format for portable, distribution-agnostic binary software deployment for Linux without needing root permissions or installation. (Wikipedia)

Here is an example for Atom in AppImage format:
https://bintray.com/probono/AppImages/Atom/_latestVersion#files

And here is the script which produced it:
https://github.com/probonopd/AppImages/blob/master/recipes/atom/Recipe

While it is relatively easy to package an Electron-based app as an AppImage, it would be nice if this could be automated in electron-builder.

@ghost
Copy link

ghost commented Jun 14, 2016

oh shit, thats cool, subscribed :-)

@develar
Copy link
Member

develar commented Jun 14, 2016

Sorry for dumb question, but quick search doesn't help — electron app requires libnotify and libappindicator packages — is this problem solved in the AppImage?

@probonopd
Copy link
Author

probonopd commented Jun 14, 2016

Yes. Simply bundle them inside the AppImage. Please open an issue on probonopd/AppImages if the AppImage linked above doesn't work on one of your targeted distributions.

@develar
Copy link
Member

develar commented Jun 14, 2016

Ok, got it. Cool thing that electron-builder already provides tested and functional docker images, so, first condition "Use an old system for building (at least 2-3 years old) to ensure the binaries run on older systems too" is already done.

@develar
Copy link
Member

develar commented Jun 14, 2016

Sadly, that fpm doesn't support AppImage and even there is no issue.

@probonopd
Copy link
Author

@develar Now there is: jordansissel/fpm#1133

@probonopd
Copy link
Author

http://www.etcher.io/ is using AppImage as their main format for distributing the Linux version of an Electron-based app. Here is their code that produces the AppImage:
https://github.com/resin-io/etcher/blob/master/scripts/build/linux.sh

@develar
Copy link
Member

develar commented Jun 15, 2016

Looks like AppImage is a rescue for us (#502, #498, #242, #497). And Docker soon release dead simple docker installers for OS X and Windows.

You can expect ApImage target in several weeks.

@probonopd
Copy link
Author

@develar cool. Let me know if you run into any kind of issues you need help with.

@ghost
Copy link

ghost commented Jun 15, 2016

It means you will not be supporting deb and rpm any more in the future? There's some downsides to appimage too, namely it including old system binaries (I think). Will the appimageautoupdate work with electron as well? There's other tools as well, gnome flatpak, and ubuntu snappy apps that you may want to look at.

@develar
Copy link
Member

develar commented Jun 15, 2016

@kunkinkan We are open source project.

I cannot in my free time test Linux Zoo and compute required packages for each format — #502 If you use opensuse&rpm — send PR or wait. i.e. — don't expect that RPM support will be polished if no-one will report issues.

you will not be supporting

As we are open source project, there is no any guarantee ;) Current priority chain — OS X -> Windows -> NSIS -> Squirrel -> deb -> rpm -> AppImage.

@ghost
Copy link

ghost commented Jun 15, 2016

Of course, it was just a question, not a demand or anything :-) Unfortunately I'm not competent enough to contribute much to this project, I'm afraid :-) But I am reporting issues ;-)

@develar
Copy link
Member

develar commented Jun 28, 2016

Why #509 is closed as backlog but this Appimage will be supported this week — see AppImage/AppImageKit#166

develar added a commit to develar/electron-builder that referenced this issue Jul 1, 2016
develar added a commit to develar/electron-builder that referenced this issue Jul 5, 2016
develar added a commit to develar/electron-builder that referenced this issue Jul 5, 2016
@develar develar closed this as completed in a9afdd4 Jul 5, 2016
@develar
Copy link
Member

develar commented Jul 5, 2016

macOS: https://github.com/electron-userland/electron-builder/wiki/Multi-Platform-Build#to-build-app-for-linux-on-macos (xz required now).

linux: https://github.com/electron-userland/electron-builder/wiki/Multi-Platform-Build#linux (xorriso required now). We don't bundle xorriso for Linux for now (only for macOS).

windows: use https://github.com/electron-userland/electron-builder/wiki/Docker (docker images updated, but not yet fully tested).

Thanks a lot @probonopd for amazing format.

Please note — we pack AppImage into xz to ensure that downloaded image can be just clicked to run (otherwise image file cannot be executed because no exec permission).

libnotify and auto update will be addressed in separate issues.

@atypicalprogrammer
Copy link

Please add version tag so that we can try it :-)

@develar
Copy link
Member

develar commented Jul 5, 2016

Current known "critical" cosmetic issue — icon in the Uniny dock shown only if run as app, not on click on image. AppImage/AppImageKit#174

@develar develar mentioned this issue Jul 5, 2016
@atypicalprogrammer
Copy link

@devalar , still no version tag, and "dev-master" doesn't seem to work either. How can test?

@develar
Copy link
Member

develar commented Jul 17, 2016

With most Electron apps from GitHub I tried to package as an AppImage so far, I get npm ERR! missing script: dist:

dist is the name of script in the package.json. And electron-builder version must be 5+. If electron-builder version is 2, it is not easy to upgrade to 5.

  • khornberg/docker-indicator — 2.
  • loveky/EasyHost — 2
  • mudpuddle/inviewer — 2
  • nainemom/nai-electron-quick-start — 5 Only this package can build AppImage.

If no dist script in the package.json — run tool directly:

./node_modules/.bin/build --linux=AppImage

Looking closer, I think the desktopintegration script got installed as AppRun

Yes, we use own version of desktopintegration and don't use AppRun — https://github.com/electron-userland/electron-builder/blob/master/templates/linux/AppRun.sh

You are assuming that the binary has the same name as the desktop file - I don't know whether that is a valid assumption.

We generate all — desktop file, executable. https://github.com/electron-userland/electron-builder/blob/master/src/targets/appImage.ts So, I am sure, it is app error, not our error (please note, that hipchat-electron uses outdated 3.x version, so, maybe something goes wrong).

@probonopd
Copy link
Author

You are assuming that the binary has the same name as the desktop file - I don't know whether that is a valid assumption.

We generate all — desktop file, executable. https://github.com/electron-userland/electron-builder/blob/master/src/targets/appImage.ts

I tried

curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs icnsutils graphicsmagick

wget https://github.com/irccloud/irccloud-desktop/archive/master.zip
unzip master.zip
cd *-master/

npm install
npm run dist -- --linux=AppImage

and an AppImage gets generated, but it wants to execute usr/bin/irccloud when in fact only usr/bin/irccloud-desktop is there (and even the .desktop file is called irccloud-desktop.desktop).

So could it be that this is not very robust?

@develar
Copy link
Member

develar commented Aug 5, 2016

@probonopd Fixed, error was in bash script.

@develar
Copy link
Member

develar commented Aug 26, 2016

AppImage is a default target for Linux since version 6 (will be released tomorrow).

@probonopd
Copy link
Author

probonopd commented Sep 5, 2016

There should be a way for application authors to have fine-grained control over what ends up in the $APPNAME.desktop file; e.g. it should be possible to contain the correct Categories= and MimeType= entries for the app.

Example: brackets-userland/brackets-electron#65

@develar
Copy link
Member

develar commented Sep 7, 2016

@probonopd Fixed.

should be a way for application authors to have fine-grained control over what ends up in the $APPNAME.desktop

build.linux.desktop

e.g.:

{foo: "bar"}

the correct Categories=

build.linux.category

@Skywalker13
Copy link

Skywalker13 commented Jan 13, 2017

@probonopd

it is very disappointed when you download etcher app and... what, what I should do next? How do I run app? Opening terminal and chmod +x?

Right click, properties, permissions, execute as a program. Should be familiar to any Linux user, since this is standard in the Linux world.

Also see https://www.youtube.com/watch?v=7C9thHXPZd8 on an idea how to remove the need for this in the future.

Reasons for not putting an AppImage into an archive (among others):

No need to unpack (e.g., a 700 MB file would take a couple of seconds to unpack)
Possible for optional helper tools to manage AppImages (e.g., download, update, display in software centers etc.) - some additional functionality is planned in this area

IMHO, the AppImage should be saved in a tar file (just TAR without compression), then the executable flag will be preserved and the "unpack" is very fast.

For an end-user it's easier... I know some Linux end-users where changing the permissions is not familiar at all.

@develar
Copy link
Member

develar commented Jan 13, 2017

@develar
Copy link
Member

develar commented Jan 16, 2017

Now you can run AppImage produced by electron-builder on Elementary OS also. — #1082 (comment)

@probonopd
Copy link
Author

I get npm ERR! missing script: dist

Running into this here again, https://travis-ci.org/probonopd/readium-desktop#L2604 - using the latest electron-builder. Do you have any idea why this might happen?

Here is the travis.yml:
https://github.com/probonopd/readium-desktop/blob/patch-1/.travis.yml

@develar
Copy link
Member

develar commented Sep 2, 2017

@probonopd this project has "package" script. Instead of

npm run build
npm run dist

Just

npm run package

should be used

@develar
Copy link
Member

develar commented Sep 2, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants