electron updater通知新版本,但不在windows中更新或下载新版本

electron updater通知新版本,但不在windows中更新或下载新版本,electron,nsis,electron-updater,Electron,Nsis,Electron Updater,electron updater 4.2.0包不下载新版本,但可以检测到它 这是github上的私有存储库 新版本已成功发送到github 在package.json中: "build": { "appId": "com.myApp.ID", "npmRebuild": false, "win": { "icon": "./resources/electron/

electron updater 4.2.0包不下载新版本,但可以检测到它

这是github上的私有存储库

新版本已成功发送到github

package.json中

"build": {
"appId": "com.myApp.ID",
"npmRebuild": false,
"win": {
  "icon": "./resources/electron/icons/256x256.png",
  "publish": [
    {
      "provider": "github",
      "owner": "me",
      "repo": "POS",
      "private": true,
      "releaseType": "release",
      "token": "<private token>"
    }
  ],
  "target": [
    {
      "target": "nsis",
      "arch": [
        "x64"
      ]
    }
  ]
}
},
appUpdater函数是:

function appUpdater(win) {
  autoUpdater.autoInstallOnAppQuit = true;
  autoUpdater.autoDownload = true;
  autoUpdater.logger = logger;
  /* Log whats happening
  TODO send autoUpdater events to renderer so that we could console log it in developer tools
  You could alsoe use nslog or other logging to see what's happening */
  let foundUpdate = false;
  autoUpdater.on('checking-for-update', () => {
    dialog.showMessageBox(win, {
      message: 'CHECKING FOR UPDATES !!'
    });
  });
  autoUpdater.on('update-available', () => {
    foundUpdate = true;
    dialog.showMessageBox(win, {
      message: ' update-available !!'
    });
  });
  autoUpdater.on('error', error => {
    autoUpdater.logger.debug(error);
  });
  // Ask the user if update is available
  autoUpdater.on('update-downloaded', (_event, releaseNotes, _releaseName) => {
    let message = 'A new version is now available. It will be installed the next time you restart the application.';
    dialog.showMessageBox(win, {
      type: 'question',
      buttons: ['Install', 'Later'],
      defaultId: 0,
      message: 'A new version has been downloaded',
      detail: message
    }, response => {
      if(response === 0) {
        setTimeout(() => autoUpdater.quitAndInstall(), 1);
      }
    });
  });
  // init for updates
  setInterval(() => {
    if(!foundUpdate) {
      autoUpdater.checkForUpdates();
    }
  }, 60000);
}
exports.appUpdater = appUpdater;
我从你那里得到文件

自动更新的目标是windows nsis

检查更新和可用更新事件正确触发,但下载更新或错误根本不会触发

如果你已经有这方面的经验,请告诉我


注意:我在用户机器中也设置了环境变量GH_TOKEN,现在比以前更好 我一直在努力更新macbigSur,因为electron builder@^20.38.0给了我非常严重的错误!!! 所以我决定更新到最新版本

electron: ^12.0.2
electron-builder: ^22.10.5
electron-updater: ^4.3.8
一开始它不起作用,给了我这样的错误: 无法差异下载,退回到完全下载:错误:允许的最大大小为50 MB

最后,我的node版本在本地是v10.15.1 我更新到了v14.16.0,现在可以使用了

使用其他版本更新和降级的另一个问题
它正在下载,但在安装时失败。

这似乎是一个错误,我可以看到这里有一个修复:将electron builder更新为最新版本,但实际上它仍然不适用于meIs NSIS标记是否真的相关?@Anders你是什么意思?我想我从问题的源头上得到了答案:请注意,在package.json中这部分:
“win”:{“certificateFile”:“/certs/my_signing_key.pfx”,“certificatePassword”:“}
我生成了虚拟证书来签署这个应用程序,如果你不提供这些文件,自动更新将无法工作!用您自己的证书信息替换这些行。我的意思是,您可能正在生成一个NSIS安装程序,但您的问题中似乎没有任何内容与NSIS相关。好的@Anders,我只是提供一些有关该项目的更多信息,以便了解出了什么问题,因此如果您在我的代码中有任何意见,请欢迎!
electron: ^12.0.2
electron-builder: ^22.10.5
electron-updater: ^4.3.8