Skip to main content

Abstract Class: PlatformPackager<DC>

Extended by​

Type Parameters​

DC​

DC extends PlatformSpecificBuildOptions

Constructors​

Constructor​

protected new PlatformPackager<DC>(info, platform): PlatformPackager<DC>

Parameters​

info​

Packager

platform​

Platform

Returns​

PlatformPackager<DC>

Properties​

appInfo​

readonly appInfo: AppInfo


info​

protected readonly info: Packager


platform​

readonly platform: Platform


platformSpecificBuildOptions​

protected readonly platformSpecificBuildOptions: DC


updateSigningKeys​

readonly updateSigningKeys: MemoLazy<UpdateManifestSigningOptions | null, KeyObject[]>

Ed25519 private key(s) used to sign auto-update manifests; empty when signing is disabled. Single source of truth for both consumers - updateInfoBuilder (signing latest*.yml) and PublishManager (embedding the derived public keys in app-update.yml) - so the two can no longer disagree about whether signing is on or which keys are in play. Several keys mean every manifest is signed by each of them (dual-signing during key rotation); the first key is the one written to the legacy single signature field. MemoLazy rather than Lazy so a hook mutating updateManifest between packs re-resolves, while a normal build parses the PEMs once.

Accessors​

appDir​

Get Signature​

get appDir(): string

Returns​

string


areNodeModulesHandledExternally​

Get Signature​

get areNodeModulesHandledExternally(): boolean

Returns​

boolean


buildResourcesDir​

Get Signature​

get buildResourcesDir(): string

Returns​

string


cancellationToken​

Get Signature​

get cancellationToken(): CancellationToken

Returns​

CancellationToken


compression​

Get Signature​

get compression(): CompressionLevel

Returns​

CompressionLevel


config​

Get Signature​

get config(): Configuration

Returns​

Configuration


debugLogger​

Get Signature​

get debugLogger(): DebugLogger

Returns​

DebugLogger


defaultTarget​

Get Signature​

get abstract defaultTarget(): string[]

Returns​

string[]


fileAssociations​

Get Signature​

get fileAssociations(): FileAssociation[]

Returns​

FileAssociation[]


forceCodeSigning​

Get Signature​

get forceCodeSigning(): boolean

Returns​

boolean


framework​

Get Signature​

get framework(): Framework

Returns​

Framework


isPrepackedAppAsar​

Get Signature​

get isPrepackedAppAsar(): boolean

Returns​

boolean


metadata​

Get Signature​

get metadata(): Metadata

Returns​

Metadata


nodePackageName​

Get Signature​

get nodePackageName(): string

Returns​

string


originalMetadata​

Get Signature​

get originalMetadata(): Metadata

Returns​

Metadata


packagerOptions​

Get Signature​

get packagerOptions(): PackagerOptions

Returns​

PackagerOptions


platformOptions​

Get Signature​

get platformOptions(): DC

Platform-level build options (e.g. config.mac, config.win, config.linux).

Returns​

DC


projectDir​

Get Signature​

get projectDir(): string

Returns​

string


relativeBuildResourcesDirname​

Get Signature​

get relativeBuildResourcesDirname(): string

Returns​

string


repositoryInfo​

Get Signature​

get repositoryInfo(): Promise<SourceRepositoryInfo | null>

Returns​

Promise<SourceRepositoryInfo | null>


resourceList​

Get Signature​

get resourceList(): Promise<string[]>

Returns​

Promise<string[]>


stageDirPathCustomizer​

Get Signature​

get stageDirPathCustomizer(): (target, packager, arch) => string

Returns​

(target, packager, arch) => string


tempDirManager​

Get Signature​

get tempDirManager(): TmpDir

Returns​

TmpDir

Methods​

addBuildFinalizeTask()​

addBuildFinalizeTask(task): void

Parameters​

task​

() => Promise<void>

Returns​

void


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>


artifactPatternConfig()​

artifactPatternConfig(targetSpecificOptions, defaultPattern): object

Parameters​

targetSpecificOptions​

TargetSpecificOptions | Nullish

defaultPattern​

string | undefined

Returns​

object

isUserForced​

isUserForced: boolean = !!userSpecifiedPattern

pattern​

pattern: string


computeAppOutDir()​

protected computeAppOutDir(outDir, arch): string

Parameters​

outDir​

string

arch​

Arch

Returns​

string


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


createGetFileMatchersOptions()​

createGetFileMatchersOptions(outDir, arch, customBuildOptions): GetFileMatchersOptions

Parameters​

outDir​

string

arch​

Arch

customBuildOptions​

PlatformSpecificBuildOptions

Returns​

GetFileMatchersOptions


createTargets()​

abstract createTargets(targets, mapper): void

Parameters​

targets​

string[]

mapper​

(name, factory) => void

Returns​

void


createTransformerForExtraFiles()​

protected createTransformerForExtraFiles(packContext): FileTransformer | null

Parameters​

packContext​

PackContext

Returns​

FileTransformer | null


doAddElectronFuses()​

protected doAddElectronFuses(packContext): Promise<void>

Parameters​

packContext​

PackContext

Returns​

Promise<void>


doGetCscPassword()​

doGetCscPassword(): string | Nullish

Returns​

string | Nullish


doPack()​

protected doPack(packOptions): Promise<void>

Parameters​

packOptions​

DoPackOptions<DC>

Returns​

Promise<void>


doSignAfterPack()​

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

Parameters​

outDir​

string

appOutDir​

string

platformName​

ElectronPlatformName

platformType​

PlatformType | undefined

arch​

Arch

platformSpecificBuildOptions​

DC

targets​

Target[]

Returns​

Promise<void>


emitAppxManifestCreated()​

emitAppxManifestCreated(path): Promise<void>

Parameters​

path​

string

Returns​

Promise<void>


emitArtifactBuildCompleted()​

emitArtifactBuildCompleted(event): Promise<void>

Parameters​

event​

ArtifactCreated

Returns​

Promise<void>


emitArtifactBuildStarted()​

emitArtifactBuildStarted(event, logFields?): Promise<void>

Parameters​

event​

ArtifactBuildStarted

logFields?​

any

Returns​

Promise<void>


emitArtifactCreated()​

emitArtifactCreated(event): Promise<void>

Parameters​

event​

ArtifactCreated

Returns​

Promise<void>


emitMsiProjectCreated()​

emitMsiProjectCreated(path): Promise<void>

Parameters​

path​

string

Returns​

Promise<void>


expandArtifactBeautyNamePattern()​

expandArtifactBeautyNamePattern(targetSpecificOptions, ext, arch?): string

Parameters​

targetSpecificOptions​

TargetSpecificOptions | Nullish

ext​

string

arch?​

Arch | null

Returns​

string


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


expandMacro()​

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

Parameters​

pattern​

string

arch?​

string | null

extra?​

any = {}

isProductNameSanitized?​

boolean = true

Returns​

string


generateAssetCatalogData()​

protected generateAssetCatalogData(iconPath): Promise<AssetCatalogResult>

Parameters​

iconPath​

string

Returns​

Promise<AssetCatalogResult>


generateIcnsFromIcon()​

generateIcnsFromIcon(iconPath): Promise<string>

Parameters​

iconPath​

string

Returns​

Promise<string>


generateName2()​

generateName2(ext, classifier, deployment): string

Parameters​

ext​

string | null

classifier​

string | Nullish

deployment​

boolean

Returns​

string


getCscLink(extraEnvName?): string | Nullish

Parameters​

extraEnvName?​

string | null

Returns​

string | Nullish


getCscPassword()​

getCscPassword(): string

Returns​

string


getDefaultFrameworkIcon()​

getDefaultFrameworkIcon(): string | null

Returns​

string | null


getElectronDestinationDir()​

getElectronDestinationDir(appOutDir): string

Parameters​

appOutDir​

string

Returns​

string


getElectronSrcDir()​

getElectronSrcDir(dist): string

Parameters​

dist​

string

Returns​

string


getIconPath()​

getIconPath(): Promise<string | null>

Returns​

Promise<string | null>


getMacOsElectronFrameworkResourcesDir()​

getMacOsElectronFrameworkResourcesDir(appOutDir): string

Parameters​

appOutDir​

string

Returns​

string


getMacOsResourcesDir()​

getMacOsResourcesDir(appOutDir): string

Parameters​

appOutDir​

string

Returns​

string


getOptionsForTarget()​

getOptionsForTarget<T>(key): T

Merge platform-level options with target-specific config under key. Replaces the manual deepAssign({}, packager.platformSpecificBuildOptions, config.X) pattern.

Type Parameters​

T​

T

Parameters​

key​

string

Returns​

T


getOrConvertIcon()​

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

Parameters​

format​

IconFormat

Returns​

Promise<string | null>


getPackageManager()​

getPackageManager(): Promise<PM>

Returns​

Promise<PM>


getResource()​

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

Parameters​

custom​

string | Nullish

names​

...string[]

Returns​

Promise<string | null>


getResourcesDir()​

getResourcesDir(appOutDir): string

Parameters​

appOutDir​

string

Returns​

string


getTempFile()​

getTempFile(suffix): Promise<string>

Parameters​

suffix​

string

Returns​

Promise<string>


getWorkspaceRoot()​

getWorkspaceRoot(): Promise<string>

Returns​

Promise<string>


pack()​

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

Parameters​

outDir​

string

arch​

Arch

targets​

Target[]

taskManager​

AsyncTaskManager

Returns​

Promise<any>


packageInDistributableFormat()​

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

Parameters​

appOutDir​

string

arch​

Arch

targets​

Target[]

taskManager​

AsyncTaskManager

Returns​

void


prepareAppInfo()​

protected prepareAppInfo(appInfo): AppInfo

Parameters​

appInfo​

AppInfo

Returns​

AppInfo


resolveIcon()​

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

Parameters​

sources​

string[]

fallbackSources​

string[]

outputFormat​

IconFormat

Returns​

Promise<IconInfo[]>


signApp()​

protected signApp(packContext, isAsar, _platformType?): Promise<SigningResult>

Parameters​

packContext​

PackContext

isAsar​

boolean

_platformType?​

PlatformType

Returns​

Promise<SigningResult>