pull/88/head
xiaojunnuo 2021-08-18 00:00:05 -07:00
parent 598aa551e2
commit 53dbd1707b
5 changed files with 43 additions and 24 deletions

View File

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

View File

@ -9,10 +9,11 @@ function appendIntro (context, systemType, latest) {
const partUpdateUrl = context.configuration.publish.url + partUpdateFile const partUpdateUrl = context.configuration.publish.url + partUpdateFile
const latestFilePath = path.join(context.outDir, latest) const latestFilePath = path.join(context.outDir, latest)
fs.appendFile(latestFilePath, `partPackage: ${partUpdateUrl}\n fs.appendFile(latestFilePath, `partPackage: ${partUpdateUrl}
releaseNotes: \n releaseNotes:
- 升级日志\n - 升级日志
- https://download.fastgit.org/docmirror/dev-sidecar/releases/download/v${version}/DevSidecar-${version}.exe\n`, - https://download.fastgit.org/docmirror/dev-sidecar/releases/download/v${version}/DevSidecar-${version}.exe
`,
(err) => { (err) => {
if (err) { if (err) {
console.log('修改latest 失败') console.log('修改latest 失败')

View File

@ -50,8 +50,9 @@ function updateHandle (app, api, win, beforeQuit, quit, log) {
// 本地开发环境改变app-update.yml地址 // 本地开发环境改变app-update.yml地址
if (process.env.NODE_ENV === 'development' && !isMac) { if (process.env.NODE_ENV === 'development' && !isMac) {
const publishUrl = process.env.VUE_APP_PUBLISH_URL const publishUrl = process.env.VUE_APP_PUBLISH_URL
const publishProvider = process.env.VUE_APP_PUBLISH_PROVIDER
autoUpdater.setFeedURL({ autoUpdater.setFeedURL({
provider: 'generic', provider: publishProvider,
url: publishUrl url: publishUrl
}) })
if (isMac) { if (isMac) {

View File

@ -1,4 +1,3 @@
function install (app, api) { function install (app, api) {
const updateParams = app.$global.update = { fromUser: false, autoDownload: false, progress: 0, downloading: false, newVersion: false, isFullUpdate: true } const updateParams = app.$global.update = { fromUser: false, autoDownload: false, progress: 0, downloading: false, newVersion: false, isFullUpdate: true }
api.ipc.on('update', (event, message) => { api.ipc.on('update', (event, message) => {
@ -55,26 +54,44 @@ function install (app, api) {
updateParams.progress = value updateParams.progress = value
} }
function downloadNewVersion (value) { function goManualUpdate (value) {
app.$confirm({
title: '暂不支持自动升级',
cancelText: 'cancel',
okText: 'ok',
content: h => {
function openGithubUrl () {
api.ipc.openExternal('https://github.com/docmirror/dev-sidecar/releases')
}
function openGiteeUrl () {
api.ipc.openExternal('https://gitee.com/docmirror/dev-sidecar/releases')
}
return <div>
<div>请前往github或gitee项目release页面下载新版本手动安装</div>
<ol>
<li><a onClick={openGithubUrl}>Github release</a></li>
<li><a onClick={openGiteeUrl}>Gitee release</a></li>
</ol>
</div>
}
})
}
async function downloadNewVersion (value) {
const platform = await api.shell.getSystemPlatform()
console.log('download new version platform', platform)
if (platform === 'linux') {
goManualUpdate(app, value)
return
}
if (value.partPackage) { if (value.partPackage) {
// 有增量更新 // 有增量更新
api.update.downloadPart(value) api.update.downloadPart(value)
} else { } else {
api.shell.getSystemPlatform().then((platform) => { if (platform === 'mac') {
if (platform === 'mac' || platform === 'linux') { goManualUpdate(value)
app.$notification.open({
duration: 15,
message: '暂不支持自动升级',
description:
'请前往github或gitee项目release页面下载新版本手动安装',
onClick: () => {
}
})
return return
} }
api.update.downloadUpdate() api.update.downloadUpdate()
})
} }
} }
function foundNewVersion (value) { function foundNewVersion (value) {

View File

@ -69,7 +69,7 @@ module.exports = {
linux: { linux: {
icon: 'build/mac/', icon: 'build/mac/',
target: [ target: [
// 'deb', 'deb',
'AppImage' 'AppImage'
] ]
}, },