1.安装electron-updater npminstallelectron-updater--save-dev 2.编写更新代码 const{autoUpdater}=require('electron-updater')ipcMain.on('checkForUpdate',e=>updateHandle())// 检测更新,在你想要检查更新的时候执行,renderer事件触发后的操作自行编写functionupdateHandle(){autoUpdater.checkForUpdates()constmessage=...
使用npm安装: npm install --save electron-simple-updater Usage Publish a new release 插入指向主机的链接,您将在其中将 updates.json 存储到 main.js . 您可以在示例中找到 updates.json 的示例 // Just place this code at the entry point of your application:constupdater=require('src/index');updater...
通过转到https://github.com/ 在 GitHub 上发布版本YOUR_GIT_HUB_USERNAME/electron-updater-example/releases,编辑发布并点击“发布发布”。 从https://github.com/YOUR_GIT_HUB_USERNAME/electron-updater-example/releases。 更新package.json中的版本,提交并推送到 GitHub。
在Windows上,您必须先将自己的应用程序安装到用户的机器中,然后才能使用autoUpdater ,因此建议您使用electronic-winstaller,electron-forge或grunt-electron-installer软件包来生成Windows安装程序。 当使用electronic-winstaller或电子伪造时,请确保您第一次运行时不尝试更新应用程序(另请参阅此问题以获取更多信息)。 还建议您...
const EBU = require('electron-basic-updater'); Application.on('ready', function(){ // Initiate the module EBU.init({ 'api': 'http:// ... ' // The API EBU will talk to }); }); 就是这样。 现在,您可以使用EBU.check()来触发更新过程; EBU 将首先检查更新,如果有新的更新,EBU 将下...
electron-updater-test 中文文档教程 electron-quick-start 克隆并运行以快速查看 Electron 的运行情况。 这是基于Electron 文档中的快速入门指南。 将此应用与Electron API Demos应用一起使用以获得 API 代码示例,以帮助您入门。 一个基本的 Electron 应用程序只需要这些文件:...
$ npm install --save electron-asar-hot-updater Now, inside the main.js file, call it like this:const { app, dialog } = require('electron'); const EAU = require('electron-asar-hot-updater'); app.on('ready', function () {