electron-builder-lib
- Version 20.23.1
- Published
- 2.01 MB
- 26 dependencies
- MIT license
Install
npm i electron-builder-lib
yarn add electron-builder-lib
pnpm add electron-builder-lib
Overview
electron-builder lib
Index
Variables
Functions
Classes
Packager
- addAfterPackHandler()
- afterPack()
- appDir
- appInfo
- areNodeModulesHandledExternally
- artifactCreated()
- build()
- buildResourcesDir
- cancellationToken
- config
- debugLogger
- devMetadata
- dispatchArtifactCreated()
- eventEmitter
- framework
- isPrepackedAppAsar
- isTwoPackageJsonProjectLayoutUsed
- metadata
- options
- projectDir
- relativeBuildResourcesDirname
- repositoryInfo
- stageDirPathCustomizer
- tempDirManager
PlatformPackager
- appInfo
- buildResourcesDir
- compression
- computeAppOutDir()
- computeSafeArtifactName()
- config
- createTargets()
- createTransformerForExtraFiles()
- debugLogger
- defaultTarget
- dispatchArtifactCreated()
- doGetCscPassword()
- doPack()
- electronDistExecutableName
- electronDistMacOsExecutableName
- expandArtifactNamePattern()
- expandMacro()
- fileAssociations
- forceCodeSigning
- generateName2()
- getCscLink()
- getCscPassword()
- getElectronDestinationDir()
- getElectronSrcDir()
- getIconPath()
- getMacOsResourcesDir()
- getOrConvertIcon()
- getResource()
- getResourcesDir()
- getTempFile()
- info
- pack()
- packageInDistributableFormat()
- packagerOptions
- platform
- platformSpecificBuildOptions
- prepareAppInfo()
- projectDir
- resolveIcon()
- resourceList
- signApp()
Interfaces
Configuration
- afterAllArtifactBuild
- afterPack
- afterSign
- apk
- appId
- appImage
- appx
- beforeBuild
- buildDependenciesFromSource
- buildVersion
- copyright
- deb
- directories
- dmg
- electronCompile
- electronDist
- electronDownload
- electronVersion
- extends
- extraMetadata
- freebsd
- includePdb
- linux
- mac
- mas
- msi
- muonVersion
- nodeGypRebuild
- npmArgs
- npmRebuild
- npmSkipBuildFromSource
- nsis
- nsisWeb
- onNodeModuleFile
- p5p
- pacman
- pkg
- portable
- productName
- protonNodeVersion
- readonly
- remoteBuild
- removePackageScripts
- rpm
- snap
- squirrelWindows
- win
NsisOptions
- allowElevation
- allowToChangeInstallationDirectory
- artifactName
- deleteAppDataOnUninstall
- differentialPackage
- displayLanguageSelector
- include
- installerHeader
- installerHeaderIcon
- installerIcon
- installerLanguages
- installerSidebar
- language
- license
- multiLanguageInstaller
- oneClick
- packElevateHelper
- perMachine
- preCompressedFileExtensions
- script
- uninstallDisplayName
- uninstallerIcon
- uninstallerSidebar
WindowsConfiguration
- additionalCertificateFile
- certificateFile
- certificatePassword
- certificateSha1
- certificateSubjectName
- electronUpdaterCompatibility
- icon
- legalTrademarks
- publisherName
- requestedExecutionLevel
- rfc3161TimeStampServer
- sign
- signAndEditExecutable
- signDlls
- signingHashAlgorithms
- target
- timeStampServer
- verifyUpdateCodeSignature
Type Aliases
Variables
variable DEFAULT_TARGET
const DEFAULT_TARGET: string;
variable DIR_TARGET
const DIR_TARGET: string;
Functions
function build
build: ( options: PackagerOptions & PublishOptions, packager?: Packager) => Promise<Array<string>>;
function buildForge
buildForge: ( forgeOptions: ForgeOptions, options: PackagerOptions) => Promise<string[]>;
Classes
class AppInfo
class AppInfo {}
constructor
constructor(info: Packager, buildVersion?: string);
property buildNumber
readonly buildNumber: string;
property buildVersion
readonly buildVersion: string;
property channel
readonly channel: string;
property companyName
readonly companyName: string;
property copyright
readonly copyright: string;
property description
readonly description: string;
property id
readonly id: string;
property macBundleIdentifier
readonly macBundleIdentifier: string;
property name
readonly name: string;
property productFilename
readonly productFilename: string;
property productName
readonly productName: string;
property sanitizedName
readonly sanitizedName: string;
property version
readonly version: string;
property versionInWeirdWindowsForm
readonly versionInWeirdWindowsForm: string;
method computePackageUrl
computePackageUrl: () => Promise<string | null>;
class Packager
class Packager {}
constructor
constructor(options: PackagerOptions, cancellationToken?: CancellationToken);
property appDir
readonly appDir: string;
property appInfo
readonly appInfo: AppInfo;
property areNodeModulesHandledExternally
readonly areNodeModulesHandledExternally: boolean;
property buildResourcesDir
readonly buildResourcesDir: string;
property cancellationToken
readonly cancellationToken: CancellationToken;
property config
readonly config: Configuration;
property debugLogger
readonly debugLogger: DebugLogger;
property devMetadata
readonly devMetadata: Metadata;
property eventEmitter
readonly eventEmitter: EventEmitter;
property framework
readonly framework: Framework;
property isPrepackedAppAsar
readonly isPrepackedAppAsar: boolean;
property isTwoPackageJsonProjectLayoutUsed
isTwoPackageJsonProjectLayoutUsed: boolean;
property metadata
readonly metadata: Metadata;
property options
readonly options: PackagerOptions;
property projectDir
readonly projectDir: string;
property relativeBuildResourcesDirname
readonly relativeBuildResourcesDirname: string;
property repositoryInfo
readonly repositoryInfo: Promise<SourceRepositoryInfo>;
property stageDirPathCustomizer
stageDirPathCustomizer: ( target: Target, packager: PlatformPackager<any>, arch: Arch) => string;
property tempDirManager
readonly tempDirManager: TmpDir;
method addAfterPackHandler
addAfterPackHandler: ( handler: (context: AfterPackContext) => Promise<any> | null) => void;
method afterPack
afterPack: (context: AfterPackContext) => Promise<any>;
method artifactCreated
artifactCreated: (handler: (event: ArtifactCreated) => void) => Packager;
method build
build: () => Promise<BuildResult>;
method dispatchArtifactCreated
dispatchArtifactCreated: (event: ArtifactCreated) => void;
class Platform
class Platform {}
constructor
constructor( name: string, buildConfigurationKey: string, nodeName: NodeJS.Platform);
property buildConfigurationKey
buildConfigurationKey: string;
property LINUX
static LINUX: Platform;
property MAC
static MAC: Platform;
property name
name: string;
property nodeName
nodeName: NodeJS.Platform;
property WINDOWS
static WINDOWS: Platform;
method createTarget
createTarget: ( type?: string | Array<string> | null, ...archs: Array<Arch>) => Map<Platform, Map<Arch, Array<string>>>;
method current
static current: () => Platform;
method fromString
static fromString: (name: string) => Platform;
method toString
toString: () => string;
class PlatformPackager
abstract class PlatformPackager<DC extends PlatformSpecificBuildOptions> {}
constructor
protected constructor(info: Packager, platform: Platform);
property appInfo
readonly appInfo: AppInfo;
property buildResourcesDir
readonly buildResourcesDir: string;
property compression
readonly compression: CompressionLevel;
property config
readonly config: Configuration;
property debugLogger
readonly debugLogger: DebugLogger;
property defaultTarget
abstract readonly defaultTarget: string[];
property electronDistExecutableName
readonly electronDistExecutableName: 'electron' | 'brave';
property electronDistMacOsExecutableName
readonly electronDistMacOsExecutableName: 'Electron' | 'Brave';
property fileAssociations
readonly fileAssociations: FileAssociation[];
property forceCodeSigning
readonly forceCodeSigning: boolean;
property info
readonly info: Packager;
property packagerOptions
readonly packagerOptions: PackagerOptions;
property platform
readonly platform: Platform;
property platformSpecificBuildOptions
readonly platformSpecificBuildOptions: PlatformSpecificBuildOptions;
property projectDir
readonly projectDir: string;
property resourceList
readonly resourceList: Promise<string[]>;
method computeAppOutDir
protected computeAppOutDir: (outDir: string, arch: Arch) => string;
method computeSafeArtifactName
computeSafeArtifactName: ( suggestedName: string | null, ext: string, arch?: Arch | null, skipArchIfX64?: boolean, safePattern?: string) => string | null;
method createTargets
abstract createTargets: ( targets: Array<string>, mapper: (name: string, factory: (outDir: string) => Target) => void) => void;
method createTransformerForExtraFiles
protected createTransformerForExtraFiles: ( packContext: AfterPackContext) => FileTransformer | null;
method dispatchArtifactCreated
dispatchArtifactCreated: ( file: string, target: Target | null, arch: Arch | null, safeArtifactName?: string | null) => void;
method doGetCscPassword
protected doGetCscPassword: () => string | null | undefined;
method doPack
protected doPack: ( outDir: string, appOutDir: string, platformName: ElectronPlatformName, arch: Arch, platformSpecificBuildOptions: DC, targets: Array<Target>) => Promise<void>;
method expandArtifactNamePattern
expandArtifactNamePattern: ( targetSpecificOptions: TargetSpecificOptions | null | undefined, ext: string, arch?: Arch | null, defaultPattern?: string, skipArchIfX64?: boolean) => string;
method expandMacro
expandMacro: ( pattern: string, arch?: string | null, extra?: any, isProductNameSanitized?: boolean) => string;
method generateName2
generateName2: ( ext: string | null, classifier: string | null | undefined, deployment: boolean) => string;
method getCscLink
protected getCscLink: ( extraEnvName?: string | null) => string | null | undefined;
method getCscPassword
protected getCscPassword: () => string;
method getElectronDestinationDir
getElectronDestinationDir: (appOutDir: string) => string;
method getElectronSrcDir
getElectronSrcDir: (dist: string) => string;
method getIconPath
getIconPath: () => Promise<string | null>;
method getMacOsResourcesDir
getMacOsResourcesDir: (appOutDir: string) => string;
method getOrConvertIcon
protected getOrConvertIcon: (format: IconFormat) => Promise<string | null>;
method getResource
getResource: ( custom: string | null | undefined, ...names: Array<string>) => Promise<string | null>;
method getResourcesDir
getResourcesDir: (appOutDir: string) => string;
method getTempFile
getTempFile: (suffix: string) => Promise<string>;
method pack
pack: ( outDir: string, arch: Arch, targets: Array<Target>, taskManager: AsyncTaskManager) => Promise<any>;
method packageInDistributableFormat
protected packageInDistributableFormat: ( appOutDir: string, arch: Arch, targets: Array<Target>, taskManager: AsyncTaskManager) => void;
method prepareAppInfo
protected prepareAppInfo: (appInfo: AppInfo) => AppInfo;
method resolveIcon
resolveIcon: ( sources: Array<string>, outputFormat: IconFormat) => Promise<Array<IconInfo>>;
method signApp
protected signApp: ( packContext: AfterPackContext, isAsar: boolean) => Promise<any>;
class PublishManager
class PublishManager implements PublishContext {}
constructor
constructor( packager: Packager, publishOptions: PublishOptions, cancellationToken?: CancellationToken);
property cancellationToken
readonly cancellationToken: CancellationToken;
property isPublish
readonly isPublish: boolean;
property progress
readonly progress: any;
method awaitTasks
awaitTasks: () => Promise<void>;
method cancelTasks
cancelTasks: () => void;
method getGlobalPublishConfigurations
getGlobalPublishConfigurations: () => Promise<Array<PublishConfiguration> | null>;
class Target
abstract class Target {}
constructor
protected constructor(name: string, isAsyncSupported?: boolean);
property isAsyncSupported
readonly isAsyncSupported: boolean;
property name
readonly name: string;
property options
abstract readonly options: TargetSpecificOptions;
property outDir
abstract readonly outDir: string;
method build
abstract build: (appOutDir: string, arch: Arch) => Promise<any>;
method checkOptions
checkOptions: () => Promise<any>;
method finishBuild
finishBuild: () => Promise<any>;
method logBuilding
protected logBuilding: ( targetPresentableName: string, artifactPath: string, arch: Arch) => void;
Interfaces
interface AfterPackContext
interface AfterPackContext {}
interface AppImageOptions
interface AppImageOptions extends CommonLinuxOptions, TargetSpecificOptions {}
property license
readonly license?: string | null;
The path to EULA license file. Defaults to
license.txt
oreula.txt
(or uppercase variants). Only plain text is supported.
property systemIntegration
readonly systemIntegration?: 'ask' | 'doNotAsk';
The system integration installation. ask
interface AppXOptions
interface AppXOptions extends TargetSpecificOptions {}
property addAutoLaunchExtension
readonly addAutoLaunchExtension?: boolean;
Whether to add auto launch extension. Defaults to
true
if [electron-winstore-auto-launch](https://github.com/felixrieseberg/electron-winstore-auto-launch) in the dependencies.
property applicationId
readonly applicationId?: string;
The application id. Defaults to
identityName
. Can’t start with numbers.
property backgroundColor
readonly backgroundColor?: string | null;
The background color of the app tile. See [Visual Elements](https://msdn.microsoft.com/en-us/library/windows/apps/br211471.aspx). #464646
property displayName
readonly displayName?: string | null;
A friendly name that can be displayed to users. Corresponds to [Properties.DisplayName](https://msdn.microsoft.com/en-us/library/windows/apps/br211432.aspx). Defaults to the application product name.
property electronUpdaterAware
readonly electronUpdaterAware?: boolean;
false
property identityName
readonly identityName?: string | null;
The name. Corresponds to [Identity.Name](https://msdn.microsoft.com/en-us/library/windows/apps/br211441.aspx). Defaults to the [application name](/configuration/configuration#Metadata-name).
property languages
readonly languages?: Array<string> | string | null;
The list of [supported languages](https://docs.microsoft.com/en-us/windows/uwp/globalizing/manage-language-and-region#specify-the-supported-languages-in-the-apps-manifest) that will be listed in the Windows Store. The first entry (index 0) will be the default language. Defaults to en-US if omitted.
property makeappxArgs
readonly makeappxArgs?: Array<string> | null;
property publisher
readonly publisher?: string | null;
The Windows Store publisher. Not used if AppX is build for testing. See [AppX Package Code Signing](#appx-package-code-signing) below.
property publisherDisplayName
readonly publisherDisplayName?: string | null;
A friendly name for the publisher that can be displayed to users. Corresponds to [Properties.PublisherDisplayName](https://msdn.microsoft.com/en-us/library/windows/apps/br211460.aspx). Defaults to company name from the application metadata.
interface ArtifactCreated
interface ArtifactCreated extends UploadTask {}
property isWriteUpdateInfo
readonly isWriteUpdateInfo?: boolean;
property packager
readonly packager: PlatformPackager<any>;
property publishConfig
readonly publishConfig?: PublishConfiguration;
property safeArtifactName
readonly safeArtifactName?: string | null;
property target
readonly target: Target | null;
property updateInfo
updateInfo?: any;
interface AsarOptions
interface AsarOptions extends AsarIntegrityOptions {}
property ordering
ordering?: string | null;
property smartUnpack
smartUnpack?: boolean;
Whether to automatically unpack executables files. true
interface AuthorMetadata
interface AuthorMetadata {}
interface BeforeBuildContext
interface BeforeBuildContext {}
property appDir
readonly appDir: string;
property arch
readonly arch: string;
property electronVersion
readonly electronVersion: string;
property platform
readonly platform: Platform;
interface BuildResult
interface BuildResult {}
property artifactPaths
readonly artifactPaths: Array<string>;
property configuration
readonly configuration: Configuration;
property outDir
readonly outDir: string;
property platformToTargets
readonly platformToTargets: Map<Platform, Map<string, Target>>;
interface CertificateFromStoreInfo
interface CertificateFromStoreInfo {}
property isLocalMachineStore
isLocalMachineStore: boolean;
property store
store: string;
property subject
subject: string;
property thumbprint
thumbprint: string;
interface CommonLinuxOptions
interface CommonLinuxOptions {}
property category
readonly category?: string | null;
The [application category](https://specifications.freedesktop.org/menu-spec/latest/apa.html#main-category-registry).
property description
readonly description?: string | null;
As [description](/configuration/configuration.md#Metadata-description) from application package.json, but allows you to specify different for Linux.
property desktop
readonly desktop?: any | null;
The [Desktop file](https://developer.gnome.org/integration-guide/stable/desktop-files.html.en) entries (name to value).
property mimeTypes
readonly mimeTypes?: Array<string> | null;
The mime types in addition to specified in the file associations. Use it if you don't want to register a new mime type, but reuse existing.
property synopsis
readonly synopsis?: string | null;
The [short description](https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Description).
interface CommonNsisOptions
interface CommonNsisOptions {}
property guid
readonly guid?: string | null;
See [GUID vs Application Name](../configuration/nsis.md#guid-vs-application-name).
property unicode
readonly unicode?: boolean;
Whether to create [Unicode installer](http://nsis.sourceforge.net/Docs/Chapter1.html#intro-unicode). true
property useZip
readonly useZip?: boolean;
false
property warningsAsErrors
readonly warningsAsErrors?: boolean;
If
warningsAsErrors
istrue
(default): NSIS will treat warnings as errors. IfwarningsAsErrors
isfalse
: NSIS will allow warnings. true
interface CommonWindowsInstallerConfiguration
interface CommonWindowsInstallerConfiguration {}
property createDesktopShortcut
readonly createDesktopShortcut?: boolean | 'always';
Whether to create desktop shortcut. Set to
always
if to recreate also on reinstall (even if removed by user). true
property createStartMenuShortcut
readonly createStartMenuShortcut?: boolean;
Whether to create start menu shortcut. true
property menuCategory
readonly menuCategory?: boolean | string;
Whether to create submenu for start menu shortcut and program files directory. If
true
, company name will be used. Or string value. false
property oneClick
readonly oneClick?: boolean;
property perMachine
readonly perMachine?: boolean;
Whether to install per all users (per-machine). false
property runAfterFinish
readonly runAfterFinish?: boolean;
Whether to run the installed application after finish. For assisted installer corresponding checkbox will be removed. true
property shortcutName
readonly shortcutName?: string | null;
The name that will be used for all shortcuts. Defaults to the application name.
interface Configuration
interface Configuration extends PlatformSpecificBuildOptions {}
Configuration Options
property afterAllArtifactBuild
readonly afterAllArtifactBuild?: | ((context: BuildResult) => Promise<Array<string>> | Array<string>) | string | null;
The function (or path to file or module id) to be [run after all artifacts are build](#afterAllArtifactBuild).
property afterPack
readonly afterPack?: | ((context: AfterPackContext) => Promise<any> | any) | string | null;
The function (or path to file or module id) to be [run after pack](#afterpack) (but before pack into distributable format and sign).
property afterSign
readonly afterSign?: | ((context: AfterPackContext) => Promise<any> | any) | string | null;
The function (or path to file or module id) to be [run after pack and sign](#aftersign) (but before pack into distributable format).
property apk
readonly apk?: LinuxTargetSpecificOptions | null;
property appId
readonly appId?: string | null;
The application id. Used as [CFBundleIdentifier](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-102070) for MacOS and as [Application User Model ID](https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx) for Windows (NSIS target only, Squirrel.Windows not supported). It is strongly recommended that an explicit ID is set. com.electron.${name}
property appImage
readonly appImage?: AppImageOptions | null;
AppImage options.
property appx
readonly appx?: AppXOptions | null;
property beforeBuild
readonly beforeBuild?: | ((context: BeforeBuildContext) => Promise<any>) | string | null;
The function (or path to file or module id) to be run before dependencies are installed or rebuilt. Works when
npmRebuild
is set totrue
. Resolving tofalse
will skip dependencies install or rebuild.If provided and
node_modules
are missing, it will not invoke production dependencies check.
property buildDependenciesFromSource
buildDependenciesFromSource?: boolean;
Whether to build the application native dependencies from source. false
property buildVersion
readonly buildVersion?: string | null;
The build version. Maps to the
CFBundleVersion
on macOS, andFileVersion
metadata property on Windows. Defaults to theversion
. IfTRAVIS_BUILD_NUMBER
orAPPVEYOR_BUILD_NUMBER
orCIRCLE_BUILD_NUM
orBUILD_NUMBER
orbamboo.buildNumber
env defined, it will be used as a build version (version.build_number
).
property copyright
readonly copyright?: string | null;
The human-readable copyright line for the app. Copyright © year ${author}
property deb
readonly deb?: DebOptions | null;
Debian package options.
property directories
readonly directories?: MetadataDirectories | null;
property dmg
readonly dmg?: DmgOptions | null;
macOS DMG options.
property electronCompile
readonly electronCompile?: boolean;
Whether to use [electron-compile](http://github.com/electron/electron-compile) to compile app. Defaults to
true
ifelectron-compile
in the dependencies. Andfalse
if in thedevDependencies
or doesn't specified.
property electronDist
readonly electronDist?: string;
The path to custom Electron build (e.g.
~/electron/out/R
).
property electronDownload
readonly electronDownload?: ElectronDownloadOptions;
The [electron-download](https://github.com/electron-userland/electron-download#usage) options.
property electronVersion
electronVersion?: string | null;
The version of electron you are packaging for. Defaults to version of
electron
,electron-prebuilt
orelectron-prebuilt-compile
dependency.
property extends
extends?: string | null;
The name of a built-in configuration preset or path to config file (relative to project dir). Currently, only
react-cra
is supported.If
react-scripts
in the app dependencies,react-cra
will be set automatically. Set tonull
to disable automatic detection.
property extraMetadata
readonly extraMetadata?: any;
Inject properties to
package.json
.
property freebsd
readonly freebsd?: LinuxTargetSpecificOptions | null;
property includePdb
readonly includePdb?: boolean;
Whether to include PDB files. false
property linux
readonly linux?: LinuxConfiguration | null;
Options related to how build Linux targets.
property mac
readonly mac?: MacConfiguration | null;
Options related to how build macOS targets.
property mas
readonly mas?: MasConfiguration | null;
MAS (Mac Application Store) options.
property msi
readonly msi?: MsiOptions | null;
property muonVersion
readonly muonVersion?: string | null;
The version of muon you are packaging for.
property nodeGypRebuild
readonly nodeGypRebuild?: boolean;
Whether to execute
node-gyp rebuild
before starting to package the app.Don't [use](https://github.com/electron-userland/electron-builder/issues/683#issuecomment-241214075) [npm](http://electron.atom.io/docs/tutorial/using-native-node-modules/#using-npm) (neither
.npmrc
) for configuring electron headers. Useelectron-builder node-gyp-rebuild
instead. false
property npmArgs
readonly npmArgs?: Array<string> | string | null;
Additional command line arguments to use when installing app native deps.
property npmRebuild
readonly npmRebuild?: boolean;
Whether to [rebuild](https://docs.npmjs.com/cli/rebuild) native dependencies before starting to package the app. true
property npmSkipBuildFromSource
readonly npmSkipBuildFromSource?: boolean;
Deprecated
Please use npmBuildFromSource.
property nsis
readonly nsis?: NsisOptions | null;
property nsisWeb
readonly nsisWeb?: NsisWebOptions | null;
property onNodeModuleFile
readonly onNodeModuleFile?: ((file: string) => void) | string | null;
The function (or path to file or module id) to be [run on each node module](#onnodemodulefile) file.
property p5p
readonly p5p?: LinuxTargetSpecificOptions | null;
property pacman
readonly pacman?: LinuxTargetSpecificOptions | null;
property pkg
readonly pkg?: PkgOptions | null;
macOS PKG options.
property portable
readonly portable?: PortableOptions | null;
property productName
readonly productName?: string | null;
As [name](#Metadata-name), but allows you to specify a product name for your executable which contains spaces and other special characters not allowed in the [name property](https://docs.npmjs.com/files/package.json#name).
property protonNodeVersion
readonly protonNodeVersion?: string | null;
*Proton Native only* The version of NodeJS you are packaging for. You can set it to
current
to set the Node.js version that you use to run electron-builder.
property readonly
readonly?: boolean;
Whether to fail if the application is not signed (to prevent unsigned app if code signing configuration is not correct). false
property remoteBuild
readonly remoteBuild?: boolean;
Whether to build using Electron Build Service if target not supported on current OS. true
property removePackageScripts
readonly removePackageScripts?: boolean;
Whether to remove
scripts
field frompackage.json
files.true
property rpm
readonly rpm?: LinuxTargetSpecificOptions | null;
property snap
readonly snap?: SnapOptions | null;
Snap options.
property squirrelWindows
readonly squirrelWindows?: SquirrelWindowsOptions | null;
property win
readonly win?: WindowsConfiguration | null;
Options related to how build Windows targets.
interface CustomWindowsSignTaskConfiguration
interface CustomWindowsSignTaskConfiguration extends WindowsSignTaskConfiguration {}
method computeSignToolArgs
computeSignToolArgs: (isWin: boolean) => Array<string>;
interface DebOptions
interface DebOptions extends LinuxTargetSpecificOptions {}
property depends
readonly depends?: Array<string> | null;
Package dependencies. Defaults to
["gconf2", "gconf-service", "libnotify4", "libappindicator1", "libxtst6", "libnss3"]
.
property packageCategory
readonly packageCategory?: string | null;
The [package category](https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Section).
property priority
readonly priority?: string | null;
The [Priority](https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Priority) attribute.
interface DmgContent
interface DmgContent {}
interface DmgOptions
interface DmgOptions extends TargetSpecificOptions {}
property background
background?: string | null;
The path to background image (default:
build/background.tiff
orbuild/background.png
if exists). The resolution of this file determines the resolution of the installer window. If background is not specified, usewindow.size
. Default locations expected background size to be 540x380.See Also
[DMG with Retina background support](http://stackoverflow.com/a/11204769/1910191).
property backgroundColor
backgroundColor?: string | null;
The background color (accepts css colors). Defaults to
#ffffff
(white) if no background image.
property contents
contents?: Array<DmgContent>;
The content — to customize icon locations.
property format
readonly format?: 'UDRW' | 'UDRO' | 'UDCO' | 'UDZO' | 'UDBZ' | 'ULFO';
The disk image format.
ULFO
(lzfse-compressed image (OS X 10.11+ only)). UDZO
property icon
readonly icon?: string | null;
The path to DMG icon (volume icon), which will be shown when mounted, relative to the [build resources](/configuration/configuration.md#MetadataDirectories-buildResources) or to the project directory. Defaults to the application icon (
build/icon.icns
).
property iconSize
readonly iconSize?: number | null;
The size of all the icons inside the DMG. 80
property iconTextSize
readonly iconTextSize?: number | null;
The size of all the icon texts inside the DMG. 12
property internetEnabled
readonly internetEnabled?: boolean;
Whether to create internet-enabled disk image (when it is downloaded using a browser it will automatically decompress the image, put the application on the desktop, unmount and remove the disk image file). false
property title
readonly title?: string | null;
The title of the produced DMG, which will be shown when mounted (volume name).
Macro
${productName}
,${version}
and${name}
are supported. ${productName} ${version}
property window
window?: DmgWindow;
The DMG windows position and size.
interface DmgWindow
interface DmgWindow {}
property height
height?: number;
The height. Defaults to background image height or 380.
property width
width?: number;
The width. Defaults to background image width or 540.
property x
x?: number;
The X position relative to left of the screen. 400
property y
y?: number;
The Y position relative to top of the screen. 100
interface ElectronDownloadOptions
interface ElectronDownloadOptions {}
property arch
arch?: string;
property cache
cache?: string | null;
The [cache location](https://github.com/electron-userland/electron-download#cache-location).
property customDir
customDir?: string | null;
property customFilename
customFilename?: string | null;
property force
force?: boolean;
property isVerifyChecksum
isVerifyChecksum?: boolean;
property mirror
mirror?: string | null;
The mirror.
property platform
platform?: ElectronPlatformName;
property quiet
quiet?: boolean;
property strictSSL
strictSSL?: boolean;
property version
version?: string;
interface FileAssociation
interface FileAssociation {}
File associations.
macOS (corresponds to [CFBundleDocumentTypes](https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-101685)) and NSIS only.
On Windows works only if [nsis.perMachine](https://electron.build/configuration/configuration#NsisOptions-perMachine) is set to
true
.
property description
readonly description?: string | null;
*windows-only.* The description.
property ext
readonly ext: string | Array<string>;
The extension (minus the leading period). e.g.
png
.
property icon
readonly icon?: string | null;
The path to icon (
.icns
for MacOS and.ico
for Windows), relative tobuild
(build resources directory). Defaults to${firstExt}.icns
/${firstExt}.ico
(if several extensions specified, first is used) or to application icon.Not supported on Linux, file issue if need (default icon will be
x-office-document
).
property isPackage
readonly isPackage?: boolean;
*macOS-only* Whether the document is distributed as a bundle. If set to true, the bundle directory is treated as a file. Corresponds to
LSTypeIsPackage
.
property mimeType
readonly mimeType?: string | null;
*linux-only.* The mime-type.
property name
readonly name?: string | null;
The name. e.g.
PNG
. Defaults toext
.
property role
readonly role?: string;
*macOS-only* The app’s role with respect to the type. The value can be
Editor
,Viewer
,Shell
, orNone
. Corresponds toCFBundleTypeRole
. Editor
interface FileCodeSigningInfo
interface FileCodeSigningInfo {}
interface FileSet
interface FileSet {}
property filter
filter?: Array<string> | string;
The [glob patterns](/file-patterns.md).
property from
from?: string;
The source path relative to the project directory.
property to
to?: string;
The destination path relative to the app's content directory for
extraFiles
and the app's resource directory forextraResources
.
interface ForgeOptions
interface ForgeOptions {}
property dir
readonly dir: string;
interface Framework
interface Framework {}
property defaultAppIdPrefix
readonly defaultAppIdPrefix: string;
property distMacOsAppName
readonly distMacOsAppName: string;
property isDefaultAppIconProvided
readonly isDefaultAppIconProvided: boolean;
property isNpmRebuildRequired
readonly isNpmRebuildRequired: boolean;
property macOsDefaultTargets
readonly macOsDefaultTargets: Array<string>;
property name
readonly name: string;
property version
readonly version: string;
method beforeCopyExtraFiles
beforeCopyExtraFiles: ( packager: PlatformPackager<any>, appOutDir: string, asarIntegrity: AsarIntegrity | null) => Promise<any>;
method createTransformer
createTransformer: () => FileTransformer | null;
method getDefaultIcon
getDefaultIcon: (platform: Platform) => string;
method prepareApplicationStageDirectory
prepareApplicationStageDirectory: ( options: PrepareApplicationStageDirectoryOptions) => Promise<any>;
interface LinuxConfiguration
interface LinuxConfiguration extends CommonLinuxOptions, PlatformSpecificBuildOptions {}
property depends
readonly depends?: Array<string> | null;
Deprecated
property executableName
readonly executableName?: string | null;
The executable name. Defaults to
productName
. Cannot be specified per target, allowed only in thelinux
.
property icon
readonly icon?: string;
The path to icon set directory or one png file, relative to the [build resources](/configuration/configuration.md#MetadataDirectories-buildResources) or to the project directory. The icon filename must contain the size (e.g. 32x32.png) of the icon. By default will be generated automatically based on the macOS icns file.
property maintainer
readonly maintainer?: string | null;
The maintainer. Defaults to [author](/configuration/configuration.md#Metadata-author).
property packageCategory
readonly packageCategory?: string | null;
backward compatibility + to allow specify fpm-only category for all possible fpm targets in one place
property target
readonly target?: TargetConfigType;
Target package type: list of
AppImage
,snap
,deb
,rpm
,freebsd
,pacman
,p5p
,apk
,7z
,zip
,tar.xz
,tar.lz
,tar.gz
,tar.bz2
,dir
.electron-builder [docker image](/multi-platform-build#docker) can be used to build Linux targets on any platform.
Please [do not put an AppImage into another archive](https://github.com/probonopd/AppImageKit/wiki/Creating-AppImages#common-mistake) like a .zip or .tar.gz. AppImage
property vendor
readonly vendor?: string | null;
The vendor. Defaults to [author](/configuration/configuration.md#Metadata-author).
interface LinuxTargetSpecificOptions
interface LinuxTargetSpecificOptions extends CommonLinuxOptions, TargetSpecificOptions {}
property afterInstall
readonly afterInstall?: string | null;
property afterRemove
readonly afterRemove?: string | null;
property compression
readonly compression?: 'gz' | 'bzip2' | 'xz' | null;
The compression type. xz
property depends
readonly depends?: Array<string> | null;
Package dependencies.
property fpm
readonly fpm?: Array<string> | null;
*Advanced only* The [fpm](https://github.com/jordansissel/fpm/wiki#usage) options.
Example:
["--before-install=build/deb-preinstall.sh", "--after-upgrade=build/deb-postinstall.sh"]
property icon
readonly icon?: string;
property maintainer
readonly maintainer?: string | null;
property packageCategory
readonly packageCategory?: string | null;
The package category.
property vendor
readonly vendor?: string | null;
interface MacConfiguration
interface MacConfiguration extends PlatformSpecificBuildOptions {}
property binaries
readonly binaries?: Array<string> | null;
Paths of any extra binaries that need to be signed.
property bundleShortVersion
readonly bundleShortVersion?: string | null;
The
CFBundleShortVersionString
. Do not use it unless you need to.
property bundleVersion
readonly bundleVersion?: string | null;
The
CFBundleVersion
. Do not use it unless [you need to](https://github.com/electron-userland/electron-builder/issues/565#issuecomment-230678643).
property category
readonly category?: string | null;
The application category type, as shown in the Finder via *View -> Arrange by Application Category* when viewing the Applications directory.
For example,
"category": "public.app-category.developer-tools"
will set the application category to *Developer Tools*.Valid values are listed in [Apple's documentation](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/TP40009250-SW8).
property cscInstallerKeyPassword
readonly cscInstallerKeyPassword?: string | null;
property cscInstallerLink
readonly cscInstallerLink?: string | null;
property electronLanguages
readonly electronLanguages?: Array<string> | string;
The electron locales. By default Electron locales used as is.
property electronUpdaterCompatibility
readonly electronUpdaterCompatibility?: string | null;
The electron-updater compatibility semver range. e.g.
>= 2.16
,>=1.0.0
. Defaults to>=1.0.0
1.0.0 latest-mac.json 2.15.0 path 2.16.0 files
property entitlements
readonly entitlements?: string | null;
The path to entitlements file for signing the app.
build/entitlements.mac.plist
will be used if exists (it is a recommended way to set). MAS entitlements is specified in the [mas](mas.md).
property entitlementsInherit
readonly entitlementsInherit?: string | null;
The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution.
build/entitlements.mac.inherit.plist
will be used if exists (it is a recommended way to set). Otherwise [default](https://github.com/electron-userland/electron-osx-sign/blob/master/default.entitlements.darwin.inherit.plist).This option only applies when signing with
entitlements
provided.
property extendInfo
readonly extendInfo?: any;
The extra entries for
Info.plist
.
property helperBundleId
readonly helperBundleId?: string | null;
The bundle identifier to use in the application helper's plist. ${appBundleIdentifier}.helper
property icon
readonly icon?: string | null;
The path to application icon. build/icon.icns
property identity
readonly identity?: string | null;
The name of certificate to use when signing. Consider using environment variables [CSC_LINK or CSC_NAME](/code-signing.md) instead of specifying this option. MAS installer identity is specified in the [mas](mas.md).
property minimumSystemVersion
readonly minimumSystemVersion?: string | null;
The minimum version of macOS required for the app to run. Corresponds to
LSMinimumSystemVersion
.
property provisioningProfile
readonly provisioningProfile?: string | null;
The path to the provisioning profile to use when signing, absolute or relative to the app root.
property requirements
readonly requirements?: string | null;
Path of [requirements file](https://developer.apple.com/library/mac/documentation/Security/Conceptual/CodeSigningGuide/RequirementLang/RequirementLang.html) used in signing. Not applicable for MAS.
property target
readonly target?: | Array<MacOsTargetName | TargetConfiguration> | MacOsTargetName | TargetConfiguration | null;
The target package type: list of
default
,dmg
,mas
,mas-dev
,pkg
,7z
,zip
,tar.xz
,tar.lz
,tar.gz
,tar.bz2
,dir
. Defaults todefault
(dmg and zip for Squirrel.Mac).
property type
readonly type?: 'distribution' | 'development' | null;
Whether to sign app for development or for distribution. distribution
interface MasConfiguration
interface MasConfiguration extends MacConfiguration {}
property binaries
readonly binaries?: Array<string> | null;
Paths of any extra binaries that need to be signed.
property entitlements
readonly entitlements?: string | null;
The path to entitlements file for signing the app.
build/entitlements.mas.plist
will be used if exists (it is a recommended way to set). Otherwise [default](https://github.com/electron-userland/electron-osx-sign/blob/master/default.entitlements.mas.plist).
property entitlementsInherit
readonly entitlementsInherit?: string | null;
The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution.
build/entitlements.mas.inherit.plist
will be used if exists (it is a recommended way to set). Otherwise [default](https://github.com/electron-userland/electron-osx-sign/blob/master/default.entitlements.mas.inherit.plist).
interface Metadata
interface Metadata {}
property author
readonly author?: AuthorMetadata | null;
property build
readonly build?: Configuration;
The electron-builder configuration.
property dependencies
readonly dependencies?: { [key: string]: string;};
property description
readonly description?: string;
The application description.
property homepage
readonly homepage?: string | null;
The url to the project [homepage](https://docs.npmjs.com/files/package.json#homepage) (NuGet Package
projectUrl
(optional) or Linux Package URL (required)).If not specified and your project repository is public on GitHub, it will be
https://github.com/${user}/${project}
by default.
property license
readonly license?: string | null;
*linux-only.* The [license](https://docs.npmjs.com/files/package.json#license) name.
property main
readonly main?: string | null;
property name
readonly name?: string;
The application name.
property productName
readonly productName?: string | null;
property repository
readonly repository?: string | RepositoryInfo | null;
The [repository](https://docs.npmjs.com/files/package.json#repository).
property version
readonly version?: string;
interface MetadataDirectories
interface MetadataDirectories {}
property app
readonly app?: string | null;
The application directory (containing the application package.json), defaults to
app
,www
or working directory.
property buildResources
readonly buildResources?: string | null;
The path to build resources.
Please note — build resources is not packed into the app. If you need to use some files, e.g. as tray icon, please include required files explicitly:
"files": ["**\/*", "build/icon.*"]
build
property output
readonly output?: string | null;
The output directory. [File macros](/file-patterns.md#file-macros) are supported. dist
interface MsiOptions
interface MsiOptions extends CommonWindowsInstallerConfiguration, TargetSpecificOptions {}
property oneClick
readonly oneClick?: boolean;
One-click installation. true
property upgradeCode
readonly upgradeCode?: string | null;
The [upgrade code](https://msdn.microsoft.com/en-us/library/windows/desktop/aa372375(v=vs.85).aspx). Optional, by default generated using app id.
property warningsAsErrors
readonly warningsAsErrors?: boolean;
If
warningsAsErrors
istrue
(default): treat warnings as errors. IfwarningsAsErrors
isfalse
: allow warnings. true
interface NsisOptions
interface NsisOptions extends CommonNsisOptions, CommonWindowsInstallerConfiguration, TargetSpecificOptions {}
property allowElevation
readonly allowElevation?: boolean;
*assisted installer only.* Allow requesting for elevation. If false, user will have to restart installer with elevated permissions. true
property allowToChangeInstallationDirectory
readonly allowToChangeInstallationDirectory?: boolean;
*assisted installer only.* Whether to allow user to change installation directory. false
property artifactName
readonly artifactName?: string | null;
The [artifact file name template](/configuration/configuration.md#artifact-file-name-template). Defaults to
${productName} Setup ${version}.${ext}
.
property deleteAppDataOnUninstall
readonly deleteAppDataOnUninstall?: boolean;
*one-click installer only.* Whether to delete app data on uninstall. false
property differentialPackage
differentialPackage?: boolean;
Defaults to
true
for web installer (nsis-web
)
property displayLanguageSelector
readonly displayLanguageSelector?: boolean;
Whether to display a language selection dialog. Not recommended (by default will be detected using OS language). false
property include
readonly include?: string | null;
The path to NSIS include script to customize installer. Defaults to
build/installer.nsh
. See [Custom NSIS script](#custom-nsis-script).
property installerHeader
readonly installerHeader?: string | null;
*assisted installer only.*
MUI_HEADERIMAGE
, relative to the [build resources](/configuration/configuration.md#MetadataDirectories-buildResources) or to the project directory. build/installerHeader.bmp
property installerHeaderIcon
readonly installerHeaderIcon?: string | null;
*one-click installer only.* The path to header icon (above the progress bar), relative to the [build resources](/configuration/configuration.md#MetadataDirectories-buildResources) or to the project directory. Defaults to
build/installerHeaderIcon.ico
or application icon.
property installerIcon
readonly installerIcon?: string | null;
The path to installer icon, relative to the [build resources](/configuration/configuration.md#MetadataDirectories-buildResources) or to the project directory. Defaults to
build/installerIcon.ico
or application icon.
property installerLanguages
readonly installerLanguages?: Array<string> | string | null;
The installer languages (e.g.
en_US
,de_DE
). Change only if you understand what do you do and for what.
property installerSidebar
readonly installerSidebar?: string | null;
*assisted installer only.*
MUI_WELCOMEFINISHPAGE_BITMAP
, relative to the [build resources](/configuration/configuration.md#MetadataDirectories-buildResources) or to the project directory. Defaults tobuild/installerSidebar.bmp
or${NSISDIR}\\Contrib\\Graphics\\Wizard\\nsis3-metro.bmp
. Image size 164 × 314 pixels.
property language
readonly language?: string | null;
[LCID Dec](https://msdn.microsoft.com/en-au/goglobal/bb964664.aspx), defaults to
1033
(English - United States
).
property license
readonly license?: string | null;
The path to EULA license file. Defaults to
license.txt
oreula.txt
(or uppercase variants). In addition totxt,
rtfand
htmlsupported (don't forget to use
target="_blank"` for links).Multiple license files in different languages are supported — use lang postfix (e.g.
_de
,_ru
)). For example, create fileslicense_de.txt
andlicense_en.txt
in the build resources. If OS language is german,license_de.txt
will be displayed. See map of [language code to name](https://github.com/meikidd/iso-639-1/blob/master/src/data.js).Appropriate license file will be selected by user OS language.
property multiLanguageInstaller
readonly multiLanguageInstaller?: boolean;
Whether to create multi-language installer. Defaults to
unicode
option value.
property oneClick
readonly oneClick?: boolean;
Whether to create one-click installer or assisted. true
property packElevateHelper
readonly packElevateHelper?: boolean;
Whether to pack the elevate executable (required for electron-updater if per-machine installer used or can be used in the future). Ignored if
perMachine
is set totrue
. true
property perMachine
readonly perMachine?: boolean;
Whether to show install mode installer page (choice per-machine or per-user) for assisted installer. Or whether installation always per all users (per-machine).
If
oneClick
istrue
(default): Whether to install per all users (per-machine).If
oneClick
isfalse
andperMachine
istrue
: no install mode installer page, always install per-machine.If
oneClick
isfalse
andperMachine
isfalse
(default): install mode installer page. false
property preCompressedFileExtensions
readonly preCompressedFileExtensions?: Array<string> | string | null;
The file extension of files that will be not compressed. Applicable only for
extraResources
andextraFiles
files. [".avi", ".mov", ".m4v", ".mp4", ".m4p", ".qt", ".mkv", ".webm", ".vmdk"]
property script
readonly script?: string | null;
The path to NSIS script to customize installer. Defaults to
build/installer.nsi
. See [Custom NSIS script](#custom-nsis-script).
property uninstallDisplayName
readonly uninstallDisplayName?: string;
The uninstaller display name in the control panel. ${productName} ${version}
property uninstallerIcon
readonly uninstallerIcon?: string | null;
The path to uninstaller icon, relative to the [build resources](/configuration/configuration.md#MetadataDirectories-buildResources) or to the project directory. Defaults to
build/uninstallerIcon.ico
or application icon.
property uninstallerSidebar
readonly uninstallerSidebar?: string | null;
*assisted installer only.*
MUI_UNWELCOMEFINISHPAGE_BITMAP
, relative to the [build resources](/configuration/configuration.md#MetadataDirectories-buildResources) or to the project directory. Defaults toinstallerSidebar
option orbuild/uninstallerSidebar.bmp
orbuild/installerSidebar.bmp
or${NSISDIR}\\Contrib\\Graphics\\Wizard\\nsis3-metro.bmp
interface NsisWebOptions
interface NsisWebOptions extends NsisOptions {}
Web Installer options.
property appPackageUrl
readonly appPackageUrl?: string | null;
The application package download URL. Optional — by default computed using publish configuration.
URL like
https://example.com/download/latest
allows web installer to be version independent (installer will download latest application package). Please note — it is [full URL](https://github.com/electron-userland/electron-builder/issues/1810#issuecomment-317650878).Custom
X-Arch
http header is set to32
or64
.
property artifactName
readonly artifactName?: string | null;
The [artifact file name template](/configuration/configuration.md#artifact-file-name-template). Defaults to
${productName} Web Setup ${version}.${ext}
.
interface PackagerOptions
interface PackagerOptions {}
property config
readonly config?: Configuration | string | null;
property effectiveOptionComputed
readonly effectiveOptionComputed?: (options: any) => Promise<boolean>;
property linux
linux?: Array<string>;
property mac
mac?: Array<string>;
property platformPackagerFactory
platformPackagerFactory?: | ((info: Packager, platform: Platform) => PlatformPackager<any>) | null;
property prepackaged
readonly prepackaged?: string | null;
property projectDir
projectDir?: string | null;
property targets
targets?: Map<Platform, Map<Arch, Array<string>>>;
property win
win?: Array<string>;
interface PkgOptions
interface PkgOptions extends TargetSpecificOptions {}
macOS product archive options.
property allowAnywhere
readonly allowAnywhere?: boolean | null;
Whether can be installed at the root of any volume, including non-system volumes. Otherwise, it cannot be installed at the root of a volume.
Corresponds to [enable_anywhere](https://developer.apple.com/library/content/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html#//apple_ref/doc/uid/TP40005370-CH100-SW70). true
property allowCurrentUserHome
readonly allowCurrentUserHome?: boolean | null;
Whether can be installed into the current user’s home directory. A home directory installation is done as the current user (not as root), and it cannot write outside of the home directory. If the product cannot be installed in the user’s home directory and be not completely functional from user’s home directory.
Corresponds to [enable_currentUserHome](https://developer.apple.com/library/content/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html#//apple_ref/doc/uid/TP40005370-CH100-SW70). true
property allowRootDirectory
readonly allowRootDirectory?: boolean | null;
Whether can be installed into the root directory. Should usually be
true
unless the product can be installed only to the user’s home directory.Corresponds to [enable_localSystem](https://developer.apple.com/library/content/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html#//apple_ref/doc/uid/TP40005370-CH100-SW70). true
property hasStrictIdentifier
readonly hasStrictIdentifier?: boolean | null;
Require identical bundle identifiers at install path? true
property identity
readonly identity?: string | null;
The name of certificate to use when signing. Consider using environment variables [CSC_LINK or CSC_NAME](../code-signing.md) instead of specifying this option.
property installLocation
readonly installLocation?: string | null;
The install location. [Do not use it](https://stackoverflow.com/questions/12863944/how-do-you-specify-a-default-install-location-to-home-with-pkgbuild) to create per-user package. Mostly never you will need to change this option.
/Applications
would install it as expected into/Applications
if the local system domain is chosen, or into$HOME/Applications
if the home installation is chosen. /Applications
property isRelocatable
readonly isRelocatable?: boolean | null;
Install bundle over previous version if moved by user? true
property isVersionChecked
readonly isVersionChecked?: boolean | null;
Don't install bundle if newer version on disk? true
property license
readonly license?: string | null;
The path to EULA license file. Defaults to
license.txt
oreula.txt
(or uppercase variants). In addition totxt,
rtfand
htmlsupported (don't forget to use
target="_blank"` for links).
property overwriteAction
readonly overwriteAction?: 'upgrade' | 'update' | null;
Specifies how an existing version of the bundle on disk should be handled when the version in the package is installed.
If you specify upgrade, the bundle in the package atomi-cally replaces any version on disk; this has the effect of deleting old paths that no longer exist in the new version of the bundle.
If you specify update, the bundle in the package overwrites the version on disk, and any files not contained in the package will be left intact; this is appropriate when you are delivering an update-only package.
Another effect of update is that the package bundle will not be installed at all if there is not already a version on disk; this allows a package to deliver an update for an app that the user might have deleted.
upgrade
property productbuild
readonly productbuild?: Array<string> | null;
should be not documented, only to experiment
property scripts
readonly scripts?: string | null;
The scripts directory, relative to
build
(build resources directory). The scripts can be in any language so long as the files are marked executable and have the appropriate shebang indicating the path to the interpreter. Scripts are required to be executable (chmod +x file
). build/pkg-scriptsSee Also
[Scripting in installer packages](http://macinstallers.blogspot.de/2012/07/scripting-in-installer-packages.html).
interface PlatformSpecificBuildOptions
interface PlatformSpecificBuildOptions extends TargetSpecificOptions {}
property artifactName
readonly artifactName?: string | null;
The [artifact file name template](/configuration/configuration.md#artifact-file-name-template). Defaults to
${productName}-${version}.${ext}
(some target can have other defaults, see corresponding options).
property asar
readonly asar?: AsarOptions | boolean | null;
Whether to package the application's source code into an archive, using [Electron's archive format](http://electron.atom.io/docs/tutorial/application-packaging/).
Node modules, that must be unpacked, will be detected automatically, you don't need to explicitly set [asarUnpack](#configuration-asarUnpack) - please file an issue if this doesn't work. true
property asarUnpack
readonly asarUnpack?: Array<string> | string | null;
A [glob patterns](/file-patterns.md) relative to the [app directory](#MetadataDirectories-app), which specifies which files to unpack when creating the [asar](http://electron.atom.io/docs/tutorial/application-packaging/) archive.
property compression
readonly compression?: CompressionLevel | null;
The compression level. If you want to rapidly test build,
store
can reduce build time significantly.maximum
doesn't lead to noticeable size difference, but increase build time. normal
property cscKeyPassword
cscKeyPassword?: string | null;
property cscLink
cscLink?: string | null;
property detectUpdateChannel
readonly detectUpdateChannel?: boolean;
Whether to infer update channel from application version pre-release components. e.g. if version
0.12.1-alpha.1
, channel will be set toalpha
. Otherwise tolatest
. true
property extraFiles
readonly extraFiles?: Array<FileSet | string> | FileSet | string | null;
property extraResources
readonly extraResources?: Array<FileSet | string> | FileSet | string | null;
property fileAssociations
readonly fileAssociations?: Array<FileAssociation> | FileAssociation;
The file associations.
property files
readonly files?: Array<FileSet | string> | FileSet | string | null;
property forceCodeSigning
readonly forceCodeSigning?: boolean;
property generateUpdatesFilesForAllChannels
readonly generateUpdatesFilesForAllChannels?: boolean;
Please see [Building and Releasing using Channels](https://github.com/electron-userland/electron-builder/issues/1182#issuecomment-324947139). false
property icon
readonly icon?: string | null;
property protocols
readonly protocols?: Array<Protocol> | Protocol;
The URL protocol schemes.
property publish
publish?: Publish;
property releaseInfo
readonly releaseInfo?: ReleaseInfo;
The release info. Intended for command line usage:
-c.releaseInfo.releaseNotes="new features"
property target
readonly target?: | Array<string | TargetConfiguration> | string | TargetConfiguration | null;
interface PortableOptions
interface PortableOptions extends TargetSpecificOptions, CommonNsisOptions {}
Portable options.
property requestExecutionLevel
readonly requestExecutionLevel?: 'user' | 'highest' | 'admin';
The [requested execution level](http://nsis.sourceforge.net/Reference/RequestExecutionLevel) for Windows. user
interface PrepareApplicationStageDirectoryOptions
interface PrepareApplicationStageDirectoryOptions {}
property appOutDir
readonly appOutDir: string;
Platform doesn't process application output directory in any way. Unpack implementation must create or empty dir if need.
property arch
readonly arch: string;
property packager
readonly packager: PlatformPackager<any>;
property platformName
readonly platformName: ElectronPlatformName;
property version
readonly version: string;
interface Protocol
interface Protocol {}
URL Protocol Schemes. Protocols to associate the app with. macOS only.
Please note — on macOS [you need to register an
open-url
event handler](http://electron.atom.io/docs/api/app/#event-open-url-macos).
interface ReleaseInfo
interface ReleaseInfo {}
property releaseDate
releaseDate?: string;
The release date.
property releaseName
releaseName?: string | null;
The release name.
property releaseNotes
releaseNotes?: string | null;
The release notes.
property releaseNotesFile
releaseNotesFile?: string | null;
The path to release notes file. Defaults to
release-notes-${platform}.md
(whereplatform
it is current platform —mac
,linux
orwindows
) orrelease-notes.md
in the [build resources](#MetadataDirectories-buildResources).
interface RepositoryInfo
interface RepositoryInfo {}
property url
readonly url: string;
interface SnapOptions
interface SnapOptions extends CommonLinuxOptions, TargetSpecificOptions {}
property after
readonly after?: Array<string> | null;
Specifies any [parts](https://snapcraft.io/docs/reference/parts) that should be built before this part. Defaults to
["desktop-gtk2""]
.If list contains
default
, it will be replaced to default list, so,["default", "foo"]
can be used to add custom partsfoo
in addition to defaults.
property assumes
readonly assumes?: Array<string> | string | null;
The list of features that must be supported by the core in order for this snap to install.
property buildPackages
readonly buildPackages?: Array<string> | null;
The list of debian packages needs to be installed for building this snap.
property confinement
readonly confinement?: 'devmode' | 'strict' | 'classic' | null;
The type of [confinement](https://snapcraft.io/docs/reference/confinement) supported by the snap. strict
property environment
readonly environment?: object | null;
The custom environment. Defaults to
{"TMPDIR: "$XDG_RUNTIME_DIR"}
. If you set custom, it will be merged with default.
property grade
readonly grade?: 'devel' | 'stable' | null;
The quality grade of the snap. It can be either
devel
(i.e. a development version of the snap, so not to be published to the “stable” or “candidate” channels) or “stable” (i.e. a stable release or release candidate, which can be released to all channels). stable
property hooks
readonly hooks?: string | null;
The [hooks](https://docs.snapcraft.io/build-snaps/hooks) directory, relative to
build
(build resources directory). build/snap-hooks
property plugs
readonly plugs?: Array<string | PlugDescriptor> | PlugDescriptor | null;
The list of [plugs](https://snapcraft.io/docs/reference/interfaces). Defaults to
["desktop", "desktop-legacy", "home", "x11", "unity7", "browser-support", "network", "gsettings", "pulseaudio", "opengl"]
.If list contains
default
, it will be replaced to default list, so,["default", "foo"]
can be used to add custom plugfoo
in addition to defaults.Additional attributes can be specified using object instead of just name of plug:
[{"browser-sandbox": {"interface": "browser-support","allow-sandbox": true},},"another-simple-plug-name"]
property stagePackages
readonly stagePackages?: Array<string> | null;
The list of Ubuntu packages to use that are needed to support the
app
part creation. Likedepends
fordeb
. Defaults to["libasound2", "libgconf2-4", "libnotify4", "libnspr4", "libnss3", "libpcre3", "libpulse0", "libxss1", "libxtst6"]
.If list contains
default
, it will be replaced to default list, so,["default", "foo"]
can be used to add custom packagefoo
in addition to defaults.
property summary
readonly summary?: string | null;
The 78 character long summary. Defaults to [productName](configuration.md#Configuration-productName).
property useTemplateApp
readonly useTemplateApp?: boolean;
Whether to use template snap. Defaults to
true
ifstagePackages
not specified.
interface SourceRepositoryInfo
interface SourceRepositoryInfo {}
interface SquirrelWindowsOptions
interface SquirrelWindowsOptions extends TargetSpecificOptions {}
property iconUrl
readonly iconUrl?: string | null;
A URL to an ICO file to use as the application icon (displayed in Control Panel > Programs and Features). Defaults to the Electron icon.
Please note — [local icon file url is not accepted](https://github.com/atom/grunt-electron-installer/issues/73), must be https/http.
If you don't plan to build windows installer, you can omit it. If your project repository is public on GitHub, it will be
https://github.com/${u}/${p}/blob/master/build/icon.ico?raw=true
by default.
property loadingGif
readonly loadingGif?: string | null;
The path to a .gif file to display during install.
build/install-spinner.gif
will be used if exists (it is a recommended way to set) (otherwise [default](https://github.com/electron/windows-installer/blob/master/resources/install-spinner.gif)).
property msi
readonly msi?: boolean;
Whether to create an MSI installer. Defaults to
false
(MSI is not created).
property name
readonly name?: string;
https://github.com/electron-userland/electron-builder/issues/1743
property remoteReleases
readonly remoteReleases?: string | boolean | null;
A URL to your existing updates. Or
true
to automatically set to your GitHub repository. If given, these will be downloaded to create delta updates.
property remoteToken
readonly remoteToken?: string | null;
Authentication token for remote updates
property useAppIdAsId
readonly useAppIdAsId?: boolean;
Use
appId
to identify package instead ofname
.
interface TargetConfiguration
interface TargetConfiguration {}
interface TargetSpecificOptions
interface TargetSpecificOptions {}
property artifactName
readonly artifactName?: string | null;
The [artifact file name template](/configuration/configuration.md#artifact-file-name-template).
property publish
publish?: Publish;
interface WindowsConfiguration
interface WindowsConfiguration extends PlatformSpecificBuildOptions {}
property additionalCertificateFile
readonly additionalCertificateFile?: string | null;
The path to an additional certificate file you want to add to the signature block.
property certificateFile
readonly certificateFile?: string | null;
The path to the *.pfx certificate you want to sign with. Please use it only if you cannot use env variable
CSC_LINK
(WIN_CSC_LINK
) for some reason. Please see [Code Signing](../code-signing.md).
property certificatePassword
readonly certificatePassword?: string | null;
The password to the certificate provided in
certificateFile
. Please use it only if you cannot use env variableCSC_KEY_PASSWORD
(WIN_CSC_KEY_PASSWORD
) for some reason. Please see [Code Signing](../code-signing.md).
property certificateSha1
readonly certificateSha1?: string | null;
The SHA1 hash of the signing certificate. The SHA1 hash is commonly specified when multiple certificates satisfy the criteria specified by the remaining switches. Works only on Windows (or on macOS if [Parallels Desktop](https://www.parallels.com/products/desktop/) Windows 10 virtual machines exits).
property certificateSubjectName
readonly certificateSubjectName?: string | null;
The name of the subject of the signing certificate. Required only for EV Code Signing and works only on Windows (or on macOS if [Parallels Desktop](https://www.parallels.com/products/desktop/) Windows 10 virtual machines exits).
property electronUpdaterCompatibility
readonly electronUpdaterCompatibility?: string | null;
The electron-updater compatibility semver range. e.g.
>= 2.16
,>=1.0.0
. Defaults to>=1.0.0
1.0.0 sha2 2.15.0 path 2.16.0 files
property icon
readonly icon?: string | null;
The path to application icon. build/icon.ico
property legalTrademarks
readonly legalTrademarks?: string | null;
The trademarks and registered trademarks.
property publisherName
readonly publisherName?: string | Array<string> | null;
[The publisher name](https://github.com/electron-userland/electron-builder/issues/1187#issuecomment-278972073), exactly as in your code signed certificate. Several names can be provided. Defaults to common name from your code signing certificate.
property requestedExecutionLevel
readonly requestedExecutionLevel?: RequestedExecutionLevel | null;
The [security level](https://msdn.microsoft.com/en-us/library/6ad1fshk.aspx#Anchor_9) at which the application requests to be executed. Cannot be specified per target, allowed only in the
win
. asInvoker
property rfc3161TimeStampServer
readonly rfc3161TimeStampServer?: string | null;
The URL of the RFC 3161 time stamp server. http://timestamp.comodoca.com/rfc3161
property sign
readonly sign?: CustomWindowsSign | string | null;
The custom function (or path to file or module id) to sign Windows executable.
property signAndEditExecutable
readonly signAndEditExecutable?: boolean;
Whether to sign and add metadata to executable. Advanced option. true
property signDlls
readonly signDlls?: boolean;
Whether to sign DLL files. Advanced option.
See Also
https://github.com/electron-userland/electron-builder/issues/3101#issuecomment-404212384 false
property signingHashAlgorithms
readonly signingHashAlgorithms?: Array<'sha1' | 'sha256'> | null;
Array of signing algorithms used. For AppX
sha256
is always used. ['sha1', 'sha256']
property target
readonly target?: TargetConfigType;
The target package type: list of
nsis
,nsis-web
(Web installer),portable
(portable app without installation),appx
,msi
,squirrel
,7z
,zip
,tar.xz
,tar.lz
,tar.gz
,tar.bz2
,dir
. AppX package can be built only on Windows 10.To use Squirrel.Windows please install
electron-builder-squirrel-windows
dependency.For
portable
app,PORTABLE_EXECUTABLE_DIR
env is set (dir where portable executable located).nsis
property timeStampServer
readonly timeStampServer?: string | null;
The URL of the time stamp server. http://timestamp.verisign.com/scripts/timstamp.dll
property verifyUpdateCodeSignature
readonly verifyUpdateCodeSignature?: boolean;
Whether to verify the signature of an available update before installation. The [publisher name](#publisherName) will be used for the signature verification.
true
interface WindowsSignOptions
interface WindowsSignOptions {}
interface WindowsSignTaskConfiguration
interface WindowsSignTaskConfiguration extends WindowsSignOptions {}
property hash
hash: string;
property isNest
isNest: boolean;
property resultOutputPath
resultOutputPath?: string;
Type Aliases
type CompressionLevel
type CompressionLevel = 'store' | 'normal' | 'maximum';
type CustomWindowsSign
type CustomWindowsSign = ( configuration: CustomWindowsSignTaskConfiguration) => Promise<any>;
type ElectronPlatformName
type ElectronPlatformName = 'darwin' | 'linux' | 'win32' | 'mas';
type MacOsTargetName
type MacOsTargetName = | 'default' | 'dmg' | 'mas' | 'mas-dev' | 'pkg' | '7z' | 'zip' | 'tar.xz' | 'tar.lz' | 'tar.gz' | 'tar.bz2' | 'dir';
type TargetConfigType
type TargetConfigType = | Array<string | TargetConfiguration> | string | TargetConfiguration | null;
Package Files (24)
- out/Framework.d.ts
- out/appInfo.d.ts
- out/configuration.d.ts
- out/core.d.ts
- out/electron/electron-download.d.ts
- out/forge-maker.d.ts
- out/index.d.ts
- out/options/AppXOptions.d.ts
- out/options/CommonWindowsInstallerConfiguration.d.ts
- out/options/FileAssociation.d.ts
- out/options/MsiOptions.d.ts
- out/options/PlatformSpecificBuildOptions.d.ts
- out/options/SnapOptions.d.ts
- out/options/SquirrelWindowsOptions.d.ts
- out/options/linuxOptions.d.ts
- out/options/macOptions.d.ts
- out/options/metadata.d.ts
- out/options/winOptions.d.ts
- out/packager.d.ts
- out/packagerApi.d.ts
- out/platformPackager.d.ts
- out/publish/PublishManager.d.ts
- out/targets/nsis/nsisOptions.d.ts
- out/windowsCodeSign.d.ts
Dependencies (26)
- 7zip-bin
- app-builder-bin
- async-exit-hook
- bluebird-lst
- builder-util
- builder-util-runtime
- chromium-pickle-js
- debug
- ejs
- electron-osx-sign
- electron-publish
- env-paths
- fs-extra-p
- hosted-git-info
- is-ci
- isbinaryfile
- js-yaml
- lazy-val
- minimatch
- normalize-package-data
- plist
- read-config-file
- sanitize-filename
- semver
- sumchecker
- temp-file
Dev Dependencies (0)
No dev dependencies.
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/electron-builder-lib
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/electron-builder-lib)
- HTML<a href="https://www.jsdocs.io/package/electron-builder-lib"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 4333 ms. - Missing or incorrect documentation? Open an issue for this package.