Skip to main content

Class: WinPackager

Extends​

Constructors​

Constructor​

new WinPackager(info): WinPackager

Parameters​

info​

Packager

Returns​

WinPackager

Overrides​

PlatformPackager.constructor

Properties​

_iconPath​

_iconPath: Lazy<string | null>


appInfo​

readonly appInfo: AppInfo

Inherited from​

PlatformPackager.appInfo


info​

protected readonly info: Packager

Inherited from​

PlatformPackager.info


platform​

readonly platform: Platform

Inherited from​

PlatformPackager.platform


platformSpecificBuildOptions​

protected readonly platformSpecificBuildOptions: WindowsConfiguration

Inherited from​

PlatformPackager.platformSpecificBuildOptions


signingManager​

readonly signingManager: Lazy<SignManager>


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.

Inherited from​

PlatformPackager.updateSigningKeys


vm​

readonly vm: Lazy<VmManager>

Accessors​

appDir​

Get Signature​

get appDir(): string

Returns​

string

Inherited from​

PlatformPackager.appDir


areNodeModulesHandledExternally​

Get Signature​

get areNodeModulesHandledExternally(): boolean

Returns​

boolean

Inherited from​

PlatformPackager.areNodeModulesHandledExternally


buildResourcesDir​

Get Signature​

get buildResourcesDir(): string

Returns​

string

Inherited from​

PlatformPackager.buildResourcesDir


cancellationToken​

Get Signature​

get cancellationToken(): CancellationToken

Returns​

CancellationToken

Inherited from​

PlatformPackager.cancellationToken


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


framework​

Get Signature​

get framework(): Framework

Returns​

Framework

Inherited from​

PlatformPackager.framework


isForceCodeSigningVerification​

Get Signature​

get isForceCodeSigningVerification(): boolean

Returns​

boolean


isPrepackedAppAsar​

Get Signature​

get isPrepackedAppAsar(): boolean

Returns​

boolean

Inherited from​

PlatformPackager.isPrepackedAppAsar


metadata​

Get Signature​

get metadata(): Metadata

Returns​

Metadata

Inherited from​

PlatformPackager.metadata


nodePackageName​

Get Signature​

get nodePackageName(): string

Returns​

string

Inherited from​

PlatformPackager.nodePackageName


originalMetadata​

Get Signature​

get originalMetadata(): Metadata

Returns​

Metadata

Inherited from​

PlatformPackager.originalMetadata


packagerOptions​

Get Signature​

get packagerOptions(): PackagerOptions

Returns​

PackagerOptions

Inherited from​

PlatformPackager.packagerOptions


platformOptions​

Get Signature​

get platformOptions(): DC

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

Returns​

DC

Inherited from​

PlatformPackager.platformOptions


projectDir​

Get Signature​

get projectDir(): string

Returns​

string

Inherited from​

PlatformPackager.projectDir


relativeBuildResourcesDirname​

Get Signature​

get relativeBuildResourcesDirname(): string

Returns​

string

Inherited from​

PlatformPackager.relativeBuildResourcesDirname


repositoryInfo​

Get Signature​

get repositoryInfo(): Promise<SourceRepositoryInfo | null>

Returns​

Promise<SourceRepositoryInfo | null>

Inherited from​

PlatformPackager.repositoryInfo


resourceList​

Get Signature​

get resourceList(): Promise<string[]>

Returns​

Promise<string[]>

Inherited from​

PlatformPackager.resourceList


stageDirPathCustomizer​

Get Signature​

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

Returns​

(target, packager, arch) => string

Inherited from​

PlatformPackager.stageDirPathCustomizer


tempDirManager​

Get Signature​

get tempDirManager(): TmpDir

Returns​

TmpDir

Inherited from​

PlatformPackager.tempDirManager

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


artifactPatternConfig()​

artifactPatternConfig(targetSpecificOptions, defaultPattern): object

Parameters​

targetSpecificOptions​

TargetSpecificOptions | Nullish

defaultPattern​

string | undefined

Returns​

object

isUserForced​

isUserForced: boolean

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

defaultArch?​

string

safePattern?​

string

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


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

Overrides​

PlatformPackager.createTransformerForExtraFiles


doAddElectronFuses()​

protected doAddElectronFuses(packContext): Promise<void>

Parameters​

packContext​

PackContext

Returns​

Promise<void>

Inherited from​

PlatformPackager.doAddElectronFuses


doGetCscPassword()​

doGetCscPassword(): string | Nullish

Returns​

string | Nullish

Overrides​

PlatformPackager.doGetCscPassword


doPack()​

protected doPack(packOptions): Promise<void>

Parameters​

packOptions​

DoPackOptions<WindowsConfiguration>

Returns​

Promise<void>

Inherited from​

PlatformPackager.doPack


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​

WindowsConfiguration

targets​

Target[]

Returns​

Promise<void>

Inherited from​

PlatformPackager.doSignAfterPack


emitAppxManifestCreated()​

emitAppxManifestCreated(path): Promise<void>

Parameters​

path​

string

Returns​

Promise<void>

Inherited from​

PlatformPackager.emitAppxManifestCreated


emitArtifactBuildCompleted()​

emitArtifactBuildCompleted(event): Promise<void>

Parameters​

event​

ArtifactCreated

Returns​

Promise<void>

Inherited from​

PlatformPackager.emitArtifactBuildCompleted


emitArtifactBuildStarted()​

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

Parameters​

event​

ArtifactBuildStarted

logFields?​

any

Returns​

Promise<void>

Inherited from​

PlatformPackager.emitArtifactBuildStarted


emitArtifactCreated()​

emitArtifactCreated(event): Promise<void>

Parameters​

event​

ArtifactCreated

Returns​

Promise<void>

Inherited from​

PlatformPackager.emitArtifactCreated


emitMsiProjectCreated()​

emitMsiProjectCreated(path): Promise<void>

Parameters​

path​

string

Returns​

Promise<void>

Inherited from​

PlatformPackager.emitMsiProjectCreated


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

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

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

Inherited from​

PlatformPackager.getElectronDestinationDir


getElectronSrcDir()​

getElectronSrcDir(dist): string

Parameters​

dist​

string

Returns​

string

Inherited from​

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


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

Inherited from​

PlatformPackager.getOptionsForTarget


getOrConvertIcon()​

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

Parameters​

format​

IconFormat

Returns​

Promise<string | null>

Inherited from​

PlatformPackager.getOrConvertIcon


getPackageManager()​

getPackageManager(): Promise<PM>

Returns​

Promise<PM>

Inherited from​

PlatformPackager.getPackageManager


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


getWorkspaceRoot()​

getWorkspaceRoot(): Promise<string>

Returns​

Promise<string>

Inherited from​

PlatformPackager.getWorkspaceRoot


pack()​

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

Parameters​

outDir​

string

arch​

Arch

targets​

Target[]

taskManager​

AsyncTaskManager

Returns​

Promise<any>

Inherited from​

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

Inherited from​

PlatformPackager.prepareAppInfo


resolveIcon()​

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

Parameters​

sources​

string[]

fallbackSources​

string[]

outputFormat​

IconFormat

Returns​

Promise<IconInfo[]>

Inherited from​

PlatformPackager.resolveIcon


signAndEditResources()​

signAndEditResources(file, arch, outDir, internalName?, requestedExecutionLevel?): Promise<SigningResult>

Parameters​

file​

string

arch​

Arch

outDir​

string

internalName?​

string | null

requestedExecutionLevel?​

RequestedExecutionLevel | null

Returns​

Promise<SigningResult>


signApp()​

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

Parameters​

packContext​

PackContext

isAsar​

boolean

Returns​

Promise<SigningResult>

Overrides​

PlatformPackager.signApp


signIf()​

signIf(file): Promise<SigningResult>

Parameters​

file​

string

Returns​

Promise<SigningResult>