refactor: 1

pull/67/head
xiaojunnuo 4 years ago
parent 6e15cb2145
commit c20ac9ac64

@ -89,7 +89,7 @@ function updateHandle (app, api, win, beforeQuit, quit, log) {
}) })
} }
function updatePart (app, api, value, partPackagePath, quit) { async function updatePart (app, api, value, partPackagePath, quit) {
const appPath = appPathUtil.getAppRootPath(app) const appPath = appPathUtil.getAppRootPath(app)
const platform = api.shell.getSystemPlatform() const platform = api.shell.getSystemPlatform()
let target = path.join(appPath, 'resources') let target = path.join(appPath, 'resources')
@ -103,8 +103,12 @@ function updateHandle (app, api, win, beforeQuit, quit, log) {
var zip = new AdmZip(partPackagePath) var zip = new AdmZip(partPackagePath)
zip.extractAllTo(target, true) zip.extractAllTo(target, true)
log.info('安装完成重启app') log.info('安装完成重启app')
try {
await beforeQuit()
} finally {
app.exit(0) app.exit(0)
} }
}
autoUpdater.on('error', function (error) { autoUpdater.on('error', function (error) {
log.info('autoUpdater error', error) log.info('autoUpdater error', error)

Loading…
Cancel
Save