Skip to main content

使用 Electron Forge 分发应用

🌐 Distributing Apps With Electron Forge

Electron Forge 是一个用于打包和发布 Electron 应用的工具。它将 Electron 的构建工具生态系统统一到一个可扩展的界面中,使任何人都可以直接开始制作 Electron 应用。

🌐 Electron Forge is a tool for packaging and publishing Electron applications. It unifies Electron's build tooling ecosystem into a single extensible interface so that anyone can jump right into making Electron apps.

替代工具

如果你不想在项目中使用 Electron Forge,你可以使用其他第三方工具来分发你的应用。

🌐 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.

这些工具由 Electron 社区的成员维护,并不提供 Electron 项目的官方支持。

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

Electron 构建器

一个“完整的解决方案,用于打包和构建可分发的 Electron 应用”,专注于提供一体化体验。electron-builder 添加了一个依赖,并在内部管理所有后续需求。

🌐 A "complete solution to package and build a ready-for-distribution Electron app" that focuses on an integrated experience. electron-builder adds a single dependency and manages all further requirements internally.

electron-builder 用自定义功能替代了 Electron 维护者使用的功能和模块(例如自动更新器)。

液压输送机

一个桌面应用部署工具,支持从任何操作系统交叉构建/签名所有软件包,无需多平台持续集成,每次启动应用时可以进行同步的网页式更新,无需更改代码,可以使用普通的 HTTP 服务器进行更新,并且注重易用性。Conveyor 用 Sparkle 替代 macOS 上的 Electron 自动更新器,用 MSIX 替代 Windows 上的自动更新器,并使用 Linux 软件包仓库。

🌐 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 是一个面向开源项目的商业工具,免费提供。有一个关于如何打包 GitHub Desktop的示例,可用于学习。

🌐 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.

入门

🌐 Getting started

Electron Forge 文档 包含了有关将你的应用从源代码交付到终端用户计算机的详细信息。这包括:

🌐 The Electron Forge docs contain detailed information on taking your application from source code to your end users' machines. This includes:

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

对于初学者,我们建议按照 Electron 的 教程 来开发、构建、打包并发布你的第一个 Electron 应用。如果你已经在机器上开发了一个应用,并且想从打包和分发开始,可以从教程的 步骤5 开始。

🌐 For beginners, we recommend following through Electron's tutorial to develop, build, package and publish your first Electron app. If you have already developed an app on your machine and want to start on packaging and distribution, start from step 5 of the tutorial.

寻求帮助

🌐 Getting help

  • 如果你在开发应用时需要帮助,我们的 社区 Discord 服务器 是向其他 Electron 应用开发者寻求建议的好地方。
  • 如果你怀疑自己遇到了 Forge 的 bug,请先查看 GitHub 问题跟踪器,看看是否有现有的问题与你的问题相符。如果没有,请随时填写我们的 bug 报告模板并提交一个新问题。