pull/88/head
xiaojunnuo 2021-08-18 15:40:39 +08:00
parent 48eec1470d
commit f1cfe91afc
5 changed files with 15 additions and 11 deletions

View File

@ -0,0 +1,3 @@
VUE_APP_PUBLISH_URL=http://dev-sidecar.docmirror.cn/update/preview/
VUE_APP_PUBLISH_PROVIDER=generic
VUE_APP_IS_BUILD=true

View File

@ -1,2 +1,3 @@
VUE_APP_PUBLISH_URL=http://dev-sidecar.docmirror.cn/update/preview/
VUE_APP_PUBLISH_PROVIDER=generic
VUE_APP_PUBLISH_PROVIDER=generic
VUE_APP_IS_BUILD=false

View File

@ -1,6 +1,6 @@
{
"name": "@docmirror/dev-sidecar-gui",
"version": "1.6.0",
"version": "1.5.0",
"private": false,
"license": "MPL-2.0",
"main": "background.js",
@ -8,7 +8,7 @@
"serve": "vue-cli-service serve",
"lint": "vue-cli-service lint",
"electron:build": "vue-cli-service electron:build",
"electron:build:pre": "vue-cli-service electron:build --mode pre",
"electron:build:pre": "vue-cli-service electron:build --mode build-pre",
"electron": "vue-cli-service electron:serve",
"electron:pre": "vue-cli-service electron:serve --mode pre",
"postinstall": "electron-builder install-app-deps",

View File

@ -48,7 +48,9 @@ function updateHandle (app, api, win, beforeQuit, quit, log) {
updateNotAva: '当前为最新版本,无需更新'
}
// 本地开发环境改变app-update.yml地址
if (process.env.NODE_ENV === 'development') {
const isBuild = process.env.VUE_APP_IS_BUILD
console.log('is build', isBuild, process.env.NODE_ENV === 'development' && isBuild !== 'true')
if (process.env.NODE_ENV === 'development' && isBuild !== 'true') {
// const publishUrl = process.env.VUE_APP_PUBLISH_URL
// autoUpdater.setFeedURL({
// provider: 'generic',
@ -63,7 +65,7 @@ function updateHandle (app, api, win, beforeQuit, quit, log) {
}
}
console.log('auto updater', autoUpdater.getFeedURL())
logger.info('auto updater', autoUpdater.getFeedURL())
autoUpdater.autoDownload = false
let partPackagePath = null
@ -102,6 +104,8 @@ function updateHandle (app, api, win, beforeQuit, quit, log) {
if (platform === 'mac') {
target = path.join(appPath, 'Resources')
}
const length = fs.statSync(partPackagePath)
log.info('安装包大小:', length)
log.info('开始解压缩,安装升级包', partPackagePath, target)

View File

@ -1,11 +1,7 @@
import path from 'path'
const isDevelopment = process.env.NODE_ENV !== 'production'
export default {
getAppRootPath (app) {
if (isDevelopment) {
return app.getAppPath()
} else {
return path.join(app.getAppPath(), '../../')
}
const exePath = app.getPath('exe')
return path.join(exePath, '../')
}
}