跳转到主内容

使用 Electron Forge 分发应用程序

Electron Forge is a tool for packaging and publishing Electron applications. 它将 Electron 的构建工具生态系统统一到一个可扩展的界面中,这样每个人都可以直接上手制作 Electron 应用。

Alternative tooling

If you do not want to use Electron Forge for your project, there are other third-party tools you can use to distribute your app.

These tools are maintained by members of the Electron community, and do not come with official support from the Electron project.

Electron Builder

Electron Builder 是一个完备的Electron应用打包和分发解决方案,它致力于软件开发的集成体验。 electron-builder adds a single dependency and manages all further requirements internally.

electron-builder 会将Electron维护者使用的模块和功能(例如: auto-updater) 替换为自定义的.

Hydraulic Conveyor

A desktop app deployment tool that supports cross-building/signing of all packages from any OS without the need for multi-platform CI, can do synchronous web-style updates on each start of the app, requires no code changes, can use plain HTTP servers for updates and which focuses on ease of use. Conveyor replaces the Electron auto-updaters with Sparkle on macOS, MSIX on Windows, and Linux package repositories.

Conveyor is a commercial tool that is free for open source projects. There's an example of how to package GitHub Desktop which can be used for learning.

入门指南

Electron Forge文档 包含关于将您的应用程序从源代码带到您的终端用户机器的详细信息。 这包括:

  • 打包你的应用程序(package)
  • 同时,为每个操作系统(生成)生成可执行文件和安装程序
  • 将这些文件发布到在线平台进行下载(发布).

对于初学者,我们建议按照Electron的教程来开发,构建,打包和发布您的第一个Electron应用程序。 如果已在计算机上开发应用,并且想要开始打包和分发,请从本教程的步骤5 开始。

寻求帮助

  • 如果您在开发应用程序时需要帮助,我们的社区 Discord 服务器是向其他 Electron 应用程序开发人员寻求建议的好地方。
  • 如果您怀疑自己遇到了 Forge 的错误,请检查 GitHub issue tracker,看看是否有任何现有问题与您的问题匹配。 如果没有,请随时填写我们的错误报告模板并提交新的问题。