我想问问各位大佬,这种情况的 electron 还有机会自动更新吗? 已经把打包好的程序安装在了客户电脑上,我要如何做才能让之前的版本更新?
// 省略上面的 import 代码...
function createWindow() {
// 创建浏览器窗口。
win = new BrowserWindow({
title: appTitle,
width: 1500,
height: 800,
center: true,
icon: icon,
show: true,
fullscreenable: true,
webPreferences: {
preload: path.join(__dirname, 'preload.js'),
}
});
ipcMain.on('goBack', (e) => {
win.webContents.goBack();
});
ipcMain.on('goForward', (e) => {
win.webContents.goForward();
});
ipcMain.on('reload', (e) => {
win.webContents.reload();
});
ipcMain.on('goHome', (e) => {
win.webContents.loadURL('https://xxx.com/home')
});
Menu.setApplicationMenu(new Menu());
win.loadURL('https://xxx.com');
}
// 省略下面的 ready 事件...