Javascript 电子制造商与电子包装商

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/37113815/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-23 19:56:27  来源:igfitidea点击:

electron-builder vs electron-packager

javascriptnativeelectronelectron-builder

提问by Ondrej Sika

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

电子制造商电子包装商之间的主要区别是什么。两者都有一些示例项目吗?哪个更适合独立的 .exe 应用程序构建?

采纳答案by RationalDev likes GoFundMonica

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

电子包装器是(更新:在此提交中更改:“重构:合并电子包装器”)由电子构建器使用。这篇文章指出

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.

如果你真的想去城里,看看electron-builder,它接受由electron-packager 生成的包并创建自动安装程序。

回答by mrm

Update August 2019

2019 年 8 月更新

I've been using electron-builderfor more than a year now, packaging my appfor 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.

我已经使用electron-builder一年多了,为 macOS、Windows 10 和 Ubuntu 桌面打包了我的应用程序。维护者 develar 在今年早些时候添加了一个很棒的文档站点,并且一直在关注 macOS 的守门人更改,以确保安装程序和更新程序仍然有效。

Update November 2018

2018 年 11 月更新

The primary developer of electron-builderhas 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-builder主要开发人员继续为该项目投入大量工作,包括对 Electron 3 的支持、新的工件发布目的地以及定期发布错误修复。之前的维护者从电子封装师离职,他们仍然没有 Windows 维护者,并且仍然不支持签名的 Windows 二进制文件。以供参考:

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

Update December 2017

2017 年 12 月更新

Electron-builderhas 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.

在过去的一年里,Electron-builder一直在努力工作,每周推出具有功能和错误修复的新版本。https://www.electron.build/上的文档非常好,并且遵循“快速设置指南”(在第一页,下面的几个部分)包括样板项目和分步说明。

Update June 2017

2017 年 6 月更新

electron-builderdoes both the packaging step (like what electron-packagerdoes), and builds platform-specific installers (like pkgor Mac AppStore for Mac, NSIS or Windows Store for windows, and AppImage for linux).

electron-builder执行打包步骤(就像做什么electron-packager一样),并构建特定于平台的安装程序(如pkgMac 的 Mac AppStore,Windows 的 NSIS 或 Windows Store,以及 linux 的 AppImage)。

For my existing project, electron-forgefailed with a "missing dependency" that was present in my package.jsonand node_modules).

对于我现有的项目,electron-forge失败,一个“缺少的依赖”,这是目前在我package.jsonnode_modules)。

It's not well documented, but electron-builderswitched 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).

它没有很好的文档记录,但electron-builder在今年早些时候从 Squirrel.windows 切换到 NSIS 作为默认的 Windows 安装程序。NSIS 制作的安装程序包要小得多(在我的项目中,从 90 mb 减少了 30 mb)。

Original post

原帖

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

截至 2017 年 3 月,在很大程度上,它们已经实现了功能平价。我发现了以下内容:

  • 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-forgeis based on electron-packager, so that might be an easier "out of the box" experience.
  • 他们都在“电子用户”组织中,所以他们都是“合法的”。
  • 电子包装器没有 Windows 维护者
  • electron-builder 有更多的贡献者,还有更多的封闭问题,所以可能有更多的错误,或者更多的用户。电子包装商有更多的明星。
  • 电子生成器比电子包装器支持更多的目标格式
  • 电子锻造基于电子封装器,因此这可能是一种更简单的“开箱即用”体验。

回答by jamesxiang

electron-packager packs source code and generates executable file.

electron-packager 打包源代码并生成可执行文件。

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

electron-builder 可以在电子中生成具有“自动更新”支持的安装程序。

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

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

回答by aestrro

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.

好吧,我知道这个帖子很旧,但我想建议任何人/每个人都使用电子锻造,它会让你的生活更美好,我认为使用它你会感觉更聪明。我个人在面对包装问题时经常做噩梦。它有一个非常简单的 cli,在全球范围内安装它,你的梦想可能会成真。

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

我当然希望它有帮助!别担心,我没有成功,但它可以帮助我制作桌面应用程序。

回答by Geng Jiawen

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.

您可以使用这个https://github.com/SimulatedGREG/electron-vue/使用 vue 和电子生成模板,它支持电子打包器和电子生成器。

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.

对我来说,我总是更喜欢电子生成器,因为它对我来说更简单,并且可以使用 travis ci 和 appveyor 生成二进制文件并推送到 github 版本,就像我制作的这个 repo https://github.com/gengjiawen/android-studio-帮手/发布