This commit is contained in:
gaoshuaixing
2022-01-11 16:40:02 +08:00
parent 0748fa39b8
commit aeab23fb96
4 changed files with 16 additions and 10 deletions

View File

@@ -52,15 +52,14 @@ const config = {
workers: 1
},
autoUpdate: {
windows: true, // windows可以开启macOs 需要签名验证
windows: false, // windows可以开启macOs 需要签名验证
macOS: false,
linux: false,
options: {
provider: 'generic',
url: 'https://kaka996.coding.net/p/resource/d/tx-resource2/git/raw/master/ee' // resource dir
url: 'https://www.coding.net/' // resource dir
},
force: false, // 强制更新
autoDownload: false, // 是否自动下载
},
awakeProtocol: {
protocol: 'electron-egg', // 自定义协议名(默认你的应用名称-英文)

View File

@@ -25,11 +25,11 @@ exports.setup = function () {
eLogger.info('[autoUpdater] [setup] server: ', server);
updateConfig.options.url = server;
// 是否自动下载
// 是否后台自动下载
autoUpdater.autoDownload = updateConfig.force ? true : false;
//if (process.env.EE_SERVER_ENV == 'local') {
if (process.env.EE_SERVER_ENV == 'local') {
autoUpdater.updateConfigPath = path.join(__dirname, '../../out/dev-app-update.yml')
//}
}
try {
autoUpdater.setFeedURL(updateConfig.options);
@@ -58,9 +58,7 @@ exports.setup = function () {
sendStatusToWindow(info);
})
autoUpdater.on('download-progress', (progressObj) => {
let percentStr = String(progressObj.percent);
let endIndex = percentStr.indexOf('.') != -1 ? percentStr.indexOf('.') : percentStr.length;
let percentNumber = percentStr.substring(0, endIndex);
let percentNumber = parseInt(progressObj.percent);
let totalSize = bytesChange(progressObj.total);
let transferredSize = bytesChange(progressObj.transferred);
let text = '已下载 ' + percentNumber + '%';

View File

@@ -1,6 +1,6 @@
{
"name": "electron-egg",
"version": "1.16.2",
"version": "1.16.3",
"description": "A fast, desktop software development framework",
"main": "main.js",
"scripts": {

View File

@@ -1,3 +1,12 @@
## 1.16.3
1. 增加手动更新 和 强制更新
2. 修复ipc监听
3. 限制一个窗口
4. 更新demo
## 1.16.2
1. 忘记更新什么了
## 1.16.1
1. 代码压缩与混淆,增加安全性
2. 新logo