Note: This feature is a demo, developers should debug it themselves.
Certificate
Optional
If your app needs to be published on the Windows or Mac App Store, or requires additional system permissions, you need to apply for a developer certificate.
- Apple Developer Certificate (if targeting macOS)
- Windows Developer Certificate (if targeting Windows)
Demo code: ./service/os/auto_updater.js
config = {
windows: false, // Windows platform
macOS: false, // macOS requires signature verification
linux: false, // Linux platform
options: {
provider: 'generic', // or github, s3, bintray
url: 'http://kodo.qiniu.com/' // resource dir, end with '/'
}
};Example
options: {
provider: 'generic',
url: 'http://kodo.qiniu.com/electron-egg/'
}url Parameter
A accessible resource directory (Qiniu Cloud, GitHub, Alibaba Cloud OSS, Tencent Cloud COS, etc.).
Upload Files
After packaging the higher version software, the files in the electron-egg/out/ directory:
- ee-win-2.4.0-x64.exe Complete installer
- ee-win-2.4.0-x64.exe.blockmap Incremental block content
- latest.yml
Upload these three files to Qiniu Cloud's object storage as follows:
# Upload directory:
http://kodo.qiniu.com/electron-egg/
# After uploading
● http://kodo.qiniu.com/electron-egg/ee-win-2.4.0-x64.exe
● http://kodo.qiniu.com/electron-egg/ee-win-2.4.0-x64.exe.blockmap
● http://kodo.qiniu.com/electron-egg/latest.ymlTest whether your three links can be downloaded (accessed). If they are accessible, when triggering the upgrade function, it will check whether auto-update is available (you can check logs for errors).
CDN
Qiniu Cloud offers 10GB of free traffic per month, sufficient for daily use.
Notes
- Dev mode does not support updates
electron-updater
If you want to implement a custom upgrade feature, please see the documentation: electron-updater
