mirror of
https://gitee.com/dromara/electron-egg.git
synced 2026-05-14 03:52:07 +08:00
1.16.3
This commit is contained in:
@@ -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', // 自定义协议名(默认你的应用名称-英文)
|
||||
|
||||
@@ -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 + '%';
|
||||
|
||||
@@ -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": {
|
||||
|
||||
Reference in New Issue
Block a user