electron-modules / graceful-updater Goto Github PK
View Code? Open in Web Editor NEWelectron-updator is a software updator management solution for Electron applications, It is convenient to complete full software update and dynamic update.
electron-updator is a software updator management solution for Electron applications, It is convenient to complete full software update and dynamic update.
import ElectronUpdator from 'graceful-updater'
const { WindowsUpdator, EventType } = ElectronUpdator
const options = {
url: {
version: '3.23.33',
project_version: 1000,
files: [
{
url: '文件地址',
},
],
updateType: 'asar',
},
logger: console, // logger
productName: 'flomo',
updateInfoFormatter: (res) => {
return res
},
ifNeedUpdate: (res) => {
this.log.info('ifNeedUpdate', res)
return true
},
}
// 2. 初始化 updator 实例
this.electronUpdator = new WindowsUpdator(options)
this.electronUpdator.on(EventType.UPDATE_DOWNLOADED, (...args) => {
console.log('updator >> %s, args: %j', EventType.UPDATE_DOWNLOADED, args)
})
this.electronUpdator.on(EventType.CHECKING_FOR_UPDATE, (...args) => {
console.log('updator >> %s, args: %j', EventType.CHECKING_FOR_UPDATE, args)
})
this.electronUpdator.on(EventType.UPDATE_AVAILABLE, (data) => {
const { version, project_version } = data?.updateInfo || {}
})
this.electronUpdator.on(EventType.UPDATE_NOT_AVAILABLE, (data) => {
const { version, project_version } = data?.updateInfo || {}
})
想知道这个是我的配置不对吗?
全量更新也是asar文件吗?不是exe或dmg文件吗?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.