Unpack icon files so setting browserWindow.icon works
This commit is contained in:
12
config.js
12
config.js
@@ -2,7 +2,8 @@ var applicationConfigPath = require('application-config-path')
|
||||
var path = require('path')
|
||||
|
||||
module.exports = {
|
||||
APP_ICON: path.join(__dirname, 'static', 'WebTorrent.png'),
|
||||
APP_FILE_ICON: path.join(pathToStatic(), 'WebTorrentFile'),
|
||||
APP_ICON: path.join(pathToStatic(), 'WebTorrent'),
|
||||
APP_NAME: 'WebTorrent',
|
||||
|
||||
CONFIG_PATH: applicationConfigPath('WebTorrent'),
|
||||
@@ -26,6 +27,9 @@ module.exports = {
|
||||
}
|
||||
|
||||
function isProduction () {
|
||||
if (!process.versions.electron) {
|
||||
return false
|
||||
}
|
||||
if (process.platform === 'darwin') {
|
||||
return !/\/Electron\.app\/Contents\/MacOS\/Electron$/.test(process.execPath)
|
||||
}
|
||||
@@ -36,3 +40,9 @@ function isProduction () {
|
||||
// TODO
|
||||
}
|
||||
}
|
||||
|
||||
function pathToStatic () {
|
||||
return isProduction()
|
||||
? path.join(process.resourcesPath, 'app.asar.unpacked', 'static')
|
||||
: path.join(__dirname, 'static')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user