add app.isPackaged (#12656)
* add isPackaged method * add false test case for app.isPackaged() * document add.isPackaged() * check isPackaged() without fs call * convert to non-method property * document app.isPackaged as a property * update tests for app.isPackaged * remove unused fs require * clarify docs for isPackaged()
This commit is contained in:
parent
4d078fdb03
commit
daf75dd375
3 changed files with 21 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
|||
'use strict'
|
||||
|
||||
const bindings = process.atomBinding('app')
|
||||
const path = require('path')
|
||||
const {app, App} = bindings
|
||||
|
||||
// Only one app object permitted.
|
||||
|
@ -57,6 +58,14 @@ Object.assign(app, {
|
|||
}
|
||||
})
|
||||
|
||||
app.isPackaged = (() => {
|
||||
const execFile = path.basename(process.execPath).toLowerCase()
|
||||
if (process.platform === 'win32') {
|
||||
return execFile !== 'electron.exe'
|
||||
}
|
||||
return execFile !== 'electron'
|
||||
})()
|
||||
|
||||
if (process.platform === 'darwin') {
|
||||
app.dock = {
|
||||
bounce (type = 'informational') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue