Unpack icon files so setting browserWindow.icon works
This commit is contained in:
@@ -41,6 +41,10 @@ var all = {
|
||||
// require().
|
||||
asar: true,
|
||||
|
||||
// A glob expression, that unpacks the files with matching names to the
|
||||
// "app.asar.unpacked" directory.
|
||||
'asar-unpack': 'WebTorrent*',
|
||||
|
||||
// The build version of the application. Maps to the FileVersion metadata property on
|
||||
// Windows, and CFBundleVersion on OS X. We're using the short git hash (e.g. 'e7d837e')
|
||||
// Windows requires the build version to start with a number :/ so we stick on a prefix
|
||||
@@ -81,7 +85,7 @@ var darwin = {
|
||||
'helper-bundle-id': 'io.webtorrent.app.helper',
|
||||
|
||||
// Application icon.
|
||||
icon: path.join(__dirname, '..', 'static', 'WebTorrent.icns')
|
||||
icon: config.APP_ICON + '.icns'
|
||||
}
|
||||
|
||||
var win32 = {
|
||||
@@ -114,7 +118,7 @@ var win32 = {
|
||||
},
|
||||
|
||||
// Application icon.
|
||||
icon: path.join(__dirname, '..', 'static', 'WebTorrent.ico')
|
||||
icon: config.APP_ICON + '.ico'
|
||||
}
|
||||
|
||||
var linux = {
|
||||
@@ -151,7 +155,7 @@ function buildDarwin (cb) {
|
||||
infoPlist.CFBundleDocumentTypes = [
|
||||
{
|
||||
CFBundleTypeExtensions: [ 'torrent' ],
|
||||
CFBundleTypeIconFile: 'WebTorrentFile.icns',
|
||||
CFBundleTypeIconFile: path.basename(config.APP_FILE_ICON) + '.icns',
|
||||
CFBundleTypeName: 'BitTorrent Document',
|
||||
CFBundleTypeRole: 'Editor',
|
||||
LSHandlerRank: 'Owner',
|
||||
@@ -169,7 +173,7 @@ function buildDarwin (cb) {
|
||||
infoPlist.CFBundleURLTypes = [
|
||||
{
|
||||
CFBundleTypeRole: 'Editor',
|
||||
CFBundleURLIconFile: 'WebTorrentFile.icns',
|
||||
CFBundleURLIconFile: path.basename(config.APP_FILE_ICON) + '.icns',
|
||||
CFBundleURLName: 'BitTorrent Magnet URL',
|
||||
CFBundleURLSchemes: [ 'magnet' ]
|
||||
}
|
||||
@@ -178,7 +182,7 @@ function buildDarwin (cb) {
|
||||
infoPlist.NSHumanReadableCopyright = config.COPYRIGHT
|
||||
|
||||
fs.writeFileSync(infoPlistPath, plist.build(infoPlist))
|
||||
cp.execSync(`cp ${webTorrentFileIconPath} ${resourcesPath}`)
|
||||
cp.execSync(`cp ${config.APP_FILE_ICON + '.icns'} ${resourcesPath}`)
|
||||
|
||||
if (cb) cb(null)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user