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"
]
}
]
}
},
Run Code Online (Sandbox Code Playgroud)
我的 electro.js 文件或 main.js 我有:
win.webContents.on('did-finish-load', () => {
if(!serve) {
appUpdater(win);
}
});
Run Code Online (Sandbox Code Playgroud)
appUpdater函数是:
function appUpdater(win) {
autoUpdater.autoInstallOnAppQuit = true;
autoUpdater.autoDownload = true;
autoUpdater.logger = logger;
/* …Run Code Online (Sandbox Code Playgroud)