Our `package.json` contains a custom `displayName` property which equals
"Etcher" at the time of this writing.
This PR makes use of this property directly instead of hardcoding
"Etcher" in some places.
Later versions make use of shell commands over the internal contents of
the module causing errors when the application is packaged as an
`asar`.
This issue is being fixed here: https://github.com/jorangreef/sudo-prompt/issues/10
For some reason, when using `windosu`, the app is elevated three times.
However this only happens when the application is packaged for
distribution.
After a couple of days debugging this issue, we have no clue about
what's going on, but `elevator` seems to work fine.
Fixes: https://github.com/resin-io/herostratus/issues/29
Currently we fire and forget `sudoPrompt.exec()` and run a timeout for
`process.exit(0)` right away, however this means that the timeout will
start as soon as the elevation dialog is shown when no sudo cache exists
and therefore the timeout will finish before the user can type his
password and submit.
The fix is to keep the parent alive until the children dies, but call
`app.dock.hide()` to make the parent completely invisible to the
operating system.
Fixes: https://github.com/resin-io/herostratus/issues/31
Currently, the parent application will not be closed until the children
process is closed, leading to two Herostratus applications running at
the same time on OS X.