electron-builder vs electron-packager [closed]
Asked Answered
S

5

148

What is main difference between electron-builder and electron-packager. Is there some example projects for both? Which is better for standalone .exe application build?

Sayles answered 9/5, 2016 at 10:47 Comment(0)
P
78

electron-packager was (update: changed in this commit: "refactor: merge electron-packager") used by electron-builder. This article states

If you really want to go to town, take a look at electron-builder which takes the packages produced by electron-packager and creates automated installers.

Porbeagle answered 9/5, 2016 at 11:12 Comment(3)
This is incorrect: I don't see any reference to electron-packager in the package.json of electron-builder. github.com/electron-userland/electron-builder/…Lawry
That's because it doesn't - anymore.Potato
I have also used electron-builder for my side project: github.com/hasukmistry/password-managerHypoglycemia
L
124

Update April 2024

The situation has reversed:

  • The Electron website has "blessed" electron-forge (which uses electron-packager) as "the" tool to use.

  • The solo developer of electron-builder abandoned the project in late 2021. Another developer has been trying to keep it afloat, but code signing (especially with macOS gatekeeper) broke a while back, and stuff like signed asar support and electron fuses aren't easily incorporated.

  • electron-forge still has only half the stars (6k) of electron-builder (13k)

  • electron-forge has 210+ open issues. electron-builder has 340+.

  • electron-forge config seems like it was designed by someone coming from Ruby on Rails: there are undocumented "conventions" (instead of explicit configuration). As an example, the default webpack template uses magick directories (like .webpack/main) that you have to crawl through debug logs and plugin code to figure out what's going on and why things aren't working.

  • electron-forge doesn't seem to support automatic node_module inclusion from webpack externals--you have to provide your own function for the magick packagerConfig.ignore parameter, and for my case, I had to write a package.json parser and npm list-like library.

TL;DR: If your application looks like what electron-forge designers envisioned a "typical" electron application should be, their template should "just work." If you stray from that, though, expect difficulties.

Update August 2019

I've been using electron-builder for more than a year now, packaging my app for macOS, Windows 10, and Ubuntu Desktop. The maintainer, develar, added a great docs site earlier this year, and has been staying on top of gatekeeper changes to macOS to ensure installers and updaters still work.

Update November 2018

The primary developer of electron-builder has continued to put substantial work into the project, including support for Electron 3, new artifact publishing destinations, and releases regularly with bug fixes. The prior maintainer stepped down from electron-packager, and they still don't have a windows maintainer, and still doesn't have support for signed windows binaries. For reference:

electron-packager ( 72 releases,  17 open issues,   639 closed)
electron-builder  (651 releases, 399 open issues, 2,603 closed)

Update December 2017

Electron-builder has been robustly worked on over the past year, pushing out new versions with features and bugfixes weekly. The documentation at https://www.electron.build/ is excellent, and following the "Quick Setup Guide" (on the first page, several sections down) includes a boilerplate project and step-by-step instructions.

Update June 2017

electron-builder does both the packaging step (like what electron-packager does), and builds platform-specific installers (like pkg or Mac AppStore for Mac, NSIS or Windows Store for windows, and AppImage for linux).

For my existing project, electron-forge failed with a "missing dependency" that was present in my package.json and node_modules).

It's not well documented, but electron-builder switched from Squirrel.windows to NSIS earlier this year as the default windows installer. NSIS makes substantially smaller installer packages (30mb down from 90mb, in my project's case).

Original post

As of March 2017, in large part, they've got feature parity. I've found the following:

  • They are both in the "electron-userland" org, so they're both "legit."
  • electron-packager doesn't have a windows maintainer
  • electron-builder has more contributors, and many more closed issues, so there may have been more bugs, or more users. electron-packager has more stars.
  • electron-builder supports substantially more target formats than electron-packager
  • electron-forge is based on electron-packager, so that might be an easier "out of the box" experience.
Lawry answered 26/3, 2017 at 3:22 Comment(0)
P
78

electron-packager was (update: changed in this commit: "refactor: merge electron-packager") used by electron-builder. This article states

If you really want to go to town, take a look at electron-builder which takes the packages produced by electron-packager and creates automated installers.

Porbeagle answered 9/5, 2016 at 11:12 Comment(3)
This is incorrect: I don't see any reference to electron-packager in the package.json of electron-builder. github.com/electron-userland/electron-builder/…Lawry
That's because it doesn't - anymore.Potato
I have also used electron-builder for my side project: github.com/hasukmistry/password-managerHypoglycemia
A
23

electron-packager packs source code and generates executable file.

electron-builder can generate installer with “auto update” support in electron.

http://electron.atom.io/docs/api/auto-updater/

Amparoampelopsis answered 9/10, 2016 at 13:39 Comment(1)
hmm electron-packager only seems to create a folder with an executable file that launches the application. it doesnt seem to create an actual installer??Pyrochemical
P
7

Ok, I know this thread is old but I would like to suggest that anyone / everyone uses electron-forge, it will make your lives better and I think you will feel more intelligent by using it. I personally had waking nightmares confronting packaging woes. It has a dead-simple cli, install it globally and your dreams may come true.

I sure hope it helps! Don't worry, I didn't make it but it helps me make desktop apps.

Parasynapsis answered 2/5, 2017 at 20:30 Comment(4)
I wish I'd have found this comment before wasting the last two days messing with both builder and packager.Hurtless
Are you able to arrange auto-updates on all three platforms with electron-forge, like you can in electron-builder?Linen
At the time of this post electron-forge has many vulnerabilities while builder and packager has none snyk.io/test/npm/electron-forge snyk.io/test/npm/electron-builder snyk.io/test/npm/electron-packagerSpay
@InkhSuTesou is that much of a concern, though? All of those vulnerabilities are in the specific dependency versions used by the tools. Most of those vulnerabilities are related to denial of service and none of them sound like issues that would get into your built package. forge, builder, and packager are all tools you run locally, not tools with an API that you deploy. To exploit those issues, an attacker would need to affect your source tree or CI server, and if they can do either of those things then they don't need a lodash vulnerability.Champ
E
6

You can use this https://github.com/SimulatedGREG/electron-vue/ to generate template using vue and electron, it support both electron-packager and electron-builder.

For me, I always prefer electron-builder because it is much simpler for me and can generate binary using travis ci and appveyor and pulish to github release, like this repo I made https://github.com/gengjiawen/android-studio-helper/releases.

Egocentrism answered 21/6, 2017 at 15:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.