使用 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.
Alternative tooling
如果你不想在项目中使用 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 Builder
专注于综合体验的 "打包和构建可立即分发的 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 维护者使用的功能和模块(例如自动更新程序)替换为自定义功能和模块。
¥electron-builder
replaces features and modules used by the Electron
maintainers (such as the auto-updater) with custom ones.
液压输送机
¥Hydraulic Conveyor
桌面应用部署工具 支持来自任何操作系统的所有包的交叉构建/签名,无需多平台 CI,可以在应用的每次启动时进行同步 Web 式更新,不需要更改代码,可以使用纯 HTTP 服务器进行更新 并注重易用性。Conveyor 将 Electron 自动更新程序替换为 macOS 上的 Sparkle、Windows 上的 MSIX 和 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:
-
打包你的应用 (包)
¥Packaging your application (package)
-
为每个 OS (制作) 生成可执行文件和安装程序,并且,
¥Generating executables and installers for each OS (make), and,
-
将这些文件发布到在线平台以下载 (发布)。
¥Publishing these files to online platforms to download (publish).
对于初学者,我们建议按照 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 应用开发者那里获取建议的好地方。
¥If you need help with developing your app, our community Discord server is a great place to get advice from other Electron app developers.
-
如果你怀疑 Forge 遇到错误,请检查 GitHub 问题跟踪器 以查看是否有任何现有问题与你的问题相符。如果没有,请随时填写我们的错误报告模板并提交新问题。
¥If you suspect you're running into a bug with Forge, please check the GitHub issue tracker to see if any existing issues match your problem. If not, feel free to fill out our bug report template and submit a new issue.