Skip to main content

Class: MacPackager

Extends​

Constructors​

Constructor​

new MacPackager(info): MacPackager

Parameters​

info​

Packager

Returns​

MacPackager

Overrides​

PlatformPackager.constructor

Properties​

appInfo​

readonly appInfo: AppInfo

Inherited from​

PlatformPackager.appInfo


codeSigningInfo​

readonly codeSigningInfo: MemoLazy<CreateKeychainOptions | null, CodeSigningInfo>


helper​

readonly helper: MacTargetHelper


info​

readonly info: Packager

Inherited from​

PlatformPackager.info


platform​

readonly platform: Platform

Inherited from​

PlatformPackager.platform


platformSpecificBuildOptions​

readonly platformSpecificBuildOptions: MacConfiguration | MasConfiguration

Inherited from​

PlatformPackager.platformSpecificBuildOptions

Accessors​

buildResourcesDir​

Get Signature​

get buildResourcesDir(): string

Returns​

string

Inherited from​

PlatformPackager.buildResourcesDir


compression​

Get Signature​

get compression(): CompressionLevel

Returns​

CompressionLevel

Inherited from​

PlatformPackager.compression


config​

Get Signature​

get config(): Configuration

Returns​

Configuration

Inherited from​

PlatformPackager.config


debugLogger​

Get Signature​

get debugLogger(): DebugLogger

Returns​

DebugLogger

Inherited from​

PlatformPackager.debugLogger


defaultTarget​

Get Signature​

get defaultTarget(): string[]

Returns​

string[]

Overrides​

PlatformPackager.defaultTarget


fileAssociations​

Get Signature​

get fileAssociations(): FileAssociation[]

Returns​

FileAssociation[]

Inherited from​

PlatformPackager.fileAssociations


forceCodeSigning​

Get Signature​

get forceCodeSigning(): boolean

Returns​

boolean

Inherited from​

PlatformPackager.forceCodeSigning


packagerOptions​

Get Signature​

get packagerOptions(): PackagerOptions

Returns​

PackagerOptions

Inherited from​

PlatformPackager.packagerOptions


projectDir​

Get Signature​

get projectDir(): string

Returns​

string

Inherited from​

PlatformPackager.projectDir


resourceList​

Get Signature​

get resourceList(): Promise<string[]>

Returns​

Promise<string[]>

Inherited from​

PlatformPackager.resourceList

Methods​

addBuildFinalizeTask()​

addBuildFinalizeTask(task): void

Parameters​

task​

() => Promise<void>

Returns​

void

Inherited from​

PlatformPackager.addBuildFinalizeTask


addElectronFuses()​

addElectronFuses(context, fuses): Promise<number>

Use AfterPackContext here to keep available for public API

Parameters​

context​

PackContext

fuses​

FuseConfig

Can be used in afterPack hook for custom fuse logic like below. It's an alternative approach if one wants to override electron-builder's @electron/fuses version

await context.packager.addElectronFuses(context, { ... })

Returns​

Promise<number>

Inherited from​

PlatformPackager.addElectronFuses


applyCommonInfo()​

applyCommonInfo(appPlist, contentsPath): Promise<void>

Parameters​

appPlist​

any

contentsPath​

string

Returns​

Promise<void>


artifactPatternConfig()​

artifactPatternConfig(targetSpecificOptions, defaultPattern): object

Parameters​

targetSpecificOptions​

TargetSpecificOptions | Nullish

defaultPattern​

string | undefined

Returns​

object

isUserForced​

isUserForced: boolean = !!userSpecifiedPattern

pattern​

pattern: string

Inherited from​

PlatformPackager.artifactPatternConfig


computeAppOutDir()​

protected computeAppOutDir(outDir, arch): string

Parameters​

outDir​

string

arch​

Arch

Returns​

string

Inherited from​

PlatformPackager.computeAppOutDir


computeSafeArtifactName()​

computeSafeArtifactName(suggestedName, ext, arch?, skipDefaultArch?, defaultArch?, safePattern?): string | null

Parameters​

suggestedName​

string | null

ext​

string

arch?​

Arch | null

skipDefaultArch?​

boolean = true

defaultArch?​

string

safePattern?​

string = "${name}-${version}-${arch}.${ext}"

Returns​

string | null

Inherited from​

PlatformPackager.computeSafeArtifactName


createGetFileMatchersOptions()​

createGetFileMatchersOptions(outDir, arch, customBuildOptions): GetFileMatchersOptions

Parameters​

outDir​

string

arch​

Arch

customBuildOptions​

PlatformSpecificBuildOptions

Returns​

GetFileMatchersOptions

Inherited from​

PlatformPackager.createGetFileMatchersOptions


createMasInstaller()​

protected createMasInstaller(appPath, outDir, arch, targetPlatform): Promise<void>

Creates the signed MAS installer .pkg for an already codesigned app. Kept separate from sign() so that the afterSign hook can run between codesigning and installer creation (see packMasTargets).

Parameters​

appPath​

string

outDir​

string

arch​

Arch

targetPlatform​

PlatformType

Returns​

Promise<void>


createTargets()​

createTargets(targets, mapper): void

Parameters​

targets​

string[]

mapper​

(name, factory) => void

Returns​

void

Overrides​

PlatformPackager.createTargets


createTransformerForExtraFiles()​

protected createTransformerForExtraFiles(packContext): FileTransformer | null

Parameters​

packContext​

PackContext

Returns​

FileTransformer | null

Inherited from​

PlatformPackager.createTransformerForExtraFiles


doAddElectronFuses()​

protected doAddElectronFuses(packContext): Promise<void>

Parameters​

packContext​

PackContext

Returns​

Promise<void>

Inherited from​

PlatformPackager.doAddElectronFuses


doFlat()​

doFlat(appPath, outFile, identity, keychain): Promise<any>

Parameters​

appPath​

string

outFile​

string

identity​

Identity

keychain​

string | Nullish

Returns​

Promise<any>


doGetCscPassword()​

doGetCscPassword(): string | Nullish

Returns​

string | Nullish

Inherited from​

PlatformPackager.doGetCscPassword


doPack()​

protected doPack(config): Promise<any>

Parameters​

config​

DoPackOptions<MacConfiguration>

Returns​

Promise<any>

Overrides​

PlatformPackager.doPack


doSign()​

protected doSign(opts, customSignOptions, identity): Promise<void>

Parameters​

opts​

SignOptions

customSignOptions​

MacConfiguration | MasConfiguration

identity​

Identity | null

Returns​

Promise<void>


doSignAfterPack()​

protected doSignAfterPack(outDir, appOutDir, platformName, arch, platformSpecificBuildOptions, targets): Promise<void>

Parameters​

outDir​

string

appOutDir​

string

platformName​

ElectronPlatformName

arch​

Arch

platformSpecificBuildOptions​

MacConfiguration | MasConfiguration

targets​

Target[]

Returns​

Promise<void>

Inherited from​

PlatformPackager.doSignAfterPack


expandArch()​

expandArch(pattern, arch?): string[]

Parameters​

pattern​

string

arch?​

Arch | null

Returns​

string[]


expandArtifactBeautyNamePattern()​

expandArtifactBeautyNamePattern(targetSpecificOptions, ext, arch?): string

Parameters​

targetSpecificOptions​

TargetSpecificOptions | Nullish

ext​

string

arch?​

Arch | null

Returns​

string

Inherited from​

PlatformPackager.expandArtifactBeautyNamePattern


expandArtifactNamePattern()​

expandArtifactNamePattern(targetSpecificOptions, ext, arch?, defaultPattern?, skipDefaultArch?, defaultArch?): string

Parameters​

targetSpecificOptions​

TargetSpecificOptions | Nullish

ext​

string

arch?​

Arch | null

defaultPattern?​

string

skipDefaultArch?​

boolean = true

defaultArch?​

string

Returns​

string

Inherited from​

PlatformPackager.expandArtifactNamePattern


expandMacro()​

expandMacro(pattern, arch?, extra?, isProductNameSanitized?): string

Parameters​

pattern​

string

arch?​

string | null

extra?​

any = {}

isProductNameSanitized?​

boolean = true

Returns​

string

Inherited from​

PlatformPackager.expandMacro


generateAssetCatalogData()​

protected generateAssetCatalogData(iconPath): Promise<AssetCatalogResult>

Parameters​

iconPath​

string

Returns​

Promise<AssetCatalogResult>

Inherited from​

PlatformPackager.generateAssetCatalogData


generateIcnsFromIcon()​

generateIcnsFromIcon(iconPath): Promise<string>

Parameters​

iconPath​

string

Returns​

Promise<string>

Inherited from​

PlatformPackager.generateIcnsFromIcon


generateName2()​

generateName2(ext, classifier, deployment): string

Parameters​

ext​

string | null

classifier​

string | Nullish

deployment​

boolean

Returns​

string

Inherited from​

PlatformPackager.generateName2


getCscLink(extraEnvName?): string | Nullish

Parameters​

extraEnvName?​

string | null

Returns​

string | Nullish

Inherited from​

PlatformPackager.getCscLink


getCscPassword()​

getCscPassword(): string

Returns​

string

Inherited from​

PlatformPackager.getCscPassword


getDefaultFrameworkIcon()​

getDefaultFrameworkIcon(): string | null

Returns​

string | null

Inherited from​

PlatformPackager.getDefaultFrameworkIcon


getElectronDestinationDir()​

getElectronDestinationDir(appOutDir): string

Parameters​

appOutDir​

string

Returns​

string

Overrides​

PlatformPackager.getElectronDestinationDir


getElectronSrcDir()​

getElectronSrcDir(dist): string

Parameters​

dist​

string

Returns​

string

Overrides​

PlatformPackager.getElectronSrcDir


getIconPath()​

getIconPath(): Promise<string | null>

Returns​

Promise<string | null>

Overrides​

PlatformPackager.getIconPath


getMacOsElectronFrameworkResourcesDir()​

getMacOsElectronFrameworkResourcesDir(appOutDir): string

Parameters​

appOutDir​

string

Returns​

string

Inherited from​

PlatformPackager.getMacOsElectronFrameworkResourcesDir


getMacOsResourcesDir()​

getMacOsResourcesDir(appOutDir): string

Parameters​

appOutDir​

string

Returns​

string

Inherited from​

PlatformPackager.getMacOsResourcesDir


getOrConvertIcon()​

protected getOrConvertIcon(format): Promise<string | null>

Parameters​

format​

IconFormat

Returns​

Promise<string | null>

Inherited from​

PlatformPackager.getOrConvertIcon


getResource()​

getResource(custom, ...names): Promise<string | null>

Parameters​

custom​

string | Nullish

names​

...string[]

Returns​

Promise<string | null>

Inherited from​

PlatformPackager.getResource


getResourcesDir()​

getResourcesDir(appOutDir): string

Parameters​

appOutDir​

string

Returns​

string

Inherited from​

PlatformPackager.getResourcesDir


getTempFile()​

getTempFile(suffix): Promise<string>

Parameters​

suffix​

string

Returns​

Promise<string>

Inherited from​

PlatformPackager.getTempFile


pack()​

pack(outDir, arch, targets, taskManager): Promise<void>

Parameters​

outDir​

string

arch​

Arch

targets​

Target[]

taskManager​

AsyncTaskManager

Returns​

Promise<void>

Overrides​

PlatformPackager.pack


packageInDistributableFormat()​

protected packageInDistributableFormat(appOutDir, arch, targets, taskManager): void

Parameters​

appOutDir​

string

arch​

Arch

targets​

Target[]

taskManager​

AsyncTaskManager

Returns​

void

Inherited from​

PlatformPackager.packageInDistributableFormat


prepareAppInfo()​

protected prepareAppInfo(appInfo): AppInfo

Parameters​

appInfo​

AppInfo

Returns​

AppInfo

Overrides​

PlatformPackager.prepareAppInfo


resolveIcon()​

resolveIcon(sources, fallbackSources, outputFormat): Promise<IconInfo[]>

Parameters​

sources​

string[]

fallbackSources​

string[]

outputFormat​

IconFormat

Returns​

Promise<IconInfo[]>

Inherited from​

PlatformPackager.resolveIcon


signApp()​

protected signApp(packContext, isAsar): Promise<boolean>

Parameters​

packContext​

PackContext

isAsar​

boolean

Returns​

Promise<boolean>

Overrides​

PlatformPackager.signApp


signMas()​

protected signMas(appPath, arch, targetPlatform): Promise<boolean>

Parameters​

appPath​

string

arch​

Arch

targetPlatform​

PlatformType

Returns​

Promise<boolean>