张恒

小幅度修正bug

......@@ -6482,12 +6482,14 @@
"balanced-match": {
"version": "1.0.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
......@@ -6502,17 +6504,20 @@
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"core-util-is": {
"version": "1.0.2",
......@@ -6629,7 +6634,8 @@
"inherits": {
"version": "2.0.4",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"ini": {
"version": "1.3.5",
......@@ -6641,6 +6647,7 @@
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
......@@ -6655,6 +6662,7 @@
"version": "3.0.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
......@@ -6662,12 +6670,14 @@
"minimist": {
"version": "0.0.8",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"minipass": {
"version": "2.9.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
......@@ -6686,6 +6696,7 @@
"version": "0.5.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
......@@ -6775,7 +6786,8 @@
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"object-assign": {
"version": "4.1.1",
......@@ -6787,6 +6799,7 @@
"version": "1.4.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"wrappy": "1"
}
......@@ -6908,6 +6921,7 @@
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
......
......@@ -7,23 +7,22 @@ const version = require('../../../package.json').version
// 您的下载地址
const baseUrl = 'http://127.0.0.1:25565/'
var Sysarch = null
var downloadUrL = null
// 识别操作系统位数
var defaultDownloadUrL = null
// 识别操作系统位数D
os.arch().includes('64') ? Sysarch = 'win64' : Sysarch = 'win32'
// 识别操作系统
// linux自己修改后缀名哦,我没有linux就没有测试了
if (os.platform().includes('win32')) {
downloadUrL = baseUrl + `electron_${version}_${Sysarch}.exe?${new Date().getTime()}`
defaultDownloadUrL = baseUrl + `electron_${version}_${Sysarch}.exe?${new Date().getTime()}`
} else if (os.platform().includes('linux')) {
downloadUrL = baseUrl + `electron_${version}_${Sysarch}?${new Date().getTime()}`
defaultDownloadUrL = baseUrl + `electron_${version}_${Sysarch}?${new Date().getTime()}`
} else {
downloadUrL = baseUrl + `electron_${version}_mac.dmg?${new Date().getTime()}`
defaultDownloadUrL = baseUrl + `electron_${version}_mac.dmg?${new Date().getTime()}`
}
export default {
download (mainWindow) {
ipcMain.on('satrt-download', (event, msg) => {
console.log(1111)
mainWindow.webContents.downloadURL(downloadUrL)
mainWindow.webContents.downloadURL(msg.downloadUrL || defaultDownloadUrL)
event.reply('confirm-download', true)
mainWindow.webContents.session.on('will-download', (event, item, webContents) => {
// 将文件保存在系统的下载目录
......
......@@ -21,7 +21,7 @@ const loadingURL = process.env.NODE_ENV === 'development' ? `http://localhost:${
var loadWindow = null
var mainWindow = null
function createMainWindow () {
function createMainWindow() {
/**
* Initial window options
*/
......@@ -83,7 +83,7 @@ function createMainWindow () {
})
}
function loadindWindow () {
function loadindWindow() {
loadWindow = new BrowserWindow({
width: 400,
height: 600,
......@@ -100,9 +100,13 @@ function loadindWindow () {
setTimeout(() => {
createMainWindow()
}, 2000)
loadWindow.on('closed', () => {
loadWindow = null
})
}
function initWindow () {
function initWindow() {
if (config.UseStartupChart) {
return loadindWindow()
} else {
......