Skip to content

Commit

Permalink
allow different appId for mac and mas
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielNSD committed Jun 7, 2023
1 parent e3fc9b5 commit c2220df
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 9 additions & 2 deletions packages/app-builder-lib/src/electron/electronMac.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,14 @@ export async function createMacApp(packager: MacPackager, appOutDir: string, asa
if (oldHelperBundleId != null) {
log.warn("build.helper-bundle-id is deprecated, please set as build.mac.helperBundleId")
}
const helperBundleIdentifier = filterCFBundleIdentifier(packager.platformSpecificBuildOptions.helperBundleId || oldHelperBundleId || `${appInfo.macBundleIdentifier}.helper`)

const cfBundleIdentifier = filterCFBundleIdentifier((isMas ? packager.config.mas?.appId : packager.platformSpecificBuildOptions.appId) || appInfo.macBundleIdentifier)

const helperBundleIdentifier = filterCFBundleIdentifier(
(isMas ? packager.config.mas?.helperBundleId : packager.platformSpecificBuildOptions.helperBundleId) || oldHelperBundleId || `${cfBundleIdentifier}.helper`
)

appPlist.CFBundleIdentifier = cfBundleIdentifier

await packager.applyCommonInfo(appPlist, contentsPath)

Expand Down Expand Up @@ -168,7 +175,7 @@ export async function createMacApp(packager: MacPackager, appOutDir: string, asa
helperLoginPlist.CFBundleExecutable = `${appFilename} Login Helper`
helperLoginPlist.CFBundleDisplayName = `${appInfo.productName} Login Helper`
// noinspection SpellCheckingInspection
helperLoginPlist.CFBundleIdentifier = `${appInfo.macBundleIdentifier}.loginhelper`
helperLoginPlist.CFBundleIdentifier = `${cfBundleIdentifier}.loginhelper`
helperLoginPlist.CFBundleVersion = appPlist.CFBundleVersion
}

Expand Down
2 changes: 0 additions & 2 deletions packages/app-builder-lib/src/macPackager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,6 @@ export default class MacPackager extends PlatformPackager<MacConfiguration> {
appPlist.LSMinimumSystemVersion = minimumSystemVersion
}

appPlist.CFBundleIdentifier = appInfo.macBundleIdentifier

appPlist.CFBundleShortVersionString = this.platformSpecificBuildOptions.bundleShortVersion || appInfo.version
appPlist.CFBundleVersion = appInfo.buildVersion

Expand Down

0 comments on commit c2220df

Please sign in to comment.