mirror of
https://gitee.com/dromara/electron-egg.git
synced 2026-05-14 11:52:07 +08:00
Merge branch 'master' of github.com:wallace5303/electron-egg
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||

|
||||
|
||||
## 文档
|
||||
- [教程文档](https://www.yuque.com/u34495/mivcfg/xnhmms)
|
||||
- [教程文档](https://www.yuque.com/u34495/mivcfg)
|
||||
- 文档进行了重新编写,更加直观,一定要看!!!
|
||||
|
||||
## 特性
|
||||
|
||||
@@ -14,7 +14,7 @@ module.exports = {
|
||||
* 安装
|
||||
*/
|
||||
install (eeApp) {
|
||||
console.log('[preload] load AutoUpdater module');
|
||||
eeApp.logger.info('[preload] load AutoUpdater module');
|
||||
|
||||
const status = {
|
||||
error: -1,
|
||||
@@ -27,13 +27,13 @@ module.exports = {
|
||||
const updateConfig = eeApp.config.autoUpdate;
|
||||
const mainWindow = eeApp.electron.mainWindow;
|
||||
const version = app.getVersion();
|
||||
console.log('[preload:autoUpdater] current version: ', version);
|
||||
eeApp.logger.info('[preload:autoUpdater] current version: ', version);
|
||||
|
||||
// 设置下载服务器地址
|
||||
let server = updateConfig.options.url;
|
||||
let lastChar = server.substring(server.length - 1);
|
||||
server = lastChar === '/' ? server : server + "/";
|
||||
console.log('[preload:autoUpdater] server: ', server);
|
||||
eeApp.logger.info('[preload:autoUpdater] server: ', server);
|
||||
updateConfig.options.url = server;
|
||||
|
||||
// 是否后台自动下载
|
||||
@@ -82,6 +82,7 @@ module.exports = {
|
||||
totalSize: totalSize,
|
||||
transferredSize: transferredSize
|
||||
}
|
||||
eeApp.logger.info('[preload:download-progress] progress: ', text);
|
||||
sendStatusToWindow(mainWindow, info);
|
||||
})
|
||||
autoUpdater.on('update-downloaded', (info) => {
|
||||
@@ -110,7 +111,6 @@ module.exports = {
|
||||
autoUpdater.downloadUpdate();
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -118,7 +118,6 @@ module.exports = {
|
||||
*/
|
||||
function sendStatusToWindow(mainWindow, content = {}) {
|
||||
const textJson = JSON.stringify(content);
|
||||
eLogger.info(textJson);
|
||||
const channel = 'app.updater';
|
||||
mainWindow.webContents.send(channel, textJson);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ module.exports = {
|
||||
* 安装
|
||||
*/
|
||||
install (eeApp) {
|
||||
console.log('[preload] load awaken module');
|
||||
eeApp.logger.info('[preload] load awaken module');
|
||||
const protocolInfo = eeApp.config.awakeProtocol;
|
||||
const PROTOCOL = protocolInfo.protocol;
|
||||
|
||||
@@ -49,7 +49,7 @@ module.exports = {
|
||||
urlPath: pathname,
|
||||
urlParams: search && search.slice(1)
|
||||
}
|
||||
console.log('[awaken] [handleUrl] awakeUrlInfo:', awakeUrlInfo);
|
||||
eeApp.logger.info('[awaken] [handleUrl] awakeUrlInfo:', awakeUrlInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ module.exports = {
|
||||
* 安装
|
||||
*/
|
||||
install (eeApp) {
|
||||
console.log('[preload] load security module');
|
||||
eeApp.logger.info('[preload] load security module');
|
||||
const runWithDebug = process.argv.find(function(e){
|
||||
let isHasDebug = e.includes("--inspect") || e.includes("--inspect-brk") || e.includes("--remote-debugging-port");
|
||||
return isHasDebug;
|
||||
@@ -18,7 +18,7 @@ module.exports = {
|
||||
|
||||
// 不允许远程调试
|
||||
if (runWithDebug) {
|
||||
console.log('[error] Remote debugging is not allowed, runWithDebug:', runWithDebug);
|
||||
eeApp.logger.error('[error] Remote debugging is not allowed, runWithDebug:', runWithDebug);
|
||||
eeApp.appQuit();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ module.exports = {
|
||||
* 安装
|
||||
*/
|
||||
install (eeApp) {
|
||||
console.log('[preload] load tray module');
|
||||
eeApp.logger.info('[preload] load tray module');
|
||||
const trayConfig = eeApp.config.tray;
|
||||
const mainWindow = eeApp.electron.mainWindow;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ const awaken = require('../library/awaken');
|
||||
module.exports = async (app) => {
|
||||
|
||||
//已实现的功能模块,可选择性使用和修改
|
||||
|
||||
|
||||
tray.install(app);
|
||||
|
||||
security.install(app);
|
||||
@@ -33,7 +33,7 @@ function loadUpdate (app) {
|
||||
const config = app.config.autoUpdate;
|
||||
if ( (is.windows() && config.windows) || (is.macOS() && config.macOS) || (is.linux() && config.linux) ) {
|
||||
const autoUpdater = require('../library/autoUpdater');
|
||||
autoUpdater.install();
|
||||
autoUpdater.install(app);
|
||||
|
||||
// 是否检查更新
|
||||
if (config.force) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ee",
|
||||
"version": "2.0.0",
|
||||
"version": "2.0.1",
|
||||
"description": "A fast, desktop software development framework",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user