Skip to content

Commit

Permalink
fix(mac): dist app quit unexpectedly caused by productName
Browse files Browse the repository at this point in the history
Close #1278
  • Loading branch information
develar committed Feb 20, 2017
1 parent 3f3419a commit 3a1042a
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions packages/electron-builder/src/packager/mac.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,25 +66,27 @@ export async function createApp(packager: PlatformPackager<any>, appOutDir: stri
const icon = await packager.getIconPath()
const oldIcon = appPlist.CFBundleIconFile
if (icon != null) {
appPlist.CFBundleIconFile = `${appInfo.productFilename}.icns`
appPlist.CFBundleIconFile = `${appFilename}.icns`
}

appPlist.CFBundleDisplayName = appInfo.productName
appPlist.CFBundleIdentifier = appBundleIdentifier
appPlist.CFBundleName = appInfo.productName
helperPlist.CFBundleDisplayName = `${appInfo.productName} Helper`
helperPlist.CFBundleIdentifier = helperBundleIdentifier
appPlist.CFBundleExecutable = appFilename
helperPlist.CFBundleName = appInfo.productName

// https://github.com/electron-userland/electron-builder/issues/1278
appPlist.CFBundleExecutable = !appFilename.endsWith(" Helper") ? appFilename : appFilename.substring(0, appFilename.length - " Helper".length)

helperPlist.CFBundleExecutable = `${appFilename} Helper`
helperEHPlist.CFBundleDisplayName = `${appFilename} Helper EH`
helperEHPlist.CFBundleIdentifier = `${helperBundleIdentifier}.EH`
helperEHPlist.CFBundleName = `${appInfo.productName} Helper EH`
helperEHPlist.CFBundleExecutable = `${appFilename} Helper EH`
helperNPPlist.CFBundleExecutable = `${appFilename} Helper NP`

helperPlist.CFBundleDisplayName = `${appInfo.productName} Helper`
helperEHPlist.CFBundleDisplayName = `${appInfo.productName} Helper EH`
helperNPPlist.CFBundleDisplayName = `${appInfo.productName} Helper NP`

helperPlist.CFBundleIdentifier = helperBundleIdentifier
helperEHPlist.CFBundleIdentifier = `${helperBundleIdentifier}.EH`
helperNPPlist.CFBundleIdentifier = `${helperBundleIdentifier}.NP`
helperNPPlist.CFBundleName = `${appInfo.productName} Helper NP`
helperNPPlist.CFBundleExecutable = `${appFilename} Helper NP`

appPlist.CFBundleShortVersionString = appInfo.version
appPlist.CFBundleVersion = appInfo.buildVersion
Expand Down

0 comments on commit 3a1042a

Please sign in to comment.