fix(gui): Don't check elevation on start on Windows (#1822)

This fixes Electron startup on Windows

Change-Type: patch
This commit is contained in:
Jonas Hermsmeier 2017-10-31 20:20:27 +01:00 committed by GitHub
parent 68f3f695cd
commit 03b252024e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -60,8 +60,11 @@ if (process.env.ELECTRON_RUN_AS_NODE || process.env.ATOM_SHELL_INTERNAL_RUN_AS_N
} }
] ]
if (_.includes([ 'win32', 'darwin' ], os.platform())) {
require('./gui/etcher')
} else {
permissions.isElevated().then((isElevated) => { permissions.isElevated().then((isElevated) => {
if (_.includes([ 'win32', 'darwin' ], os.platform()) || isElevated) { if (isElevated) {
require('./gui/etcher') require('./gui/etcher')
return Bluebird.resolve() return Bluebird.resolve()
} }
@ -112,4 +115,5 @@ if (process.env.ELECTRON_RUN_AS_NODE || process.env.ATOM_SHELL_INTERNAL_RUN_AS_N
electron.dialog.showErrorBox(errors.getTitle(error), errors.getDescription(error)) electron.dialog.showErrorBox(errors.getTitle(error), errors.getDescription(error))
electron.app.exit(EXIT_CODES.GENERAL_ERROR) electron.app.exit(EXIT_CODES.GENERAL_ERROR)
}) })
}
} }