【问题标题】:Get Release Notes from Electron autoUpdater从 Electron autoUpdater 获取发行说明
【发布时间】:2020-04-13 10:20:13
【问题描述】:

我正在使用 Electron autoUpdater 来更新我的应用程序,源代码是一个私有的 Github 存储库。 它可以很好地更新应用程序,但我似乎无法获得我的发行说明。这些是发布后可以在 Github 中输入的描述吗?如果不是这样,我如何在新版本中包含发行说明?

我已尝试从以下位置获取发行说明:

//info.releaseNotes
autoUpdater.on('update-downloaded', (info) => 
//notes
autoUpdater.on('update-downloaded', (info, notes) => 
//info.releaseNotes
autoUpdater.on('update-available', (info) => 
//notes
autoUpdater.on('update-available', (info, notes) => 

所有这些日志都是未定义的。

编辑:

Electron builder 不提供Github body 那么我该如何添加发行说明?

【问题讨论】:

  • 既然您已经标记了 electron-builder,假设您使用的是 electron-builder,并且它不支持 gh body 的发行说明:github.com/electron-userland/electron-builder/issues/2890
  • @OJKwon 那么我该如何添加发行说明?
  • 1.使用与 gh 不同的自动更新服务器,手动为发行说明提供 json 有效负载。 2. 等到上游的 electron-builder 解决了这个问题。另请注意,无论如何,发行说明在 Windows 上不可用,因此无论解决此问题,您仍然无法通过自动更新事件处理程序获得发行说明。
  • (electronjs.org/docs/api/auto-updater#event-update-downloaded: On Windows only releaseName is available.)
  • @OJKWon 我不知道为什么这么说。我能够让它在 Windows 上运行。看来需要更新了。

标签: electron electron-builder


【解决方案1】:

目前无法获取 Github 正文,因此需要直接从应用程序添加发行说明。

将 release-notes.md 添加到资源文件夹,并在那里写注释。

在电子文件中,

autoUpdater.on('update-downloaded', (info) => {
  //Get release notes 
  info.releaseNotes 

这对我来说适用于 Windows。

【讨论】:

  • 信息返回什么?
猜你喜欢
  • 2011-07-15
  • 2021-05-22
  • 1970-01-01
  • 2012-06-30
  • 1970-01-01
  • 2017-01-16
  • 1970-01-01
  • 2010-09-22
  • 2021-10-30
相关资源
最近更新 更多