Skip to content

Commit

Permalink
chore: code format
Browse files Browse the repository at this point in the history
  • Loading branch information
jackple authored Sep 13, 2023
1 parent d6306a5 commit 83eb633
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/electron-updater/src/NsisUpdater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,15 @@ export class NsisUpdater extends BaseUpdater {
// https://github.com/electron-userland/electron-builder/issues/1129
// Node 8 sends errors: https://nodejs.org/dist/latest-v8.x/docs/api/errors.html#errors_common_system_errors
const errorCode = (e as NodeJS.ErrnoException).code
this._logger.info(`Cannot run installer: error code: ${errorCode}, error message: "${e.message}", will be executed again using elevate if EACCES, and will try to use electron.shell.openItem if ENOENT`)
this._logger.info(
`Cannot run installer: error code: ${errorCode}, error message: "${e.message}", will be executed again using elevate if EACCES, and will try to use electron.shell.openItem if ENOENT`
)
if (errorCode === "UNKNOWN" || errorCode === "EACCES") {
callUsingElevation()
} else if (errorCode === 'ENOENT') {
require("electron").shell.openPath(options.installerPath).catch((err: Error) => this.dispatchError(err))
} else if (errorCode === "ENOENT") {
require("electron")
.shell.openPath(options.installerPath)
.catch((err: Error) => this.dispatchError(err))
} else {
this.dispatchError(e)
}
Expand Down

0 comments on commit 83eb633

Please sign in to comment.